Skip to main content

Visualizing the model using RViz

Prerequisites

📄ROS Development
Detailed guide on ROS development for Leo Rover, covering topics like adding additional functionalities, building ROS packages and more.

Installation

To visualize the model, you will need 2 additional packages:

  • leo_description - contains the URDF model of Leo Rover with all the required mesh files.
  • leo_viz - contains visualization launch files and RViz configurations for Leo Rover.

You can build them using the instructions from this chapter. You can also download the prebuilt packages from the ROS repository by executing:

sudo apt install ros-${ROS_DISTRO}-leo-viz

Launch

Now, to visualize the model in RViz, just type:

roslaunch leo_viz rviz.launch
RVIZ window

Alternatively, you can open a fresh instance of RViz by typing:

rviz

In the Fixed Frame option choose base_link.

Location of Fixed Frame option

In Displays panel, click Add and choose RobotModel plugin.

Location of Add RobotModel option

Change the Background Color to make the model more visible.

Location of Background change option

You should see the wheels rotating when the Rover is being steered.

Running the visualization offline

You can run the visualization without being connected to the Rover. For this, you will need to change environment variables to point to your loopback device:

export ROS_IP=127.0.0.1
export ROS_MASTER_URI=http://127.0.0.1:11311

Then, use the launch file located in the leo_viz package:

roslaunch leo_viz view_model.launch
info

roslaunch will automatically spawn the Master node (roscore) if it detects that it is not already running.

An RViz instance with RobotModel plugin should start, as well as GUI for joint_state_publisher that let's you specify simulated wheel positions.