-
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.
- Loading branch information
Showing
15 changed files
with
143 additions
and
139 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
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* MIT License | ||
* | ||
* Copyright (c) 2023 Andreas Merkle <[email protected]> | ||
* | ||
* | ||
* 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 | ||
|
@@ -25,9 +25,9 @@ | |
DESCRIPTION | ||
*******************************************************************************/ | ||
/** | ||
* @brief Abstract IMU interface, depicts Zumo32U4IMU library | ||
* @brief Abstract IMU (Inertial Measurement Unit) interface, depicts Zumo32U4IMU library | ||
* @author Juliane Kerpe <[email protected]> | ||
* | ||
* | ||
* @addtogroup HALInterfaces | ||
* | ||
* @{ | ||
|
@@ -55,12 +55,14 @@ | |
/** Struct of the IMU data in x, y and z direction. */ | ||
typedef struct _IMUData | ||
{ | ||
int16_t valueX; | ||
int16_t valueY; | ||
int16_t valueZ; | ||
int16_t valueX; /* Raw sensor value in x direction (unitless) */ | ||
int16_t valueY; /* Raw sensor value in y direction (unitless) */ | ||
int16_t valueZ; /* Raw sensor value in z direction (unitless) */ | ||
} __attribute__((packed)) IMUData; | ||
|
||
/** The abstract IMU interface. */ | ||
/** The abstract IMU interface. | ||
* IMU stands for Inertial Measurement Unit. | ||
*/ | ||
class IIMU | ||
{ | ||
public: | ||
|
@@ -77,49 +79,49 @@ class IIMU | |
* @return True if the sensor type was detected succesfully; false otherwise. | ||
*/ | ||
virtual bool init() = 0; | ||
|
||
/** | ||
* Enables all of the inertial sensors with a default configuration. | ||
*/ | ||
virtual void enableDefault() = 0; | ||
|
||
/** | ||
* Configures the sensors with settings optimized for turn sensing. | ||
*/ | ||
virtual void configureForTurnSensing() = 0; | ||
|
||
/** | ||
* Takes a reading from the accelerometer and makes the measurements available in a. | ||
*/ | ||
*/ | ||
virtual void readAccelerometer() = 0; | ||
|
||
/** | ||
* Takes a reading from the gyro and makes the measurements available in g. | ||
*/ | ||
virtual void readGyro() = 0; | ||
|
||
/** | ||
* Takes a reading from the magnetometer and makes the measurements available in m. | ||
*/ | ||
virtual void readMagnetometer() = 0; | ||
|
||
/** | ||
* 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. | ||
*/ | ||
virtual bool accelerometerDataReady() = 0; | ||
|
||
/** | ||
* Indicates whether the gyro has new measurement data ready. | ||
* | ||
* | ||
* @return True if there is new gyro data available; false otherwise. | ||
*/ | ||
virtual bool gyroDataReady() = 0; | ||
|
||
/** | ||
* Indicates whether the magnetometer has new measurement data ready. | ||
* | ||
* | ||
* @return True if there is new magnetometer data available; false otherwise. | ||
*/ | ||
virtual bool magnetometerDataReady() = 0; | ||
|
@@ -129,21 +131,21 @@ class IIMU | |
* | ||
* @param[in] accelerationValues Pointer to IMUData struct. | ||
*/ | ||
virtual void getAccelerationValues(IMUData* accelerationValues) = 0; | ||
virtual const void getAccelerationValues(IMUData* accelerationValues) = 0; | ||
|
||
/** | ||
* Get last raw Gyroscope values as a IMUData struct containing values in x, y and z. | ||
* | ||
* @param[in] turnRates Pointer to IMUData struct. | ||
*/ | ||
virtual void getTurnRates(IMUData* turnRates) = 0; | ||
virtual const void getTurnRates(IMUData* turnRates) = 0; | ||
|
||
/** | ||
* Get last raw Magnetometer values as a IMUData struct containing values in x, y and z. | ||
* | ||
* @param[in] magnetometerValues Pointer to IMUData struct. | ||
*/ | ||
virtual void getMagnetometerValues(IMUData* magnetometerValues) = 0; | ||
virtual const void getMagnetometerValues(IMUData* magnetometerValues) = 0; | ||
|
||
/** | ||
* Calibrate the IMU. | ||
|
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
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
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
Oops, something went wrong.