Rviz guide

From Robin

Revision as of 19:21, 25 February 2023 by Claudaba (Talk | contribs)
Jump to: navigation, search

Rviz is a great visualization tool for visualizing information published on ROS topics. This includes being able to visualize what the robot is sensing through its sensors, maps of the environment, and so on, along the robot model itself.

Contents

Setup

To make it easier working with Tiago and ROS, you can use a Singularity container where the most basic packages you need are already installed. See how you can use the Singularity container on the robin wiki page here.

You might need to set some environment variables to be able to run simulations on your computer successfully. After you enter the Singulairty shell and you are ready to start simulating, check the environment variables ROS_MASTER_URI and ROS_IP. The ROS master should be set to run locally on your computer and the ROS ip should be set to your computer, like this:

 $ export ROS_MASTER_URI=http://localhost:11311
 $ export ROS_IP=vixen-nb.uio.no

If you are not using the vixen computer, change the IP to the computer you are using. In addition, you might need to set these environment variables every time you enter a new Singularity shell.

Visualizing different types of information in Rviz

  • coming soon*


Running a premade navigation simulation in Rviz

To run a premade navigation example in Rviz, you should first enter a Singularity shell, source ROS and the workspace, and then launch the program. First enter the Singularity shell using the following command:

 $ singularity shell --nv /projects/robin/programs/sing-con/ros-melodic-pal/ros-melodic-pal.sif

Next, source ROS and the workspace like this:

 $ source /opt/ros/melodic/setup.bash
 $ source /tiago_public_ws/devel/setup.bash

Then launch the simulation with this command:

 $ roslaunch tiago_2dnav_gazebo tiago_mapping.launch public_sim:=true robot:=steel

This will open up both Gazebo and Rviz. The Gazebo window shows the simulation of the world, consisting of the loaded environment of an office and Tiago. The Rviz window shows how the robot perceives its environment through its sensors, alongside a map of the environment. You can move the robot around by clicking on “2D Nav Goal” button in the menu and choose where the robot should move and what its end orientations should be. When you do so, you can observe how the map expands as Tiago explores more of it.

You can also use the arrows on your keyboard to move Tiago around in the environment, as shown in the Tiago handbook. To do this, open another terminal, enter the Singularity shell, and source ROS and the workspace. Then, run the following command and use the arrows to move Tiago.

 $ rosrun key_teleop key_teleop.py


Using Rviz with the physical Tiago

  • coming soon*
Personal tools
Front page