BTK
0.3dev.0
Open-source library to visualize/process biomechanical data
|
Container of analog channels representing an inertial measurement unit (IMU). More...
#include <btkIMU.h>
Public Types | |
typedef Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > | CalMatrix |
typedef btkSharedPtr< const IMU > | ConstPointer |
typedef btkNullPtr< IMU > | NullPointer |
typedef btkSharedPtr< IMU > | Pointer |
typedef Eigen::Matrix< double, 3, 3 > | Rotation |
Public Types inherited from btk::DataObjectLabeled | |
typedef btkSharedPtr< const DataObjectLabeled > | ConstPointer |
typedef btkSharedPtr < DataObjectLabeled > | Pointer |
Public Types inherited from btk::DataObject | |
typedef btkSharedPtr< const DataObject > | ConstPointer |
typedef btkNullPtr< DataObject > | NullPointer |
typedef btkSharedPtr< DataObject > | Pointer |
Public Types inherited from btk::Object | |
typedef btkSharedPtr< const Object > | ConstPointer |
typedef btkSharedPtr< Object > | Pointer |
Static Public Member Functions | |
static NullPointer | Null () |
Static Public Member Functions inherited from btk::DataObject | |
static NullPointer | Null () |
Protected Member Functions | |
IMU (const std::string &label, const std::string &desc, bool init) | |
IMU (const IMU &toCopy) | |
Protected Member Functions inherited from btk::DataObjectLabeled | |
DataObjectLabeled (const std::string &label="", const std::string &description="") | |
DataObjectLabeled (const DataObjectLabeled &toCopy) | |
Protected Member Functions inherited from btk::DataObject | |
DataObject () | |
DataObject (const DataObject &toCopy) | |
virtual | ~DataObject () |
Protected Member Functions inherited from btk::Object | |
Object () | |
Object (const Object &toCopy) | |
virtual | ~Object () |
Protected Attributes | |
int | m_Type |
Protected Attributes inherited from btk::DataObjectLabeled | |
std::string | m_Description |
std::string | m_Label |
Protected Attributes inherited from btk::Object | |
unsigned long int | m_Timestamp |
Container of analog channels representing an inertial measurement unit (IMU).
This class proposes to store any number of analog channels but the 6 first channels could be used for 3 accelerometers and 3 gyroscopes as some convenient methods are proposed in this way (see SetChannels(), GetAccelerometerX(), GetAccelerometerY(), GetAccelerometerZ(), GetGyroscopeX(), GetGyroscopeY(), GetGyroscopeZ()).
The storage of the channel is done using an ID and not an array index. You can then use the same ID for some kind of sensor even if other are missing (i.e. IMU with accelerometers disabled or configured with 1 acc, and 2 gyros., etc.).
Note: This class is still experimental and could be modified in the next release.
Type which represents a possible calibration matrix used with the IMU to aligne sensors axes together (gyrosocope axes and accelerometer axes).
Smart pointer associated with a const IMU object.
Smart pointer associated with a IMU object.
Type definition for Eigen 3x3 rotation matrix (of double).
|
inlinevirtual |
Empty destructor.
|
protected |
Constructor
|
protected |
Constructor of copy
|
inline |
Deep copy of the current object.
|
inline |
Convenient method to return the analog channel with the ID 0 (which should correspond to an accelerometer measuring data on the X axis of the IMU).
|
inline |
Convenient method to return the analog channel with the ID 1 (which should correspond to an accelerometer measuring data on the Y axis of the IMU).
|
inline |
Convenient method to return the analog channel with the ID 2 (which should correspond to an accelerometer measuring data on the Z axis of the IMU).
|
inline |
Returns calibration marix.
|
inline |
Returns the calibration matrix.
Analog::Pointer btk::IMU::GetChannel | ( | int | id | ) |
Returns the analog channel with the given ID. If there is no analog channel with the given ID, then an exception is thrown.
Analog::ConstPointer btk::IMU::GetChannel | ( | int | id | ) | const |
Returns the analog channel with the given ID. If there is no analog channel with the given ID, then an exception is thrown.
Analog::Pointer btk::IMU::GetChannel | ( | const std::string & | label | ) |
Returns the analog channel with the given label. If there is no analog channel with the given label, then an exception is thrown.
Analog::ConstPointer btk::IMU::GetChannel | ( | const std::string & | label | ) | const |
Returns the analog channel with the given label. If there is no analog channel with the given label, then an exception is thrown.
|
inline |
Returns the number of channels used by the IMU.
AnalogCollection::Pointer btk::IMU::GetChannels | ( | ) |
Returns the analog channels of the IMU in a collection. The analog channels are pushed in the collection by using their ID.
|
inline |
Returns the number of frames set in this IMU.
|
inline |
Returns the frequency set to the IMU. (by default it is 0 Hz).
|
inline |
Convenient method to return the analog channel with the ID 3 (which should correspond to a gyroscope measuring data on the X axis of the IMU).
|
inline |
Convenient method to return the analog channel with the ID 4 (which should correspond to a gyroscope measuring data on the Y axis of the IMU).
|
inline |
Convenient method to return the analog channel with the ID 5 (which should correspond to a gyroscope measuring data on the Z axis of the IMU).
|
inline |
Returns the type of the IMU.
|
inlinestatic |
Static function to return a null pointer.
void btk::IMU::Rotate | ( | const Rotation & | R | ) |
Convenient method to rotate the analog channels with the IDs 0-5. This method handles the case where some of these analog channels are missing.
void btk::IMU::SetCalMatrix | ( | const CalMatrix & | cal | ) |
Sets the calibration matrix. Assigning a calibration matrix won't change sensors' values. This is only an informative member to know what is the orientation between the sensors. However the filter btk::IMUsExtractor can adapt sensors' values to have aligned measurements.
void btk::IMU::SetChannel | ( | int | id, |
Analog::Pointer | channel | ||
) |
Sets an analog channel to the given ID. If an analog channel is already set to this ID, then it is replaced.
void btk::IMU::SetChannels | ( | Analog::Pointer | accX, |
Analog::Pointer | accY, | ||
Analog::Pointer | accZ, | ||
Analog::Pointer | gyroX, | ||
Analog::Pointer | gyroY, | ||
Analog::Pointer | gyroZ | ||
) |
Sets the 6 first channels of the IMUs with the analog channels accX, accY, accZ, gyroX, gyroY, gyroZ.
void btk::IMU::SetFrameNumber | ( | int | fn | ) |
Set the number of frames for the IMU and modify also the number of frames for the channels.
void btk::IMU::SetFrequency | ( | double | f | ) |
Sets the acquisition sample rate associated to the IMU.