TixiaoShan / LIO-SAM

LIO-SAM: Tightly-coupled Lidar Inertial Odometry via Smoothing and Mapping
BSD 3-Clause "New" or "Revised" License
3.34k stars 1.24k forks source link

GPS data format matching #463

Open QCL-Virgo opened 9 months ago

QCL-Virgo commented 9 months ago

An error message appears when I run bag: [ERROR] [1701932176.859127476]: Client [/lio_sam_mapOptmization] wants topic /gps/fix to have datatype/md5sum [nav_msgs/Odometry/cd5e73d190d741a2f92e81eda573aca7], but our version has [sensor_msgs/NavSatFix/2d3a8cd499b9b4a0249fb98fd05cfa48]. Dropping connection.

The error shows that the GPS data to be accepted does not match the GPS data type in the bag. How should I solve this problem?

Spirquel commented 5 months ago

in ros, a topic has a publisher and subscriber. In this topic exist one type of msg who is the same for pub and sub. So in your problem, the msg in your topic is "nav_msgs/Odometry" and the sub of that (the slam who is the sub) read and understand only "nav_msgs/Odometry". But you send like msg "sensor_msgs/NavSatFix/" who is a msg for GPS. The solution for that is maybe to change the topic (because you send GPS point in a topic for Odometrie). In the ReadMe for this slam it said "To enable the GPS function, change "gpsTopic" in "params.yaml" to "odometry/gps"." you test it ? If this solution don't work, you can create a node for read the "sensor_msgs/NavSatFix/" and translation it on "nav_msgs/Odometry".

jianhuaz commented 2 weeks ago

Hi @Spirquel "you can create a node for read the "sensor_msgs/NavSatFix/" and translation it on "nav_msgs/Odometry"." what do I need to turn to? I use robot_localization's navsat_transform_node, but to use this, I need Odometry data, which LIO-SAM does not have.