Skip to content

AHRS Firmware for the SparkFun 9DOF Razor IMU and SparkFun 9DOF Sensor Stick

License

Notifications You must be signed in to change notification settings

lebarsfa/razor-9dof-ahrs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Razor AHRS

9 Degree of Measurement Attitude and Heading Reference System for Sparkfun OpenLog Artemis (SPX-15846 and DEV-16832), 9DoF Razor IMU M0 (SEN-14001), 9DOF Razor IMU (SEN-10125 and SEN-10736) and 9DOF Sensor Stick (SEN-10183, SEN-10321 and SEN-10724)

Original repository : https://github.com/ptrbrtz/razor-9dof-ahrs

Download

Clone the repository on GitHub or download a specific release.

Tutorial

You find a detailed tutorial in the original Wiki.

Note: For SPX-15846 and DEV-16832 (OpenLog Artemis), you will need to follow the same instructions as for the OLA_IMU_Basics.ino sample from https://github.com/sparkfun/OpenLog_Artemis (i.e. get the drivers from https://learn.sparkfun.com/tutorials/how-to-install-ch340-drivers, install SparkFun Apollo3 boards in Arduino IDE as in https://learn.sparkfun.com/tutorials/installing-board-definitions-in-the-arduino-ide (add https://raw.githubusercontent.com/sparkfun/Arduino_Boards/master/IDE_Board_Manager/package_sparkfun_index.json to FilePreferencesAdditional Board Manager URLs) and ensure you select SparkFun Apollo3SparkFun RedBoard Artemis ATP as the board and install SparkFun ICM 20948 IMU Arduino library as in https://learn.sparkfun.com/tutorials/installing-an-arduino-library). For SEN-14001 (9DoF Razor IMU M0), you will need to follow the same instructions as for the default firmware on https://learn.sparkfun.com/tutorials/9dof-razor-imu-m0-hookup-guide and use an updated version of SparkFun_MPU-9250-DMP_Arduino_Library from https://github.com/lebarsfa/SparkFun_MPU-9250-DMP_Arduino_Library (an updated version of the default firmware is also available on https://github.com/lebarsfa/9DOF_Razor_IMU).

Quick setup

Razor AHRS Firmware and Processing Test Sketch

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.

Optional: Mac OS X / Unix / Linux / Windows C++ Interface

Use the provided Qt Creator project (check ProjectsRun SettingsRun in terminal to force your application to run inside a separate terminal) or compile test program from the command line (add -Iunix_adapt -DDISABLE_TIMEZONE_STRUCT_REDEFINITION -DENABLE_O_NDELAY_WORKAROUND for MinGW/MSYS):

g++ Example.cpp RazorAHRS.cpp -Wall -D_REENTRANT -lpthread -o example

Run it:

./example

Note: To use the provided Visual Studio 2017 project, you will need to install Pthreads-win32 from http://www.ensta-bretagne.fr/lebars/Share/pthreads-win32-msvc.zip.

Optional: Android Interface

About Razor AHRS and Android Bluetooth: Bluetooth seems to be even more picky on Android than it is anyway. Be sure to have a look at the section about Android Bluetooth in the tutorial.

Compiling and running the test app: Open up your Android-ready Eclipse and import both projects using FileImport...GeneralExisting Projects into Workspace with the root folder being Android/. Then build and run the test app from Eclipse.

Building your own app:

  • Your app needs to target Android 2.0 (API Level 5) or later. The RazorAHRS Library Project has to be present in your Workspace. Add the library to your app under Project PropertiesAndroidLibrary.

  • In case you want yaw/heading to reference "true north" and not just magnetic north, you can use the included DeclinationHelper class to find out about declination at your current position.

  • You have to specify these uses-permissions in the AndroidManifest.xml:
    android.permission.BLUETOOTH and android.permission.BLUETOOTH_ADMIN

  • If you want to use the DeclinationHelper class you also need:
    android.permission.ACCESS_FINE_LOCATION and android.permission.ACCESS_COARSE_LOCATION

Optional: ROS Interface

See http://wiki.ros.org/razor_imu_9dof.

About

AHRS Firmware for the SparkFun 9DOF Razor IMU and SparkFun 9DOF Sensor Stick

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 47.4%
  • Java 19.3%
  • C 18.8%
  • Processing 10.0%
  • MATLAB 3.9%
  • QMake 0.6%