Can't visualize in rviz2 with 'odom' as 'Fixed Frame'
I am using ROS2 foxy on Ubuntu 20.04 on amd64 architecture. I have a topic /velodyne_points
of type sensor_msgs/msg/PointCloud2
which is published w.r.t frame velodyne
which I came to know through its header information.
header:
stamp:
sec: 4103
nanosec: 308000000
frame_id: velodyne
This is how my tf tree looks like. In rviz, I can visualize this topic with every other frame set as Fixed Frame
except odom
.
On terminal, I see many messages when odom
is set as Fixed Frame
. [INFO] [1658783478.987451404] [rviz]: Message Filter dropping message: frame 'velodyne' at time 4332.314 for reason 'Unknown'
. They disappear when any other frame is set.
I tried to confirm that tf between odom and velodyne exists using below command which sounds OK to me. I checked some related questions (357762 which suggests that timing is missing from odom to the required frame TF (in my case, it is velodyne
). But from the output of below message, I see At time ....
line which I think consists the required tf time. Another related question is (367138 which redirects to 357762 and also suggests to setup a static tf but why?
If anyone gets this issue, it's saying that rviz2 cannot render the data because it's not attached to the main tf tree. Even view_frames won't see it. You'll need to setup a static transform between it and the map, such as
ros2 run tf2_ros static_transform_publisher "0" "0" "0" "0" "0" "0" "map" "frame"
dev@dev-Dell-G15-5511:~$ ros2 run tf2_ros tf2_echo odom velodyne
[INFO] [1658783641.648389985] [tf2_echo]: Waiting for transform odom -> velodyne: Invalid frame ID "odom" passed to canTransform argument target_frame - frame does not exist
At time 1658783642.633743699
- Translation: [0.001, 0.053, 0.783]
- Rotation: in Quaternion [0.000, 0.000, 0.568, 0.823]
I don't understand two things over here.
1) What's so special about the odom
frame over here?
2) From where did the map
frame come into picture? ros2 run tf2_tools view_frames.py
does not show it in the tree (neither as linked, nor as isolated) but rviz2 shows it in TF.
Please help.