1

I have ROS2 Foxy set up on an Ubuntu 20.04 machine. When using RQt, I am able to see all the topics on my network just fine and I am able to subscribe to all of them and even plot them on a live graph. However, publishing doesn't work correctly and always publishes null/default messages. For example, if I try to publish a Bool message with the data as "true" then it still publishes "false". Same with any numeric types - whatever number I try to publish, it always publishes 0. See the image for examples: RQt screenshot

To debug, I have tried publishing these same messages from Python scripts and from the 'ros2 pub' command line utility. These always work just fine and my subscribers in RQt are able to see the correct values being published. Has anyone else dealt with this? What is the underlying cause and how to solve it? Is it perhaps fixed in ROS2 Galactic?

Bhavesh
  • 31
  • 3
  • You are referrring to [rqt_publisher](https://github.com/ros-visualization/rqt_publisher/tree/foxy-devel) (and [rqt_topic](https://github.com/ros-visualization/rqt_topic/tree/foxy-devel)), right? So you have checked the output from console with `ros2 topic echo ` when publishing from `rqt_publisher` and found the publisher and not the topic monitor to be the issue. I assume that this does not have to do anything with ROS itself but it might be related to [this issue on their Github](https://github.com/ros-visualization/rqt_publisher/issues/27). – 2b-t Jun 04 '21 at 16:06
  • @2b-t That's exactly right! Thank you. I was able to make it work locally by reverting the relevant commit, just like in the link you posted. I will post it as an answer/workaround below. – Bhavesh Jun 25 '21 at 18:54

1 Answers1

2

As user '2b-t' pointed out in the comments, this is an issue where working code was removed from rqt_publisher in the foxy-devel branch. So while RQt in ROS2 Foxy is broken, for now there is a workaround of cloning rqt_publisher into your ROS2 workspace and manually adding in the missing code. It's easy and there's an example pull request created by a github user 'coalman321' which shows how to revert the offending commit here (https://github.com/ros-visualization/rqt_publisher/pull/28/files).

Steps to fix:

  • cd into the src directory your ROS2 workspace
  • git clone https://github.com/ros-visualization/rqt_publisher.git
  • cd rqt_publisher
  • git checkout foxy-devel
  • git revert 367049ecc4ce3cab
  • cd back up to the root of your ROS2 workspace
  • colcon build --symlink-install --packages-up-to rqt_publisher
  • source install/local_setup.bash

Now when you run rqt and publish a non-null value, it should work correctly! You can monitor the value either from command line e.g. ros2 topic echo or from the Topic Monitor within RQt itself.

Bhavesh
  • 31
  • 3
  • The fix is now in https://github.com/ros-visualization/rqt_publisher/tree/foxy-devel, It worked for me today without applying the need to revert any commits. – Brian Erickson Jul 20 '21 at 05:40