5 Replies Latest reply on Mar 18, 2018 12:47 PM by bluevalhalla

    BMI160 IMU data publishing to ROS




      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.




        • 1. Re: BMI160 IMU data publishing to ROS
          Intel Corporation
          This message was posted on behalf of Intel Corporation

          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.


          • 2. Re: BMI160 IMU data publishing to ROS

            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 <my_computer_name> 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




            • 3. Re: BMI160 IMU data publishing to ROS



              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: 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?




              • 4. Re: BMI160 IMU data publishing to ROS

                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.




                • 5. Re: BMI160 IMU data publishing to ROS

                  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 ardupilot code for the Inertial Sensor (BMI160) and the 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 release notes and from 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 razor_imu_9dof code.