Skip to content

Commit

Permalink
Implemented findings of gabryelreyes
Browse files Browse the repository at this point in the history
  • Loading branch information
jkerpe committed Nov 17, 2023
1 parent 3366609 commit 3a2a1c7
Show file tree
Hide file tree
Showing 24 changed files with 80 additions and 24 deletions.
2 changes: 1 addition & 1 deletion lib/AppSensorFusion/SerialMuxChannels.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/HALConvoyLeaderSim/Board.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ class Board : public IBoard
}

/**
* Get IMU (=Inertial Measurement Unit) driver.
* Get IMU (Inertial Measurement Unit) driver.
*
* @return IMU driver
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/HALConvoyLeaderTarget/Board.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class Board : public IBoard
}

/**
* Get IMU (=Inertial Measurement Unit) driver.
* Get IMU (Inertial Measurement Unit) driver.
*
* @return IMU driver
*/
Expand Down
11 changes: 10 additions & 1 deletion lib/HALConvoyLeaderTarget/ConvoyLeaderIMU.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/HALInterfaces/IBoard.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class IBoard


/**
* Get IMU (=Inertial Measurement Unit) driver.
* Get IMU (Inertial Measurement Unit) driver.
*
* @return IMU driver
*/
Expand Down
4 changes: 2 additions & 2 deletions lib/HALInterfaces/IIMU.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/HALLineFollowerSim/Board.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ class Board : public IBoard
}

/**
* Get IMU (=Inertial Measurement Unit) driver.
* Get IMU (Inertial Measurement Unit) driver.
*
* @return IMU driver
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/HALLineFollowerTarget/Board.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class Board : public IBoard
}

/**
* Get IMU (=Inertial Measurement Unit) driver.
* Get IMU (Inertial Measurement Unit) driver.
*
* @return IMU driver
*/
Expand Down
11 changes: 10 additions & 1 deletion lib/HALLineFollowerTarget/LineFollowerIMU.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/HALRemoteControlSim/Board.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ class Board : public IBoard
}

/**
* Get IMU (=Inertial Measurement Unit) driver.
* Get IMU (Inertial Measurement Unit) driver.
*
* @return IMU driver
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/HALRemoteControlTarget/Board.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class Board : public IBoard
}

/**
* Get IMU (=Inertial Measurement Unit) driver.
* Get IMU (Inertial Measurement Unit) driver.
*
* @return IMU driver
*/
Expand Down
11 changes: 10 additions & 1 deletion lib/HALRemoteControlTarget/RemoteControlIMU.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/HALSensorFusionSim/Board.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ class Board : public IBoard
}

/**
* Get IMU (=Inertial Measurement Unit) driver.
* Get IMU (Inertial Measurement Unit) driver.
*
* @return IMU driver
*/
Expand Down
5 changes: 3 additions & 2 deletions lib/HALSensorFusionTarget/Board.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
2 changes: 1 addition & 1 deletion lib/HALSensorFusionTarget/Board.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ class Board : public IBoard
}

/**
* Get IMU (=Inertial Measurement Unit) driver.
* Get IMU (Inertial Measurement Unit) driver.
*
* @return IMU driver
*/
Expand Down
8 changes: 8 additions & 0 deletions lib/HALSensorFusionTarget/SensorFusionBuzzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/******************************************************************************
Expand Down
2 changes: 1 addition & 1 deletion lib/HALSensorFusionTarget/SensorFusionProximitySensors.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class SensorFusionProximitySensors : public IProximitySensors
*/
uint8_t getNumSensors() const final
{
return 1;
return 1U;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/HALSim/IMU.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/HALTarget/IMU.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/HALTest/Board.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class Board : public IBoard
}

/**
* Get IMU (=Inertial Measurement Unit) driver.
* Get IMU (Inertial Measurement Unit) driver.
*
* @return IMU driver
*/
Expand Down
8 changes: 8 additions & 0 deletions lib/HALTest/Buzzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/******************************************************************************
Expand Down
15 changes: 13 additions & 2 deletions lib/HALTest/IMU.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@
* Includes
*****************************************************************************/
#include "IIMU.h"

/******************************************************************************
* Macros
*****************************************************************************/

/******************************************************************************
* Types and Classes
*****************************************************************************/

/** The IMU adapter.
* IMU stands for Inertial Measurement Unit.
*/
Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/HALTest/ProximitySensors.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class ProximitySensors : public IProximitySensors
*/
uint8_t getNumSensors() const final
{
return 1;
return 1U;
}

/**
Expand Down
1 change: 1 addition & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ lib_deps =
lib_ignore =
APPConvoyLeader
APPLineFollower
APPSensorFusion

; *****************************************************************************
; Remote control application specific HAL for target
Expand Down

0 comments on commit 3a2a1c7

Please sign in to comment.