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

Transform [sender=unknown_publisher] Unknown reason for transform failure

asked 2020-05-07 08:02:55 -0500

Yehor gravatar image

updated 2020-05-07 08:32:13 -0500

Hello, I have issue with my lidar. It doesn't show the data when the fixed frame is anything except its own laser_frame.

I means, when I switch fixed frame to /odom or /base_footprint I do not see any data in rviz anymore and starting receive that error message :Transform [sender=unknown_publisher] Unknown reason for transform failure.

I am using YDLIDAR X4

could someone help me? Thank you

EDITED 1:

the photo of tf tree: image description

edit retag flag offensive close merge delete

Comments

What does rosrun tf view_frames show for a tf tree?? Likely you dont load the urdf of your robot, or dont publish a map and odom etc. Do you only launch X4.launch? Fixed frame in rviz usually is the map frame. For your lidar you need a laser_frame in your urdf or a static transform publisher wich transforms direct or indirect from base_link/base_footprint to laser_frame. The standard X4.launch file has a static transform from base_footprint to laser_frame (the last few lines). In the launchfile as well there is the line "" . Visualization only works if there is a transform for the frame_id´s frame. X4.launch alone only gives you laser_frame no other transforms are published no odom no base_footprint.

Dragonslayer gravatar image Dragonslayer  ( 2020-05-07 08:22:08 -0500 )edit

@Dragonslayer I have added

I have static transform publisher from base_footprint to laser_frame.

Yehor gravatar image Yehor  ( 2020-05-07 08:32:27 -0500 )edit

Odom publishes at low frequenzy 6hz. Might be an issue. If you just launch X4.lauch without the driver_node and set fixed_frame base_footprint the same thing happens?

Dragonslayer gravatar image Dragonslayer  ( 2020-05-07 08:42:35 -0500 )edit

If you visualize tf in rviz what does it show? Errors as well?

Dragonslayer gravatar image Dragonslayer  ( 2020-05-07 08:56:35 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2020-05-07 09:02:21 -0500

Yehor gravatar image

I found the solution here: https://github.com/EAIBOT/ydlidar/iss...

In the cpp of the lidar node you have to change these lines:

scan_msg.scan_time = scan.config.scan_time/1000000000.0; scan_msg.time_increment = scan.config.time_increment/1000000000.0;

edit flag offensive delete link more

Comments

Nice to hear. By the way I red sometime ago that rviz in some cases use another coordinate system, this was in regard to pointclouds though. The solution was to invert the axis in rviz, so not to mess up calculations in ros. So if your robot after all this "looks" good in rviz but "works" the wrong way this might be a topic to follow up on. All the best. Matt

Dragonslayer gravatar image Dragonslayer  ( 2020-05-07 09:11:18 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2020-05-07 08:02:55 -0500

Seen: 2,165 times

Last updated: May 07 '20