Tutorials/CloudSim/gz client remote

Introduction === This tutorial covers:
 * Connect to the simulation using Gazebo and rviz from your local machine

Prerequisites ===

1. This tutorial assumes you are familiar with the previous launch/terminate a constellation tutorial.

2. It also requires that you establish a VPN with your local computer and the cloud constellation. Check out the tutorial to setup the VPN before continuing.

3. A Gazebo simulation task must be running on the sim machine. See the running simulation tasks tutorial. Images for this tutorial are taken from the atlas_utils package's vrc_task_1.launch launch file.

DRCSIM installation on the OCU (Operator Control Unit or local computer) ===

Follow these instructions to install the minimum packages required to launch gzclient and rviz on your local machine:

1. Configure your Ubuntu repositories to allow "restricted," "universe," and "multiverse." You can follow the Ubuntu guide for instructions on doing this.

1. Setup your computer to accept software from packages.osrfoundation.org.

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu precise main" > /etc/apt/sources.list.d/ros-latest.list' sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu precise main" > /etc/apt/sources.list.d/gazebo-latest.list'

1. Retrieve and install the keys for the ROS and DRC repositories.

wget http://packages.ros.org/ros.key -O - | sudo apt-key add - wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -

1. On the local machine, you should have the drcsim and ros-fuerte-visualization packages (see installation guide). This will install the Atlas robot meshes on your local machine, as well as the rviz tool.

sudo apt-get update sudo apt-get install drcsim ros-groovy-visualization

Connecting to a remote simulator from your local computer or OCU (Operator Control Unit) === Make sure you have the VPN running. Configure ROS and Gazebo to connect to the cloud constellation, by sourcing your local drcsim configuration file (if it is not invoked by your ~/.bashrc) and the cloud ros.bash configuration file. It will configure your local ROS environment to communicate with the remote ROS master over the VPN link. . /usr/share/drcsim/setup.sh
 * 1) Warning: Only necessary if it is not invoked by your ~/.bashrc

. router_cx4a0cd28e/ros.bash
 * 1) Do not forget to use your own constellation ID which you can find in your console

Running rviz and gzclient over the Virtual Private Network ===

Once the VPN and the environment variables are set up, we can launch rviz by typing on your local machine:

rosrun rviz rviz

To add a robot or other displays to rviz, see the instructions here



Now you can do the same things that you can do when running the simulation locally, such as visualizing and logging sensor data.

Open a new terminal, source your local drcsim `setup.sh` file (if it is not invoked by your ~/.bashrc) and the ros.bash file again:

. /usr/share/drcsim/setup.sh
 * 1) Attention: Only necessary if it is not invoked by your ~/.bashrc

. router_cx4a0cd28e/ros.bash
 * 1) Do not forget to use your own constellation ID which you can find in your console

Run gzclient to visualize your current simulation: gzclient

With gzclient running on the local computer, you can easily navigate inside the world:



With the proper configuration files sourced, local Gazebo commands can also be sent to a cloud simulation:

gztopic echo /gazebo/default/world_stats

You should see something like this:

real_time { sec: 5852 nsec: 365862665 } paused: false

sim_time { sec: 3199 nsec: 599000000 } pause_time { sec: 0 nsec: 0 } real_time { sec: 5852 nsec: 565947836 } paused: false

You can now interact with the simulation as if you were working on a local machine.

You can also start sensor viewers from your local machine, to look through the eyes of Atlas for example:

gztopic view

Select the sensor stream to observe:



The sensor data will appear in a separate window:




 * 1) Next ##

Next: CloudSim development