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

Revision history [back]

click to hide/show revision 1
initial version

Short answer is that the current python wrapper (driver) is not capable of providing you with magnetometer date, but only with the data you originally received (and some other data you are not using).

Long answer: The reason why you are not receiving magnetometer data is because the python wrapper you are using doesn't have this reading. If you look at the source code you can see it reads data from message frame with ID number 10 (also frame with ID number 12, 13 and 20 but these are not relevant for your test). In the MIDG II user manual on page 22 you can find that the frame for magnetometer reading is message frame with the ID number 3. This in term means that the python driver is processing navigation sensor data found in message frame number 10 and publishes it as a sensor_msgs/Imu message (the one you received) without the magnetometer data as this data is never even processed. Other aforementioned frames are also being processed but only GPS data is being published.

Easier solution for your problem is to use a different driver which indeed does have that reading, but I am not aware if there any for python. A bit trickier solution is to change the python driver itself and add this functionality and then publish it to a different topic as PeteBlackerThe3rd mentioned, maybe also creating your own message type with all sensor data you need (depending on the use case). This is not a hard problem to solve (as much can be learned from reading the existing code and provided user manual) but it can be tricky if you never did it by yourself.