Skip to content

Commit

Permalink
Arduino 1.x and Processing 2.x compatibility update
Browse files Browse the repository at this point in the history
v1.4.2 header and readme updates
  • Loading branch information
ptrbrtz committed Oct 19, 2013
1 parent dce826e commit 96f5212
Show file tree
Hide file tree
Showing 19 changed files with 60 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
* for Sparkfun "9DOF Razor IMU" and "9DOF Sensor Stick"
*
* Released under GNU GPL (General Public License) v3.0
* Copyright (C) 2013 Peter Bartz
* Copyright (C) 2013 Peter Bartz [http://ptrbrtz.net]
* Copyright (C) 2011-2012 Quality & Usability Lab, Deutsche Telekom Laboratories, TU Berlin
* Written by Peter Bartz ([email protected])
*
* Infos, updates, bug reports and feedback:
* Infos, updates, bug reports, contributions and feedback:
* https://github.com/ptrbrtz/razor-9dof-ahrs
******************************************************************************************/

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/******************************************************************************************
* Android Java Interface for Razor AHRS v1.4.1
* Android Java Interface for Razor AHRS v1.4.2
* 9 Degree of Measurement Attitude and Heading Reference System
* for Sparkfun "9DOF Razor IMU" and "9DOF Sensor Stick"
*
* Released under GNU GPL (General Public License) v3.0
* Copyright (C) 2013 Peter Bartz
* Copyright (C) 2013 Peter Bartz [http://ptrbrtz.net]
* Copyright (C) 2011-2012 Quality & Usability Lab, Deutsche Telekom Laboratories, TU Berlin
* Written by Peter Bartz ([email protected])
*
* Infos, updates, bug reports and feedback:
* Infos, updates, bug reports, contributions and feedback:
* https://github.com/ptrbrtz/razor-9dof-ahrs
******************************************************************************************/

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/******************************************************************************************
* Android Java Interface for Razor AHRS v1.4.1
* Android Java Interface for Razor AHRS v1.4.2
* 9 Degree of Measurement Attitude and Heading Reference System
* for Sparkfun "9DOF Razor IMU" and "9DOF Sensor Stick"
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/******************************************************************************************
* Android Java Interface for Razor AHRS v1.4.1
* Android Java Interface for Razor AHRS v1.4.2
* 9 Degree of Measurement Attitude and Heading Reference System
* for Sparkfun "9DOF Razor IMU" and "9DOF Sensor Stick"
*
Expand Down
6 changes: 3 additions & 3 deletions Android/RazorExampleApp/src/de/tuberlin/qu/RazorExample.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/******************************************************************************************
* Android Java Interface for Razor AHRS v1.4.1
* Android Java Interface for Razor AHRS v1.4.2
* 9 Degree of Measurement Attitude and Heading Reference System
* for Sparkfun "9DOF Razor IMU" and "9DOF Sensor Stick"
*
* Released under GNU GPL (General Public License) v3.0
* Copyright (C) 2013 Peter Bartz
* Copyright (C) 2013 Peter Bartz [http://ptrbrtz.net]
* Copyright (C) 2011-2012 Quality & Usability Lab, Deutsche Telekom Laboratories, TU Berlin
* Written by Peter Bartz ([email protected])
*
* Infos, updates, bug reports and feedback:
* Infos, updates, bug reports, contributions and feedback:
* https://github.com/ptrbrtz/razor-9dof-ahrs
******************************************************************************************/

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/***************************************************************************************************************
* Razor AHRS Firmware v1.4.1
* Razor AHRS Firmware v1.4.2
* 9 Degree of Measurement Attitude and Heading Reference System
* for Sparkfun "9DOF Razor IMU" (SEN-10125 and SEN-10736)
* and "9DOF Sensor Stick" (SEN-10183, 10321 and SEN-10724)
*
* Released under GNU GPL (General Public License) v3.0
* Copyright (C) 2013 Peter Bartz
* Copyright (C) 2013 Peter Bartz [http://ptrbrtz.net]
* Copyright (C) 2011-2012 Quality & Usability Lab, Deutsche Telekom Laboratories, TU Berlin
*
* Infos, updates, bug reports and feedback:
* Infos, updates, bug reports, contributions and feedback:
* https://github.com/ptrbrtz/razor-9dof-ahrs
*
*
Expand Down Expand Up @@ -42,6 +42,8 @@
* * v1.4.1
* * Added output modes to read raw and/or calibrated sensor data in text or binary format.
* * Added static magnetometer soft iron distortion compensation
* * v1.4.2
* * (No core firmware changes)
*
* TODOs:
* * Allow optional use of EEPROM for storing and reading calibration values.
Expand Down Expand Up @@ -218,7 +220,7 @@ boolean output_errors = false; // true or false
#define ACCEL_Z_MIN ((float) -250)
#define ACCEL_Z_MAX ((float) 250)

// Magnetometer (standard calibration)
// Magnetometer (standard calibration mode)
// "magn x,y,z (min/max) = X_MIN/X_MAX Y_MIN/Y_MAX Z_MIN/Z_MAX"
#define MAGN_X_MIN ((float) -600)
#define MAGN_X_MAX ((float) 600)
Expand All @@ -227,7 +229,7 @@ boolean output_errors = false; // true or false
#define MAGN_Z_MIN ((float) -600)
#define MAGN_Z_MAX ((float) 600)

// Magnetometer (extended calibration)
// Magnetometer (extended calibration mode)
// Uncommend to use extended magnetometer calibration (compensates hard & soft iron errors)
//#define CALIBRATION__MAGN_USE_EXTENDED true
//const float magn_ellipsoid_center[3] = {0, 0, 0};
Expand All @@ -242,12 +244,12 @@ boolean output_errors = false; // true or false
/*
// Calibration example:
// "accel x,y,z (min/max) = -278.00/270.00 -254.00/284.00 -294.00/235.00"
#define ACCEL_X_MIN ((float) -278)
#define ACCEL_X_MAX ((float) 270)
#define ACCEL_Y_MIN ((float) -254)
#define ACCEL_Y_MAX ((float) 284)
#define ACCEL_Z_MIN ((float) -294)
// "accel x,y,z (min/max) = -277.00/264.00 -256.00/278.00 -299.00/235.00"
#define ACCEL_X_MIN ((float) -277)
#define ACCEL_X_MAX ((float) 264)
#define ACCEL_Y_MIN ((float) -256)
#define ACCEL_Y_MAX ((float) 278)
#define ACCEL_Z_MIN ((float) -299)
#define ACCEL_Z_MAX ((float) 235)
// "magn x,y,z (min/max) = -511.00/581.00 -516.00/568.00 -489.00/486.00"
Expand All @@ -268,10 +270,10 @@ const float magn_ellipsoid_transform[3][3] = {{0.902, -0.00354, 0.000636}, {-0.0
//const float magn_ellipsoid_center[3] = {72.3360, 23.0954, 53.6261};
//const float magn_ellipsoid_transform[3][3] = {{0.879685, 0.000540833, -0.0106054}, {0.000540833, 0.891086, -0.0130338}, {-0.0106054, -0.0130338, 0.997494}};
//"gyro x,y,z (current/average) = -32.00/-34.82 102.00/100.41 -16.00/-16.38"
#define GYRO_AVERAGE_OFFSET_X ((float) -34.82)
#define GYRO_AVERAGE_OFFSET_Y ((float) 100.41)
#define GYRO_AVERAGE_OFFSET_Z ((float) -16.38)
//"gyro x,y,z (current/average) = -40.00/-42.05 98.00/96.20 -18.00/-18.36"
#define GYRO_AVERAGE_OFFSET_X ((float) -42.05)
#define GYRO_AVERAGE_OFFSET_Y ((float) 96.20)
#define GYRO_AVERAGE_OFFSET_Z ((float) -18.36)
*/


Expand Down Expand Up @@ -299,7 +301,7 @@ const float magn_ellipsoid_transform[3][3] = {{0.902, -0.00354, 0.000636}, {-0.0
// Check if hardware version code is defined
#ifndef HW__VERSION_CODE
// Generate compile error
#error YOU HAVE TO SELECT THE HARDWARE YOU ARE USING! See "HARDWARE OPTIONS" in "USER SETUP AREA" at top of Razor_AHRS.pde (or .ino)!
#error YOU HAVE TO SELECT THE HARDWARE YOU ARE USING! See "HARDWARE OPTIONS" in "USER SETUP AREA" at top of Razor_AHRS.ino!
#endif

#include <Wire.h>
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions C++/Example.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/******************************************************************************************
* Test Program: Mac OSX / Unix / Linux C++ Interface for Razor AHRS v1.4.1
* Test Program: Mac OSX / Unix / Linux C++ Interface for Razor AHRS v1.4.2
* 9 Degree of Measurement Attitude and Heading Reference System
* for Sparkfun "9DOF Razor IMU" and "9DOF Sensor Stick"
*
* Released under GNU GPL (General Public License) v3.0
* Copyright (C) 2013 Peter Bartz
* Copyright (C) 2013 Peter Bartz [http://ptrbrtz.net]
* Copyright (C) 2011-2012 Quality & Usability Lab, Deutsche Telekom Laboratories, TU Berlin
* Written by Peter Bartz ([email protected])
*
* Infos, updates, bug reports and feedback:
* Infos, updates, bug reports, contributions and feedback:
* https://github.com/ptrbrtz/razor-9dof-ahrs
******************************************************************************************/

Expand Down
6 changes: 3 additions & 3 deletions C++/RazorAHRS.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/******************************************************************************************
* Mac OSX / Unix / Linux C++ Interface for Razor AHRS v1.4.1
* Mac OSX / Unix / Linux C++ Interface for Razor AHRS v1.4.2
* 9 Degree of Measurement Attitude and Heading Reference System
* for Sparkfun "9DOF Razor IMU" and "9DOF Sensor Stick"
*
* Released under GNU GPL (General Public License) v3.0
* Copyright (C) 2013 Peter Bartz
* Copyright (C) 2013 Peter Bartz [http://ptrbrtz.net]
* Copyright (C) 2011-2012 Quality & Usability Lab, Deutsche Telekom Laboratories, TU Berlin
* Written by Peter Bartz ([email protected])
*
* Infos, updates, bug reports and feedback:
* Infos, updates, bug reports,contributions and feedback:
* https://github.com/ptrbrtz/razor-9dof-ahrs
******************************************************************************************/

Expand Down
6 changes: 3 additions & 3 deletions C++/RazorAHRS.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/******************************************************************************************
* Mac OSX / Unix / Linux C++ Interface for Razor AHRS v1.4.1
* Mac OSX / Unix / Linux C++ Interface for Razor AHRS v1.4.2
* 9 Degree of Measurement Attitude and Heading Reference System
* for Sparkfun "9DOF Razor IMU" and "9DOF Sensor Stick"
*
* Released under GNU GPL (General Public License) v3.0
* Copyright (C) 2013 Peter Bartz
* Copyright (C) 2013 Peter Bartz Bartz [http://ptrbrtz.net]
* Copyright (C) 2011-2012 Quality & Usability Lab, Deutsche Telekom Laboratories, TU Berlin
* Written by Peter Bartz ([email protected])
*
* Infos, updates, bug reports and feedback:
* Infos, updates, bug reports, contributions and feedback:
* https://github.com/ptrbrtz/razor-9dof-ahrs
******************************************************************************************/

Expand Down
8 changes: 4 additions & 4 deletions Matlab/magnetometer_calibration/magnetometer_calibration.m
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
%******************************************************************************************
% Magnetometer Calibration Skript for Razor AHRS v1.4.1
% Magnetometer Calibration Skript for Razor AHRS v1.4.2
% 9 Degree of Measurement Attitude and Heading Reference System
% for Sparkfun "9DOF Razor IMU" and "9DOF Sensor Stick"
%
% Released under GNU GPL (General Public License) v3.0
% Copyright (C) 2013 Peter Bartz
% Copyright (C) 2013 Peter Bartz [http://ptrbrtz.net]
% Copyright (C) 2012 Quality & Usability Lab, Deutsche Telekom Laboratories, TU Berlin
% Written by Peter Bartz ([email protected])
%
% Infos, updates, bug reports and feedback:
% Infos, updates, bug reports, contributions and feedback:
% https://github.com/ptrbrtz/razor-9dof-ahrs
%******************************************************************************************

Expand All @@ -33,7 +33,7 @@
S = comp * S; % do compensation

% output info
fprintf('In the Razor_AHRS.pde (or .ino), under "SENSOR CALIBRATION" find the section that reads "Magnetometer (extended calibration)"\n');
fprintf('In the Razor_AHRS.ino, under "SENSOR CALIBRATION" find the section that reads "Magnetometer (extended calibration)"\n');
fprintf('Replace the existing 3 lines with these:\n\n');
fprintf('#define CALIBRATION__MAGN_USE_EXTENDED true\n');
fprintf('const float magn_ellipsoid_center[3] = {%.6g, %.6g, %.6g};\n', e_center);
Expand Down
19 changes: 11 additions & 8 deletions Processing/Magnetometer_calibration/Magnetometer_calibration.pde
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
/******************************************************************************************
* Magnetometer Sampling Sketch for Razor AHRS v1.4.1
* Magnetometer Sampling Sketch for Razor AHRS v1.4.2
* 9 Degree of Measurement Attitude and Heading Reference System
* for Sparkfun "9DOF Razor IMU" and "9DOF Sensor Stick"
*
* Released under GNU GPL (General Public License) v3.0
* Copyright (C) 2013 Peter Bartz
* Copyright (C) 2013 Peter Bartz [http://ptrbrtz.net]
* Copyright (C) 2011-2012 Quality & Usability Lab, Deutsche Telekom Laboratories, TU Berlin
* Written by Peter Bartz (peter-bartz@gmx.de)
*
* Infos, updates, bug reports and feedback:
* Infos, updates, bug reports, contributions and feedback:
* https://github.com/ptrbrtz/razor-9dof-ahrs
******************************************************************************************/

/*
NOTE: There seems to be a bug with the serial library in the latest Processing
versions 1.5 and 1.5.1: "WARNING: RXTX Version mismatch ...". The previous version
1.2.1 works fine and is still available on the web.
NOTE: There seems to be a bug with the serial library in Processing versions 1.5
and 1.5.1: "WARNING: RXTX Version mismatch ...".
Processing 2.0.x seems to work just fine. Later versions may too.
Alternatively, the older version 1.2.1 also works and is still available on the web.
*/

/*
NOTE: You have to install a library, before this sketch can be run!
IMPORTANT: You have to install a library, before this sketch can be run!
We're using EJML for matrix math, because it's really fast:
http://code.google.com/p/java-matrix-benchmark/
Also, it's released under LGPL, which fits well with our GPL.
Expand All @@ -29,6 +30,7 @@
create a folder "library" inside "EJML" and put the .jar inside. Rename to EJML.jar. So you
should have "libraries/EJML/library/EJML.jar". Restart Processing and you're good.
More info on installing libraries in Processing: http://wiki.processing.org/w/How_to_Install_a_Contributed_Library
Tested to be working with EJML 0.17 and 0.23.
*/
import org.ejml.data.*;
import org.ejml.simple.*;
Expand All @@ -45,6 +47,7 @@ final static int SERIAL_PORT_NUM = 0;

import processing.opengl.*;
import processing.serial.*;
import java.io.*;

final static int SERIAL_PORT_BAUD_RATE = 57600;

Expand Down Expand Up @@ -361,7 +364,7 @@ void outputCalibration() {
println("\n");

// Output calibration
System.out.printf("In the Razor_AHRS.pde (or .ino), under 'SENSOR CALIBRATION' find the section that reads 'Magnetometer (extended calibration)'\n");
System.out.printf("In the Razor_AHRS.ino, under 'SENSOR CALIBRATION' find the section that reads 'Magnetometer (extended calibration)'\n");
System.out.printf("Replace the existing 3 lines with these:\n\n");
System.out.printf("#define CALIBRATION__MAGN_USE_EXTENDED true\n");
System.out.printf("const float magn_ellipsoid_center[3] = {%.6g, %.6g, %.6g};\n", center.get(0), center.get(1), center.get(2));
Expand Down
13 changes: 7 additions & 6 deletions Processing/Razor_AHRS_test/Razor_AHRS_test.pde
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
/******************************************************************************************
* Test Sketch for Razor AHRS v1.4.1
* Test Sketch for Razor AHRS v1.4.2
* 9 Degree of Measurement Attitude and Heading Reference System
* for Sparkfun "9DOF Razor IMU" and "9DOF Sensor Stick"
*
* Released under GNU GPL (General Public License) v3.0
* Copyright (C) 2013 Peter Bartz
* Copyright (C) 2013 Peter Bartz [http://ptrbrtz.net]
* Copyright (C) 2011-2012 Quality & Usability Lab, Deutsche Telekom Laboratories, TU Berlin
* Written by Peter Bartz (peter-bartz@gmx.de)
*
* Infos, updates, bug reports and feedback:
* Infos, updates, bug reports, contributions and feedback:
* https://github.com/ptrbrtz/razor-9dof-ahrs
******************************************************************************************/

/*
NOTE: There seems to be a bug with the serial library in the latest Processing
versions 1.5 and 1.5.1: "WARNING: RXTX Version mismatch ...". The previous version
1.2.1 works fine and is still available on the web.
NOTE: There seems to be a bug with the serial library in Processing versions 1.5
and 1.5.1: "WARNING: RXTX Version mismatch ...".
Processing 2.0.x seems to work just fine. Later versions may too.
Alternatively, the older version 1.2.1 also works and is still available on the web.
*/

import processing.opengl.*;
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Quick setup

### Razor AHRS Firmware and *Processing* Test Sketch

Select your hardware in `Arduino/Razor_AHRS/Razor_AHRS.pde` under `"USER SETUP AREA"` / `"HARDWARE OPTIONS"`.
Select your hardware in `Arduino/Razor_AHRS/Razor_AHRS.ino` under `"USER SETUP AREA"` / `"HARDWARE OPTIONS"`.
Upload the firmware using *Arduino*.
Run `Processing/Razor_AHRS_test/Razor_AHRS_test.pde` using *Processing*.

Expand Down

0 comments on commit 96f5212

Please sign in to comment.