home  /   who am i  /   my work  /   soap box

robovero sensors


download

The patch, patched firmware, and compiled firmware for the Robovero can be downloaded below. For instructions on building and installing the firmware, visit the robovero website: http://www.robovero.org.

A simple C program can also be downloaded below. This program will connect to the robovero and read from the sensors using POSIX compliant C code. The top of the source file contains compilation and execution instructions.

Description Version Last change Download
Binaries v1.2 March 24, 2012 Tarball / Zip
Source code v1.2 March 24, 2012 Tarball / Zip
Patch v1.2 March 24, 2012 Patch / GitHub
Simple C Example v1.0 December 8, 2012 Source / GitHub

media

Configuring and reading sensors
Configuring and Reading Sensors

manual


1. Overview

The sensors firmware patch allows for easy configuration and reading from the accelerometer, magnometer, and gyroscope on the Robovero. Without this patch, it's not possible to query the state of these sensors at a high frequency. The modification closely follows existing firmware philosophy, and provides six new command line functions which can be invoked. All integer arguments must be specified in hexadecimal format.


2. Commands

2.1. Accelerometer

Configuring the accelerometer can be done with the command below.

configAccel power x_on y_on z_on output_hz scale

The table below contains a description of each argument.

Argument Description
power Enables or disables the sensor. Set to 1 to enable it or 0 to disable it.
x_on Enables or disables the x axis. Set to 1 to enable it or 0 to disable it.
y_on Enables or disables the y axis. Set to 1 to enable it or 0 to disable it.
z_on Enables or disables the z axis. Set to 1 to enable it or 0 to disable it.
output_hz Specify the frequency at which the sensor should update, in Hz. Possible values are: 50, 100, 400, or 1000.
scale Specify the scale, in units g, at which the sensor should operate. Possible values are: 2, 4, or 8.

The current state of the accelerometer can be retrieved with the command below.

readAccel

Upon execution, readAccel will output the current sensor value for each enabled axis in hexadecimal format. The output order will be x y z. If an axis isn't enabled, the output will be skipped. Each value output is followed by a new line character. Additionally, the output values are offset by 32768.

To convert the output value to g, the equation below can be used.

g = ( value - 32768 ) / ( 32768 / scale )

2.2. Magnometer

Configuring the magnometer can be done with the command below.

configMag power bias output_cHz field_range

The table below contains a description of each argument.

Argument Description
power Enables or disables the sensor. Set to 1 to enable it or 0 to disable it.
bias Set the bias configuration. Set to 0 for normal bias, 1 for positive bias, or 2 for negative bias.
output_cHz Specify the frequency at which the sensor should update, in centi-Hz. Possible values are: 75, 150, 300, 750, 1500, 3000, or 7500.
field_range Specify the field range, in units deci-Gauss, at which the sensor should operate. Possible values are: 13, 19, 25, 40, 47, 56, or 81.

The current state of the magnometer can be retrieved with the command below.

readMag

Upon execution, readMag will output the current sensor value for each enabled axis in hexadecimal format. The output order will be x y z. Each value output is followed by a new line character. Additionally, the output values are offset by 4096. A value of 0 corresponds to NaN.

To convert the output value to G, the equation below can be used.

G = ( value - 4096 ) / ( 4096 / ( field_range / 10 ) )

2.3. Gyroscope

Configuring the gyroscope can be done with the command below.

configGyro power x_on y_on z_on output_hz scale

The table below contains a description of each argument.

Argument Description
power Enables or disables the sensor. Set to 1 to enable it or 0 to disable it.
x_on Enables or disables the x axis. Set to 1 to enable it or 0 to disable it.
y_on Enables or disables the y axis. Set to 1 to enable it or 0 to disable it.
z_on Enables or disables the z axis. Set to 1 to enable it or 0 to disable it.
output_hz Specify the frequency at which the sensor should update, in Hz. Possible values are: 100, 200, 400, or 800.
scale Specify the scale, in units dps, at which the sensor should operate. Possible values are: 250, 500, or 2000.

The current state of the gyroscope can be retrieved with the command below.

readGyro

Upon execution, readGyro will output the current sensor value for each enabled axis in hexadecimal format. The output order will be x y z. If an axis isn't enabled, the output will be skipped. Each value output is followed by a new line character. Additionally, the output values are offset by 32768.

To convert the output value to dps, the equation below can be used.

dps = ( value - 32768 ) / ( 32768 / scale )

3. Firmware Usage

Building and flashing the firmware requires the robovero cross-compilation tools. Instructions on setting up an environment, building, and flashing the firmware can be found at the official Robovero website: http://www.robovero.org.


4. Licensing

The Robovero sensors patch is licensed under the simplified BSD license:

Copyright 2012, Andrew Gottemoller
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

Neither the name of Andrew Gottemoller nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.


5. Alternative Licensing

A special license for the Rovoero sensors patch is available if you are unable to meet the conditions of the license described above. For more information, please contact me.