-
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.
added IMU and send data via serialmuxprot
- Loading branch information
Showing
18 changed files
with
806 additions
and
17 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
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 |
---|---|---|
@@ -0,0 +1,143 @@ | ||
/* MIT License | ||
* | ||
* Copyright (c) 2023 Juliane Kerpe <[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 | ||
* 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 | ||
*******************************************************************************/ | ||
/** | ||
* @brief Abstract IMU interface | ||
* @author Juliane Kerpe <[email protected]> | ||
* | ||
* @addtogroup HALInterfaces | ||
* | ||
* @{ | ||
*/ | ||
#ifndef IIMU_H | ||
#define IIMU_H | ||
|
||
/****************************************************************************** | ||
* Compile Switches | ||
*****************************************************************************/ | ||
|
||
/****************************************************************************** | ||
* Includes | ||
*****************************************************************************/ | ||
#include <stdint.h> | ||
|
||
/****************************************************************************** | ||
* Macros | ||
*****************************************************************************/ | ||
|
||
/****************************************************************************** | ||
* Types and Classes | ||
*****************************************************************************/ | ||
|
||
/** The abstract IMU interface. */ | ||
class IIMU | ||
{ | ||
public: | ||
/** | ||
* Destroys the interface. | ||
*/ | ||
virtual ~IIMU() | ||
{ | ||
} | ||
|
||
/** | ||
* Initializes the Accelerometer. | ||
*/ | ||
virtual void init() = 0; | ||
|
||
/** | ||
* Reads the sensors for calibration. | ||
* The calibration factors are stored internally. | ||
*/ | ||
virtual void calibrate() = 0; | ||
|
||
|
||
/** | ||
* Get last Accelerometer values. | ||
* | ||
* @return Accelerometer values | ||
*/ | ||
virtual const double* getAccelerometerValues() = 0; | ||
|
||
|
||
/** | ||
* Get last Gyroscope values. | ||
* | ||
* @return Gyroscope values | ||
*/ | ||
virtual const double getGyroValue() = 0; | ||
|
||
/** | ||
* Get number of axis used. | ||
* | ||
* @return number of axis which are evaluated | ||
*/ | ||
virtual const uint8_t getNumberOfAccelerometerAxis() = 0; | ||
|
||
|
||
/** | ||
* Checks whether the calibration was successful or not. | ||
* | ||
* @return If successful, it will return true otherwise false. | ||
*/ | ||
virtual bool isCalibrationSuccessful() = 0; | ||
|
||
/** | ||
* It will return the index of the sensor, which caused to fail the calibration. | ||
* If calibration was successful, it will return 0xFF. | ||
* If calibration was not not done yet, it will return 0xFE. | ||
* | ||
* @return xxx | ||
*/ | ||
virtual uint8_t getCalibErrorInfo() const = 0; | ||
|
||
|
||
/** | ||
* Calibration error information: Calibration successful. | ||
*/ | ||
static const uint8_t CALIB_ERROR_OK = 0xFF; | ||
|
||
/** | ||
* Calibration error information: Calibration not done yet. | ||
*/ | ||
static const uint8_t CALIB_ERROR_NOT_CALIBRATED = 0xFE; | ||
|
||
protected: | ||
/** | ||
* Constructs the interface. | ||
*/ | ||
IIMU() | ||
{ | ||
} | ||
|
||
private: | ||
}; | ||
|
||
/****************************************************************************** | ||
* Functions | ||
*****************************************************************************/ | ||
|
||
#endif /* IIMU */ | ||
/** @} */ |
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.