PointCloud2 visualisation in rviz2
EDIT:
Apparently the problem is not about visualisation or rviz. I tried to implement a minimal subscriber that receives point cloud messages and just print a notification and it doesn't work. The callback is never called. However, if I use ros2 echo
I can subscribe and receive messages. I can confirm that the nodes are connected in the graph, so it is not a topic name issue.
Am I missing something?
END EDIT
Hi all,
I am finally migrating from ROS1 to ROS2 and, currently, I am trying to implement nodes to process depth images and point clouds.
I have a node that reads depth images from a folder and publishes them as messages paired with the corresponding camera calibration message. These depth messages are feed to depth_image_proc::PointCloudXyzNode
, which correctly publish them as point clouds.
This is the output I get from echoing the topic:
header:
stamp:
sec: 1611675769
nanosec: 545850714
frame_id: camera_depth_optical_frame
height: 480
width: 640
fields: '<sequence type: sensor_msgs/msg/PointField, length: 3>'
is_bigendian: false
point_step: 16
row_step: 10240
data: '<sequence type: uint8, length: 4915200>'
is_dense: false
From here the message seems fine and well-formed. However, when I try to see in rviz2 I get nothing. At first I thought it was a problem with tf, so I tried to publish a dummy transformation between map
and camera_depth_optical_frame
, but nothing appears.
This is what I get in rviz2:
No matter what it keeps saying: "Showing [0] points from [0] messages"
Any idea of what could be the problem?