Visualize pointcloud2 on rviz2

asked 2021-05-11 05:07:27 -0600

francesco gravatar image

updated 2021-05-11 05:34:50 -0600

I am trying to visualize a pointcloud published from the gazebo depth camera plugin, but rviz complains with the following:

[INFO] [1620727112.970424552] [rviz]: Message Filter dropping message: frame 'camera_link' at time 619.835 for reason 'Unknown'

The message (published on /camera/points) is:

header:
  stamp:
    sec: 357
    nanosec: 835000000
  frame_id: camera_link
height: 1
width: 76800
fields: '<sequence type: sensor_msgs/msg/PointField, length: 4>'
is_bigendian: false
point_step: 32
row_step: 2457600
data: '<sequence type: uint8, length: 2457600>'
is_dense: true

camera_link exists in tf, and I tried all different kind of QoS setting in the rviz PointCloud2 plugin.

EDIT: If I set the global frame in rviz to camera_link, the pointcloud is visualized, but not using any other frame, even though the tf tree is correct. Output of tf view_frames is:

digraph G { "link6" -> "camera_link"[label=" Broadcaster: default_authority\nAverage rate: 10000.0\nBuffer length: 0.0\nMost recent transform: 0.0\nOldest transform: 0.0\n"]; "link5" -> "link6"[label=" Broadcaster: default_authority\nAverage rate: 20.013\nBuffer length: 4.997\nMost recent transform: 1620729066.500792\nOldest transform: 1620729061.50394\n"]; "world" -> "base_link"[label=" Broadcaster: default_authority\nAverage rate: 10000.0\nBuffer length: 0.0\nMost recent transform: 0.0\nOldest transform: 0.0\n"]; "link6" -> "laser_mount_link"[label=" Broadcaster: default_authority\nAverage rate: 10000.0\nBuffer length: 0.0\nMost recent transform: 0.0\nOldest transform: 0.0\n"]; "base_link" -> "base_0"[label=" Broadcaster: default_authority\nAverage rate: 10000.0\nBuffer length: 0.0\nMost recent transform: 0.0\nOldest transform: 0.0\n"]; "base_0" -> "link1"[label=" Broadcaster: default_authority\nAverage rate: 20.013\nBuffer length: 4.997\nMost recent transform: 1620729066.500792\nOldest transform: 1620729061.50394\n"]; "link1" -> "link2"[label=" Broadcaster: default_authority\nAverage rate: 20.013\nBuffer length: 4.997\nMost recent transform: 1620729066.500792\nOldest transform: 1620729061.50394\n"]; "link2" -> "link3"[label=" Broadcaster: default_authority\nAverage rate: 20.013\nBuffer length: 4.997\nMost recent transform: 1620729066.500792\nOldest transform: 1620729061.50394\n"]; "link3" -> "link4"[label=" Broadcaster: default_authority\nAverage rate: 20.013\nBuffer length: 4.997\nMost recent transform: 1620729066.500792\nOldest transform: 1620729061.50394\n"]; "link4" -> "link5"[label=" Broadcaster: default_authority\nAverage rate: 20.013\nBuffer length: 4.997\nMost recent transform: 1620729066.500792\nOldest transform: 1620729061.50394\n"]; edge [style=invis]; subgraph cluster_legend { style=bold; color=black; label ="view_frames Result"; "Recorded at time: 1620729066.5162456"[ shape=plaintext ] ; }->"world";

I am using ros2 foxy on ubuntu 20.04 and rviz2. Details on version:

librviz-dev/focal 1.13.7+dfsg-1build2 amd64
librviz4d/focal 1.13.7+dfsg-1build2 amd64
python3-rviz/focal 1.13.7+dfsg-1build2 amd64
ros-foxy-nav2-rviz-plugins-dbgsym/focal 0.4.7-1focal.20210423.031243 amd64
ros-foxy-nav2-rviz-plugins/focal 0.4.7-1focal.20210423.031243 amd64
ros-foxy-rviz-assimp-vendor/focal,now 8.2.1-1focal.20210422.235601 amd64 [installed,automatic]
ros-foxy-rviz-common-dbgsym/focal 8.2.1-1focal.20210423.021136 amd64
ros-foxy-rviz-common/focal,now 8.2.1-1focal.20210423.021136 amd64 [installed,automatic]
ros-foxy-rviz-default-plugins-dbgsym/focal 8.2.1-1focal.20210423.023030 amd64
ros-foxy-rviz-default-plugins/focal,now 8.2.1-1focal.20210423.023030 amd64 [installed,automatic]
ros-foxy-rviz-ogre-vendor-dbgsym/focal 8.2.1-1focal.20210422.235609 amd64 ...
(more)
edit retag flag offensive close merge delete

Comments

In rviz, if you add a TF display and look in the Status are there any warnings or errors for the relevant transformations?

shonigmann gravatar image shonigmann  ( 2021-05-11 13:12:48 -0600 )edit

No, all fine. From both the tf plugin on rviz and the view_frame tool the tf tree seems well connected all the way from world frame to camera_link through the robot arm (doosan-robot2 m0609). I tried to increase the publish frequency of the robot_state_publisher from 20 to 100hz, in case of a problem of timings in the tf lookup, but no difference.

francesco gravatar image francesco  ( 2021-05-11 17:27:10 -0600 )edit

Have you verified that your QoS settings (e.g. the Reliability Policy) in RVIZ match your publisher's settings?

shonigmann gravatar image shonigmann  ( 2021-05-11 17:31:14 -0600 )edit

I tried all the possible reliability policy options. It doesn't make a difference. the message gets discarded unless i set the global frame to camera_link.

francesco gravatar image francesco  ( 2021-05-11 17:37:38 -0600 )edit