[[Tutorial for ver.3]]

Virtual robots can be controlled by using SIGVerse and ROS (Robot Operating System).

This section describes a sample program that uses ROS.
Please refer to [[this page>Tutorial for ver.3]] for sample programs that do not use ROS.



#contents

* System Requirements [#SystemRequirements]

If you want to use ROS, prepare an Ubuntu environment and install ROS there. ~
And Ubuntu communicates with Windows on which Unity is installed. ~

Please refer to [[this page>Tutorial for ver.3]] for requirements on Windows.

The ROS requirement is that the OS is '' Ubuntu 16.04 '' and ROS [[Distribution>http://wiki.ros.org/Distributions]] is '' Kinetic Kame ''.

#ref(RobotOperationUsingROS.png)




* Environment Setup[#vf01a3c9]

** Build Windows environment [#k2704bce]

Please refer to [[this page>Tutorial for ver.3#SystemRequirements]] to build the Windows environment.
After that, perform the following environment construction.

** Build Ubuntu environment [#zddcd2d8]

Build Ubuntu environment as follows.~

*** Using VMware [#gc586877]

Instead of preparing an Ubuntu PC, you can use an Ubuntu virtual machine on Windows. ~
However, in this case, the tutorial using GPU is difficult.

The procedure for building an Ubuntu environment using VMware is as follows.

+ Install VMware Workstation 15.5.0 Player for Windows 64-bit Operating Systems.~
https://my.vmware.com/web/vmware/free#desktop_end_user_computing/vmware_workstation_player/15_0
+ Download Iso file of Ubuntu 16.04.6 LTS.~
http://releases.ubuntu.com/16.04/
+ Launch VMware Workstation Player.
+ Click [Create a New Virtual Machine].
+ Use [Installer disc image file(iso):] and select ubuntu-16.04.6-desktop-amd64.iso.
+ Recommend to check "Store virtual disk as a single file".
+ Please adjust Memory and Processors in [Edit virtual machine settings] after creating VM image.




*** Install ROS Kinetic [#dccef8ca]
Install ROS by following [[this steps>http://wiki.ros.org/kinetic/Installation/Ubuntu]]. ~
Then follow the [[ROS tutorial>http://wiki.ros.org/ROS/Tutorials/InstallingandConfiguringROSEnvironment]] until you create a ROS workspace.

And add "~/catkin_ws/devel/setup.bash" to .bashrc to simplify subsequent commands. Be careful if you manage multiple ROS workspaces.

 $ echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
 $ source ~/.bashrc


*** Install ROSBridge_suite [#c3162771]
Start the terminal and execute the following command.

 $ sudo apt-get install ros-kinetic-rosbridge-server



*** Install Mongo C driver [#n65f2eba]
In the terminal, execute the following command:

 $ cd ~/Downloads
 $ wget https://github.com/mongodb/mongo-c-driver/releases/download/1.4.2/mongo-c-driver-1.4.2.tar.gz
 $ tar zxvf mongo-c-driver-1.4.2.tar.gz
 $ cd mongo-c-driver-1.4.2
 $ ./configure
 $ make
 $ sudo make install


*** Install Mongo C ++ driver [#lf0687e5]
In the terminal, execute the following command:

 $ cd ~/Downloads 
 $ wget https://github.com/mongodb/mongo-cxx-driver/archive/r3.0.3.tar.gz
 $ tar zxvf r3.0.3.tar.gz
 $ cd mongo-cxx-driver-r3.0.3/build
 $ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DLIBMONGOC_DIR=/usr/local -DLIBBSON_DIR=/usr/local ..
 $ sudo make EP_mnmlstc_core
 $ make
 $ sudo make install



*** sigverse_ros_bridge settings [#n891675d]
In the terminal, execute the following command:

 $ cd ~/catkin_ws/src
 $ git clone https://github.com/SIGVerse/sigverse_ros_package.git
 $ cd ..
 $ catkin_make




*** Install Turtlebot packages [#c4f5154e]

Install ROS packages to use [[Turtlebot>http://wiki.ros.org/Robots/TurtleBot]]. ~
Since there are currently only Indigo pages, the command is replaced for Kinetic.

 $ sudo apt-get install ros-kinetic-turtlebot ros-kinetic-turtlebot-apps ros-kinetic-turtlebot-interactions ros-kinetic-turtlebot-simulator ros-kinetic-kobuki-ftdi ros-kinetic-ar-track-alvar-msgs

If an error occurs after changing to "kinetic", the error message will disappear by deleting the report file.

 $ ls -la /var/crash
 $ sudo rm /var/crash/*

Please refer to the following page when installing to Kinetic Kame. ~
http://answers.ros.org/question/246015/installing-turtlebot-on-ros-kinetic/

 $ sudo apt-get install -y linux-headers-generic
 $ sudo sh -c 'echo "deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
 deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
 deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
 deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted" > \
   /etc/apt/sources.list.d/official-source-repositories.list'
 $ sudo apt-get update
 $ sudo apt-get install -y ros-kinetic-librealsense
 $ sudo apt-get install -y ros-kinetic-realsense-camera
 $ sudo apt-get install -y ros-kinetic-turtlebot

It is also convenient to install the following:

 $ sudo apt-get install ros-kinetic-turtlebot*

Then deploy the launch XML file (3dsensor) for SIGVerse.

 $ cd ~/catkin_ws/
 $ sudo cp src/sigverse_ros_package/samples/turtlebot2/resources/asus_xtion_pro_sigverse.launch.xml /opt/ros/${ROS_DISTRO}/share/turtlebot_bringup/launch/includes/3dsensor

~* Regarding this matter, [[Mr. Isao Hara from the National Institute of Advanced Industrial Science and Technology>http://hara.jpn.com/_default/ja/Topics/SIGVerse20Ver.3.html]] provided files and advices. Thank you.



*** Install PR2 package [#hf065135]
Install the PR2 packages with the following command to use the PR2.

 $ sudo apt-get install ros-kinetic-pr2*




* Executing Sample scenes using ROS [#o023aef1]

** Unity scene Execution [#open_scene]

Before running the Unity sample scene, you need to set the IP address for ROS on Unity.

+ Check the IP address of the Ubuntu side. ~
Execute the following command in Ubuntu side to check the IP address.
  $ ifconfig
+ Open the SIGVerse project in Unity.
+ Click [SIGVerse]-[SIGVerse Settings] in the Unity menu to open the SIGVerse settings window.
+ Enter the IP address of Ubuntu side in [Config file Settings]-[Rosbridge IP]. ~
(You can also change [Rosbridge Port] and [SIGVerse Bridge Port] in the same way.)

#ref(SIGVerseSettings.png)


The Unity scene is executed as follows:
+ Double-click [Assets/SIGVerse/SampleScenes/xxxxx/yyyyy(.unity)] on the [Project] tab to open the target scene.
+ Click the play button at the top center of the Unity to play the scene.


** (Turtlebot2)Follower[#turtlebot2_follower]

This is explained on [[this page>(Turtlebot2)Follower]].


** (Turtlebot2)Operate with keyboard [#turtlebot2_key_teleop]

This is explained on [[this page>(Turtlebot2)Operate with keyboard]].


** (TurtleBot3)Grasp by keyboard operation [#c97bb2bb]

This is explained on [[this page>(TurtleBot3)Grasp by keyboard operation]].

** (TurtleBot3)Grasp automatically [#ebd4a933]

This is a simple sample that uses darknet_ros (YOLO) for object recognition and uses point cloud data for grasping automatically.

This is explained on [[this page>(TurtleBot3)Grasp automatically]].


** (TurtleBot3)SLAM execution [#i221ef46]

This is explained on [[this page>(TurtleBot3)SLAM execution]]


** (TurtleBot3)Recognize human pointing [#xc5f1917]

This is explained on [[this page>(TurtleBot3)Recognize human pointing]].


** (PR2)Operate with keyboard [#pr2_key_teleop]

This is explained on [[this page>(PR2)Operate with keyboard]].


** (HSR)Operate with keyboard[#hsr_key_teleop]

This is explained on [[this page>(HSR)Operate with keyboard]].


** (HSR)The Cleanup task execution [#hsr_cleanup]

This is explained on [[this page>(HSR)The Cleanup task execution]]

** (HSR)The Cleanup task execution using cloud and VR [#hsr_cleanup]

Performs the cleanup task that involves PUN (Photon Unity Networking) cloud and human login using VR device (Oculus Rift).~
A human and a robot log in to the same virtual space, and the human gives a cleanup instruction to the robot by pointing.~
The robot (ROS) side and the human (VR) side are connected via the Internet.

This is explained on [[this page>(HSR)The Cleanup task execution using cloud and VR]].




----

#counter

Front page   New List of pages Search Recent changes   Help   RSS of recent changes