pcdangio / ros-driver_mpu9250

ROS driver for the InvenSense MPU9250 9DoF IMU.
MIT License
35 stars 14 forks source link

How to publish to laser_scan_matcher? #13

Closed adityasivaraj closed 2 years ago

adityasivaraj commented 2 years ago

Hello,

You've done great work with this driver, and I would like to use it in my project. But, since this driver is publishing to the unofficial sensor_msgs_ext instead of sensor_msgs, please let me know how do I publish to nodes that listen to sensor_msgs?

In my case I want to use the IMU with laser_scan_matcher. How do I make it listen to sensor_msgs_ext instead of sensor_msgs?

pcdangio commented 2 years ago

glad the driver has been useful for you! i originally wrote the driver for a custom project of mine, and then decided to open source it. haven't gotten around to making a branch for the standard sensor_msgs interface. i recommend you modify this driver to publish sensor_msgs/Imu messages for use in your application, which should be a quick and easy fix

i use my own sensor_msgs_ext definitions in my projects for higher efficiency (and simplicity)

adityasivaraj commented 2 years ago

Hey pcdangio, thanks for the reply! I am not familiar with the source code of the original sensor_msgs topic, is it just deleting "_ext" from the code? (I am assuming all the additional items you added are in separate files and that just using "sensor_msgs" will solve the issue) If not, and it is much more complex, I am thinking just using another microcontroller like Arduino to send data via USB would be a lot quicker...

pcdangio commented 2 years ago

It's not too hard as long as you know how to publish a message in ROS with C++. There's a tutorial here if you need it.

All the data message publishing happens in the below snippet. All you need to do is replace my sensor_msgs_ext with the IMU message from sensor_msgs.

https://github.com/pcdangio/ros-driver_mpu9250/blob/master/src/ros_node.cpp#L160-L209