Inertial measurement unit orientation filter. Ported from Sebastian Madgwick's paper, "An efficient orientation filter for inertial and inertial/magnetic sensor arrays".

Dependents:   IMURover IMUfilter_HelloWorld IMUfilter_RPYExample 12_TCPIP ... more

Embed: (wiki syntax)

« Back to documentation index

IMUfilter Class Reference

IMUfilter Class Reference

IMU orientation filter. More...

#include <IMUfilter.h>

Public Member Functions

 IMUfilter (double rate, double gyroscopeMeasurementError)
 Constructor.
void updateFilter (double w_x, double w_y, double w_z, double a_x, double a_y, double a_z)
 Update the filter variables.
void computeEuler (void)
 Compute the Euler angles based on the current filter data.
double getRoll (void)
 Get the current roll.
double getPitch (void)
 Get the current pitch.
double getYaw (void)
 Get the current yaw.
void reset (void)
 Reset the filter.

Detailed Description

IMU orientation filter.

Definition at line 51 of file IMUfilter.h.


Constructor & Destructor Documentation

IMUfilter ( double  rate,
double  gyroscopeMeasurementError 
)

Constructor.

Includes.

Initializes filter variables.

Parameters:
rateThe rate at which the filter should be updated.
gyroscopeMeasurementErrorThe error of the gyroscope in degrees per second. This used to calculate a tuning constant for the filter. Try changing this value if there are jittery readings, or they change too much or too fast when rotating the IMU.
Author:
Aaron Berk

LICENSE

Copyright (c) 2010 ARM Limited

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

DESCRIPTION

IMU orientation filter developed by Sebastian Madgwick.

Find more details about his paper here:

http://code.google.com/p/imumargalgorithm30042010sohm/

Definition at line 40 of file IMUfilter.cpp.


Member Function Documentation

void computeEuler ( void   )

Compute the Euler angles based on the current filter data.

Definition at line 168 of file IMUfilter.cpp.

double getPitch ( void   )

Get the current pitch.

Returns:
The current pitch angle in radians.

Definition at line 200 of file IMUfilter.cpp.

double getRoll ( void   )

Get the current roll.

Returns:
The current roll angle in radians.

Definition at line 194 of file IMUfilter.cpp.

double getYaw ( void   )

Get the current yaw.

Returns:
The current yaw angle in radians.

Definition at line 206 of file IMUfilter.cpp.

void reset ( void   )

Reset the filter.

Definition at line 212 of file IMUfilter.cpp.

void updateFilter ( double  w_x,
double  w_y,
double  w_z,
double  a_x,
double  a_y,
double  a_z 
)

Update the filter variables.

Parameters:
w_xX-axis gyroscope reading in rad/s.
w_yY-axis gyroscope reading in rad/s.
w_zZ-axis gyroscope reading in rad/s.
a_xX-axis accelerometer reading in m/s/s.
a_yY-axis accelerometer reading in m/s/s.
a_zZ-axis accelerometer reading in m/s/s.

Definition at line 67 of file IMUfilter.cpp.