From f27e73b3a88312357d781c280bb476e4f1625e6e Mon Sep 17 00:00:00 2001 From: greyes Date: Fri, 2 Jan 2026 19:14:02 +0100 Subject: [PATCH 1/8] Added V2 interfaces --- lib/HALInterfaces/src/IBoard.h | 44 +++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/lib/HALInterfaces/src/IBoard.h b/lib/HALInterfaces/src/IBoard.h index c3d37c30..cd729bb8 100644 --- a/lib/HALInterfaces/src/IBoard.h +++ b/lib/HALInterfaces/src/IBoard.h @@ -93,12 +93,33 @@ class IBoard virtual IBattery& getBattery() = 0; /** - * Get button driver. + * Get button "Reset" driver. * * @return Button driver. */ virtual IButton& getButton() = 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 red LED driver. * @@ -120,6 +141,27 @@ class IBoard */ virtual ILed& getBlueLed() = 0; + /** + * Get LED "A" driver. + * + * @return LED "A" driver. + */ + virtual ILed& getLedA() = 0; + + /** + * Get LED "B" driver. + * + * @return LED "B" driver. + */ + virtual ILed& getLedB() = 0; + + /** + * Get LED "C" driver. + * + * @return LED "C" driver. + */ + virtual ILed& getLedC() = 0; + /** * Get Network driver. * From e43d27500fe618f7b0dfb04bc83ee32d04803384 Mon Sep 17 00:00:00 2001 From: greyes Date: Fri, 2 Jan 2026 19:18:06 +0100 Subject: [PATCH 2/8] Renamed button "reset" interface --- lib/APPLineFollower/src/States/ReadyState.cpp | 2 +- lib/APPLineFollower/src/States/ReleaseTrackState.cpp | 2 +- lib/APPLineFollower/src/States/StartupState.cpp | 2 +- lib/HALInterfaces/src/IBoard.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/APPLineFollower/src/States/ReadyState.cpp b/lib/APPLineFollower/src/States/ReadyState.cpp index a87d5af5..a6cdae0e 100644 --- a/lib/APPLineFollower/src/States/ReadyState.cpp +++ b/lib/APPLineFollower/src/States/ReadyState.cpp @@ -79,7 +79,7 @@ void ReadyState::entry() void ReadyState::process(StateMachine& sm) { - IButton& button = Board::getInstance().getButton(); + IButton& button = Board::getInstance().getButtonReset(); if (nullptr == m_lineSensors) { diff --git a/lib/APPLineFollower/src/States/ReleaseTrackState.cpp b/lib/APPLineFollower/src/States/ReleaseTrackState.cpp index 5dbe62c0..85a88f2d 100644 --- a/lib/APPLineFollower/src/States/ReleaseTrackState.cpp +++ b/lib/APPLineFollower/src/States/ReleaseTrackState.cpp @@ -80,7 +80,7 @@ void ReleaseTrackState::entry() void ReleaseTrackState::process(StateMachine& sm) { - IButton& button = Board::getInstance().getButton(); + IButton& button = Board::getInstance().getButtonReset(); /* Change parameter set? */ if (true == Util::isButtonTriggered(button, m_isButtonPressed)) diff --git a/lib/APPLineFollower/src/States/StartupState.cpp b/lib/APPLineFollower/src/States/StartupState.cpp index 16545746..793defc6 100644 --- a/lib/APPLineFollower/src/States/StartupState.cpp +++ b/lib/APPLineFollower/src/States/StartupState.cpp @@ -73,7 +73,7 @@ void StartupState::entry() void StartupState::process(StateMachine& sm) { - IButton& button = Board::getInstance().getButton(); + IButton& button = Board::getInstance().getButtonReset(); switch (m_subState) { diff --git a/lib/HALInterfaces/src/IBoard.h b/lib/HALInterfaces/src/IBoard.h index cd729bb8..e4495863 100644 --- a/lib/HALInterfaces/src/IBoard.h +++ b/lib/HALInterfaces/src/IBoard.h @@ -97,7 +97,7 @@ class IBoard * * @return Button driver. */ - virtual IButton& getButton() = 0; + virtual IButton& getButtonReset() = 0; /** * Get button "A" driver. From 52bc8b02bd487b682c5c1cc1b175b2a1f4b99c0c Mon Sep 17 00:00:00 2001 From: greyes Date: Fri, 2 Jan 2026 19:18:49 +0100 Subject: [PATCH 3/8] Adapted Target Board --- lib/HALSim/src/Board.h | 4 +- lib/HALTargetCommon/src/Board.cpp | 8 ++- lib/HALTargetCommon/src/Board.h | 92 +++++++++++++++++++++++++++++-- 3 files changed, 97 insertions(+), 7 deletions(-) diff --git a/lib/HALSim/src/Board.h b/lib/HALSim/src/Board.h index 5ef9c547..56118579 100644 --- a/lib/HALSim/src/Board.h +++ b/lib/HALSim/src/Board.h @@ -113,7 +113,7 @@ class Board : public IBoard */ IButton& getButton() final { - return m_button; + return m_buttonReset; } /** @@ -212,7 +212,7 @@ class Board : public IBoard Battery m_battery; /** Button "Reset" driver */ - ButtonReset m_button; + ButtonReset m_buttonReset; /** Blue LED driver */ LedBlue m_ledBlue; diff --git a/lib/HALTargetCommon/src/Board.cpp b/lib/HALTargetCommon/src/Board.cpp index 4fff73a1..b3086ebe 100644 --- a/lib/HALTargetCommon/src/Board.cpp +++ b/lib/HALTargetCommon/src/Board.cpp @@ -117,10 +117,16 @@ void Board::process() Board::Board() : IBoard(), m_battery(), - m_button(), + m_buttonReset(), + m_buttonA(), + m_buttonB(), + m_buttonC(), m_ledBlue(), m_ledGreen(), m_ledRed(), + m_ledA(), + m_ledB(), + m_ledC(), m_network(), m_hostRobot(), m_configFilePath(CONFIG_FILE_PATH) diff --git a/lib/HALTargetCommon/src/Board.h b/lib/HALTargetCommon/src/Board.h index 73f56416..35a4058a 100644 --- a/lib/HALTargetCommon/src/Board.h +++ b/lib/HALTargetCommon/src/Board.h @@ -46,9 +46,15 @@ #include #include "Battery.h" #include "ButtonReset.h" +#include "ButtonA.h" +#include "ButtonB.h" +#include "ButtonC.h" #include "LedBlue.h" #include "LedGreen.h" #include "LedRed.h" +#include "LedA.h" +#include "LedB.h" +#include "LedC.h" #include "Network.h" #include "ButtonDrv.h" #include "Robot.h" @@ -102,13 +108,43 @@ class Board : public IBoard } /** - * Get button driver. + * Get button "Reset" driver. * * @return Button driver. */ - IButton& getButton() final + IButton& getButtonReset() final { - return m_button; + return m_buttonReset; + } + + /** + * Get button "A" driver. + * + * @return Button "A" driver. + */ + IButton& getButtonA() final + { + 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; } /** @@ -141,6 +177,36 @@ class Board : public IBoard return m_ledRed; } + /** + * Get LED "A" driver. + * + * @return LED "A" driver. + */ + ILed& getLedA() final + { + return m_ledA; + } + + /** + * Get LED "B" driver. + * + * @return LED "B" driver. + */ + ILed& getLedB() final + { + return m_ledB; + } + + /** + * Get LED "C" driver. + * + * @return LED "C" driver. + */ + ILed& getLedC() final + { + return m_ledC; + } + /** * Get Network driver. * @@ -187,7 +253,16 @@ class Board : public IBoard Battery m_battery; /** Button "Reset" driver */ - ButtonReset m_button; + ButtonReset m_buttonReset; + + /** Button "A" driver */ + ButtonA m_buttonA; + + /** Button "B" driver */ + ButtonB m_buttonB; + + /** Button "C" driver */ + ButtonC m_buttonC; /** Blue LED driver */ LedBlue m_ledBlue; @@ -198,6 +273,15 @@ class Board : public IBoard /** Red LED driver */ LedRed m_ledRed; + /** LED "A" driver */ + LedA m_ledA; + + /** LED "B" driver */ + LedB m_ledB; + + /** LED "C" driver */ + LedC m_ledC; + /** Network driver */ Network m_network; From a95b45f4e2288cd445fa424a84bf5c59f21055b7 Mon Sep 17 00:00:00 2001 From: greyes Date: Fri, 2 Jan 2026 19:26:43 +0100 Subject: [PATCH 4/8] Adapted Sim Board --- lib/HALSim/src/Board.cpp | 8 +++- lib/HALSim/src/Board.h | 86 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 92 insertions(+), 2 deletions(-) diff --git a/lib/HALSim/src/Board.cpp b/lib/HALSim/src/Board.cpp index ad5fb616..bba69437 100644 --- a/lib/HALSim/src/Board.cpp +++ b/lib/HALSim/src/Board.cpp @@ -113,10 +113,16 @@ Board::Board() : m_robot.getReceiver(RobotDeviceNames::RECEIVER_NAME_SERIAL)), m_keyboard(m_simTime, m_robot.getKeyboard()), m_battery(), - m_button(m_keyboard), + m_buttonReset(m_keyboard), + m_buttonA(m_keyboard), + m_buttonB(m_keyboard), + m_buttonC(m_keyboard), m_ledBlue(), m_ledGreen(), m_ledRed(), + m_ledA(), + m_ledB(), + m_ledC(), m_network(), m_hostRobot(m_serialDrv), m_configFilePath(), diff --git a/lib/HALSim/src/Board.h b/lib/HALSim/src/Board.h index 56118579..f8909347 100644 --- a/lib/HALSim/src/Board.h +++ b/lib/HALSim/src/Board.h @@ -47,9 +47,15 @@ #include #include "Battery.h" #include "ButtonReset.h" +#include "ButtonA.h" +#include "ButtonB.h" +#include "ButtonC.h" #include "LedBlue.h" #include "LedGreen.h" #include "LedRed.h" +#include "LedA.h" +#include "LedB.h" +#include "LedC.h" #include "Network.h" #include "Robot.h" #include "WebotsSerialDrv.h" @@ -111,11 +117,41 @@ class Board : public IBoard * * @return Button driver. */ - IButton& getButton() final + IButton& getButtonReset() final { return m_buttonReset; } + /** + * Get button "A" driver. + * + * @return Button "A" driver. + */ + IButton& getButtonA() final + { + 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 yellow LED driver. * @@ -146,6 +182,36 @@ class Board : public IBoard return m_ledRed; } + /** + * Get LED "A" driver. + * + * @return LED "A" driver. + */ + ILed& getLedA() final + { + return m_ledA; + } + + /** + * Get LED "B" driver. + * + * @return LED "B" driver. + */ + ILed& getLedB() final + { + return m_ledB; + } + + /** + * Get LED "C" driver. + * + * @return LED "C" driver. + */ + ILed& getLedC() final + { + return m_ledC; + } + /** * Get Network driver. * @@ -214,6 +280,15 @@ class Board : public IBoard /** Button "Reset" driver */ ButtonReset m_buttonReset; + /** Button "A" driver */ + ButtonA m_buttonA; + + /** Button "B" driver */ + ButtonB m_buttonB; + + /** Button "C" driver */ + ButtonC m_buttonC; + /** Blue LED driver */ LedBlue m_ledBlue; @@ -223,6 +298,15 @@ class Board : public IBoard /** Red LED driver */ LedRed m_ledRed; + /** LED "A" driver */ + LedA m_ledA; + + /** LED "B" driver */ + LedB m_ledB; + + /** LED "C" driver */ + LedC m_ledC; + /** Network driver */ Network m_network; From 24bb7c3a7f04c1503a8249787cd0a6030c7aa1f8 Mon Sep 17 00:00:00 2001 From: greyes Date: Fri, 2 Jan 2026 19:40:57 +0100 Subject: [PATCH 5/8] Try to run inside a webots container --- .github/workflows/simulation_build.yml | 37 ++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/simulation_build.yml diff --git a/.github/workflows/simulation_build.yml b/.github/workflows/simulation_build.yml new file mode 100644 index 00000000..6577d0ba --- /dev/null +++ b/.github/workflows/simulation_build.yml @@ -0,0 +1,37 @@ +name: simulation_build + +# Controls when the action will run. +on: + push: + branches: [ '**' ] + release: + # A release, pre-release, or draft of a release is published. + types: [ published ] + # Allows you to run this workflow manually from the Actions tab. + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel. +jobs: + # The introduction just shows some useful informations. + intro: + # The type of runner that the job will run on. + runs-on: ubuntu-24.04 + container: cyberbotics/webots:R2025a-ubuntu22.04 + # Steps represent a sequence of tasks that will be executed as part of the job. + steps: + - run: echo "The job was automatically triggered by a ${{ github.event_name }} event." + - run: echo "The name of the branch is ${{ github.ref }} and the repository is ${{ github.repository }}." + + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12.3' + cache: 'pip' + cache-dependency-path: .github/workflows/requirements.txt + + - name: Install dependencies + run: | + pip install -r .github/workflows/requirements.txt \ No newline at end of file From 0aa6156893129713257d7e745efd2a88f318cd3c Mon Sep 17 00:00:00 2001 From: greyes Date: Fri, 2 Jan 2026 19:46:15 +0100 Subject: [PATCH 6/8] Try to build simulation environments --- .github/workflows/simulation_build.yml | 37 +++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/.github/workflows/simulation_build.yml b/.github/workflows/simulation_build.yml index 6577d0ba..feaa6088 100644 --- a/.github/workflows/simulation_build.yml +++ b/.github/workflows/simulation_build.yml @@ -34,4 +34,39 @@ jobs: - name: Install dependencies run: | - pip install -r .github/workflows/requirements.txt \ No newline at end of file + pip install -r .github/workflows/requirements.txt + + # Build Webots simulation targets + build: + # The type of runner that the job will run on. + runs-on: ubuntu-24.04 + needs: intro + strategy: + matrix: + environment: ["ConvoyLeaderSim", + "ConvoyFollowerSim", + "LineFollowerSim", + "RemoteControlSim", + "SensorFusionSim"] + + # Steps represent a sequence of tasks that will be executed as part of the job. + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12.3' + cache: 'pip' + cache-dependency-path: .github/workflows/requirements.txt + + - name: Install dependencies + run: | + pip install -r .github/workflows/requirements.txt + + - name: Compile ${{ matrix.environment }} firmware + run: platformio run --environment ${{ matrix.environment }} + + - name: Perform static checks on ${{ matrix.environment }} + run: platformio check --environment ${{ matrix.environment }} --fail-on-defect=medium --fail-on-defect=high \ No newline at end of file From 8fbb234edd368622acfaee33ea8d5a9b64bf9319 Mon Sep 17 00:00:00 2001 From: greyes Date: Fri, 2 Jan 2026 19:57:00 +0100 Subject: [PATCH 7/8] Removed failed CI test for simulation --- .github/workflows/simulation_build.yml | 72 -------------------------- 1 file changed, 72 deletions(-) delete mode 100644 .github/workflows/simulation_build.yml diff --git a/.github/workflows/simulation_build.yml b/.github/workflows/simulation_build.yml deleted file mode 100644 index feaa6088..00000000 --- a/.github/workflows/simulation_build.yml +++ /dev/null @@ -1,72 +0,0 @@ -name: simulation_build - -# Controls when the action will run. -on: - push: - branches: [ '**' ] - release: - # A release, pre-release, or draft of a release is published. - types: [ published ] - # Allows you to run this workflow manually from the Actions tab. - workflow_dispatch: - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel. -jobs: - # The introduction just shows some useful informations. - intro: - # The type of runner that the job will run on. - runs-on: ubuntu-24.04 - container: cyberbotics/webots:R2025a-ubuntu22.04 - # Steps represent a sequence of tasks that will be executed as part of the job. - steps: - - run: echo "The job was automatically triggered by a ${{ github.event_name }} event." - - run: echo "The name of the branch is ${{ github.ref }} and the repository is ${{ github.repository }}." - - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.12.3' - cache: 'pip' - cache-dependency-path: .github/workflows/requirements.txt - - - name: Install dependencies - run: | - pip install -r .github/workflows/requirements.txt - - # Build Webots simulation targets - build: - # The type of runner that the job will run on. - runs-on: ubuntu-24.04 - needs: intro - strategy: - matrix: - environment: ["ConvoyLeaderSim", - "ConvoyFollowerSim", - "LineFollowerSim", - "RemoteControlSim", - "SensorFusionSim"] - - # Steps represent a sequence of tasks that will be executed as part of the job. - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.12.3' - cache: 'pip' - cache-dependency-path: .github/workflows/requirements.txt - - - name: Install dependencies - run: | - pip install -r .github/workflows/requirements.txt - - - name: Compile ${{ matrix.environment }} firmware - run: platformio run --environment ${{ matrix.environment }} - - - name: Perform static checks on ${{ matrix.environment }} - run: platformio check --environment ${{ matrix.environment }} --fail-on-defect=medium --fail-on-defect=high \ No newline at end of file From 42bcb9fe7e0428b6a982366103397979f52c0c50 Mon Sep 17 00:00:00 2001 From: greyes Date: Fri, 2 Jan 2026 20:10:41 +0100 Subject: [PATCH 8/8] Fixed some Doxygen rename consistencies --- lib/HALInterfaces/src/IBoard.h | 2 +- lib/HALSim/src/Board.h | 4 ++-- lib/HALTargetCommon/src/Board.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/HALInterfaces/src/IBoard.h b/lib/HALInterfaces/src/IBoard.h index e4495863..28d0d397 100644 --- a/lib/HALInterfaces/src/IBoard.h +++ b/lib/HALInterfaces/src/IBoard.h @@ -95,7 +95,7 @@ class IBoard /** * Get button "Reset" driver. * - * @return Button driver. + * @return Button "Reset" driver. */ virtual IButton& getButtonReset() = 0; diff --git a/lib/HALSim/src/Board.h b/lib/HALSim/src/Board.h index f8909347..214b0968 100644 --- a/lib/HALSim/src/Board.h +++ b/lib/HALSim/src/Board.h @@ -113,9 +113,9 @@ class Board : public IBoard } /** - * Get button driver. + * Get button "Reset" driver. * - * @return Button driver. + * @return Button "Reset" driver. */ IButton& getButtonReset() final { diff --git a/lib/HALTargetCommon/src/Board.h b/lib/HALTargetCommon/src/Board.h index 35a4058a..bdacaff6 100644 --- a/lib/HALTargetCommon/src/Board.h +++ b/lib/HALTargetCommon/src/Board.h @@ -110,7 +110,7 @@ class Board : public IBoard /** * Get button "Reset" driver. * - * @return Button driver. + * @return Button "Reset" driver. */ IButton& getButtonReset() final {