ros2 gazebo camera not publishing data

asked 2021-02-12 16:20:19 -0500

simonsure gravatar image

updated 2022-07-13 09:58:50 -0500

lucasw gravatar image

Currently, I have ROS2 Foxy-Fitzroy installed on Ubuntu 20.04. With a launch file I'm starting gazebo and loading a world. A python file then calls the service /spawn_entity to place an robot into the world. The robot is given as an urdf file. The robot is correctly displayed in GAZEBO and rqt shows that some node is registered to publish data on the topic /custom_ns/camera1/image_raw. Now, I could make the following observation:

  • The terminal, in which Gazebo has been started, is showing the following warnings. Those explain, why the nodes are not registered on the topics /custom and /custom_info. Still, there should be data published.

This is the code from the urdf:

  <gazebo reference="camera_link">
    <sensor type="camera" name="camera1">
      <camera name="head">
      <plugin name="camera_controller" filename="">

I migrated this from ROS1 according to the following guide: It still recommends using the upper notation for passing custom topics despite the warning in the terminal.

I would appreciate any help as there is no solution in sight after several days of work!

edit retag flag offensive close merge delete



So, after some digging I found the reason. The plugin worked fine but the problem were the QoS settings within in RViz, which did not align by default. Just settings those to best efford solved the issue immediately.

simonsure gravatar image simonsure  ( 2021-02-20 03:05:58 -0500 )edit

Thanks for the hint! I also can't display the pointcloud, but changing the setting didn't work. I don't receive any message on the camera topic (even though it is published). Is it normal that both image and point cloud are coming on the same topic?

francesco gravatar image francesco  ( 2021-05-09 07:09:00 -0500 )edit