Community
cancel
Showing results for 
Search instead for 
Did you mean: 
trix
New Contributor I
2,352 Views

BMI160 IMU data publishing to ROS

Hi,

Is there some sample code to read and publish data from the BMI160 IMU on the compute board as ROS messages? I know that I could use the built in flight controller's IMU and I have been able to use MAVROS to echo that IMU data, but I would not be able to use the built-in flight controller for the project I am working on.

Thanks,

Trixie

0 Kudos
6 Replies
idata
Community Manager
351 Views

Hello Trixie,

 

 

Thank you for your interest in the Intel Aero compute board.

 

Your request has been received and is currently being investigated.

 

We will get back to you as soon as possible.

 

 

Regards,

 

Octavian

 

trix
New Contributor I
351 Views

Hi Octavian,

Thank you for replying back. I saw your message on the separate thread I opened so I'm just gonna copy over what I said from there about the step I tried to take.

I've tried to open the spidev3.0 device by writing a simple python script (and have also changed its permission to be executable of course):

# !/usr/bin/env python

import spidev

spi = spidev.SpiDev()

spi.open(3, 0)

However, I am met with a Permission Denied error. I am wondering if anyone else has had this trouble or is there something else I am missing here?

Additionally, I have tried to run this command on my terminal:

spi_xfer -b 3 -c 0 -d 0x80 -w 2

And the result is this, but I have no idea what to do with this information:

spi mode: 0

bits per word: 8

max speed: 1000000 Hz

TX: 0x80 0x0

RX: 0x0 0xd1

If it helps, I am currently running Ubuntu 16.04 LTS on my Aero compute board and this is what I get when I run uname -a:

Linux 4.4.76-aero-1.2 # 1 SMP PREEMPT Thu Nov 9 21:20:17 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Thanks!

Trixie

trix
New Contributor I
351 Views

Hi,

I ended up using the Bosch SensorTec driver to actually get some reading out of the BMI160 IMU. This is the driver I'm currently using: https://github.com/BoschSensortec/BMI160_driver GitHub - BoschSensortec/BMI160_driver: Bosch Sensortec BMI160 sensor driver. I haven't fully made a ROS publisher but it's a start. However, I am also wondering if I can integrate the BMM150 Magnetometer that is also in the compute board. While trying to follow the Bosch SensorTec guide, I saw that this condition had to be true in order to integrate the BMM150 into the BMI160: "It is assumed that secondary interface of bmi160 has external pull-up resistor in order to access the auxiliary sensor bmm150".

So would it be possible to do this integration in the compute board?

Thanks,

Trixie

EMill6
Beginner
351 Views

Hi Trixie,

Have you had any luck with the IMU drivers and ROS publisher for the Aero Compute Board? I am about to start on this myself, so if you have any pointers or a project I can help with, that would be great!

In addition to the Bosch SensorTec drivers, I also ran across some driver in the https://github.com/ArduPilot/ardupilot ardupilot code for the https://github.com/ArduPilot/ardupilot/blob/fb77d0739e3235d53c156e26930cbd122c3124eb/libraries/AP_In... Inertial Sensor (BMI160) and the https://github.com/ArduPilot/ardupilot/blob/fb77d0739e3235d53c156e26930cbd122c3124eb/libraries/AP_Co... magnetic sensor (BMI150). I'm not sure if these will work for the Aero Compute Board, or if they are for other hardware, but the copyright notices for both are from Intel. It seems from the https://github.com/ArduPilot/ardupilot/blob/a6ff2cacdde2d53e8a6afb7ba6415c2e7cbe3af6/ArduCopter/Rele... release notes and from https://github.com/ArduPilot/ardupilot/blob/b26d140316405cee6a4fa0d0a96e41b901721c1b/Tools/ardupilot... boards.py that the code supports both the Aero compute board and the flight controller.

For hints on how to start the ROS publisher, I was looking at the https://github.com/KristofRobot/razor_imu_9dof razor_imu_9dof code.

Regards,

Ed

EMill6
Beginner
351 Views

I am in a similar situation as Trixie.

I only have the Aero Compute Board and the Vision Accessory Kit (not the full RTF kit). I also need the IMU and Magnetometer information in ROS. The only reason I purchased the stand alone compute board was because it has the IMU/Mag onboard. It was not clear that there is no software support for these components. Providing a ROS package for these components would be extremely useful. Short of that, please at least provide the necessary information to do the work ourselves, e. g. if/how the 150 is connected to the 160.

Regards,

Ed

EMill6
Beginner
351 Views

I put together a simple python based driver and ROS publisher for the BMI160 and the BMM150. I have verified the data from the python drivers pretty much those I get from the Bosch C drivers. You can find the code https://github.com/ejmiller2/ros_aero_imu here.

Reply