Skip to content

agalbachicar/ros2_visualization_playground

Repository files navigation

ros2_visualization_playground

Guidelines

Base project docker image with ros2 foxy full distribution and a few sample packages to show off the power of RQT and PlotJuggler.

Docker

  • NVIDIA GPU support - Skip this step if you don't have an NVIDIA graphics card

Make sure you have the drivers installed:

nvidia-smi

Install nvidia-container-toolkit in your host machine:

sudo apt-get install -y nvidia-container-toolkit
  • Build the docker image whose name is ros2_foxy:
./docker/build.sh

You can also try to set a specific image name:

./docker/build.sh -i my_fancy_image_name
  • Run a docker container from ros2_foxy called ros2_foxy_container:
./docker/run.sh

You can also try to set specific image and container names:

./docker/run.sh -i my_fancy_image_name -c my_fancy_container_name

And a prompt in the docker image should appear at the root of the workspace:

$ pwd
/home/username/ws
$ ls -lash src/
total 12K
4.0K drwxr-xr-x 3 root         root         4.0K Nov 25 20:53 .
4.0K drwxr-xr-x 1 root         root         4.0K Nov 25 20:53 ..
4.0K drwxrwxr-x 4 agalbachicar agalbachicar 4.0K Nov 25 19:20 ros2_visualization_playground

Prepare your workspace, build and test

  • To install dependencies via rosdep:
rosdep install -i -y --rosdistro foxy --from-paths src
  • To build:
colcon build

And if you want details of the run commands:

colcon build --event-handlers console_direct+
  • To test:
colcon test --event-handlers console_direct+
colcon test-result

Try the code!

After building, source your install space:

source install/setup.bash

Run a node to generate synthetic telemetry data:

ros2 run telemetry_data_generation telemetry_data_node

Run the quaternion to euler angles conversion

ros2 run telemetry_visualization quat2euler_node

Run the rqt_gui visualization:

ros2 run rqt_gui rqt_gui --perspective-file install/telemetry_visualization/config/perspectives/pose.perspective

And you should see the RQT visualization displaying something like:

rqt_perspective

Alternatively, you could use PlotJuggler:

ros2 run plotjuggler plotjuggler

Once the window is open, load the layout configuration by clicking on the button next to Layout and look for the layout.xml file that should be in install/telemetry_visualization/config/plotjuggler/layout.xml. Choose the ROS2 Topic Subscriber and click on Start. Select /pose and /euler_angles topics. Click on Start and you should see something like the following picture.

plot_juggler_layout

About

ROS2 RQT and PlotJuggler demonstrations.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published