Skip to content

IMU Setup

Charlie Weiss edited this page Dec 23, 2018 · 1 revision

Overview

The IMU gave us a lot of trouble in this project. We initially tried to integrate the IMU into the Raspi onboard the Neato. However, this quickly proved to be a lot of work that was not conducive to the learning of the project, so we pivoted to the less permanent solution of taping the IMU to the robot and connecting it to the computer via a long USB extension cable.

Attempt 1: Raspi Integration

Upload Default Firmware

  1. Go to ROS razor_imu_9dof wiki page (link) and clone the source git repository.
  2. Follow the instructions in the README (link). The HW__VERSION_CODE is 10736, according to the Sparkfun page for the Razor IMU (link).
  3. In the firmware in file Razor_AHRS, set your startup mode to OUTPUT__MODE_ANGLES_AG_SENSORS as shown below:
// Select your startup output mode and format here!
int output_mode = OUTPUT__MODE_ANGLES_AG_SENSORS;
int output_format = OUTPUT__FORMAT_TEXT;

Upload the code to the IMU and open the Serial monitor. You should see full RPYAG data being printed out.

Setup with Neato

In imu_redirect, remove the timeout
ssh into [email protected] No Name Jane 3
~pi/CompRoboPrep/PiSetupFiles/imu_redirect.py, comment out imu redirect
port 7778
Robot https://github.com/xiaozhengxu/razor_imu_9dof edit etc/rc.local

Attempt 2: USB Cable

  1. Follow step 1 for Attempt 1
  2. Calibrate razor following instructions in "Calibration" heading below. Upload new firmware to the razor.
  3. Follow step 4.3 in ROS razor_imu_9d0f wiki page (linked from step 1 in Attempt 1) to setup your razor config yaml file. Input calibration values into my_razor.yaml. (note: not sure which set of values takes precedence, so change both)
  4. Run launch file razor-pub.launch.

Calibration

The ROS wiki razor_imu_9dof page (link) has a section on sensor calibration, underneath the "Sensor Calibration" heading. We calibrated the accelerometer and gyroscope using the methods set out on this page. The calibration values are as listed below:

accel min/max gyro
x -270/254 -19.5
y -267/257 22.12
z -254/267 7.04