I think if your tf's are defined correctly (i.e. they account for this 20cm,20cm,10cm translation), then robot_localization should work correctly. What that package does is takes the messages from the topics which you specify and tries to fuse them. But in order to fuse the information, it needs to know the tf between both sensor's frame. So, first you should try to set your tf correct and then use the robot_licalization package. I hope it helps!
Originally posted by dvy with karma: 52 on 2022-09-28
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by JACKLiuDay on 2022-09-29:
Thank you so much for your reply. You mean that the installation location information between multiple sensors is obtained through the frame_id in the topics. Through the tf transformation information of each frame_id, the corresponding installation offset information can be queried, so that the robot_localization can work normally. So I'll pass the 20cm 20cm 10cm mount offset to robot_localization via a static tf transform. Thank you again.
Comment by dvy on 2022-09-30:
@JACKLiuDay : You got the idea. However, please note that you need to publish a static tf only if the sensors are not defined in your robot urdf model which I doubt (otherwise, how would you get the sensor data). To check the tf between two frames, you can do: ros2 run tf2_ros tf2_echo velodyne base_link
(where velodyne is first frame_id and base_link is another; replace them with your frame_ids) on ROS2 or tf2_tools echo.py <frame_id_1> <frame_id_2>
on ROS1. Btw, how did you get odometry information from lidar?
Comment by JACKLiuDay on 2022-10-08:
@dvy Hi, I just finished my vacation. My tf between two sensors are obtained by robot_state_publisher. It can publish tf messages with sensor.xacro. We can define different sensor link in the xacro file. Or publish the transformation information between coordinate systems through static tf transformation as you said. The lidar odometry is obtained by using LIO SAM. https://github.com/TixiaoShan/LIO-SAM
It can fuse GPS and lidar.
Comment by dvy on 2022-12-20:
@JACKLiuDay : If this answers your question, can you please accept it as correct?