From 3a2a1c7601374ab4aabe225da51fd2271ed28401 Mon Sep 17 00:00:00 2001 From: jkerpe Date: Fri, 17 Nov 2023 08:50:41 +0100 Subject: [PATCH] Implemented findings of gabryelreyes --- lib/AppSensorFusion/SerialMuxChannels.h | 2 +- lib/HALConvoyLeaderSim/Board.h | 2 +- lib/HALConvoyLeaderTarget/Board.h | 2 +- lib/HALConvoyLeaderTarget/ConvoyLeaderIMU.h | 11 ++++++++++- lib/HALInterfaces/IBoard.h | 2 +- lib/HALInterfaces/IIMU.h | 4 ++-- lib/HALLineFollowerSim/Board.h | 2 +- lib/HALLineFollowerTarget/Board.h | 2 +- lib/HALLineFollowerTarget/LineFollowerIMU.h | 11 ++++++++++- lib/HALRemoteControlSim/Board.h | 2 +- lib/HALRemoteControlTarget/Board.h | 2 +- lib/HALRemoteControlTarget/RemoteControlIMU.h | 11 ++++++++++- lib/HALSensorFusionSim/Board.h | 2 +- lib/HALSensorFusionTarget/Board.cpp | 5 +++-- lib/HALSensorFusionTarget/Board.h | 2 +- lib/HALSensorFusionTarget/SensorFusionBuzzer.cpp | 8 ++++++++ .../SensorFusionProximitySensors.h | 2 +- lib/HALSim/IMU.h | 2 +- lib/HALTarget/IMU.h | 2 +- lib/HALTest/Board.h | 2 +- lib/HALTest/Buzzer.cpp | 8 ++++++++ lib/HALTest/IMU.h | 15 +++++++++++++-- lib/HALTest/ProximitySensors.h | 2 +- platformio.ini | 1 + 24 files changed, 80 insertions(+), 24 deletions(-) diff --git a/lib/AppSensorFusion/SerialMuxChannels.h b/lib/AppSensorFusion/SerialMuxChannels.h index 8d233491..bfe7d957 100644 --- a/lib/AppSensorFusion/SerialMuxChannels.h +++ b/lib/AppSensorFusion/SerialMuxChannels.h @@ -92,7 +92,7 @@ typedef struct _SensorData */ int16_t magnetometerValueY; - /** Gyroscope value around z axis as a raw sensor value in digits. + /** Gyro value around z axis as a raw sensor value in digits. * It can be converted into a physical turn rate in mrad/s via the multiplication * with a sensitivity factor in mrad/s/digit. */ diff --git a/lib/HALConvoyLeaderSim/Board.h b/lib/HALConvoyLeaderSim/Board.h index 4da498ca..a93221f9 100644 --- a/lib/HALConvoyLeaderSim/Board.h +++ b/lib/HALConvoyLeaderSim/Board.h @@ -215,7 +215,7 @@ class Board : public IBoard } /** - * Get IMU (=Inertial Measurement Unit) driver. + * Get IMU (Inertial Measurement Unit) driver. * * @return IMU driver */ diff --git a/lib/HALConvoyLeaderTarget/Board.h b/lib/HALConvoyLeaderTarget/Board.h index 242d15b9..5f2ed0ba 100644 --- a/lib/HALConvoyLeaderTarget/Board.h +++ b/lib/HALConvoyLeaderTarget/Board.h @@ -210,7 +210,7 @@ class Board : public IBoard } /** - * Get IMU (=Inertial Measurement Unit) driver. + * Get IMU (Inertial Measurement Unit) driver. * * @return IMU driver */ diff --git a/lib/HALConvoyLeaderTarget/ConvoyLeaderIMU.h b/lib/HALConvoyLeaderTarget/ConvoyLeaderIMU.h index 44fca197..7f90fae8 100644 --- a/lib/HALConvoyLeaderTarget/ConvoyLeaderIMU.h +++ b/lib/HALConvoyLeaderTarget/ConvoyLeaderIMU.h @@ -44,6 +44,15 @@ * Includes *****************************************************************************/ #include "IIMU.h" + +/****************************************************************************** + * Macros + *****************************************************************************/ + +/****************************************************************************** + * Types and Classes + *****************************************************************************/ + /** The IMU adapter as a dummy driver for the IMU of the Convoy Leader Application. * IMU stands for Inertial Measurement Unit. */ @@ -142,7 +151,7 @@ class ConvoyLeaderIMU : public IIMU } /** - * Get last raw Gyroscope values as an IMUData struct containing values in x, y and z in digits. + * Get last raw Gyro values as an IMUData struct containing values in x, y and z in digits. * * @param[in] turnRates Pointer to IMUData struct where the raw turn Rates in digits in x, y and z * direction will be written into. The values can be converted into physical values in mrad/s via the multiplication diff --git a/lib/HALInterfaces/IBoard.h b/lib/HALInterfaces/IBoard.h index e32f5a1b..cba94803 100644 --- a/lib/HALInterfaces/IBoard.h +++ b/lib/HALInterfaces/IBoard.h @@ -167,7 +167,7 @@ class IBoard /** - * Get IMU (=Inertial Measurement Unit) driver. + * Get IMU (Inertial Measurement Unit) driver. * * @return IMU driver */ diff --git a/lib/HALInterfaces/IIMU.h b/lib/HALInterfaces/IIMU.h index 326e6d18..7c685645 100644 --- a/lib/HALInterfaces/IIMU.h +++ b/lib/HALInterfaces/IIMU.h @@ -52,7 +52,7 @@ * Types and Classes *****************************************************************************/ -/** Struct of the raw and not yet converted IMU Data (=accelerometer, gyro or magnetometer values) +/** Struct of the raw and not yet converted IMU Data (accelerometer, gyro or magnetometer values) * in digits in x, y and z direction. */ typedef struct _IMUData { @@ -137,7 +137,7 @@ class IIMU virtual const void getAccelerationValues(IMUData* accelerationValues) = 0; /** - * Get last raw Gyroscope values as an IMUData struct containing values in x, y and z in digits. + * Get last raw Gyro values as an IMUData struct containing values in x, y and z in digits. * * @param[in] turnRates Pointer to IMUData struct where the raw turn Rates in digits in x, y and z * direction will be written into. The values can be converted into physical values in mrad/s via the multiplication diff --git a/lib/HALLineFollowerSim/Board.h b/lib/HALLineFollowerSim/Board.h index 4da498ca..a93221f9 100644 --- a/lib/HALLineFollowerSim/Board.h +++ b/lib/HALLineFollowerSim/Board.h @@ -215,7 +215,7 @@ class Board : public IBoard } /** - * Get IMU (=Inertial Measurement Unit) driver. + * Get IMU (Inertial Measurement Unit) driver. * * @return IMU driver */ diff --git a/lib/HALLineFollowerTarget/Board.h b/lib/HALLineFollowerTarget/Board.h index d6fe7fb4..0fedf8d3 100644 --- a/lib/HALLineFollowerTarget/Board.h +++ b/lib/HALLineFollowerTarget/Board.h @@ -210,7 +210,7 @@ class Board : public IBoard } /** - * Get IMU (=Inertial Measurement Unit) driver. + * Get IMU (Inertial Measurement Unit) driver. * * @return IMU driver */ diff --git a/lib/HALLineFollowerTarget/LineFollowerIMU.h b/lib/HALLineFollowerTarget/LineFollowerIMU.h index 8705eaba..843da792 100644 --- a/lib/HALLineFollowerTarget/LineFollowerIMU.h +++ b/lib/HALLineFollowerTarget/LineFollowerIMU.h @@ -44,6 +44,15 @@ * Includes *****************************************************************************/ #include "IIMU.h" + +/****************************************************************************** + * Macros + *****************************************************************************/ + +/****************************************************************************** + * Types and Classes + *****************************************************************************/ + /** The IMU adapter as a dummy driver for the IMU of the LineFollower Application. * IMU stands for Inertial Measurement Unit. */ @@ -142,7 +151,7 @@ class LineFollowerIMU : public IIMU } /** - * Get last raw Gyroscope values as an IMUData struct containing values in x, y and z in digits. + * Get last raw Gyro values as an IMUData struct containing values in x, y and z in digits. * * @param[in] turnRates Pointer to IMUData struct where the raw turn Rates in digits in x, y and z * direction will be written into. The values can be converted into physical values in mrad/s via the multiplication diff --git a/lib/HALRemoteControlSim/Board.h b/lib/HALRemoteControlSim/Board.h index 4da498ca..a93221f9 100644 --- a/lib/HALRemoteControlSim/Board.h +++ b/lib/HALRemoteControlSim/Board.h @@ -215,7 +215,7 @@ class Board : public IBoard } /** - * Get IMU (=Inertial Measurement Unit) driver. + * Get IMU (Inertial Measurement Unit) driver. * * @return IMU driver */ diff --git a/lib/HALRemoteControlTarget/Board.h b/lib/HALRemoteControlTarget/Board.h index 278d59c7..be1fad44 100644 --- a/lib/HALRemoteControlTarget/Board.h +++ b/lib/HALRemoteControlTarget/Board.h @@ -210,7 +210,7 @@ class Board : public IBoard } /** - * Get IMU (=Inertial Measurement Unit) driver. + * Get IMU (Inertial Measurement Unit) driver. * * @return IMU driver */ diff --git a/lib/HALRemoteControlTarget/RemoteControlIMU.h b/lib/HALRemoteControlTarget/RemoteControlIMU.h index 035da55c..6680f60f 100644 --- a/lib/HALRemoteControlTarget/RemoteControlIMU.h +++ b/lib/HALRemoteControlTarget/RemoteControlIMU.h @@ -44,6 +44,15 @@ * Includes *****************************************************************************/ #include "IIMU.h" + +/****************************************************************************** + * Macros + *****************************************************************************/ + +/****************************************************************************** + * Types and Classes + *****************************************************************************/ + /** The IMU adapter as a dummy driver for the IMU of the RemoteControl Application. * IMU stands for Inertial Measurement Unit. */ @@ -142,7 +151,7 @@ class RemoteControlIMU : public IIMU } /** - * Get last raw Gyroscope values as an IMUData struct containing values in x, y and z in digits. + * Get last raw Gyro values as an IMUData struct containing values in x, y and z in digits. * * @param[in] turnRates Pointer to IMUData struct where the raw turn Rates in digits in x, y and z * direction will be written into. The values can be converted into physical values in mrad/s via the multiplication diff --git a/lib/HALSensorFusionSim/Board.h b/lib/HALSensorFusionSim/Board.h index 4da498ca..a93221f9 100644 --- a/lib/HALSensorFusionSim/Board.h +++ b/lib/HALSensorFusionSim/Board.h @@ -215,7 +215,7 @@ class Board : public IBoard } /** - * Get IMU (=Inertial Measurement Unit) driver. + * Get IMU (Inertial Measurement Unit) driver. * * @return IMU driver */ diff --git a/lib/HALSensorFusionTarget/Board.cpp b/lib/HALSensorFusionTarget/Board.cpp index 82cc4878..ed9c3c8f 100644 --- a/lib/HALSensorFusionTarget/Board.cpp +++ b/lib/HALSensorFusionTarget/Board.cpp @@ -76,9 +76,10 @@ void Board::init() m_lineSensors.init(); m_motors.init(); m_proximitySensors.initFrontSensor(); - m_imu.init(); + /* TODO: TD084 React if IMU initialization fails */ + (void)m_imu.init(); m_imu.enableDefault(); - m_imu.configureForTurnSensing(); + m_imu.configureForTurnSensing(); m_imu.calibrate(); } diff --git a/lib/HALSensorFusionTarget/Board.h b/lib/HALSensorFusionTarget/Board.h index 2bcb61d4..4959fdfe 100644 --- a/lib/HALSensorFusionTarget/Board.h +++ b/lib/HALSensorFusionTarget/Board.h @@ -209,7 +209,7 @@ class Board : public IBoard } /** - * Get IMU (=Inertial Measurement Unit) driver. + * Get IMU (Inertial Measurement Unit) driver. * * @return IMU driver */ diff --git a/lib/HALSensorFusionTarget/SensorFusionBuzzer.cpp b/lib/HALSensorFusionTarget/SensorFusionBuzzer.cpp index 56a411a2..b72e6a08 100644 --- a/lib/HALSensorFusionTarget/SensorFusionBuzzer.cpp +++ b/lib/HALSensorFusionTarget/SensorFusionBuzzer.cpp @@ -60,14 +60,22 @@ void SensorFusionBuzzer::playFrequency(uint16_t freq, uint16_t duration, uint8_t volume) { + /* Not implemented*/ + (void) freq; + (void) duration; + (void) volume; } void SensorFusionBuzzer::playMelody(const char* sequence) { + /* Not implemented*/ + (void) sequence; } void SensorFusionBuzzer::playMelodyPGM(const char* sequence) { + /* Not implemented*/ + (void) sequence; } /****************************************************************************** diff --git a/lib/HALSensorFusionTarget/SensorFusionProximitySensors.h b/lib/HALSensorFusionTarget/SensorFusionProximitySensors.h index 6ad1673a..fb1efec4 100644 --- a/lib/HALSensorFusionTarget/SensorFusionProximitySensors.h +++ b/lib/HALSensorFusionTarget/SensorFusionProximitySensors.h @@ -85,7 +85,7 @@ class SensorFusionProximitySensors : public IProximitySensors */ uint8_t getNumSensors() const final { - return 1; + return 1U; } /** diff --git a/lib/HALSim/IMU.h b/lib/HALSim/IMU.h index 9bdecff1..f43638bd 100644 --- a/lib/HALSim/IMU.h +++ b/lib/HALSim/IMU.h @@ -167,7 +167,7 @@ class IMU : public IIMU void const getAccelerationValues(IMUData* accelerationValues); /** - * Get last raw Gyroscope values as an IMUData struct containing values in x, y and z in digits. + * Get last raw Gyro values as an IMUData struct containing values in x, y and z in digits. * * @param[in] turnRates Pointer to IMUData struct where the raw turn Rates in digits in x, y and z * direction will be written into. The values can be converted into physical values in mrad/s via the multiplication diff --git a/lib/HALTarget/IMU.h b/lib/HALTarget/IMU.h index 9383c6b4..fe37e116 100644 --- a/lib/HALTarget/IMU.h +++ b/lib/HALTarget/IMU.h @@ -147,7 +147,7 @@ class IMU : public IIMU const void getAccelerationValues(IMUData* accelerationValues); /** - * Get last raw Gyroscope values as an IMUData struct containing values in x, y and z in digits. + * Get last raw Gyro values as an IMUData struct containing values in x, y and z in digits. * * @param[in] turnRates Pointer to IMUData struct where the raw turn Rates in digits in x, y and z * direction will be written into. The values can be converted into physical values in mrad/s via the multiplication diff --git a/lib/HALTest/Board.h b/lib/HALTest/Board.h index 50ad18af..2e262f93 100644 --- a/lib/HALTest/Board.h +++ b/lib/HALTest/Board.h @@ -210,7 +210,7 @@ class Board : public IBoard } /** - * Get IMU (=Inertial Measurement Unit) driver. + * Get IMU (Inertial Measurement Unit) driver. * * @return IMU driver */ diff --git a/lib/HALTest/Buzzer.cpp b/lib/HALTest/Buzzer.cpp index 0e6dea0c..42ee891c 100644 --- a/lib/HALTest/Buzzer.cpp +++ b/lib/HALTest/Buzzer.cpp @@ -60,14 +60,22 @@ void Buzzer::playFrequency(uint16_t freq, uint16_t duration, uint8_t volume) { + /* Not implemented*/ + (void) freq; + (void) duration; + (void) volume; } void Buzzer::playMelody(const char* sequence) { + /* Not implemented*/ + (void) sequence; } void Buzzer::playMelodyPGM(const char* sequence) { + /* Not implemented*/ + (void) sequence; } /****************************************************************************** diff --git a/lib/HALTest/IMU.h b/lib/HALTest/IMU.h index 3d2905ba..befc7282 100644 --- a/lib/HALTest/IMU.h +++ b/lib/HALTest/IMU.h @@ -44,6 +44,15 @@ * Includes *****************************************************************************/ #include "IIMU.h" + +/****************************************************************************** + * Macros + *****************************************************************************/ + +/****************************************************************************** + * Types and Classes + *****************************************************************************/ + /** The IMU adapter. * IMU stands for Inertial Measurement Unit. */ @@ -70,7 +79,9 @@ class IMU : public IIMU /** * Enables all of the inertial sensors with a default configuration. */ - void enableDefault(){}; + void enableDefault() + { + }; /** * Configures the sensors with settings optimized for turn sensing. @@ -142,7 +153,7 @@ class IMU : public IIMU } /** - * Get last raw Gyroscope values as an IMUData struct containing values in x, y and z in digits. + * Get last raw Gyro values as an IMUData struct containing values in x, y and z in digits. * * @param[in] turnRates Pointer to IMUData struct where the raw turn Rates in digits in x, y and z * direction will be written into. The values can be converted into physical values in mrad/s via the multiplication diff --git a/lib/HALTest/ProximitySensors.h b/lib/HALTest/ProximitySensors.h index 9774d4d6..c01ac81d 100644 --- a/lib/HALTest/ProximitySensors.h +++ b/lib/HALTest/ProximitySensors.h @@ -85,7 +85,7 @@ class ProximitySensors : public IProximitySensors */ uint8_t getNumSensors() const final { - return 1; + return 1U; } /** diff --git a/platformio.ini b/platformio.ini index fb6db6ca..626facf9 100644 --- a/platformio.ini +++ b/platformio.ini @@ -278,6 +278,7 @@ lib_deps = lib_ignore = APPConvoyLeader APPLineFollower + APPSensorFusion ; ***************************************************************************** ; Remote control application specific HAL for target