This software is built on the Robotic Operating System (ROS), which needs to be installed first. Additionaly, the ROS MiniImu Calibration and Sensor Fusion depends on following software:
arduino toolchain (simple programming environment for education pcbs)
rosserial (wrapper to transmit ros messages over a serial port)
sudo apt-get install ros-indigo-rosserial-arduino
sudo apt-get install ros-indigo-rosserial
Boost (general purpose c++ library),
sudo apt-get install libboost-dev
armadillo (c++ linear algebra library),
sudo apt-get install liblapack-dev
sudo apt-get install libblas-dev
sudo apt-get install libarmadillo-dev
To use the packages in your project, clone the latest version of this repository to the source folder of your catkin workspace. Make sure that all dependencies listed above are installed before executing catkin_make.
cd ~/catkin_ws/src
git clone https://github.com/AR2A/imu-minimu-arduino.git
cd ..
catkin_make
In order for the download to work modify the file “avr_imu/firmware/CMakeLists.txt” to suit your setup.
cmake_minimum_required(VERSION 2.8.3)
include_directories(ros_lib arduino_libs)
generate_arduino_firmware(avr_imu
SRCS avr_imu.cpp arduino_libs/L3G/L3G.cpp arduino_libs/LSM303/LSM303.cpp ros_lib/time.cpp
BOARD mega2560
PORT /dev/ttyACM0
)
Most likely the variables BOARD and PORT have to be modified.
Afterwards you download the firmware by issuing the following commands inside your catkin workspace.
catkin_make avr_imu_firmware_avr_imu
catkin_make avr_imu_firmware_avr_imu-upload
For debugging purposes it can be useful to visualize the orientation within rviz. To do so install the imu_tools package which contains the rviz_imu_plugin package.
sudo apt-get install ros-indigo-imu-tools
This is the rosserial node running on the arduino board. The node reads the data from the imu over the spi interface and issues a message containing this data in a 50 Hz cycle.
None
/imu/data_raw
(sensor_msgs/Imu)
The raw register data of the imu (accelerometer and gyroscope).
/imu/magnetic_field
(sensor_msgs/MagneticField)
The raw register data of the imu (magnetometer).
None
None
This node executes a step by step calibration process to compensate the alignement and scaling of the imu data (as well as hard and soft ironing effects on the magnetometer data). When the calibration finishes the calculated data is stored inside the ros execution path (typical ~/.ros).
/imu/data_raw
(sensor_msgs/Imu)
The raw register data of the imu (accelerometer and gyroscope).
/imu/magnetic_field
(sensor_msgs/MagneticField)
The raw register data of the imu (magnetometer).
None
None
None
This node processes the senor fusion with an extended kalman filter
The node is roughly designed after the findings of the following paper:
David Jurman, Marko Jankovec, Roman Kamnik, Marko Topic, “Calibration and data fusion solution for the miniature attitude and heading reference system”, in Sensors and Actuators A: Physical, Volume 138, 2007.
/imu/data_raw
(sensor_msgs/Imu)
The raw register data of the imu (accelerometer and gyroscope).
/imu/magnetic_field
(sensor_msgs/MagneticField)
The raw register data of the imu (magnetometer).
/imu/data
(sensor_msgs/Imu)
The fused orientation data.
None
None
Please report bugs and request features using the Issue Tracker.