-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented new Findings by BlueAndi
- Loading branch information
Showing
5 changed files
with
163 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
DESCRIPTION | ||
*******************************************************************************/ | ||
/** | ||
* @brief IMU implementation of the simulation | ||
* @brief IMU (Inertial Measurement Unit) implementation of the simulation | ||
* @author Juliane Kerpe <[email protected]> | ||
* | ||
* @addtogroup HALSim | ||
|
@@ -58,7 +58,9 @@ | |
* Types and Classes | ||
*****************************************************************************/ | ||
|
||
/** The IMU adapter. */ | ||
/** The IMU adapter. | ||
* IMU stands for Inertial Measurement Unit. | ||
*/ | ||
class IMU : public IIMU | ||
{ | ||
public: | ||
|
@@ -156,23 +158,29 @@ class IMU : public IIMU | |
} | ||
|
||
/** | ||
* Get last raw Accelerometer values as a IMUData struct containing values in x, y and z. | ||
* Get last raw Accelerometer values as an IMUData struct containing values in x, y and z. | ||
* | ||
* @param[in] accelerationValues Pointer to IMUData struct. | ||
* @param[in] accelerationValues Pointer to IMUData struct where the raw, unitless acceleration values in | ||
* x, y and z direction will be written into. The values can be converted into physical values in mm/s^2 via the | ||
* multiplication with a sensitivity factor in mm/s^2/bit. | ||
*/ | ||
void const getAccelerationValues(IMUData* accelerationValues); | ||
|
||
/** | ||
* Get last raw Gyroscope values as a IMUData struct containing values in x, y and z. | ||
* Get last raw Gyroscope values as an IMUData struct containing values in x, y and z. | ||
* | ||
* @param[in] turnRates Pointer to IMUData struct. | ||
* @param[in] turnRates Pointer to IMUData struct where the raw, unitless turn Rates in x, y and z | ||
* direction will be written into. The values can be converted into physical values in mrad/s via the multiplication | ||
* with a sensitivity factor in mrad/s/bit. | ||
*/ | ||
void const getTurnRates(IMUData* turnRates); | ||
|
||
/** | ||
* Get last raw Magnetometer values as a IMUData struct containing values in x, y and z. | ||
* Get last raw Magnetometer values as an IMUData struct containing values in x, y and z. | ||
* | ||
* @param[in] magnetometerValues Pointer to IMUData struct. | ||
* @param[in] magnetometerValues Pointer to IMUData struct where the raw, unitless magnetometer values in | ||
* x, y and z direction will be written into. The values can be converted into physical values in mgauss via the | ||
* multiplication with a sensitivity factor in mgauss/bit. | ||
*/ | ||
void const getMagnetometerValues(IMUData* magnetometerValues); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
DESCRIPTION | ||
*******************************************************************************/ | ||
/** | ||
* @brief IMU implementation | ||
* @brief IMU (Inertial Measurement Unit) implementation | ||
* @author Juliane Kerpe <[email protected]> | ||
* | ||
* @addtogroup HALSim | ||
|
@@ -53,7 +53,9 @@ | |
* Types and Classes | ||
*****************************************************************************/ | ||
|
||
/** The IMU adapter. */ | ||
/** The IMU adapter. | ||
* IMU stands for Inertial Measurement Unit. | ||
*/ | ||
class IMU : public IIMU | ||
{ | ||
public: | ||
|
@@ -63,6 +65,9 @@ class IMU : public IIMU | |
*/ | ||
IMU() : | ||
IIMU(), | ||
m_accelerometerValues{0, 0, 0}, | ||
m_gyroValues{0, 0, 0}, | ||
m_magnetometerValues{0, 0, 0}, | ||
m_rawAccelerometerOffsetX(0), | ||
m_rawAccelerometerOffsetY(0), | ||
m_rawAccelerometerOffsetZ(0), | ||
|
@@ -133,23 +138,29 @@ class IMU : public IIMU | |
bool magnetometerDataReady(); | ||
|
||
/** | ||
* Get last raw Accelerometer values as a IMUData struct containing values in x, y and z. | ||
* Get last raw Accelerometer values as an IMUData struct containing values in x, y and z. | ||
* | ||
* @param[in] accelerationValues Pointer to IMUData struct. | ||
* @param[in] accelerationValues Pointer to IMUData struct where the raw, unitless acceleration values in | ||
* x, y and z direction will be written into. The values can be converted into physical values in mm/s^2 via the | ||
* multiplication with a sensitivity factor in mm/s^2/bit. | ||
*/ | ||
const void getAccelerationValues(IMUData* accelerationValues); | ||
|
||
/** | ||
* Get last raw Gyroscope values as a IMUData struct containing values in x, y and z. | ||
* Get last raw Gyroscope values as an IMUData struct containing values in x, y and z. | ||
* | ||
* @param[in] turnRates Pointer to IMUData struct. | ||
* @param[in] turnRates Pointer to IMUData struct where the raw, unitless turn Rates in x, y and z | ||
* direction will be written into. The values can be converted into physical values in mrad/s via the multiplication | ||
* with a sensitivity factor in mrad/s/bit. | ||
*/ | ||
const void getTurnRates(IMUData* turnRates); | ||
|
||
/** | ||
* Get last raw Magnetometer values as a IMUData struct containing values in x, y and z. | ||
* Get last raw Magnetometer values as an IMUData struct containing values in x, y and z. | ||
* | ||
* @param[in] magnetometerValues Pointer to IMUData struct. | ||
* @param[in] magnetometerValues Pointer to IMUData struct where the raw, unitless magnetometer values in | ||
* x, y and z direction will be written into. The values can be converted into physical values in mgauss via the | ||
* multiplication with a sensitivity factor in mgauss/bit. | ||
*/ | ||
const void getMagnetometerValues(IMUData* magnetometerValues); | ||
|
||
|
@@ -159,9 +170,9 @@ class IMU : public IIMU | |
void calibrate(); | ||
|
||
private: | ||
IMUData m_accelerometerValues = {0, 0, 0}; /* Raw accelerometer readings. */ | ||
IMUData m_gyroValues = {0, 0, 0}; /* Raw gyro readings. */ | ||
IMUData m_magnetometerValues = {0, 0, 0}; /* Raw magnetometer readings. */ | ||
IMUData m_accelerometerValues; /* Raw accelerometer readings. */ | ||
IMUData m_gyroValues; /* Raw gyro readings. */ | ||
IMUData m_magnetometerValues; /* Raw magnetometer readings. */ | ||
|
||
protected: | ||
private: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
DESCRIPTION | ||
*******************************************************************************/ | ||
/** | ||
* @brief IMU realization | ||
* @brief IMU (Inertial Measurement Unit) realization | ||
* @author Juliane Kerpe <[email protected]> | ||
* | ||
* @addtogroup HALSim | ||
|
@@ -36,7 +36,6 @@ | |
#ifndef IMU_H | ||
#define IMU_H | ||
|
||
|
||
/****************************************************************************** | ||
* Compile Switches | ||
*****************************************************************************/ | ||
|
@@ -45,7 +44,9 @@ | |
* Includes | ||
*****************************************************************************/ | ||
#include "IIMU.h" | ||
|
||
/** The IMU adapter. | ||
* IMU stands for Inertial Measurement Unit. | ||
*/ | ||
class IMU : public IIMU | ||
{ | ||
public: | ||
|
@@ -61,80 +62,114 @@ class IMU : public IIMU | |
* | ||
* @return True if the sensor type was detected succesfully; false otherwise. | ||
*/ | ||
bool init(){return true;} | ||
|
||
bool init() | ||
{ | ||
return true; | ||
} | ||
|
||
/** | ||
* Enables all of the inertial sensors with a default configuration. | ||
*/ | ||
void enableDefault() {}; | ||
void enableDefault(){}; | ||
|
||
/** | ||
* Configures the sensors with settings optimized for turn sensing. | ||
*/ | ||
void configureForTurnSensing() {} | ||
void configureForTurnSensing() | ||
{ | ||
} | ||
|
||
/** | ||
* Takes a reading from the accelerometer and makes the measurements available in a. | ||
*/ | ||
void readAccelerometer() {} | ||
|
||
*/ | ||
void readAccelerometer() | ||
{ | ||
} | ||
|
||
/** | ||
* Takes a reading from the gyro and makes the measurements available in g. | ||
*/ | ||
void readGyro() {} | ||
|
||
void readGyro() | ||
{ | ||
} | ||
|
||
/** | ||
* Takes a reading from the magnetometer and makes the measurements available in m. | ||
*/ | ||
void readMagnetometer() {} | ||
|
||
void readMagnetometer() | ||
{ | ||
} | ||
|
||
/** | ||
* Indicates whether the accelerometer has new measurement data ready. | ||
* | ||
* @return True if there is new accelerometer data available; false otherwise. | ||
* | ||
* @return True if there is new accelerometer data available; false otherwise. | ||
*/ | ||
bool accelerometerDataReady() {return true;} | ||
|
||
bool accelerometerDataReady() | ||
{ | ||
return true; | ||
} | ||
|
||
/** | ||
* Indicates whether the gyro has new measurement data ready. | ||
* | ||
* | ||
* @return True if there is new gyro data available; false otherwise. | ||
*/ | ||
bool gyroDataReady() {return true;} | ||
|
||
bool gyroDataReady() | ||
{ | ||
return true; | ||
} | ||
|
||
/** | ||
* Indicates whether the magnetometer has new measurement data ready. | ||
* | ||
* | ||
* @return True if there is new magnetometer data available; false otherwise. | ||
*/ | ||
bool magnetometerDataReady() {return true;} | ||
|
||
bool magnetometerDataReady() | ||
{ | ||
return true; | ||
} | ||
|
||
/** | ||
* Get last raw Accelerometer values as a IMUData struct containing values in x, y and z. | ||
* Get last raw Accelerometer values as an IMUData struct containing values in x, y and z. | ||
* | ||
* @param[in] accelerationValues Pointer to IMUData struct. | ||
* @param[in] accelerationValues Pointer to IMUData struct where the raw, unitless acceleration values in | ||
* x, y and z direction will be written into. The values can be converted into physical values in mm/s^2 via the | ||
* multiplication with a sensitivity factor in mm/s^2/bit. | ||
*/ | ||
const void getAccelerationValues(IMUData* accelerationValues) {} | ||
const void getAccelerationValues(IMUData* accelerationValues) | ||
{ | ||
} | ||
|
||
/** | ||
* Get last raw Gyroscope values as a IMUData struct containing values in x, y and z. | ||
* Get last raw Gyroscope values as an IMUData struct containing values in x, y and z. | ||
* | ||
* @param[in] turnRates Pointer to IMUData struct. | ||
* @param[in] turnRates Pointer to IMUData struct where the raw, unitless turn Rates in x, y and z | ||
* direction will be written into. The values can be converted into physical values in mrad/s via the multiplication | ||
* with a sensitivity factor in mrad/s/bit. | ||
*/ | ||
const void getTurnRates(IMUData* turnRates) {} | ||
const void getTurnRates(IMUData* turnRates) | ||
{ | ||
} | ||
|
||
/** | ||
* Get last raw Magnetometer values as a IMUData struct containing values in x, y and z. | ||
* Get last raw Magnetometer values as an IMUData struct containing values in x, y and z. | ||
* | ||
* @param[in] magnetometerValues Pointer to IMUData struct. | ||
* @param[in] magnetometerValues Pointer to IMUData struct where the raw, unitless magnetometer values in | ||
* x, y and z direction will be written into. The values can be converted into physical values in mgauss via the | ||
* multiplication with a sensitivity factor in mgauss/bit. | ||
*/ | ||
const void getMagnetometerValues(IMUData* magnetometerValues) {} | ||
|
||
const void getMagnetometerValues(IMUData* magnetometerValues) | ||
{ | ||
} | ||
|
||
/** | ||
* Calibrate the IMU. | ||
*/ | ||
virtual void calibrate() {} | ||
|
||
virtual void calibrate() | ||
{ | ||
} | ||
|
||
private: | ||
}; | ||
|
||
|
Oops, something went wrong.