IMU data from Reach Kit

@igor.vereninov, I would also be interested in the raw IMU data from the MPU9250 for use in post processing the nav solution of a point on the vehicle. It would be good enough for me if the full 200Hz data could be logged onboard or externally. Has anyone successfully done this ?

I got this to work quickly using this code:

For a quick test:
pip install spidev

change line 6 in to
imu = MPU9250(spi_bus_number = 5, spi_dev_number = 1)

and run python
will output the sensor values until you abort
Acc: -0.006 +0.081 +0.990 Gyr: +2.317 +1.098 +0.854 Mag: +37.691 +14.026 +21.0451


Can you give the novice guide to how you used the python code to start getting data out of the reach? How did you connect, where did you store and run? Thx.

…success after messing around with it for a little bit.

Steps for someone else:
logged into the reach as root:
used a file manager window and connected to the reach as a server.
copied the files (modified as above) into a new directory /imu
SSH into the reach
cd in /imu
started spitting out numbers the look reasonable. Need to figure out how to make sence of the Gyr and Mag readings.

Seems like you could modify the script to send these values to a TPC address/port and get the numbers out in a stream.

1 Like

ANyone know a good way to convert the output to roll pitch yaw? I am getting the following output following ago’s method

Acc: +0.047 -0.003 +0.994 Gyr: -0.915 +0.183 +0.610 Mag: -11.795 +4.275 -78.898
Acc: +0.055 +0.004 +1.010 Gyr: -0.854 +0.061 +0.549 Mag: -11.795 +4.275 -78.898
Acc: +0.047 -0.007 +1.009 Gyr: -0.671 -0.122 +0.610 Mag: -11.795 +4.275 -78.898
Acc: +0.048 -0.013 +0.980 Gyr: -0.732 -0.061 +0.427 Mag: -9.293 -0.356 -77.175
Acc: +0.056 -0.007 +1.006 Gyr: -0.793 +0.183 +0.427 Mag: -9.293 -0.356 -77.175
Acc: +0.054 -0.008 +1.006 Gyr: -0.915 +0.000 +0.427 Mag: -9.293 -0.356 -77.175
Acc: +0.057 -0.010 +0.992 Gyr: -0.854 +0.000 +0.488 Mag: -9.293 -0.356 -77.175

Do a lot of math…or use RTIMULib2, which does all of the math for you. Search for other posts on the forum for the IMU and using the RTIMULib2 implementation to get useful data out.

Here’s how I did it.

There’s also a RTIMULib2 branch on the forum that’s parsed out all of the GUI stuff.


We’ve made some ROS node to get IMU values out of the reach. We tested it successfully for reach M+. It’s based on the RTIMULib2 that we compiled for the reach, for reasons we were not able to compile directly on it. Let us know if there are issues we’ll update the readme and make the required edit to the code. This outputs IMU message (Pose + Gyros + Accel) and the Compass as a MagneticField message.



I’m using your code for a moment but now I need to get the IMU data WITH the GPS data on the serial ouput (with OTG). Did you find a solution to do this?



Hi All,

Is there any update on when these data might be available alongside the GPS to download through the wifi interface (or some other way)?

IMU is on our to-do list, however, it is not yet implemented in ReachView. The good news is that the driver for the sensor is installed and you make use of it if you know Linux and programming.

Hi Igor,

Its been quite a long time since this conversation indicated the IMU data would be extractable from within ReachView.

The IMU data for a mobile platform such as a drone, is important for establishing the accurate location relative to the pitch, roll and yaw of the craft and to have a separate device to obtain this is another level of complexity that should be avoided.

Can you give an update on this 2016 discussion for when we can expect this in 2019.

Kind regards, Steve


Is the IMU module in RS+ and RS2 the same? Can it be accurate to mm level or within 2cm level?

@dolnz @l3technologycambodia, it’s WIP, we can’t provide exact dates on when it will be ready.

Hi Andrew,

Are you able to indicate the progress to date and what that looks like?

Regards, Steve.

We’ll release the feature as soon as it’ll be ready, @dolnz.
At the moment I can’t provide any additional info.

@andrew.yushkevich… is it available yet?


No, it’s not available, @jantjj. We’ll let everyone know when this happens.
As before, the driver for the sensor is installed and you can use it if you know Linux and programming.

Okay thanks.

1 Like

I successfully compiled spidev for Reach M+ (had to cross compile) but after running your script I got an error in at, self.spi_dev_number) calling. The error is “IOError: [Errno 2] No such file or directory”.

My question: are the spi parameters dependant of the Reach Model (M+ Vs RS+) or is it that there is no driver for the M+ ? I can’t find the files Igor talked about previsouly (/home/reach/MPUtest)…


I found the answer after using RTIMULIB and getting a look at the RTIMULib.ini file: on Reach M+, line 6 in should be “imu = MPU9250(spi_bus_number = 0 , spi_dev_number = 0 )”.

Now I wonder why magnetometer values are all 0.


Had to calibrate the magnetometer to receive non zero values.

RTIMULib fused output seems roughtly identical wether accelerometer, gyroscope and magnetometer are activated or only the accelerometer is. I expected the more numerous the inputs, the more precise the output. Through my tests it look likes the fusion only act has a low filter on the roll and pitch angles, reducing the acceleration effects for instance. Is it normal though that with all sensors activated the ouptut is not well compensated (10deg error when decelerating during a pure one axis translation)?

A quick warning for everybody who is using IMU data in their project. Emlid has decided to stop providing root access to M+ and other devices

This is already the case in the current dev build

It doesn’t seem to be possible to access the SPI device and the IMU with the new configuration.

I advise you to update to the new version carefully if this is a concern for you. The last working version AFAIK is 2.18.1 .

I just unwrapped and connected an RS2, availability of IMU data was one of my main reasons for buying it.

Do I read this thread correctly concluding that it’s impossible to get out IMU data a reach RS2 ?

I very much know Linux and programming. But without root access and without any userland exposed IMU data I can’t do anything here? Also no IMU data is exposed on an HTTP API or similar?