MART uIMU code details


IMU drift data summary page

Overview

This page explains the general layout of the nIMU portion of the MART code.
The term nIMU refers to this product. The exact model of the nIMU that MART uses is NA02-0150F050A.
The table below is key to editing the code to work with other versions. It gives the constants used in the code to convert the raw IMU data into SI units.
The uIMU can either be run through a virtual port with a usb to serial conveter, it can also be used with libusb and bulk reads. I used the serial driver. The driver for the memsese nIMU usb connector is
drivers/usb/serial/cp210x.ko
in the linux kernel.
The direct usb communication class hasn't been implemented yet, but it would be nice to do it someday since it would remove the need for the kernel module and the exact name of the serial port to read from.
Also, thanks to the player/stage package for providing a diver for this device, a few lines of code were taken from them and added here. I wouldn't have thought to use the ntohs functions in this context.
The code works by creating is a subclass of nIMU and then calling the start function. The reads from the nIMU are threaded. The constructor also takes a pointer to a nIMUDataBlockPtr object. This is a shared pointer to a thread safe class that the IMU read thread shares with the clients. Data is updated in that shared memory block, and a timestamp is updated on each read. All clients have to do it check to see if the timestamp is upated, and if so read data out of the shared block. The shared pointer wrapper takes care of deleting the data block. It should never be deleted manually, just let it go out of scope.
It is also easy to plot imu data from the test program in octave with commands like this:
load outputFile
plot(outputFile(:,1))
That plots all rows in column 1 from the outputFile file. See the head of the imu test data for column information.

And here is some sample data ploted in octave, that was exported from the IMU test class.