ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

RVIZ can not visualize lidar data (tf2 frame_ids cannot start with a '/' like)

asked 2022-05-09 07:58:49 -0500

Kracozebr gravatar image

I'm trying to visualize lidar point cloud recorded in bag file. I use ros noetic for this. I play the bag file:
rosbag play -l /home/test2.bag
and open rviz to visualize. I get the follow error (unfortunately I can not upload the file as I'm new and not have at least 5 points):
I have Fixed Frame map and Global Status: Warn Fixed Frame NO TF data and
For frame [/rslidar]: Fixed Frame [map] does not exist

I found the same issue at stack overflow and on this forum: https://stackoverflow.com/questions/5... https://answers.ros.org/question/1959...
There are 2 solutions the first is to set Fixed Frame to /rslidar and the other is to set up a publisher that tells rviz where to put the fixed world frame stmth like this:
rosrun tf static_transform_publisher 0 0 0 0 0 0 map rslidar 50

I tried both but solutions and they don't work. When I tried to change Fixed Frame to /rslidar the slash can not be wrote and as a result only rslidar is written in Fixed Frame and the error is the next:
Failed to transform from frame [/rslidfar] to frame [rslidar]

If I set up publisher via tf static_transform_publisher the error is:
For frame [/rslidar]: Fixed Frame [map] does not exist

And in rviz log there is the warning:

As I understand the slash is not allowable as argument. How can I change name to display point cloud?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-05-10 06:55:36 -0500

I don't think the slash is the problem. Are you sure that the frame for the messages is /rslidar ?

You can verify the correct frame_id for your lidar messages. First play the bag file, then do rostopic echo <lidar_topic_name>, when you echo to the lidar messages you can see the correct frame_id for this message. In RVIZ if you change the global option frame to the one you see in rostopic echo, you should be able to see Lidar data.

edit flag offensive delete link more

Comments

Thanks for replying! I checked the lidar message and the frame_id is really /rslidar The output is:
header: seq: 20294 stamp: secs: 1650027264 nsecs: 94891548 frame_id: "/rslidar" height: 32 width: 1812 ... So I installed bagtools (http://wiki.ros.org/bag_tools?distro=... ) and changed the frame_id
rosrun bag_tools change_frame_id.py -o /home/test2_renamed.bag -i /home/test2.bag -f rslidar -t /rslidar_points
and after that I could to visualize the lidar data.
Although I needed to ran the docker with ros kinetic because bag_tools is not released in noetic.

Kracozebr gravatar image Kracozebr  ( 2022-05-11 01:24:06 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2022-05-09 07:58:49 -0500

Seen: 739 times

Last updated: May 15 '22