[ROS2] rviz2 and rqt do not shown published image
Hi,
I have created a Gazebo world with a camera and the image is publishing to a topic of type sensor_msgs/msg/Image. I opened rviz2 and rqt to see the published image. But both tools shown a empty image.
When I run the ros2 topic echo
command I see that image data is published.
To test it you can use the gazebo_ros_camera_demo.world from the gazebo_plugin package.
Is this a bug of rviz and rqt or is there a missing setting?
EDIT:
QoS are the the same by default. I ran the command ros2 topic info -v /demo_cam/camera1/image_raw
and got following output:
Type: sensor_msgs/msg/Image
Publisher count: 1
Node name: camera_controller
Node namespace: /demo_cam
Topic type: sensor_msgs/msg/Image
Endpoint type: PUBLISHER
GID: 01.0f.0d.01.ba.44.00.00.01.00.00.00.00.00.12.03.00.00.00.00.00.00.00.00
QoS profile:
Reliability: RMW_QOS_POLICY_RELIABILITY_BEST_EFFORT
Durability: RMW_QOS_POLICY_DURABILITY_VOLATILE
Lifespan: 2147483651294967295 nanoseconds
Deadline: 2147483651294967295 nanoseconds
Liveliness: RMW_QOS_POLICY_LIVELINESS_AUTOMATIC
Liveliness lease duration: 2147483651294967295 nanoseconds
Subscription count: 1
Node name: rviz
Node namespace: /
Topic type: sensor_msgs/msg/Image
Endpoint type: SUBSCRIPTION
GID: 01.0f.0d.01.99.45.00.00.01.00.00.00.00.00.26.04.00.00.00.00.00.00.00.00
QoS profile:
Reliability: RMW_QOS_POLICY_RELIABILITY_RELIABLE
Durability: RMW_QOS_POLICY_DURABILITY_VOLATILE
Lifespan: 2147483651294967295 nanoseconds
Deadline: 2147483651294967295 nanoseconds
Liveliness: RMW_QOS_POLICY_LIVELINESS_AUTOMATIC
Liveliness lease duration: 2147483651294967295 nanoseconds
I tried to reproduce your problem in
eloquent
and experienced the same issue in rviz. However, rqt works out of the box for me. Looks like rviz requires the tf transform from your fixed frame tocamera_link
to be available. Try setting your fixed frame tocamera_link
or providing a tf transform.Another common issue in this context are mismatching Quality of Service settings. However, it works fine with the default settings in my case. (not sure whether rqt's default QoS settings changed in foxy)
Thanks for your reply. I have edited my question with the QoS. I also tried to set the fixed frame in RViz to camera_link but I dont get it working
@lmiller you wrote in your edit, that the QoS settings are the same but your log output shows that your publisher is reliability
BEST_EFFORT
, while the subscriber is set toRELIABLE
. This is not a compatible configuration (see here). Have you tried changing your rviz subscriber to best effort in the topic section?@Phgo Oh I didnt see that. I set the reliability QoS to
Best Effort
in RViz & the world frame tocamera_link
and now it works in RViz.@lmiller as far as I know is not yet possible to change the QoS in rqt GUI (The issue addressing this is still open) Do you need any further help on this or does this answer your question?
@Phgo Thanks this answered my question