Search code examples
ros

How to use custom laser scan message fro gmapping? I am using YD LIDAR. Can I publish the scan message to another ropic than /scan?


How to use a custom laser scan message for gmapping? I am using YD LIDAR. Can I publish the scan message to another rostopic than /scan?

Publishing the custom message to the same topic is not appropriate, and if I publish to another topic, how can I use it for gmappping and navigation package?


Solution

  • You would need to change the actual gmapping repo or create a node to convert from you custom message type to sensor_msgs::LaserScan. Because if it is a custom message, the void laserCallback(const sensor_msgs::LaserScan::ConstPtr& scan) from the node won't be able to handle.

    Mapping to another topic can be achieved by doing remap, either in the launch file of the laserscan publisher or the subscriber