diff --git a/doc/doxygen/doxygen_warnings.txt b/doc/doxygen/doxygen_warnings.txt index e69de29b..f73ec18c 100644 --- a/doc/doxygen/doxygen_warnings.txt +++ b/doc/doxygen/doxygen_warnings.txt @@ -0,0 +1,24 @@ +C:/Users/jkerpe/MasterArbeit/10_Code/Launcher/RadonUlzer/lib/APPSensorFusion/App.h:127: error: Member App(const App &app) (function) of class App is not documented. +C:/Users/jkerpe/MasterArbeit/10_Code/Launcher/RadonUlzer/lib/APPSensorFusion/App.h:128: error: Member operator=(const App &app) (function) of class App is not documented. +C:/Users/jkerpe/MasterArbeit/10_Code/Launcher/RadonUlzer/lib/APPSensorFusion/DrivingState.h:159: error: Member DrivingState(const DrivingState &state) (function) of class DrivingState is not documented. +C:/Users/jkerpe/MasterArbeit/10_Code/Launcher/RadonUlzer/lib/APPSensorFusion/DrivingState.h:160: error: Member operator=(const DrivingState &state) (function) of class DrivingState is not documented. +C:/Users/jkerpe/MasterArbeit/10_Code/Launcher/RadonUlzer/lib/APPSensorFusion/DrivingState.h:163: error: argument 'lineSensorValue' of command @param is not found in the argument list of DrivingState::processOnTrack(int16_t position, const uint16_t *lineSensorValues) +C:/Users/jkerpe/MasterArbeit/10_Code/Launcher/RadonUlzer/lib/APPSensorFusion/DrivingState.h:163: error: The following parameter of DrivingState::processOnTrack(int16_t position, const uint16_t *lineSensorValues) is not documented: + parameter 'lineSensorValues' +C:/Users/jkerpe/MasterArbeit/10_Code/Launcher/RadonUlzer/lib/APPSensorFusion/DrivingState.h:171: error: argument 'lineSensorValue' of command @param is not found in the argument list of DrivingState::processTrackLost(int16_t position, const uint16_t *lineSensorValues) +C:/Users/jkerpe/MasterArbeit/10_Code/Launcher/RadonUlzer/lib/APPSensorFusion/DrivingState.h:171: error: The following parameter of DrivingState::processTrackLost(int16_t position, const uint16_t *lineSensorValues) is not documented: + parameter 'lineSensorValues' +C:/Users/jkerpe/MasterArbeit/10_Code/Launcher/RadonUlzer/lib/APPSensorFusion/ErrorState.h:125: error: Member ErrorState(const ErrorState &state) (function) of class ErrorState is not documented. +C:/Users/jkerpe/MasterArbeit/10_Code/Launcher/RadonUlzer/lib/APPSensorFusion/ErrorState.h:126: error: Member operator=(const ErrorState &state) (function) of class ErrorState is not documented. +C:/Users/jkerpe/MasterArbeit/10_Code/Launcher/RadonUlzer/lib/APPSensorFusion/LineSensorsCalibrationState.h:134: error: Member LineSensorsCalibrationState(const LineSensorsCalibrationState &state) (function) of class LineSensorsCalibrationState is not documented. +C:/Users/jkerpe/MasterArbeit/10_Code/Launcher/RadonUlzer/lib/APPSensorFusion/LineSensorsCalibrationState.h:135: error: Member operator=(const LineSensorsCalibrationState &state) (function) of class LineSensorsCalibrationState is not documented. +C:/Users/jkerpe/MasterArbeit/10_Code/Launcher/RadonUlzer/lib/APPSensorFusion/MotorSpeedCalibrationState.h:140: error: Member MotorSpeedCalibrationState(const MotorSpeedCalibrationState &state) (function) of class MotorSpeedCalibrationState is not documented. +C:/Users/jkerpe/MasterArbeit/10_Code/Launcher/RadonUlzer/lib/APPSensorFusion/MotorSpeedCalibrationState.h:141: error: Member operator=(const MotorSpeedCalibrationState &state) (function) of class MotorSpeedCalibrationState is not documented. +C:/Users/jkerpe/MasterArbeit/10_Code/Launcher/RadonUlzer/lib/APPSensorFusion/ParameterSets.h:135: error: Member ParameterSets(const ParameterSets &set) (function) of class ParameterSets is not documented. +C:/Users/jkerpe/MasterArbeit/10_Code/Launcher/RadonUlzer/lib/APPSensorFusion/ParameterSets.h:136: error: Member operator=(const ParameterSets &set) (function) of class ParameterSets is not documented. +C:/Users/jkerpe/MasterArbeit/10_Code/Launcher/RadonUlzer/lib/APPSensorFusion/ReadyState.h:119: error: Member ReadyState(const ReadyState &state) (function) of class ReadyState is not documented. +C:/Users/jkerpe/MasterArbeit/10_Code/Launcher/RadonUlzer/lib/APPSensorFusion/ReadyState.h:120: error: Member operator=(const ReadyState &state) (function) of class ReadyState is not documented. +C:/Users/jkerpe/MasterArbeit/10_Code/Launcher/RadonUlzer/lib/APPSensorFusion/ReleaseTrackState.h:114: error: Member ReleaseTrackState(const ReleaseTrackState &state) (function) of class ReleaseTrackState is not documented. +C:/Users/jkerpe/MasterArbeit/10_Code/Launcher/RadonUlzer/lib/APPSensorFusion/ReleaseTrackState.h:115: error: Member operator=(const ReleaseTrackState &state) (function) of class ReleaseTrackState is not documented. +C:/Users/jkerpe/MasterArbeit/10_Code/Launcher/RadonUlzer/lib/APPSensorFusion/StartupState.h:113: error: Member StartupState(const StartupState &state) (function) of class StartupState is not documented. +C:/Users/jkerpe/MasterArbeit/10_Code/Launcher/RadonUlzer/lib/APPSensorFusion/StartupState.h:114: error: Member operator=(const StartupState &state) (function) of class StartupState is not documented. diff --git a/lib/AppSensorFusion/DrivingState.cpp b/lib/AppSensorFusion/DrivingState.cpp index 973bc419..a3db9d40 100644 --- a/lib/AppSensorFusion/DrivingState.cpp +++ b/lib/AppSensorFusion/DrivingState.cpp @@ -25,7 +25,7 @@ DESCRIPTION *******************************************************************************/ /** - * @brief Calibration state + * @brief Driving state * @author Andreas Merkle */ diff --git a/lib/AppSensorFusion/ErrorState.cpp b/lib/AppSensorFusion/ErrorState.cpp index 3e66bb48..65c15a46 100644 --- a/lib/AppSensorFusion/ErrorState.cpp +++ b/lib/AppSensorFusion/ErrorState.cpp @@ -63,12 +63,7 @@ void ErrorState::entry() { - IDisplay& display = Board::getInstance().getDisplay(); - - display.clear(); - display.print("Error"); - display.gotoXY(0, 1); - display.print(m_errorMsg); + /* Nothing to do. */ } void ErrorState::process(StateMachine& sm) diff --git a/lib/AppSensorFusion/LineSensorsCalibrationState.cpp b/lib/AppSensorFusion/LineSensorsCalibrationState.cpp index 87e80493..98929398 100644 --- a/lib/AppSensorFusion/LineSensorsCalibrationState.cpp +++ b/lib/AppSensorFusion/LineSensorsCalibrationState.cpp @@ -67,15 +67,9 @@ void LineSensorsCalibrationState::entry() { - IDisplay& display = Board::getInstance().getDisplay(); DifferentialDrive& diffDrive = DifferentialDrive::getInstance(); Odometry& odometry = Odometry::getInstance(); - display.clear(); - display.print("Calib"); - display.gotoXY(0, 1); - display.print("LineS"); - /* Prepare calibration drive. */ m_calibrationSpeed = diffDrive.getMaxMotorSpeed() / 3; m_orientation = odometry.getOrientation(); diff --git a/lib/AppSensorFusion/MotorSpeedCalibrationState.cpp b/lib/AppSensorFusion/MotorSpeedCalibrationState.cpp index 6ca5b441..c6b98e26 100644 --- a/lib/AppSensorFusion/MotorSpeedCalibrationState.cpp +++ b/lib/AppSensorFusion/MotorSpeedCalibrationState.cpp @@ -73,13 +73,6 @@ static const char* TAG = "MSCState"; void MotorSpeedCalibrationState::entry() { - IDisplay& display = Board::getInstance().getDisplay(); - - display.clear(); - display.print("Calib"); - display.gotoXY(0, 1); - display.print("MSpeed"); - /* Setup relative encoders */ m_relEncoders.clear(); diff --git a/lib/AppSensorFusion/ReadyState.cpp b/lib/AppSensorFusion/ReadyState.cpp index 1c1d8057..20506fd7 100644 --- a/lib/AppSensorFusion/ReadyState.cpp +++ b/lib/AppSensorFusion/ReadyState.cpp @@ -70,18 +70,8 @@ static const char* TAG = "RState"; void ReadyState::entry() { - IDisplay& display = Board::getInstance().getDisplay(); const int32_t SENSOR_VALUE_OUT_PERIOD = 1000; /* ms */ - display.clear(); - display.print("Rdy."); - - if (true == m_isLapTimeAvailable) - { - display.gotoXY(0, 1); - display.print(m_lapTime); - } - /* The line sensor value shall be output on console cyclic. */ m_timer.start(SENSOR_VALUE_OUT_PERIOD); } diff --git a/lib/AppSensorFusion/ReleaseTrackState.cpp b/lib/AppSensorFusion/ReleaseTrackState.cpp index 9e9592ae..03c488db 100644 --- a/lib/AppSensorFusion/ReleaseTrackState.cpp +++ b/lib/AppSensorFusion/ReleaseTrackState.cpp @@ -109,15 +109,7 @@ void ReleaseTrackState::exit() void ReleaseTrackState::showParSet() const { - IDisplay& display = Board::getInstance().getDisplay(); - uint8_t parSetId = ParameterSets::getInstance().getCurrentSetId(); - const char* parSetName = ParameterSets::getInstance().getParameterSet().name; - - display.clear(); - display.print("Set "); - display.print(parSetId); - display.gotoXY(0, 1); - display.print(parSetName); + /* Nothing to do. */ } /****************************************************************************** diff --git a/lib/AppSensorFusion/StartupState.cpp b/lib/AppSensorFusion/StartupState.cpp index 2912110f..25ee2a57 100644 --- a/lib/AppSensorFusion/StartupState.cpp +++ b/lib/AppSensorFusion/StartupState.cpp @@ -64,26 +64,8 @@ void StartupState::entry() { - IDisplay& display = Board::getInstance().getDisplay(); - /* Initialize HAL */ Board::getInstance().init(); - - /* Surprise the audience. */ - Sound::playStartup(); - - /* Show team id / team name */ - display.clear(); - display.print(TEAM_NAME_LINE_1); - display.gotoXY(0, 1); - display.print(TEAM_NAME_LINE_2); - delay(TEAM_NAME_DURATION); - - /* Show operator info on LCD */ - display.clear(); - display.print("Press A"); - display.gotoXY(0, 1); - display.print("to calib"); } void StartupState::process(StateMachine& sm) diff --git a/lib/HALConvoyLeaderSim/Board.cpp b/lib/HALConvoyLeaderSim/Board.cpp index 25791f05..d4a1fd84 100644 --- a/lib/HALConvoyLeaderSim/Board.cpp +++ b/lib/HALConvoyLeaderSim/Board.cpp @@ -117,15 +117,6 @@ const char* Board::PROXIMITY_SENSOR_FRONT_LEFT_NAME = "proxim_sensor_fl"; /* Name of the front right proximity sensor in the robot simulation. */ const char* Board::PROXIMITY_SENSOR_FRONT_RIGHT_NAME = "proxim_sensor_fr"; -/* Name of the accelerometer in the robot simulation. */ -const char* Board::ACCELEROMETER_NAME = "accelerometer"; - -/* Name of the gyro in the robot simulation. */ -const char* Board::GYRO_NAME = "gyro"; - -/* Name of the magnetometer in the robot simulation. */ -const char* Board::MAGNETOMETER_NAME = "magnetometer"; - /****************************************************************************** * Protected Methods *****************************************************************************/ @@ -149,4 +140,4 @@ void Board::init() /****************************************************************************** * Local Functions - *****************************************************************************/ + *****************************************************************************/ \ No newline at end of file diff --git a/lib/HALConvoyLeaderSim/Board.h b/lib/HALConvoyLeaderSim/Board.h index a93221f9..33c20b6e 100644 --- a/lib/HALConvoyLeaderSim/Board.h +++ b/lib/HALConvoyLeaderSim/Board.h @@ -43,7 +43,6 @@ * Includes *****************************************************************************/ #include -#include #include #include #include @@ -56,7 +55,6 @@ #include #include #include -#include #include #include @@ -74,7 +72,7 @@ /** * The concrete simulation robot board. */ -class Board : public IBoard +class Board { public: /** @@ -92,14 +90,14 @@ class Board : public IBoard /** * Initialize the hardware. */ - void init() final; + void init(); /** * Get button A driver. * * @return Button A driver. */ - IButton& getButtonA() final + IButton& getButtonA() { return m_buttonA; } @@ -109,7 +107,7 @@ class Board : public IBoard * * @return Button B driver. */ - IButton& getButtonB() final + IButton& getButtonB() { return m_buttonB; } @@ -119,7 +117,7 @@ class Board : public IBoard * * @return Button C driver. */ - IButton& getButtonC() final + IButton& getButtonC() { return m_buttonC; } @@ -129,7 +127,7 @@ class Board : public IBoard * * @return Buzzer driver. */ - IBuzzer& getBuzzer() final + IBuzzer& getBuzzer() { return m_buzzer; } @@ -139,7 +137,7 @@ class Board : public IBoard * * @return LCD driver. */ - IDisplay& getDisplay() final + IDisplay& getDisplay() { return m_display; } @@ -149,7 +147,7 @@ class Board : public IBoard * * @return Encoders driver. */ - IEncoders& getEncoders() final + IEncoders& getEncoders() { return m_encoders; } @@ -159,7 +157,7 @@ class Board : public IBoard * * @return Line sensor driver. */ - ILineSensors& getLineSensors() final + ILineSensors& getLineSensors() { return m_lineSensors; } @@ -169,7 +167,7 @@ class Board : public IBoard * * @return Motor driver. */ - IMotors& getMotors() final + IMotors& getMotors() { return m_motors; } @@ -179,7 +177,7 @@ class Board : public IBoard * * @return Red LED driver. */ - ILed& getRedLed() final + ILed& getRedLed() { return m_ledRed; } @@ -189,7 +187,7 @@ class Board : public IBoard * * @return Yellow LED driver. */ - ILed& getYellowLed() final + ILed& getYellowLed() { return m_ledYellow; } @@ -199,7 +197,7 @@ class Board : public IBoard * * @return Green LED driver. */ - ILed& getGreenLed() final + ILed& getGreenLed() { return m_ledGreen; } @@ -209,21 +207,11 @@ class Board : public IBoard * * @return Proximity sensors driver */ - IProximitySensors& getProximitySensors() final + IProximitySensors& getProximitySensors() { return m_proximitySensors; } - /** - * Get IMU (Inertial Measurement Unit) driver. - * - * @return IMU driver - */ - IIMU& getIMU() final - { - return m_imu; - } - protected: private: /** Name of the speaker in the robot simulation. */ @@ -289,15 +277,6 @@ class Board : public IBoard /** Name of the front right proximity sensor in the robot simulation. */ static const char* PROXIMITY_SENSOR_FRONT_RIGHT_NAME; - /** Name of the accelerometer in the robot simulation. */ - static const char* ACCELEROMETER_NAME; - - /** Name of the gyro in the robot simulation. */ - static const char* GYRO_NAME; - - /** Name of the Magnetometer in the robot simulation. */ - static const char* MAGNETOMETER_NAME; - /** Simulated roboter instance. */ webots::Robot m_robot; @@ -334,23 +313,19 @@ class Board : public IBoard /** Red LED driver */ LedRed m_ledRed; - /** Red LED driver */ + /** Yellow LED driver */ LedYellow m_ledYellow; - /** Red LED driver */ + /** Green LED driver */ LedGreen m_ledGreen; /** Proximity sensors */ ProximitySensors m_proximitySensors; - /** IMU driver */ - IMU m_imu; - /** * Constructs the concrete board. */ Board() : - IBoard(), m_robot(), m_simTime(m_robot), m_keyboard(m_simTime, m_robot.getKeyboard()), @@ -371,9 +346,7 @@ class Board : public IBoard m_ledYellow(m_robot.getLED(LED_YELLOW_NAME)), m_ledGreen(m_robot.getLED(LED_GREEN_NAME)), m_proximitySensors(m_simTime, m_robot.getDistanceSensor(PROXIMITY_SENSOR_FRONT_LEFT_NAME), - m_robot.getDistanceSensor(PROXIMITY_SENSOR_FRONT_RIGHT_NAME)), - m_imu(m_simTime, m_robot.getAccelerometer(ACCELEROMETER_NAME), m_robot.getGyro(GYRO_NAME), - m_robot.getCompass(MAGNETOMETER_NAME)) + m_robot.getDistanceSensor(PROXIMITY_SENSOR_FRONT_RIGHT_NAME)) { } @@ -422,4 +395,4 @@ class Board : public IBoard *****************************************************************************/ #endif /* BOARD_H */ -/** @} */ +/** @} */ \ No newline at end of file diff --git a/lib/HALConvoyLeaderTarget/Board.cpp b/lib/HALConvoyLeaderTarget/Board.cpp index ed9c3c8f..e900fbf9 100644 --- a/lib/HALConvoyLeaderTarget/Board.cpp +++ b/lib/HALConvoyLeaderTarget/Board.cpp @@ -76,13 +76,8 @@ void Board::init() m_lineSensors.init(); m_motors.init(); m_proximitySensors.initFrontSensor(); - /* TODO: TD084 React if IMU initialization fails */ - (void)m_imu.init(); - m_imu.enableDefault(); - m_imu.configureForTurnSensing(); - m_imu.calibrate(); } /****************************************************************************** * Local Functions - *****************************************************************************/ + *****************************************************************************/ \ No newline at end of file diff --git a/lib/HALConvoyLeaderTarget/Board.h b/lib/HALConvoyLeaderTarget/Board.h index 5f2ed0ba..15c457af 100644 --- a/lib/HALConvoyLeaderTarget/Board.h +++ b/lib/HALConvoyLeaderTarget/Board.h @@ -27,7 +27,7 @@ /** * @brief The physical robot board realization. * @author Andreas Merkle - * + * * @addtogroup HALTarget * * @{ @@ -43,7 +43,6 @@ * Includes *****************************************************************************/ #include -#include #include #include #include @@ -56,7 +55,6 @@ #include #include #include -#include /****************************************************************************** * Macros @@ -69,12 +67,13 @@ /** * The concrete physical board. */ -class Board : public IBoard +class Board { public: + /** * Get board instance. - * + * * @return Board instance */ static Board& getInstance() @@ -87,14 +86,14 @@ class Board : public IBoard /** * Initialize the hardware. */ - void init() final; + void init(); /** * Get button A driver. * * @return Button A driver. */ - IButton& getButtonA() final + IButton& getButtonA() { return m_buttonA; } @@ -104,7 +103,7 @@ class Board : public IBoard * * @return Button B driver. */ - IButton& getButtonB() final + IButton& getButtonB() { return m_buttonB; } @@ -114,7 +113,7 @@ class Board : public IBoard * * @return Button C driver. */ - IButton& getButtonC() final + IButton& getButtonC() { return m_buttonC; } @@ -124,7 +123,7 @@ class Board : public IBoard * * @return Buzzer driver. */ - IBuzzer& getBuzzer() final + IBuzzer& getBuzzer() { return m_buzzer; } @@ -134,7 +133,7 @@ class Board : public IBoard * * @return LCD driver. */ - IDisplay& getDisplay() final + IDisplay& getDisplay() { return m_display; } @@ -144,7 +143,7 @@ class Board : public IBoard * * @return Encoders driver. */ - IEncoders& getEncoders() final + IEncoders& getEncoders() { return m_encoders; } @@ -154,7 +153,7 @@ class Board : public IBoard * * @return Line sensor driver. */ - ILineSensors& getLineSensors() final + ILineSensors& getLineSensors() { return m_lineSensors; } @@ -164,7 +163,7 @@ class Board : public IBoard * * @return Motor driver. */ - IMotors& getMotors() final + IMotors& getMotors() { return m_motors; } @@ -174,7 +173,7 @@ class Board : public IBoard * * @return Red LED driver. */ - ILed& getRedLed() final + ILed& getRedLed() { return m_ledRed; } @@ -184,7 +183,7 @@ class Board : public IBoard * * @return Yellow LED driver. */ - ILed& getYellowLed() final + ILed& getYellowLed() { return m_ledYellow; } @@ -194,33 +193,25 @@ class Board : public IBoard * * @return Green LED driver. */ - ILed& getGreenLed() final + ILed& getGreenLed() { return m_ledGreen; } /** * Get proximity sensors driver. - * + * * @return Proximity sensors driver */ - IProximitySensors& getProximitySensors() final + IProximitySensors& getProximitySensors() { return m_proximitySensors; } - /** - * Get IMU (Inertial Measurement Unit) driver. - * - * @return IMU driver - */ - IIMU& getIMU() final - { - return m_imu; - } - protected: + private: + /** Button A driver */ ButtonA m_buttonA; @@ -248,23 +239,19 @@ class Board : public IBoard /** Red LED driver */ LedRed m_ledRed; - /** Red LED driver */ + /** Yellow LED driver */ LedYellow m_ledYellow; - /** Red LED driver */ + /** Green LED driver */ LedGreen m_ledGreen; /** Proximity sensors */ ProximitySensors m_proximitySensors; - /** IMU Driver (Dummy Driver for the Convoy Leader Application) */ - ConvoyLeaderIMU m_imu; - /** * Constructs the concrete board. */ Board() : - IBoard(), m_buttonA(), m_buttonB(), m_buttonC(), @@ -276,8 +263,7 @@ class Board : public IBoard m_ledRed(), m_ledYellow(), m_ledGreen(), - m_proximitySensors(), - m_imu() + m_proximitySensors() { } @@ -287,6 +273,7 @@ class Board : public IBoard ~Board() { } + }; /****************************************************************************** @@ -294,4 +281,4 @@ class Board : public IBoard *****************************************************************************/ #endif /* BOARD_H */ -/** @} */ +/** @} */ \ No newline at end of file diff --git a/lib/HALConvoyLeaderTarget/ConvoyLeaderIMU.cpp b/lib/HALConvoyLeaderTarget/ConvoyLeaderIMU.cpp deleted file mode 100644 index 4c461e09..00000000 --- a/lib/HALConvoyLeaderTarget/ConvoyLeaderIMU.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* MIT License - * - * Copyright (c) 2023 Andreas Merkle - * - * 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 IMU implementation for ConvoyLeader Application - * @author Juliane Kerpe - */ - -/****************************************************************************** - * Includes - *****************************************************************************/ -#include "ConvoyLeaderIMU.h" -/****************************************************************************** - * Compiler Switches - *****************************************************************************/ - -/****************************************************************************** - * Macros - *****************************************************************************/ - -/****************************************************************************** - * Types and classes - *****************************************************************************/ - -/****************************************************************************** - * Prototypes - *****************************************************************************/ - -/****************************************************************************** - * Local Variables - *****************************************************************************/ - -/****************************************************************************** - * Public Methods - *****************************************************************************/ - -/****************************************************************************** - * Protected Methods - *****************************************************************************/ - -/****************************************************************************** - * Private Methods - *****************************************************************************/ - -/****************************************************************************** - * External Functions - *****************************************************************************/ - -/****************************************************************************** - * Local Functions - *****************************************************************************/ diff --git a/lib/HALConvoyLeaderTarget/ConvoyLeaderIMU.h b/lib/HALConvoyLeaderTarget/ConvoyLeaderIMU.h deleted file mode 100644 index 7f90fae8..00000000 --- a/lib/HALConvoyLeaderTarget/ConvoyLeaderIMU.h +++ /dev/null @@ -1,190 +0,0 @@ -/* MIT License - * - * Copyright (c) 2023 Andreas Merkle - * - * 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 IMU (Inertial Measurement Unit) realization for ConvoyLeader Application - * @author Juliane Kerpe - * - * @addtogroup HALTarget - * - * @{ - */ - -#ifndef CONVOYLEADERIMU_H -#define CONVOYLEADERIMU_H - -/****************************************************************************** - * Compile Switches - *****************************************************************************/ - -/****************************************************************************** - * 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. - */ -class ConvoyLeaderIMU : public IIMU -{ -public: - /** - * Destroys the adapter. - */ - ~ConvoyLeaderIMU() - { - } - - /** - * Initializes the inertial sensors and detects their type. - * - * @return True if the sensor type was detected succesfully; false otherwise. - */ - bool init() - { - return true; - } - - /** - * Enables all of the inertial sensors with a default configuration. - */ - void enableDefault(){}; - - /** - * Configures the sensors with settings optimized for turn sensing. - */ - void configureForTurnSensing() - { - } - - /** - * Takes a reading from the accelerometer and makes the measurements available in a. - */ - void readAccelerometer() - { - } - - /** - * Takes a reading from the gyro and makes the measurements available in g. - */ - void readGyro() - { - } - - /** - * Takes a reading from the magnetometer and makes the measurements available in m. - */ - void readMagnetometer() - { - } - - /** - * Indicates whether the accelerometer has new measurement data ready. - * - * @return True if there is new accelerometer data available; false otherwise. - */ - 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; - } - - /** - * Indicates whether the magnetometer has new measurement data ready. - * - * @return True if there is new magnetometer data available; false otherwise. - */ - bool magnetometerDataReady() - { - return true; - } - - /** - * Get last raw Accelerometer values as an IMUData struct containing values in x, y and z in digits. - * - * @param[in] accelerationValues Pointer to IMUData struct where the raw acceleration values in digits 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/digit. - */ - const void getAccelerationValues(IMUData* accelerationValues) - { - } - - /** - * 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 - * with a sensitivity factor in mrad/s/digit. - */ - const void getTurnRates(IMUData* turnRates) - { - } - - /** - * Get last raw Magnetometer values as an IMUData struct containing values in x, y and z in digits. - * - * @param[in] magnetometerValues Pointer to IMUData struct where the raw magnetometer values in digits 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/digit. - */ - const void getMagnetometerValues(IMUData* magnetometerValues) - { - } - - /** - * Calibrate the IMU. - */ - virtual void calibrate() - { - } - -private: -}; - -/****************************************************************************** - * Functions - *****************************************************************************/ - -#endif /* CONVOYLEADERIMU_H */ -/** @} */ diff --git a/lib/HALInterfaces/IBoard.h b/lib/HALInterfaces/IBoard.h deleted file mode 100644 index cba94803..00000000 --- a/lib/HALInterfaces/IBoard.h +++ /dev/null @@ -1,194 +0,0 @@ -/* MIT License - * - * Copyright (c) 2023 Andreas Merkle - * - * 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 Board interface, which abstracts the physical board - * @author Andreas Merkle - * - * @addtogroup HALInterfaces - * - * @{ - */ - -#ifndef IBOARD_H -#define IBOARD_H - -/****************************************************************************** - * Compile Switches - *****************************************************************************/ - -/****************************************************************************** - * Includes - *****************************************************************************/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/****************************************************************************** - * Macros - *****************************************************************************/ - -/****************************************************************************** - * Types and Classes - *****************************************************************************/ - -/** - * Abstracts the physical board interface. - */ -class IBoard -{ -public: - - /** - * Destroys the board interface. - */ - virtual ~IBoard() - { - } - - /** - * Initialize the hardware. - */ - virtual void init() = 0; - - /** - * Get button A driver. - * - * @return Button A driver. - */ - virtual IButton& getButtonA() = 0; - - /** - * Get button B driver. - * - * @return Button B driver. - */ - virtual IButton& getButtonB() = 0; - - /** - * Get button C driver. - * - * @return Button C driver. - */ - virtual IButton& getButtonC() = 0; - - /** - * Get buzzer driver. - * - * @return Buzzer driver. - */ - virtual IBuzzer& getBuzzer() = 0; - - /** - * Get LCD driver. - * - * @return LCD driver. - */ - virtual IDisplay& getDisplay() = 0; - - /** - * Get encoders driver. - * - * @return Encoders driver. - */ - virtual IEncoders& getEncoders() = 0; - - /** - * Get line sensors driver. - * - * @return Line sensor driver. - */ - virtual ILineSensors& getLineSensors() = 0; - - /** - * Get motor driver. - * - * @return Motor driver. - */ - virtual IMotors& getMotors() = 0; - - /** - * Get red LED driver. - * - * @return Red LED driver. - */ - virtual ILed& getRedLed() = 0; - - /** - * Get yellow LED driver. - * - * @return Yellow LED driver. - */ - virtual ILed& getYellowLed() = 0; - - /** - * Get green LED driver. - * - * @return Green LED driver. - */ - virtual ILed& getGreenLed() = 0; - - /** - * Get proximity sensors driver. - * - * @return Proximity sensors driver - */ - virtual IProximitySensors& getProximitySensors() = 0; - - - /** - * Get IMU (Inertial Measurement Unit) driver. - * - * @return IMU driver - */ - virtual IIMU& getIMU() = 0; - -protected: - - /** - * Constructs the board interface. - */ - IBoard() - { - } - -private: - -}; - -/****************************************************************************** - * Functions - *****************************************************************************/ - -#endif /* IBOARD_H */ -/** @} */ \ No newline at end of file diff --git a/lib/HALLineFollowerSim/Board.cpp b/lib/HALLineFollowerSim/Board.cpp index dca7eb17..d4a1fd84 100644 --- a/lib/HALLineFollowerSim/Board.cpp +++ b/lib/HALLineFollowerSim/Board.cpp @@ -117,15 +117,6 @@ const char* Board::PROXIMITY_SENSOR_FRONT_LEFT_NAME = "proxim_sensor_fl"; /* Name of the front right proximity sensor in the robot simulation. */ const char* Board::PROXIMITY_SENSOR_FRONT_RIGHT_NAME = "proxim_sensor_fr"; -/* Name of the accelerometer in the robot simulation. */ -const char* Board::ACCELEROMETER_NAME = "accelerometer"; - -/* Name of the gyro in the robot simulation. */ -const char* Board::GYRO_NAME = "gyro"; - -/* Name of the magnetometer in the robot simulation. */ -const char* Board::MAGNETOMETER_NAME = "magnetometer"; - /****************************************************************************** * Protected Methods *****************************************************************************/ @@ -144,13 +135,9 @@ void Board::init() m_keyboard.init(); m_lineSensors.init(); m_motors.init(); - /* TODO: TD084 React if IMU initialization fails */ - (void)m_imu.init(); - m_imu.enableDefault(); - m_imu.configureForTurnSensing(); - m_imu.calibrate(); + m_proximitySensors.initFrontSensor(); } /****************************************************************************** * Local Functions - *****************************************************************************/ + *****************************************************************************/ \ No newline at end of file diff --git a/lib/HALLineFollowerSim/Board.h b/lib/HALLineFollowerSim/Board.h index a93221f9..33c20b6e 100644 --- a/lib/HALLineFollowerSim/Board.h +++ b/lib/HALLineFollowerSim/Board.h @@ -43,7 +43,6 @@ * Includes *****************************************************************************/ #include -#include #include #include #include @@ -56,7 +55,6 @@ #include #include #include -#include #include #include @@ -74,7 +72,7 @@ /** * The concrete simulation robot board. */ -class Board : public IBoard +class Board { public: /** @@ -92,14 +90,14 @@ class Board : public IBoard /** * Initialize the hardware. */ - void init() final; + void init(); /** * Get button A driver. * * @return Button A driver. */ - IButton& getButtonA() final + IButton& getButtonA() { return m_buttonA; } @@ -109,7 +107,7 @@ class Board : public IBoard * * @return Button B driver. */ - IButton& getButtonB() final + IButton& getButtonB() { return m_buttonB; } @@ -119,7 +117,7 @@ class Board : public IBoard * * @return Button C driver. */ - IButton& getButtonC() final + IButton& getButtonC() { return m_buttonC; } @@ -129,7 +127,7 @@ class Board : public IBoard * * @return Buzzer driver. */ - IBuzzer& getBuzzer() final + IBuzzer& getBuzzer() { return m_buzzer; } @@ -139,7 +137,7 @@ class Board : public IBoard * * @return LCD driver. */ - IDisplay& getDisplay() final + IDisplay& getDisplay() { return m_display; } @@ -149,7 +147,7 @@ class Board : public IBoard * * @return Encoders driver. */ - IEncoders& getEncoders() final + IEncoders& getEncoders() { return m_encoders; } @@ -159,7 +157,7 @@ class Board : public IBoard * * @return Line sensor driver. */ - ILineSensors& getLineSensors() final + ILineSensors& getLineSensors() { return m_lineSensors; } @@ -169,7 +167,7 @@ class Board : public IBoard * * @return Motor driver. */ - IMotors& getMotors() final + IMotors& getMotors() { return m_motors; } @@ -179,7 +177,7 @@ class Board : public IBoard * * @return Red LED driver. */ - ILed& getRedLed() final + ILed& getRedLed() { return m_ledRed; } @@ -189,7 +187,7 @@ class Board : public IBoard * * @return Yellow LED driver. */ - ILed& getYellowLed() final + ILed& getYellowLed() { return m_ledYellow; } @@ -199,7 +197,7 @@ class Board : public IBoard * * @return Green LED driver. */ - ILed& getGreenLed() final + ILed& getGreenLed() { return m_ledGreen; } @@ -209,21 +207,11 @@ class Board : public IBoard * * @return Proximity sensors driver */ - IProximitySensors& getProximitySensors() final + IProximitySensors& getProximitySensors() { return m_proximitySensors; } - /** - * Get IMU (Inertial Measurement Unit) driver. - * - * @return IMU driver - */ - IIMU& getIMU() final - { - return m_imu; - } - protected: private: /** Name of the speaker in the robot simulation. */ @@ -289,15 +277,6 @@ class Board : public IBoard /** Name of the front right proximity sensor in the robot simulation. */ static const char* PROXIMITY_SENSOR_FRONT_RIGHT_NAME; - /** Name of the accelerometer in the robot simulation. */ - static const char* ACCELEROMETER_NAME; - - /** Name of the gyro in the robot simulation. */ - static const char* GYRO_NAME; - - /** Name of the Magnetometer in the robot simulation. */ - static const char* MAGNETOMETER_NAME; - /** Simulated roboter instance. */ webots::Robot m_robot; @@ -334,23 +313,19 @@ class Board : public IBoard /** Red LED driver */ LedRed m_ledRed; - /** Red LED driver */ + /** Yellow LED driver */ LedYellow m_ledYellow; - /** Red LED driver */ + /** Green LED driver */ LedGreen m_ledGreen; /** Proximity sensors */ ProximitySensors m_proximitySensors; - /** IMU driver */ - IMU m_imu; - /** * Constructs the concrete board. */ Board() : - IBoard(), m_robot(), m_simTime(m_robot), m_keyboard(m_simTime, m_robot.getKeyboard()), @@ -371,9 +346,7 @@ class Board : public IBoard m_ledYellow(m_robot.getLED(LED_YELLOW_NAME)), m_ledGreen(m_robot.getLED(LED_GREEN_NAME)), m_proximitySensors(m_simTime, m_robot.getDistanceSensor(PROXIMITY_SENSOR_FRONT_LEFT_NAME), - m_robot.getDistanceSensor(PROXIMITY_SENSOR_FRONT_RIGHT_NAME)), - m_imu(m_simTime, m_robot.getAccelerometer(ACCELEROMETER_NAME), m_robot.getGyro(GYRO_NAME), - m_robot.getCompass(MAGNETOMETER_NAME)) + m_robot.getDistanceSensor(PROXIMITY_SENSOR_FRONT_RIGHT_NAME)) { } @@ -422,4 +395,4 @@ class Board : public IBoard *****************************************************************************/ #endif /* BOARD_H */ -/** @} */ +/** @} */ \ No newline at end of file diff --git a/lib/HALLineFollowerTarget/Board.cpp b/lib/HALLineFollowerTarget/Board.cpp index ed9c3c8f..e900fbf9 100644 --- a/lib/HALLineFollowerTarget/Board.cpp +++ b/lib/HALLineFollowerTarget/Board.cpp @@ -76,13 +76,8 @@ void Board::init() m_lineSensors.init(); m_motors.init(); m_proximitySensors.initFrontSensor(); - /* TODO: TD084 React if IMU initialization fails */ - (void)m_imu.init(); - m_imu.enableDefault(); - m_imu.configureForTurnSensing(); - m_imu.calibrate(); } /****************************************************************************** * Local Functions - *****************************************************************************/ + *****************************************************************************/ \ No newline at end of file diff --git a/lib/HALLineFollowerTarget/Board.h b/lib/HALLineFollowerTarget/Board.h index 0fedf8d3..15c457af 100644 --- a/lib/HALLineFollowerTarget/Board.h +++ b/lib/HALLineFollowerTarget/Board.h @@ -27,7 +27,7 @@ /** * @brief The physical robot board realization. * @author Andreas Merkle - * + * * @addtogroup HALTarget * * @{ @@ -43,7 +43,6 @@ * Includes *****************************************************************************/ #include -#include #include #include #include @@ -56,7 +55,6 @@ #include #include #include -#include /****************************************************************************** * Macros @@ -69,12 +67,13 @@ /** * The concrete physical board. */ -class Board : public IBoard +class Board { public: + /** * Get board instance. - * + * * @return Board instance */ static Board& getInstance() @@ -87,14 +86,14 @@ class Board : public IBoard /** * Initialize the hardware. */ - void init() final; + void init(); /** * Get button A driver. * * @return Button A driver. */ - IButton& getButtonA() final + IButton& getButtonA() { return m_buttonA; } @@ -104,7 +103,7 @@ class Board : public IBoard * * @return Button B driver. */ - IButton& getButtonB() final + IButton& getButtonB() { return m_buttonB; } @@ -114,7 +113,7 @@ class Board : public IBoard * * @return Button C driver. */ - IButton& getButtonC() final + IButton& getButtonC() { return m_buttonC; } @@ -124,7 +123,7 @@ class Board : public IBoard * * @return Buzzer driver. */ - IBuzzer& getBuzzer() final + IBuzzer& getBuzzer() { return m_buzzer; } @@ -134,7 +133,7 @@ class Board : public IBoard * * @return LCD driver. */ - IDisplay& getDisplay() final + IDisplay& getDisplay() { return m_display; } @@ -144,7 +143,7 @@ class Board : public IBoard * * @return Encoders driver. */ - IEncoders& getEncoders() final + IEncoders& getEncoders() { return m_encoders; } @@ -154,7 +153,7 @@ class Board : public IBoard * * @return Line sensor driver. */ - ILineSensors& getLineSensors() final + ILineSensors& getLineSensors() { return m_lineSensors; } @@ -164,7 +163,7 @@ class Board : public IBoard * * @return Motor driver. */ - IMotors& getMotors() final + IMotors& getMotors() { return m_motors; } @@ -174,7 +173,7 @@ class Board : public IBoard * * @return Red LED driver. */ - ILed& getRedLed() final + ILed& getRedLed() { return m_ledRed; } @@ -184,7 +183,7 @@ class Board : public IBoard * * @return Yellow LED driver. */ - ILed& getYellowLed() final + ILed& getYellowLed() { return m_ledYellow; } @@ -194,33 +193,25 @@ class Board : public IBoard * * @return Green LED driver. */ - ILed& getGreenLed() final + ILed& getGreenLed() { return m_ledGreen; } /** * Get proximity sensors driver. - * + * * @return Proximity sensors driver */ - IProximitySensors& getProximitySensors() final + IProximitySensors& getProximitySensors() { return m_proximitySensors; } - /** - * Get IMU (Inertial Measurement Unit) driver. - * - * @return IMU driver - */ - IIMU& getIMU() final - { - return m_imu; - } - protected: + private: + /** Button A driver */ ButtonA m_buttonA; @@ -248,23 +239,19 @@ class Board : public IBoard /** Red LED driver */ LedRed m_ledRed; - /** Red LED driver */ + /** Yellow LED driver */ LedYellow m_ledYellow; - /** Red LED driver */ + /** Green LED driver */ LedGreen m_ledGreen; /** Proximity sensors */ ProximitySensors m_proximitySensors; - /** IMU Driver (Dummy Driver for the LineFollower Application) */ - LineFollowerIMU m_imu; - /** * Constructs the concrete board. */ Board() : - IBoard(), m_buttonA(), m_buttonB(), m_buttonC(), @@ -276,8 +263,7 @@ class Board : public IBoard m_ledRed(), m_ledYellow(), m_ledGreen(), - m_proximitySensors(), - m_imu() + m_proximitySensors() { } @@ -287,6 +273,7 @@ class Board : public IBoard ~Board() { } + }; /****************************************************************************** @@ -294,4 +281,4 @@ class Board : public IBoard *****************************************************************************/ #endif /* BOARD_H */ -/** @} */ +/** @} */ \ No newline at end of file diff --git a/lib/HALLineFollowerTarget/LineFollowerIMU.cpp b/lib/HALLineFollowerTarget/LineFollowerIMU.cpp deleted file mode 100644 index f8038cff..00000000 --- a/lib/HALLineFollowerTarget/LineFollowerIMU.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* MIT License - * - * Copyright (c) 2023 Andreas Merkle - * - * 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 IMU implementation for LineFollower Application - * @author Juliane Kerpe - */ - -/****************************************************************************** - * Includes - *****************************************************************************/ -#include "LineFollowerIMU.h" -/****************************************************************************** - * Compiler Switches - *****************************************************************************/ - -/****************************************************************************** - * Macros - *****************************************************************************/ - -/****************************************************************************** - * Types and classes - *****************************************************************************/ - -/****************************************************************************** - * Prototypes - *****************************************************************************/ - -/****************************************************************************** - * Local Variables - *****************************************************************************/ - -/****************************************************************************** - * Public Methods - *****************************************************************************/ - -/****************************************************************************** - * Protected Methods - *****************************************************************************/ - -/****************************************************************************** - * Private Methods - *****************************************************************************/ - -/****************************************************************************** - * External Functions - *****************************************************************************/ - -/****************************************************************************** - * Local Functions - *****************************************************************************/ diff --git a/lib/HALLineFollowerTarget/LineFollowerIMU.h b/lib/HALLineFollowerTarget/LineFollowerIMU.h deleted file mode 100644 index 843da792..00000000 --- a/lib/HALLineFollowerTarget/LineFollowerIMU.h +++ /dev/null @@ -1,190 +0,0 @@ -/* MIT License - * - * Copyright (c) 2023 Andreas Merkle - * - * 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 IMU (Inertial Measurement Unit) realization for LineFollower Application - * @author Juliane Kerpe - * - * @addtogroup HALTarget - * - * @{ - */ - -#ifndef LINEFOLLOWERIMU_H -#define LINEFOLLOWERIMU_H - -/****************************************************************************** - * Compile Switches - *****************************************************************************/ - -/****************************************************************************** - * 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. - */ -class LineFollowerIMU : public IIMU -{ -public: - /** - * Destroys the adapter. - */ - ~LineFollowerIMU() - { - } - - /** - * Initializes the inertial sensors and detects their type. - * - * @return True if the sensor type was detected succesfully; false otherwise. - */ - bool init() - { - return true; - } - - /** - * Enables all of the inertial sensors with a default configuration. - */ - void enableDefault(){}; - - /** - * Configures the sensors with settings optimized for turn sensing. - */ - void configureForTurnSensing() - { - } - - /** - * Takes a reading from the accelerometer and makes the measurements available in a. - */ - void readAccelerometer() - { - } - - /** - * Takes a reading from the gyro and makes the measurements available in g. - */ - void readGyro() - { - } - - /** - * Takes a reading from the magnetometer and makes the measurements available in m. - */ - void readMagnetometer() - { - } - - /** - * Indicates whether the accelerometer has new measurement data ready. - * - * @return True if there is new accelerometer data available; false otherwise. - */ - 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; - } - - /** - * Indicates whether the magnetometer has new measurement data ready. - * - * @return True if there is new magnetometer data available; false otherwise. - */ - bool magnetometerDataReady() - { - return true; - } - - /** - * Get last raw Accelerometer values as an IMUData struct containing values in x, y and z in digits. - * - * @param[in] accelerationValues Pointer to IMUData struct where the raw acceleration values in digits 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/digit. - */ - const void getAccelerationValues(IMUData* accelerationValues) - { - } - - /** - * 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 - * with a sensitivity factor in mrad/s/digit. - */ - const void getTurnRates(IMUData* turnRates) - { - } - - /** - * Get last raw Magnetometer values as an IMUData struct containing values in x, y and z in digits. - * - * @param[in] magnetometerValues Pointer to IMUData struct where the raw magnetometer values in digits 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/digit. - */ - const void getMagnetometerValues(IMUData* magnetometerValues) - { - } - - /** - * Calibrate the IMU. - */ - virtual void calibrate() - { - } - -private: -}; - -/****************************************************************************** - * Functions - *****************************************************************************/ - -#endif /* LINEFOLLOWERIMU_H */ -/** @} */ diff --git a/lib/HALRemoteControlSim/Board.cpp b/lib/HALRemoteControlSim/Board.cpp index 76d0166c..d4a1fd84 100644 --- a/lib/HALRemoteControlSim/Board.cpp +++ b/lib/HALRemoteControlSim/Board.cpp @@ -117,15 +117,6 @@ const char* Board::PROXIMITY_SENSOR_FRONT_LEFT_NAME = "proxim_sensor_fl"; /* Name of the front right proximity sensor in the robot simulation. */ const char* Board::PROXIMITY_SENSOR_FRONT_RIGHT_NAME = "proxim_sensor_fr"; -/* Name of the accelerometer in the robot simulation. */ -const char* Board::ACCELEROMETER_NAME = "accelerometer"; - -/* Name of the gyro in the robot simulation. */ -const char* Board::GYRO_NAME = "gyro"; - -/* Name of the magnetometer in the robot simulation. */ -const char* Board::MAGNETOMETER_NAME = "magnetometer"; - /****************************************************************************** * Protected Methods *****************************************************************************/ @@ -145,13 +136,8 @@ void Board::init() m_lineSensors.init(); m_motors.init(); m_proximitySensors.initFrontSensor(); - /* TODO: TD084 React if IMU initialization fails */ - (void)m_imu.init(); - m_imu.enableDefault(); - m_imu.configureForTurnSensing(); - m_imu.calibrate(); } /****************************************************************************** * Local Functions - *****************************************************************************/ + *****************************************************************************/ \ No newline at end of file diff --git a/lib/HALRemoteControlSim/Board.h b/lib/HALRemoteControlSim/Board.h index a93221f9..33c20b6e 100644 --- a/lib/HALRemoteControlSim/Board.h +++ b/lib/HALRemoteControlSim/Board.h @@ -43,7 +43,6 @@ * Includes *****************************************************************************/ #include -#include #include #include #include @@ -56,7 +55,6 @@ #include #include #include -#include #include #include @@ -74,7 +72,7 @@ /** * The concrete simulation robot board. */ -class Board : public IBoard +class Board { public: /** @@ -92,14 +90,14 @@ class Board : public IBoard /** * Initialize the hardware. */ - void init() final; + void init(); /** * Get button A driver. * * @return Button A driver. */ - IButton& getButtonA() final + IButton& getButtonA() { return m_buttonA; } @@ -109,7 +107,7 @@ class Board : public IBoard * * @return Button B driver. */ - IButton& getButtonB() final + IButton& getButtonB() { return m_buttonB; } @@ -119,7 +117,7 @@ class Board : public IBoard * * @return Button C driver. */ - IButton& getButtonC() final + IButton& getButtonC() { return m_buttonC; } @@ -129,7 +127,7 @@ class Board : public IBoard * * @return Buzzer driver. */ - IBuzzer& getBuzzer() final + IBuzzer& getBuzzer() { return m_buzzer; } @@ -139,7 +137,7 @@ class Board : public IBoard * * @return LCD driver. */ - IDisplay& getDisplay() final + IDisplay& getDisplay() { return m_display; } @@ -149,7 +147,7 @@ class Board : public IBoard * * @return Encoders driver. */ - IEncoders& getEncoders() final + IEncoders& getEncoders() { return m_encoders; } @@ -159,7 +157,7 @@ class Board : public IBoard * * @return Line sensor driver. */ - ILineSensors& getLineSensors() final + ILineSensors& getLineSensors() { return m_lineSensors; } @@ -169,7 +167,7 @@ class Board : public IBoard * * @return Motor driver. */ - IMotors& getMotors() final + IMotors& getMotors() { return m_motors; } @@ -179,7 +177,7 @@ class Board : public IBoard * * @return Red LED driver. */ - ILed& getRedLed() final + ILed& getRedLed() { return m_ledRed; } @@ -189,7 +187,7 @@ class Board : public IBoard * * @return Yellow LED driver. */ - ILed& getYellowLed() final + ILed& getYellowLed() { return m_ledYellow; } @@ -199,7 +197,7 @@ class Board : public IBoard * * @return Green LED driver. */ - ILed& getGreenLed() final + ILed& getGreenLed() { return m_ledGreen; } @@ -209,21 +207,11 @@ class Board : public IBoard * * @return Proximity sensors driver */ - IProximitySensors& getProximitySensors() final + IProximitySensors& getProximitySensors() { return m_proximitySensors; } - /** - * Get IMU (Inertial Measurement Unit) driver. - * - * @return IMU driver - */ - IIMU& getIMU() final - { - return m_imu; - } - protected: private: /** Name of the speaker in the robot simulation. */ @@ -289,15 +277,6 @@ class Board : public IBoard /** Name of the front right proximity sensor in the robot simulation. */ static const char* PROXIMITY_SENSOR_FRONT_RIGHT_NAME; - /** Name of the accelerometer in the robot simulation. */ - static const char* ACCELEROMETER_NAME; - - /** Name of the gyro in the robot simulation. */ - static const char* GYRO_NAME; - - /** Name of the Magnetometer in the robot simulation. */ - static const char* MAGNETOMETER_NAME; - /** Simulated roboter instance. */ webots::Robot m_robot; @@ -334,23 +313,19 @@ class Board : public IBoard /** Red LED driver */ LedRed m_ledRed; - /** Red LED driver */ + /** Yellow LED driver */ LedYellow m_ledYellow; - /** Red LED driver */ + /** Green LED driver */ LedGreen m_ledGreen; /** Proximity sensors */ ProximitySensors m_proximitySensors; - /** IMU driver */ - IMU m_imu; - /** * Constructs the concrete board. */ Board() : - IBoard(), m_robot(), m_simTime(m_robot), m_keyboard(m_simTime, m_robot.getKeyboard()), @@ -371,9 +346,7 @@ class Board : public IBoard m_ledYellow(m_robot.getLED(LED_YELLOW_NAME)), m_ledGreen(m_robot.getLED(LED_GREEN_NAME)), m_proximitySensors(m_simTime, m_robot.getDistanceSensor(PROXIMITY_SENSOR_FRONT_LEFT_NAME), - m_robot.getDistanceSensor(PROXIMITY_SENSOR_FRONT_RIGHT_NAME)), - m_imu(m_simTime, m_robot.getAccelerometer(ACCELEROMETER_NAME), m_robot.getGyro(GYRO_NAME), - m_robot.getCompass(MAGNETOMETER_NAME)) + m_robot.getDistanceSensor(PROXIMITY_SENSOR_FRONT_RIGHT_NAME)) { } @@ -422,4 +395,4 @@ class Board : public IBoard *****************************************************************************/ #endif /* BOARD_H */ -/** @} */ +/** @} */ \ No newline at end of file diff --git a/lib/HALRemoteControlTarget/Board.cpp b/lib/HALRemoteControlTarget/Board.cpp index 8ef95118..e900fbf9 100644 --- a/lib/HALRemoteControlTarget/Board.cpp +++ b/lib/HALRemoteControlTarget/Board.cpp @@ -74,14 +74,10 @@ void Board::init() { m_encoders.init(); m_lineSensors.init(); - /* TODO: TD084 React if IMU initialization fails */ - (void)m_imu.init(); - m_imu.enableDefault(); - m_imu.configureForTurnSensing(); - m_imu.calibrate(); - + m_motors.init(); + m_proximitySensors.initFrontSensor(); } /****************************************************************************** * Local Functions - *****************************************************************************/ + *****************************************************************************/ \ No newline at end of file diff --git a/lib/HALRemoteControlTarget/Board.h b/lib/HALRemoteControlTarget/Board.h index be1fad44..15c457af 100644 --- a/lib/HALRemoteControlTarget/Board.h +++ b/lib/HALRemoteControlTarget/Board.h @@ -27,7 +27,7 @@ /** * @brief The physical robot board realization. * @author Andreas Merkle - * + * * @addtogroup HALTarget * * @{ @@ -43,7 +43,6 @@ * Includes *****************************************************************************/ #include -#include #include #include #include @@ -56,7 +55,6 @@ #include #include #include -#include /****************************************************************************** * Macros @@ -69,12 +67,13 @@ /** * The concrete physical board. */ -class Board : public IBoard +class Board { public: + /** * Get board instance. - * + * * @return Board instance */ static Board& getInstance() @@ -87,14 +86,14 @@ class Board : public IBoard /** * Initialize the hardware. */ - void init() final; + void init(); /** * Get button A driver. * * @return Button A driver. */ - IButton& getButtonA() final + IButton& getButtonA() { return m_buttonA; } @@ -104,7 +103,7 @@ class Board : public IBoard * * @return Button B driver. */ - IButton& getButtonB() final + IButton& getButtonB() { return m_buttonB; } @@ -114,7 +113,7 @@ class Board : public IBoard * * @return Button C driver. */ - IButton& getButtonC() final + IButton& getButtonC() { return m_buttonC; } @@ -124,7 +123,7 @@ class Board : public IBoard * * @return Buzzer driver. */ - IBuzzer& getBuzzer() final + IBuzzer& getBuzzer() { return m_buzzer; } @@ -134,7 +133,7 @@ class Board : public IBoard * * @return LCD driver. */ - IDisplay& getDisplay() final + IDisplay& getDisplay() { return m_display; } @@ -144,7 +143,7 @@ class Board : public IBoard * * @return Encoders driver. */ - IEncoders& getEncoders() final + IEncoders& getEncoders() { return m_encoders; } @@ -154,7 +153,7 @@ class Board : public IBoard * * @return Line sensor driver. */ - ILineSensors& getLineSensors() final + ILineSensors& getLineSensors() { return m_lineSensors; } @@ -164,7 +163,7 @@ class Board : public IBoard * * @return Motor driver. */ - IMotors& getMotors() final + IMotors& getMotors() { return m_motors; } @@ -174,7 +173,7 @@ class Board : public IBoard * * @return Red LED driver. */ - ILed& getRedLed() final + ILed& getRedLed() { return m_ledRed; } @@ -184,7 +183,7 @@ class Board : public IBoard * * @return Yellow LED driver. */ - ILed& getYellowLed() final + ILed& getYellowLed() { return m_ledYellow; } @@ -194,33 +193,25 @@ class Board : public IBoard * * @return Green LED driver. */ - ILed& getGreenLed() final + ILed& getGreenLed() { return m_ledGreen; } /** * Get proximity sensors driver. - * + * * @return Proximity sensors driver */ - IProximitySensors& getProximitySensors() final + IProximitySensors& getProximitySensors() { return m_proximitySensors; } - /** - * Get IMU (Inertial Measurement Unit) driver. - * - * @return IMU driver - */ - IIMU& getIMU() final - { - return m_imu; - } - protected: + private: + /** Button A driver */ ButtonA m_buttonA; @@ -248,23 +239,19 @@ class Board : public IBoard /** Red LED driver */ LedRed m_ledRed; - /** Red LED driver */ + /** Yellow LED driver */ LedYellow m_ledYellow; - /** Red LED driver */ + /** Green LED driver */ LedGreen m_ledGreen; /** Proximity sensors */ ProximitySensors m_proximitySensors; - /** IMU Driver (Dummy Driver for the RemoteControl Application) */ - RemoteControlIMU m_imu; - /** * Constructs the concrete board. */ Board() : - IBoard(), m_buttonA(), m_buttonB(), m_buttonC(), @@ -276,8 +263,7 @@ class Board : public IBoard m_ledRed(), m_ledYellow(), m_ledGreen(), - m_proximitySensors(), - m_imu() + m_proximitySensors() { } @@ -287,6 +273,7 @@ class Board : public IBoard ~Board() { } + }; /****************************************************************************** @@ -294,4 +281,4 @@ class Board : public IBoard *****************************************************************************/ #endif /* BOARD_H */ -/** @} */ +/** @} */ \ No newline at end of file diff --git a/lib/HALRemoteControlTarget/RemoteControlIMU.cpp b/lib/HALRemoteControlTarget/RemoteControlIMU.cpp deleted file mode 100644 index 7c226b49..00000000 --- a/lib/HALRemoteControlTarget/RemoteControlIMU.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* MIT License - * - * Copyright (c) 2023 Andreas Merkle - * - * 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 IMU implementation for RemoteControl Application - * @author Juliane Kerpe - */ - -/****************************************************************************** - * Includes - *****************************************************************************/ -#include "RemoteControlIMU.h" -/****************************************************************************** - * Compiler Switches - *****************************************************************************/ - -/****************************************************************************** - * Macros - *****************************************************************************/ - -/****************************************************************************** - * Types and classes - *****************************************************************************/ - -/****************************************************************************** - * Prototypes - *****************************************************************************/ - -/****************************************************************************** - * Local Variables - *****************************************************************************/ - -/****************************************************************************** - * Public Methods - *****************************************************************************/ - -/****************************************************************************** - * Protected Methods - *****************************************************************************/ - -/****************************************************************************** - * Private Methods - *****************************************************************************/ - -/****************************************************************************** - * External Functions - *****************************************************************************/ - -/****************************************************************************** - * Local Functions - *****************************************************************************/ diff --git a/lib/HALRemoteControlTarget/RemoteControlIMU.h b/lib/HALRemoteControlTarget/RemoteControlIMU.h deleted file mode 100644 index 6680f60f..00000000 --- a/lib/HALRemoteControlTarget/RemoteControlIMU.h +++ /dev/null @@ -1,190 +0,0 @@ -/* MIT License - * - * Copyright (c) 2023 Andreas Merkle - * - * 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 IMU (Inertial Measurement Unit) realization for RemoteControl Application - * @author Juliane Kerpe - * - * @addtogroup HALTarget - * - * @{ - */ - -#ifndef REMOTECONTROLIMU_H -#define REMOTECONTROLIMU_H - -/****************************************************************************** - * Compile Switches - *****************************************************************************/ - -/****************************************************************************** - * 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. - */ -class RemoteControlIMU : public IIMU -{ -public: - /** - * Destroys the adapter. - */ - ~RemoteControlIMU() - { - } - - /** - * Initializes the inertial sensors and detects their type. - * - * @return True if the sensor type was detected succesfully; false otherwise. - */ - bool init() - { - return true; - } - - /** - * Enables all of the inertial sensors with a default configuration. - */ - void enableDefault(){}; - - /** - * Configures the sensors with settings optimized for turn sensing. - */ - void configureForTurnSensing() - { - } - - /** - * Takes a reading from the accelerometer and makes the measurements available in a. - */ - void readAccelerometer() - { - } - - /** - * Takes a reading from the gyro and makes the measurements available in g. - */ - void readGyro() - { - } - - /** - * Takes a reading from the magnetometer and makes the measurements available in m. - */ - void readMagnetometer() - { - } - - /** - * Indicates whether the accelerometer has new measurement data ready. - * - * @return True if there is new accelerometer data available; false otherwise. - */ - 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; - } - - /** - * Indicates whether the magnetometer has new measurement data ready. - * - * @return True if there is new magnetometer data available; false otherwise. - */ - bool magnetometerDataReady() - { - return true; - } - - /** - * Get last raw Accelerometer values as an IMUData struct containing values in x, y and z in digits. - * - * @param[in] accelerationValues Pointer to IMUData struct where the raw acceleration values in digits 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/digit. - */ - const void getAccelerationValues(IMUData* accelerationValues) - { - } - - /** - * 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 - * with a sensitivity factor in mrad/s/digit. - */ - const void getTurnRates(IMUData* turnRates) - { - } - - /** - * Get last raw Magnetometer values as an IMUData struct containing values in x, y and z in digits. - * - * @param[in] magnetometerValues Pointer to IMUData struct where the raw magnetometer values in digits 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/digit. - */ - const void getMagnetometerValues(IMUData* magnetometerValues) - { - } - - /** - * Calibrate the IMU. - */ - virtual void calibrate() - { - } - -private: -}; - -/****************************************************************************** - * Functions - *****************************************************************************/ - -#endif /* REMOTECONTROLIMU_H */ -/** @} */ diff --git a/lib/HALSensorFusionSim/Board.cpp b/lib/HALSensorFusionSim/Board.cpp index 1ce0d595..65586f1a 100644 --- a/lib/HALSensorFusionSim/Board.cpp +++ b/lib/HALSensorFusionSim/Board.cpp @@ -102,20 +102,8 @@ const char* Board::LIGHT_SENSOR_3_NAME = "lightsensor_rm"; /* Name of the light sensor 4 in the robot simulation. */ const char* Board::LIGHT_SENSOR_4_NAME = "lightsensor_r"; -/* Name of the red LED in the robot simulation. */ -const char* Board::LED_RED_NAME = "led_red"; - /* Name of the yellow LED in the robot simulation. */ const char* Board::LED_YELLOW_NAME = "led_yellow"; - -/* Name of the green LED in the robot simulation. */ -const char* Board::LED_GREEN_NAME = "led_green"; - -/* Name of the front left proximity sensor in the robot simulation. */ -const char* Board::PROXIMITY_SENSOR_FRONT_LEFT_NAME = "proxim_sensor_fl"; - -/* Name of the front right proximity sensor in the robot simulation. */ -const char* Board::PROXIMITY_SENSOR_FRONT_RIGHT_NAME = "proxim_sensor_fr"; # /* Name of the accelerometer in the robot simulation. */ const char* Board::ACCELEROMETER_NAME = "accelerometer"; diff --git a/lib/HALSensorFusionSim/Board.h b/lib/HALSensorFusionSim/Board.h index a93221f9..1ce9a9e0 100644 --- a/lib/HALSensorFusionSim/Board.h +++ b/lib/HALSensorFusionSim/Board.h @@ -43,19 +43,12 @@ * Includes *****************************************************************************/ #include -#include #include -#include -#include #include -#include #include #include #include -#include #include -#include -#include #include #include @@ -74,7 +67,7 @@ /** * The concrete simulation robot board. */ -class Board : public IBoard +class Board { public: /** @@ -92,64 +85,34 @@ class Board : public IBoard /** * Initialize the hardware. */ - void init() final; + void init(); /** * Get button A driver. * * @return Button A driver. */ - IButton& getButtonA() final + IButton& getButtonA() { return m_buttonA; } - /** - * Get button B driver. - * - * @return Button B driver. - */ - IButton& getButtonB() final - { - return m_buttonB; - } - - /** - * Get button C driver. - * - * @return Button C driver. - */ - IButton& getButtonC() final - { - return m_buttonC; - } - - /** + /** * Get buzzer driver. * * @return Buzzer driver. */ - IBuzzer& getBuzzer() final + IBuzzer& getBuzzer() { return m_buzzer; } - /** - * Get LCD driver. - * - * @return LCD driver. - */ - IDisplay& getDisplay() final - { - return m_display; - } - /** * Get encoders. * * @return Encoders driver. */ - IEncoders& getEncoders() final + IEncoders& getEncoders() { return m_encoders; } @@ -159,7 +122,7 @@ class Board : public IBoard * * @return Line sensor driver. */ - ILineSensors& getLineSensors() final + ILineSensors& getLineSensors() { return m_lineSensors; } @@ -169,57 +132,27 @@ class Board : public IBoard * * @return Motor driver. */ - IMotors& getMotors() final + IMotors& getMotors() { return m_motors; } - /** - * Get red LED driver. - * - * @return Red LED driver. - */ - ILed& getRedLed() final - { - return m_ledRed; - } - /** * Get yellow LED driver. * * @return Yellow LED driver. */ - ILed& getYellowLed() final + ILed& getYellowLed() { return m_ledYellow; } - /** - * Get green LED driver. - * - * @return Green LED driver. - */ - ILed& getGreenLed() final - { - return m_ledGreen; - } - - /** - * Get proximity sensors driver. - * - * @return Proximity sensors driver - */ - IProximitySensors& getProximitySensors() final - { - return m_proximitySensors; - } - /** * Get IMU (Inertial Measurement Unit) driver. * * @return IMU driver */ - IIMU& getIMU() final + IIMU& getIMU() { return m_imu; } @@ -274,21 +207,9 @@ class Board : public IBoard /** Name of the light sensor 4 in the robot simulation. */ static const char* LIGHT_SENSOR_4_NAME; - /** Name of the red LED in the robot simulation. */ - static const char* LED_RED_NAME; - /** Name of the yellow LED in the robot simulation. */ static const char* LED_YELLOW_NAME; - /** Name of the green LED in the robot simulation. */ - static const char* LED_GREEN_NAME; - - /** Name of the front proximity sensor in the robot simulation. */ - static const char* PROXIMITY_SENSOR_FRONT_LEFT_NAME; - - /** Name of the front right proximity sensor in the robot simulation. */ - static const char* PROXIMITY_SENSOR_FRONT_RIGHT_NAME; - /** Name of the accelerometer in the robot simulation. */ static const char* ACCELEROMETER_NAME; @@ -310,18 +231,9 @@ class Board : public IBoard /** Button A driver */ ButtonA m_buttonA; - /** Button B driver */ - ButtonB m_buttonB; - - /** Button C driver */ - ButtonC m_buttonC; - /** Buzzer driver */ Buzzer m_buzzer; - /** Display driver */ - Display m_display; - /** Encoders driver */ Encoders m_encoders; @@ -331,18 +243,9 @@ class Board : public IBoard /** Motors driver */ Motors m_motors; - /** Red LED driver */ - LedRed m_ledRed; - /** Red LED driver */ LedYellow m_ledYellow; - /** Red LED driver */ - LedGreen m_ledGreen; - - /** Proximity sensors */ - ProximitySensors m_proximitySensors; - /** IMU driver */ IMU m_imu; @@ -350,15 +253,11 @@ class Board : public IBoard * Constructs the concrete board. */ Board() : - IBoard(), m_robot(), m_simTime(m_robot), m_keyboard(m_simTime, m_robot.getKeyboard()), m_buttonA(m_keyboard), - m_buttonB(m_keyboard), - m_buttonC(m_keyboard), m_buzzer(m_robot.getSpeaker(SPEAKER_NAME)), - m_display(m_robot.getDisplay(DISPLAY_NAME)), m_encoders(m_simTime, m_robot.getPositionSensor(POS_SENSOR_LEFT_NAME), m_robot.getPositionSensor(POS_SENSOR_RIGHT_NAME)), m_lineSensors(m_simTime, m_robot.getEmitter(EMITTER_0_NAME), m_robot.getEmitter(EMITTER_1_NAME), @@ -367,11 +266,7 @@ class Board : public IBoard m_robot.getDistanceSensor(LIGHT_SENSOR_1_NAME), m_robot.getDistanceSensor(LIGHT_SENSOR_2_NAME), m_robot.getDistanceSensor(LIGHT_SENSOR_3_NAME), m_robot.getDistanceSensor(LIGHT_SENSOR_4_NAME)), m_motors(m_robot.getMotor(LEFT_MOTOR_NAME), m_robot.getMotor(RIGHT_MOTOR_NAME)), - m_ledRed(m_robot.getLED(LED_RED_NAME)), m_ledYellow(m_robot.getLED(LED_YELLOW_NAME)), - m_ledGreen(m_robot.getLED(LED_GREEN_NAME)), - m_proximitySensors(m_simTime, m_robot.getDistanceSensor(PROXIMITY_SENSOR_FRONT_LEFT_NAME), - m_robot.getDistanceSensor(PROXIMITY_SENSOR_FRONT_RIGHT_NAME)), m_imu(m_simTime, m_robot.getAccelerometer(ACCELEROMETER_NAME), m_robot.getGyro(GYRO_NAME), m_robot.getCompass(MAGNETOMETER_NAME)) { diff --git a/lib/HALSensorFusionTarget/Board.cpp b/lib/HALSensorFusionTarget/Board.cpp index ed9c3c8f..19ce9c3e 100644 --- a/lib/HALSensorFusionTarget/Board.cpp +++ b/lib/HALSensorFusionTarget/Board.cpp @@ -75,7 +75,6 @@ void Board::init() m_encoders.init(); m_lineSensors.init(); m_motors.init(); - m_proximitySensors.initFrontSensor(); /* TODO: TD084 React if IMU initialization fails */ (void)m_imu.init(); m_imu.enableDefault(); diff --git a/lib/HALSensorFusionTarget/Board.h b/lib/HALSensorFusionTarget/Board.h index 4959fdfe..72044227 100644 --- a/lib/HALSensorFusionTarget/Board.h +++ b/lib/HALSensorFusionTarget/Board.h @@ -43,18 +43,13 @@ * Includes *****************************************************************************/ #include -#include #include -#include -#include -#include +#include +#include #include #include #include -#include #include -#include -#include #include /****************************************************************************** @@ -68,7 +63,7 @@ /** * The concrete physical board. */ -class Board : public IBoard +class Board { public: /** @@ -86,64 +81,34 @@ class Board : public IBoard /** * Initialize the hardware. */ - void init() final; + void init(); /** * Get button A driver. * * @return Button A driver. */ - IButton& getButtonA() final + IButton& getButtonA() { return m_buttonA; } - /** - * Get button B driver. - * - * @return Button B driver. - */ - IButton& getButtonB() final - { - return m_buttonB; - } - - /** - * Get button C driver. - * - * @return Button C driver. - */ - IButton& getButtonC() final - { - return m_buttonC; - } - /** * Get buzzer driver. * * @return Buzzer driver. */ - IBuzzer& getBuzzer() final + IBuzzer& getBuzzer() { return m_buzzer; } - /** - * Get LCD driver. - * - * @return LCD driver. - */ - IDisplay& getDisplay() final - { - return m_display; - } - /** * Get encoders. * * @return Encoders driver. */ - IEncoders& getEncoders() final + IEncoders& getEncoders() { return m_encoders; } @@ -153,7 +118,7 @@ class Board : public IBoard * * @return Line sensor driver. */ - ILineSensors& getLineSensors() final + ILineSensors& getLineSensors() { return m_lineSensors; } @@ -163,57 +128,27 @@ class Board : public IBoard * * @return Motor driver. */ - IMotors& getMotors() final + IMotors& getMotors() { return m_motors; } - /** - * Get red LED driver. - * - * @return Red LED driver. - */ - ILed& getRedLed() final - { - return m_ledRed; - } - /** * Get yellow LED driver. * * @return Yellow LED driver. */ - ILed& getYellowLed() final + ILed& getYellowLed() { return m_ledYellow; } - /** - * Get green LED driver. - * - * @return Green LED driver. - */ - ILed& getGreenLed() final - { - return m_ledGreen; - } - - /** - * Get proximity sensors driver. - * - * @return Proximity sensors driver - */ - IProximitySensors& getProximitySensors() final - { - return m_proximitySensors; - } - /** * Get IMU (Inertial Measurement Unit) driver. * * @return IMU driver */ - IIMU& getIMU() final + IIMU& getIMU() { return m_imu; } @@ -223,17 +158,8 @@ class Board : public IBoard /** Button A driver */ ButtonA m_buttonA; - /** Button B driver (Dummy driver only for the Sensor Fusion App) */ - SensorFusionButton m_buttonB; - - /** Button C driver (Dummy driver only for the Sensor Fusion App) */ - SensorFusionButton m_buttonC; - - /** Buzzer driver (Dummy driver only for the Sensor Fusion App) */ - SensorFusionBuzzer m_buzzer; - - /** Display driver (Dummy driver only for the Sensor Fusion App) */ - SensorFusionDisplay m_display; + /** Buzzer driver */ + Buzzer m_buzzer; /** Encoders driver */ Encoders m_encoders; @@ -244,18 +170,9 @@ class Board : public IBoard /** Motors driver */ Motors m_motors; - /** Red LED driver */ - LedRed m_ledRed; - - /** Red LED driver */ + /** Yellow LED driver */ LedYellow m_ledYellow; - /** Red LED driver */ - LedGreen m_ledGreen; - - /** Proximity sensors dummy driver (Dummy driver only for the Sensor Fusion App) */ - SensorFusionProximitySensors m_proximitySensors; - /** IMU Driver */ IMU m_imu; @@ -263,19 +180,12 @@ class Board : public IBoard * Constructs the concrete board. */ Board() : - IBoard(), m_buttonA(), - m_buttonB(), - m_buttonC(), m_buzzer(), - m_display(), m_encoders(), m_lineSensors(), m_motors(), - m_ledRed(), m_ledYellow(), - m_ledGreen(), - m_proximitySensors(), m_imu() { } diff --git a/lib/HALSensorFusionTarget/SensorFusionButton.cpp b/lib/HALSensorFusionTarget/SensorFusionButton.cpp deleted file mode 100644 index 042f55b1..00000000 --- a/lib/HALSensorFusionTarget/SensorFusionButton.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* MIT License - * - * Copyright (c) 2023 Andreas Merkle - * - * 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 Button realization for the Sensor Fusion App - * @author Juliane Kerpe - */ - -/****************************************************************************** - * Includes - *****************************************************************************/ -#include "SensorFusionButton.h" - -/****************************************************************************** - * Compiler Switches - *****************************************************************************/ - -/****************************************************************************** - * Macros - *****************************************************************************/ - -/****************************************************************************** - * Types and classes - *****************************************************************************/ - -/****************************************************************************** - * Prototypes - *****************************************************************************/ - -/****************************************************************************** - * Local Variables - *****************************************************************************/ - -/****************************************************************************** - * Public Methods - *****************************************************************************/ - -/****************************************************************************** - * Protected Methods - *****************************************************************************/ - -/****************************************************************************** - * Private Methods - *****************************************************************************/ - -/****************************************************************************** - * External Functions - *****************************************************************************/ - -/****************************************************************************** - * Local Functions - *****************************************************************************/ diff --git a/lib/HALSensorFusionTarget/SensorFusionButton.h b/lib/HALSensorFusionTarget/SensorFusionButton.h deleted file mode 100644 index 8bfe4fa8..00000000 --- a/lib/HALSensorFusionTarget/SensorFusionButton.h +++ /dev/null @@ -1,99 +0,0 @@ -/* MIT License - * - * Copyright (c) 2023 Andreas Merkle - * - * 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 Button realization for the Sensor Fusion App - * @author Juliane Kerpe - * - * @addtogroup HALTarget - * - * @{ - */ - -#ifndef SENSORFUSIONBUTTON_H -#define SENSORFUSIONBUTTON_H - -/****************************************************************************** - * Compile Switches - *****************************************************************************/ - -/****************************************************************************** - * Includes - *****************************************************************************/ -#include "IButton.h" - -/****************************************************************************** - * Macros - *****************************************************************************/ - -/****************************************************************************** - * Types and Classes - *****************************************************************************/ - -/** This class provides access to a dummy driver for the Button of the Sensor Fusion Application. */ -class SensorFusionButton : public IButton -{ -public: - /** - * Constructs the button adapter. - */ - SensorFusionButton() : IButton() - { - } - - /** - * Destroys the button adapter. - */ - ~SensorFusionButton() - { - } - - /** - * Is button pressed or not - * - * @return If button is pressed, returns true otherwise false. - */ - bool isPressed() final - { - return false; - } - - /** - * Wait until button is released. - */ - void waitForRelease() final - { - } - -private: -}; - -/****************************************************************************** - * Functions - *****************************************************************************/ - -#endif /* SENSORFUSIONBUTTON_H */ -/** @} */ diff --git a/lib/HALSensorFusionTarget/SensorFusionBuzzer.cpp b/lib/HALSensorFusionTarget/SensorFusionBuzzer.cpp deleted file mode 100644 index b72e6a08..00000000 --- a/lib/HALSensorFusionTarget/SensorFusionBuzzer.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/* MIT License - * - * Copyright (c) 2023 Andreas Merkle - * - * 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 Buzzer realization for the Sensor Fusion App - * @author Juliane Kerpe - */ - -/****************************************************************************** - * Includes - *****************************************************************************/ -#include "SensorFusionBuzzer.h" - -/****************************************************************************** - * Compiler Switches - *****************************************************************************/ - -/****************************************************************************** - * Macros - *****************************************************************************/ - -/****************************************************************************** - * Types and classes - *****************************************************************************/ - -/****************************************************************************** - * Prototypes - *****************************************************************************/ - -/****************************************************************************** - * Local Variables - *****************************************************************************/ - -/****************************************************************************** - * Public Methods - *****************************************************************************/ - -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; -} - -/****************************************************************************** - * Protected Methods - *****************************************************************************/ - -/****************************************************************************** - * Private Methods - *****************************************************************************/ - -/****************************************************************************** - * External Functions - *****************************************************************************/ diff --git a/lib/HALSensorFusionTarget/SensorFusionBuzzer.h b/lib/HALSensorFusionTarget/SensorFusionBuzzer.h deleted file mode 100644 index 1b30db59..00000000 --- a/lib/HALSensorFusionTarget/SensorFusionBuzzer.h +++ /dev/null @@ -1,129 +0,0 @@ -/* MIT License - * - * Copyright (c) 2023 Andreas Merkle - * - * 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 Buzzer realization for the Sensor Fusion App - * @author Juliane Kerpe - * - * @addtogroup HALTarget - * - * @{ - */ - -#ifndef SENSORFUSIONBUZZER_H -#define SENSORFUSIONBUZZER_H - -/****************************************************************************** - * Compile Switches - *****************************************************************************/ - -/****************************************************************************** - * Includes - *****************************************************************************/ -#include "IBuzzer.h" - -/****************************************************************************** - * Macros - *****************************************************************************/ - -/****************************************************************************** - * Types and Classes - *****************************************************************************/ - -/** This class provides access to a dummy driver for the Buzzer of the Sensor Fusion Application. */ -class SensorFusionBuzzer : public IBuzzer -{ -public: - /** - * Constructs the buzzer adapter. - */ - SensorFusionBuzzer() : IBuzzer() - { - } - - /** - * Destroys the buzzer adapter. - */ - ~SensorFusionBuzzer() - { - } - - /** - * Plays the specified frequency for the specified duration. - * - * This function plays the note in the background while your program continues - * to execute. If you call another buzzer function while the note is playing, - * the new function call will overwrite the previous and take control of the - * buzzer. - * - * @warning @a frequency × @a duration / 1000 must be no greater than - * 0xFFFF (65535). This means you can't use a duration of 65535 ms for - * frequencies greater than 1 kHz. For example, the maximum duration you can - * use for a frequency of 10 kHz is 6553 ms. If you use a duration longer than - * this, you will produce an integer overflow that can result in unexpected - * behavior. - * - * @param[in] freq Frequency to play in 0.1 Hz. - * @param[in] duration Duration of the note in milliseconds. - * @param[in] volume Volume of the note (0-15). - */ - void playFrequency(uint16_t freq, uint16_t duration, uint8_t volume) final; - - /** - * Plays a melody sequence out of RAM. - * - * @param[in] sequence Melody sequence in RAM - */ - void playMelody(const char* sequence) final; - - /** - * Plays a melody sequence out of program space. - * - * @param[in] sequence Melody sequence in program space - */ - void playMelodyPGM(const char* sequence) final; - - /** - * Checks whether a note, frequency, or sequence is being played. - * - * @return if the buzzer is current playing a note, frequency, or sequence it will - * return true otherwise false. - */ - bool isPlaying() final - { - return false; - } - -private: - -}; - -/****************************************************************************** - * Functions - *****************************************************************************/ - -#endif /* SENSORFUSIONBUZZER_H */ -/** @} */ diff --git a/lib/HALSensorFusionTarget/SensorFusionDisplay.cpp b/lib/HALSensorFusionTarget/SensorFusionDisplay.cpp deleted file mode 100644 index 7646dab8..00000000 --- a/lib/HALSensorFusionTarget/SensorFusionDisplay.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* MIT License - * - * Copyright (c) 2023 Andreas Merkle - * - * 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 Display realization for the Sensor Fusion App - * @author Juliane Kerpe - */ - -/****************************************************************************** - * Includes - *****************************************************************************/ -#include "SensorFusionDisplay.h" - -/****************************************************************************** - * Compiler Switches - *****************************************************************************/ - -/****************************************************************************** - * Macros - *****************************************************************************/ - -/****************************************************************************** - * Types and classes - *****************************************************************************/ - -/****************************************************************************** - * Prototypes - *****************************************************************************/ - -/****************************************************************************** - * Local Variables - *****************************************************************************/ - -/****************************************************************************** - * Public Methods - *****************************************************************************/ - -/****************************************************************************** - * Protected Methods - *****************************************************************************/ - -/****************************************************************************** - * Private Methods - *****************************************************************************/ - -/****************************************************************************** - * External Functions - *****************************************************************************/ - -/****************************************************************************** - * Local Functions - *****************************************************************************/ diff --git a/lib/HALSensorFusionTarget/SensorFusionDisplay.h b/lib/HALSensorFusionTarget/SensorFusionDisplay.h deleted file mode 100644 index 55c80a9c..00000000 --- a/lib/HALSensorFusionTarget/SensorFusionDisplay.h +++ /dev/null @@ -1,183 +0,0 @@ -/* MIT License - * - * Copyright (c) 2023 Andreas Merkle - * - * 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 Display realization for the Sensor Fusion App - * @author Juliane Kerpe - * - * @addtogroup HALTarget - * - * @{ - */ - -#ifndef SENSORFUSIONDISPLAY_H -#define SENSORFUSIONDISPLAY_H - -/****************************************************************************** - * Compile Switches - *****************************************************************************/ - -/****************************************************************************** - * Includes - *****************************************************************************/ -#include "IDisplay.h" - -/****************************************************************************** - * Macros - *****************************************************************************/ - -/****************************************************************************** - * Types and Classes - *****************************************************************************/ - -/** This class provides access to a dummy driver for the Display of the Sensor Fusion Application. */ -class SensorFusionDisplay : public IDisplay -{ -public: - /** - * Constructs the display adapter. - */ - SensorFusionDisplay() : IDisplay() - { - } - - /** - * Destroys the display adapter. - */ - ~SensorFusionDisplay() - { - } - - /** - * Clear the display and set the cursor to the upper left corner. - */ - void clear() final - { - } - - /** - * Set the cursor to the given position. - * - * @param[in] xCoord x-coordinate, 0 is the most left position. - * @param[in] yCoord y-coordinate, 0 is the most upper position. - */ - void gotoXY(uint8_t xCoord, uint8_t yCoord) final - { - } - - /** - * Print the string to the display at the current cursor position. - * - * @param[in] str String - * - * @return Printed number of characters - */ - size_t print(const char str[]) final - { - return 0; - } - - /** - * Print the unsigned 8-bit value to the display at the current cursor position. - * - * @param[in] value Value - * - * @return Printed number of characters - */ - size_t print(uint8_t value) final - { - return 0; - } - - /** - * Print the unsigned 16-bit value to the display at the current cursor position. - * - * @param[in] value Value - * - * @return Printed number of characters - */ - size_t print(uint16_t value) final - { - return 0; - } - - /** - * Print the unsigned 32-bit value to the display at the current cursor position. - * - * @param[in] value Value - * - * @return Printed number of characters - */ - size_t print(uint32_t value) final - { - return 0; - } - - /** - * Print the signed 8-bit value to the display at the current cursor position. - * - * @param[in] value Value - * - * @return Printed number of characters - */ - size_t print(int8_t value) final - { - return 0; - } - - /** - * Print the signed 16-bit value to the display at the current cursor position. - * - * @param[in] value Value - * - * @return Printed number of characters - */ - size_t print(int16_t value) final - { - return 0; - } - - /** - * Print the signed 32-bit value to the display at the current cursor position. - * - * @param[in] value Value - * - * @return Printed number of characters - */ - size_t print(int32_t value) final - { - return 0; - } - -private: -}; - -/****************************************************************************** - * Functions - *****************************************************************************/ - -#endif /* SENSORFUSIONDISPLAY_H */ -/** @} */ diff --git a/lib/HALSensorFusionTarget/SensorFusionProximitySensors.cpp b/lib/HALSensorFusionTarget/SensorFusionProximitySensors.cpp deleted file mode 100644 index d6ee9f83..00000000 --- a/lib/HALSensorFusionTarget/SensorFusionProximitySensors.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* MIT License - * - * Copyright (c) 2023 Andreas Merkle - * - * 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 Proximity sensors realization for the Sensor Fusion App - * @author Juliane Kerpe - */ - -/****************************************************************************** - * Includes - *****************************************************************************/ -#include "SensorFusionProximitySensors.h" - -/****************************************************************************** - * Compiler Switches - *****************************************************************************/ - -/****************************************************************************** - * Macros - *****************************************************************************/ - -/****************************************************************************** - * Types and classes - *****************************************************************************/ - -/****************************************************************************** - * Prototypes - *****************************************************************************/ - -/****************************************************************************** - * Local Variables - *****************************************************************************/ - -/****************************************************************************** - * Public Methods - *****************************************************************************/ - -/****************************************************************************** - * Protected Methods - *****************************************************************************/ - -/****************************************************************************** - * Private Methods - *****************************************************************************/ - -/****************************************************************************** - * External Functions - *****************************************************************************/ - -/****************************************************************************** - * Local Functions - *****************************************************************************/ diff --git a/lib/HALSensorFusionTarget/SensorFusionProximitySensors.h b/lib/HALSensorFusionTarget/SensorFusionProximitySensors.h deleted file mode 100644 index fb1efec4..00000000 --- a/lib/HALSensorFusionTarget/SensorFusionProximitySensors.h +++ /dev/null @@ -1,139 +0,0 @@ -/* MIT License - * - * Copyright (c) 2023 Andreas Merkle - * - * 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 Proximity sensors realization for the Sensor Fusion App - * @author Juliane Kerpe - * - * @addtogroup HALTarget - * - * @{ - */ -#ifndef SENSORFUSIONPROXIMITYSENSORS_H -#define SENSORFUSIONPROXIMITYSENSORS_H - -/****************************************************************************** - * Compile Switches - *****************************************************************************/ - -/****************************************************************************** - * Includes - *****************************************************************************/ -#include -#include - -/****************************************************************************** - * Macros - *****************************************************************************/ - -/****************************************************************************** - * Types and Classes - *****************************************************************************/ - -/** This class provides access to a dummy driver for the Proximity Sensors of the Sensor Fusion Application. */ -class SensorFusionProximitySensors : public IProximitySensors -{ -public: - /** - * Constructs the ProximitySensors adapter. - */ - SensorFusionProximitySensors() : IProximitySensors() - { - } - - /** - * Destroys the ProximitySensors adapter. - */ - virtual ~SensorFusionProximitySensors() - { - } - - /** - * Initialize only the front proximity sensor. - */ - void initFrontSensor() final - { - } - - /** - * Returns the number of sensors. - * - * @return Number of sensors - */ - uint8_t getNumSensors() const final - { - return 1U; - } - - /** - * Emits IR pulses and gets readings from the sensors. - */ - void read() final - { - } - - /** - * Returns the number of brightness levels for the left LEDs that - * activated the front proximity sensor. - * - * @return Number of brightness levels - */ - uint8_t countsFrontWithLeftLeds() const final - { - return 0; - } - - /** - * Returns the number of brightness levels for the right LEDs that - * activated the front proximity sensor. - * - * @return Number of brightness levels - */ - uint8_t countsFrontWithRightLeds() const final - { - return 0; - } - - /** - * Returns the number of brightness levels. - * - * @return Number of brightness levels. - */ - uint8_t getNumBrightnessLevels() const final - { - return 1; - } - -protected: -private: -}; - -/****************************************************************************** - * Functions - *****************************************************************************/ - -#endif /* SENSORFUSIONPROXIMITYSENSORS_H */ -/** @} */ diff --git a/lib/HALTest/Board.h b/lib/HALTest/Board.h index 2e262f93..4b275399 100644 --- a/lib/HALTest/Board.h +++ b/lib/HALTest/Board.h @@ -43,7 +43,6 @@ * Includes *****************************************************************************/ #include -#include #include #include #include @@ -69,7 +68,7 @@ /** * The concrete simulation robot board. */ -class Board : public IBoard +class Board { public: /** @@ -87,14 +86,14 @@ class Board : public IBoard /** * Initialize the hardware. */ - void init() final; + void init(); /** * Get button A driver. * * @return Button A driver. */ - IButton& getButtonA() final + IButton& getButtonA() { return m_buttonA; } @@ -104,7 +103,7 @@ class Board : public IBoard * * @return Button B driver. */ - IButton& getButtonB() final + IButton& getButtonB() { return m_buttonB; } @@ -114,7 +113,7 @@ class Board : public IBoard * * @return Button C driver. */ - IButton& getButtonC() final + IButton& getButtonC() { return m_buttonC; } @@ -124,7 +123,7 @@ class Board : public IBoard * * @return Buzzer driver. */ - IBuzzer& getBuzzer() final + IBuzzer& getBuzzer() { return m_buzzer; } @@ -134,7 +133,7 @@ class Board : public IBoard * * @return LCD driver. */ - IDisplay& getDisplay() final + IDisplay& getDisplay() { return m_display; } @@ -144,7 +143,7 @@ class Board : public IBoard * * @return Encoders driver. */ - IEncoders& getEncoders() final + IEncoders& getEncoders() { return m_encoders; } @@ -154,7 +153,7 @@ class Board : public IBoard * * @return Line sensor driver. */ - ILineSensors& getLineSensors() final + ILineSensors& getLineSensors() { return m_lineSensors; } @@ -164,7 +163,7 @@ class Board : public IBoard * * @return Motor driver. */ - IMotors& getMotors() final + IMotors& getMotors() { return m_motors; } @@ -174,7 +173,7 @@ class Board : public IBoard * * @return Red LED driver. */ - ILed& getRedLed() final + ILed& getRedLed() { return m_ledRed; } @@ -184,7 +183,7 @@ class Board : public IBoard * * @return Yellow LED driver. */ - ILed& getYellowLed() final + ILed& getYellowLed() { return m_ledYellow; } @@ -194,7 +193,7 @@ class Board : public IBoard * * @return Green LED driver. */ - ILed& getGreenLed() final + ILed& getGreenLed() { return m_ledGreen; } @@ -204,7 +203,7 @@ class Board : public IBoard * * @return Proximity sensors driver */ - IProximitySensors& getProximitySensors() final + IProximitySensors& getProximitySensors() { return m_proximitySensors; } @@ -268,10 +267,10 @@ class Board : public IBoard /** Red LED driver */ LedRed m_ledRed; - /** Red LED driver */ + /** Yellow LED driver */ LedYellow m_ledYellow; - /** Red LED driver */ + /** Green LED driver */ LedGreen m_ledGreen; /** Proximity sensors */ @@ -284,7 +283,6 @@ class Board : public IBoard * Constructs the concrete board. */ Board() : - IBoard(), m_buttonA(), m_buttonB(), m_buttonC(),