Ask Your Question

gyro for turtlebot

asked 2012-01-24 19:52:24 -0500

apalomer gravatar image


I'm looking for a gyro for my turtlbot, but the ones that I've found the drivers are horribly expensive (microstan -> £1592+VAT!). Now I am looking for a normal gyro (arround £50-70), but my question is: will I have to build the drivers or the drivers for the gyro that turtlebot uses by default with iCreate (SparkFun ADXRS613S/623 Breakout Board) will more or less work with any gyro??


edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2012-01-25 00:35:01 -0500

updated 2012-01-27 02:23:45 -0500

In short, yes you should be able to get away with replacing your turtlebot's gyro with another similar one without having to "write a driver" per se--since most cheap gyros operate in the same manner: outputting an analog voltage proportional to the angular rate about the axis of the sensor package it should only require minor modification of the turtlebot's existing python module.

A post on how to hook up a rate gyro mimicking the configuration in the turtlebot (its not specific to the ADXRS613 it refers to) can be found here. This can be useful if you don't actually have a turtlebot, but rather just a create with a laptop (no turtlebot power/gyro board).

Unfortunately the main distributor for the ADXRS613 breakout was Sparkfun and they've discontinued that breakout due to the chip being end-of-lifed by the manufacturer. You may be able to find some resellers that still have stock, but I haven't had much success.

UPDATE: There seem to be a few left here, however these will probably dry up soon.

UPDATE 2: It should be noted that ClearPath, one of the distributors of the Turtlebot has apparently switched to the ADXRS652 chip. Since they have in-house fab capability, its unlikely they'll produce a breakout for this chip--you'd have to make your own or wait for someone like Sparkfun to make one.

The MLX90609 breakout might make a suitable replacement (from Sparkfun or Active Robots). Again, if you're just operating with a iRobot Create then you can hook up the analog out of the gyro to the same DB-25 pins described in the first linked post. You may still have to modify in the src folder of the turtlebot_node package a bit. Taking a quick glance at that file shows a slightly different formula for calculating orientation than I'm familiar with, so here's the calculation (in C++) that I use on my cheap gyro (from bilibot repo):

    double dt = current_time - last_time; // last time we read ADC
    double maxValue = 1024; // using Create's 10-bit ADC
    double vRef = 5;  // 5v reference
    double zeroRateV = avg * vRef / maxValue; // I calculate zeroRateV from a circular buffer during startup, avg is the average of these values
    double sensitivity = 0.013;  // mV/deg/sec from datasheet

    rate = (gyro_adc * vRef / maxValue - zeroRateV) / sensitivity;

    orientation += rate * dt;

You'll have to figure out from the datasheet what the sensitivity (mV/deg/sec) value is and substitute it in the equation above. It should be relatively trivial to modify's publish method if need be to match the above calculation.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2012-01-24 19:52:24 -0500

Seen: 2,051 times

Last updated: Jan 27 '12