Reputation: 31
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?
Upvotes: 1
Views: 699
Reputation: 31
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 workspacegit 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 workspacecolcon 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.
Upvotes: 2