xsens_imu
Public Member Functions | Static Public Attributes | List of all members
xsens_imu::XsensDriver Class Reference

#include <XsensDriver.hpp>

Public Member Functions

 XsensDriver ()
 
 ~XsensDriver ()
 
bool open (std::string const &dev)
 
bool close ()
 
bool setReadingMode (enum xsens_imu::imuMode=ONLY_ORI_DATA)
 
bool setCalibrationMode ()
 
int getFileHandle ()
 
enum xsens_imu::errorCodes getReading ()
 
enum xsens_imu::errorCodes getReadingNonBlocking ()
 
bool setTimeout (const uint32_t timeout)
 
void setFrequency (const uint16_t new_sample_frequency)
 
uint16_t getFrequency (void)
 
int getPacketCounter ()
 
Eigen::Quaternion< double > getOrientation () const
 
Eigen::Vector3d getEulerAngles () const
 
Eigen::Vector3d getCalibratedAccData () const
 
Eigen::Vector3d getCalibratedGyroData () const
 
Eigen::Vector3d getCalibratedMagData () const
 
Eigen::Vector3d getRawAccData () const
 
Eigen::Vector3d getRawGyroData () const
 
Eigen::Vector3d getRawMagData () const
 
std::list< std::string > getScenarios () const
 
std::list< std::string > getAvailableScenarios ()
 
bool setScenario (std::string const &name)
 
bool setSyncOut (bool enable, bool pulse, bool positive)
 

Static Public Attributes

static const int DEFAULT_SAMPLE_FREQUENCY = 100
 

Constructor & Destructor Documentation

XsensDriver::XsensDriver ( )
XsensDriver::~XsensDriver ( )

Member Function Documentation

bool XsensDriver::close ( void  )
std::list< std::string > XsensDriver::getAvailableScenarios ( )
Eigen::Vector3d XsensDriver::getCalibratedAccData ( ) const

Returns the calibrated accelerometer data Note getReading() should be called before calling this function

Eigen::Vector3d XsensDriver::getCalibratedGyroData ( ) const

Returns the calibrated gyroscope data Note getReading() should be called before calling this function

Eigen::Vector3d XsensDriver::getCalibratedMagData ( ) const

Returns the calibrated magnetometer data Note getReading() should be called before calling this function

Eigen::Vector3d XsensDriver::getEulerAngles ( ) const

Returns the current orientation as Euler Angels (aerospace convention: Roll, Pitch, Yaw). Returned angles given as Tait–Bryan convention with x-Axis as heading direction: Rotation around x-Axis in YZ-Plane: Roll (Angle Phi) Rotation around y-Axis in XZ-Plane: Pitch (Angle Theta) Rotation around z-Axis in XY Plane: Yaw (Angle Psi)

Note getReading() should be called before calling this function

int XsensDriver::getFileHandle ( )
uint16_t XsensDriver::getFrequency ( void  )

Gets the sampling frequency of IMU. Returns frequency in Hz. Note: Method has to be called BEFORE setReadingMode() to apply new frequency value.

Eigen::Quaternion< double > XsensDriver::getOrientation ( ) const

Returns the current orientation as quaternion. Note getReading() should be called before calling this function

int XsensDriver::getPacketCounter ( )

Returns the packt count of the last received packet from the IMU

Eigen::Vector3d XsensDriver::getRawAccData ( ) const

Returns the raw accelerometer data Note getReading() should be called before calling this function

Eigen::Vector3d XsensDriver::getRawGyroData ( ) const

Returns the raw gyroscope data Note getReading() should be called before calling this function

Eigen::Vector3d XsensDriver::getRawMagData ( ) const

Returns the raw magnetometer data Note getReading() should be called before calling this function

enum xsens_imu::errorCodes XsensDriver::getReading ( )

This function acquires a new sensor reading from the Xsens IMU.

Return Values 0 Data Aquired -1 Timeout -2 Error fetching data from IMU

enum xsens_imu::errorCodes XsensDriver::getReadingNonBlocking ( )

This function acquires a new sensor reading from the Xsens IMU.

Return Values 0 Data Aquired -1 Error_Again e.g. no reading there yet -2 Error fetching data from IMU

std::list<std::string> xsens_imu::XsensDriver::getScenarios ( ) const

Returns the list of scenario names that are available on this device

bool XsensDriver::open ( std::string const &  dev)
bool XsensDriver::setCalibrationMode ( )
void XsensDriver::setFrequency ( const uint16_t  new_sample_frequency)

Sets the sampling frequency for reading measurements from the IMU. Parameter is in Hz Note: Method has to be called BEFORE setReadingMode() to apply new frequency value.

bool XsensDriver::setReadingMode ( enum xsens_imu::imuMode  output_mode = ONLY_ORI_DATA)
bool XsensDriver::setScenario ( std::string const &  name)
bool XsensDriver::setSyncOut ( bool  enable,
bool  pulse,
bool  positive 
)

Configures the SyncOut pin. Must be done before setReadingMode(). enable: selects enabled or disabled pulse: when true, a pulse is emitted on sensor acquisition, otherwise the level of the line is toggled. positive: direction of the pulse

bool XsensDriver::setTimeout ( const uint32_t  timeout)

Sets the timout for reading measurements from the IMU. Parameter is in ms returns true on success

Member Data Documentation

const int xsens_imu::XsensDriver::DEFAULT_SAMPLE_FREQUENCY = 100
static

The documentation for this class was generated from the following files: