From 064c0af790289bd43712044ea5371ece7384d272 Mon Sep 17 00:00:00 2001 From: vinle0 Date: Fri, 4 Oct 2024 23:46:20 +0000 Subject: [PATCH 1/4] Initial code --- .../client_display_subsystem.cpp | 12 +++ .../client_display_subsystem.hpp | 22 +++++ .../client-display/command_client_display.cpp | 72 +++++++++++++++++ .../client-display/command_client_display.hpp | 80 +++++++++++++++++++ 4 files changed, 186 insertions(+) create mode 100644 ut-robomaster/src/contols/client-display/client_display_subsystem.cpp create mode 100644 ut-robomaster/src/contols/client-display/client_display_subsystem.hpp create mode 100644 ut-robomaster/src/contols/client-display/command_client_display.cpp create mode 100644 ut-robomaster/src/contols/client-display/command_client_display.hpp diff --git a/ut-robomaster/src/contols/client-display/client_display_subsystem.cpp b/ut-robomaster/src/contols/client-display/client_display_subsystem.cpp new file mode 100644 index 00000000..5898b9e1 --- /dev/null +++ b/ut-robomaster/src/contols/client-display/client_display_subsystem.cpp @@ -0,0 +1,12 @@ +#include "client_display_subsystem.hpp" + +#include "tap/communication/sensors/buzzer/buzzer.hpp" + +namespace subsystems::control +{ + ClientDisplaySubsystem::ClientDisplaySubsystem( + tap::Drivers *drivers + ) : Subsystem(drivers) + { + } +} \ No newline at end of file diff --git a/ut-robomaster/src/contols/client-display/client_display_subsystem.hpp b/ut-robomaster/src/contols/client-display/client_display_subsystem.hpp new file mode 100644 index 00000000..c885b4f2 --- /dev/null +++ b/ut-robomaster/src/contols/client-display/client_display_subsystem.hpp @@ -0,0 +1,22 @@ +#pragma once + +#include "drivers.hpp" +#include "tap/control/command.hpp" +#include "tap/control/subsystem.hpp" +#include "tap/communication/sensors/buzzer/buzzer.hpp" + +using namespace tap::control; + +namespace subsystems::control +{ +class ClientDisplaySubsystem : public Subsystem +{ +public: + ClientDisplaySubsystem(tap::Drivers*); + virtual ~ClientDisplaySubsystem() {} + + void initialize() override {}; + + const char* getName() override { return "client display"; } +}; +} \ No newline at end of file diff --git a/ut-robomaster/src/contols/client-display/command_client_display.cpp b/ut-robomaster/src/contols/client-display/command_client_display.cpp new file mode 100644 index 00000000..b9ea243a --- /dev/null +++ b/ut-robomaster/src/contols/client-display/command_client_display.cpp @@ -0,0 +1,72 @@ +#include "command_client_display.hpp" + + +modm::ResumableResult BeybladeIndicator::sendInitialGraphics() +{ + // The number represents the index of the resumable function in this class + RF_BEGIN(0); + + RF_CALL(refSerialTransmitter.sendGraphic(&msg)); + + RF_END(); +} + +modm::ResumableResult BeybladeIndicator::update() +{ + // This is the second resumable function so its index is 1 + RF_BEGIN(1); + + RF_CALL(refSerialTransmitter.sendGraphic(&msg)); + + RF_END(); +} + +void BeybladeIndicator::initialize() +{ + RefSerialTransmitter::configGraphicGenerics( + &msg.graphicData[0], + graphicName, + RefSerialData::Tx::GRAPHIC_ADD, + 1, // Graphic layer can be 0-9 + RefSerialData::Tx::GraphicColor::PINK + ); + RefSerialTransmitter::configCircle( + 50, + 1920/2, + 1080/2, + 200, + &msg.graphicData[0] + ); + } + +namespace commands +{ + +void CommandClientDisplay::restartHud() +{ + beybladeIndicator.initialize(); + + this->restarting = false; +} + +bool CommandClientDisplay::run() +{ + if (!this->isRunning()) { + restart(); + this->restartHud(); + } + + PT_BEGIN(); + + PT_WAIT_UNTIL(drivers->refSerial.getRefSerialReceivingData()); + + PT_CALL(beybladeIndicator.sendInitialGraphics()); + + while (!this->restarting) { + PT_CALL(beybladeIndicator.update()); + PT_YIELD(); + } + + PT_END(); +} +} \ No newline at end of file diff --git a/ut-robomaster/src/contols/client-display/command_client_display.hpp b/ut-robomaster/src/contols/client-display/command_client_display.hpp new file mode 100644 index 00000000..2300978d --- /dev/null +++ b/ut-robomaster/src/contols/client-display/command_client_display.hpp @@ -0,0 +1,80 @@ +#pragma once + +#include "tap/control/command.hpp" +#include "tap/communication/serial/ref_serial_transmitter.hpp" +#include "tap/communication/serial/ref_serial_data.hpp" +#include "modm/processing/protothread.hpp" +#include "modm/processing/resumable.hpp" + +#include "tap/communication/sensors/buzzer/buzzer.hpp" + +#include "drivers.hpp" + +#include "control/client-display/client_display_subsystem.hpp" + +#include "subsystems/chassis/chassis_subsystem.hpp" + +using namespace tap::control; +using namespace tap::communication::serial; + +using subsystems::control::ClientDisplaySubsystem; +using subsystems::chassis::ChassisSubsystem; + +class BeybladeIndicator : protected modm::Resumable<2> +{ +private: + const uint8_t* graphicName = (uint8_t*)"\x00\x00\x01"; + RefSerialTransmitter &refSerialTransmitter; + RefSerialData::Tx::Graphic5Message msg; + +public: + BeybladeIndicator(RefSerialTransmitter refSerialTransmitter) + : refSerialTransmitter(refSerialTransmitter) + {} + + modm::ResumableResult sendInitialGraphics(); + modm::ResumableResult update(); + + void initialize(); +}; + +namespace commands +{ +class CommandClientDisplay : public Command, modm::pt::Protothread +{ +private: + src::Drivers* drivers; + RefSerialTransmitter refSerialTransmitter; + BeybladeIndicator beybladeIndicator; + bool restarting = true; + + void restartHud(); +public: + CommandClientDisplay( + src::Drivers *drivers, + ChassisSubsystem *chassis) + : Command(), + drivers(drivers), + refSerialTransmitter(drivers), + beybladeIndicator(refSerialTransmitter) + { + addSubsystemRequirement(chassis); + } + + bool run(); + + const char *getName() const override { return "client display"; } + void initialize() override + { + tap::buzzer::playNote(&drivers->pwm, 880); + this->restarting = true; + }; + + void execute() override + { + run(); + } + void end(bool) override {} + bool isFinished() const override { return false; } +}; +} \ No newline at end of file From a7c4715464aaa6a16e3e7a57ddaeacba5b9c0929 Mon Sep 17 00:00:00 2001 From: vinle0 Date: Fri, 4 Oct 2024 23:46:20 +0000 Subject: [PATCH 2/4] Bad directory --- .../client-display/client_display_subsystem.cpp | 0 .../client-display/client_display_subsystem.hpp | 0 .../client-display/command_client_display.cpp | 0 .../client-display/command_client_display.hpp | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename ut-robomaster/src/{contols => control}/client-display/client_display_subsystem.cpp (100%) rename ut-robomaster/src/{contols => control}/client-display/client_display_subsystem.hpp (100%) rename ut-robomaster/src/{contols => control}/client-display/command_client_display.cpp (100%) rename ut-robomaster/src/{contols => control}/client-display/command_client_display.hpp (100%) diff --git a/ut-robomaster/src/contols/client-display/client_display_subsystem.cpp b/ut-robomaster/src/control/client-display/client_display_subsystem.cpp similarity index 100% rename from ut-robomaster/src/contols/client-display/client_display_subsystem.cpp rename to ut-robomaster/src/control/client-display/client_display_subsystem.cpp diff --git a/ut-robomaster/src/contols/client-display/client_display_subsystem.hpp b/ut-robomaster/src/control/client-display/client_display_subsystem.hpp similarity index 100% rename from ut-robomaster/src/contols/client-display/client_display_subsystem.hpp rename to ut-robomaster/src/control/client-display/client_display_subsystem.hpp diff --git a/ut-robomaster/src/contols/client-display/command_client_display.cpp b/ut-robomaster/src/control/client-display/command_client_display.cpp similarity index 100% rename from ut-robomaster/src/contols/client-display/command_client_display.cpp rename to ut-robomaster/src/control/client-display/command_client_display.cpp diff --git a/ut-robomaster/src/contols/client-display/command_client_display.hpp b/ut-robomaster/src/control/client-display/command_client_display.hpp similarity index 100% rename from ut-robomaster/src/contols/client-display/command_client_display.hpp rename to ut-robomaster/src/control/client-display/command_client_display.hpp From 185c1dbac49e80e47f33da65722db08c0e4af55b Mon Sep 17 00:00:00 2001 From: Caleb Chalmers Date: Sat, 9 Nov 2024 00:02:35 +0000 Subject: [PATCH 3/4] Testing basic working example (not working) --- .../client_display_subsystem.cpp | 15 ++-- .../client_display_subsystem.hpp | 20 +++-- .../client-display/command_client_display.cpp | 79 +++++++---------- .../client-display/command_client_display.hpp | 87 ++++++++----------- .../src/robots/standard/standard_control.hpp | 7 ++ 5 files changed, 97 insertions(+), 111 deletions(-) diff --git a/ut-robomaster/src/control/client-display/client_display_subsystem.cpp b/ut-robomaster/src/control/client-display/client_display_subsystem.cpp index 5898b9e1..792fae33 100644 --- a/ut-robomaster/src/control/client-display/client_display_subsystem.cpp +++ b/ut-robomaster/src/control/client-display/client_display_subsystem.cpp @@ -4,9 +4,12 @@ namespace subsystems::control { - ClientDisplaySubsystem::ClientDisplaySubsystem( - tap::Drivers *drivers - ) : Subsystem(drivers) - { - } -} \ No newline at end of file +ClientDisplaySubsystem::ClientDisplaySubsystem(tap::Drivers *drivers) : Subsystem(drivers) {} + +void ClientDisplaySubsystem::initialize() {} + +void ClientDisplaySubsystem::refresh() {} + +void ClientDisplaySubsystem::runHardwareTests() {} + +} // namespace subsystems::control \ No newline at end of file diff --git a/ut-robomaster/src/control/client-display/client_display_subsystem.hpp b/ut-robomaster/src/control/client-display/client_display_subsystem.hpp index c885b4f2..055f3ea6 100644 --- a/ut-robomaster/src/control/client-display/client_display_subsystem.hpp +++ b/ut-robomaster/src/control/client-display/client_display_subsystem.hpp @@ -1,22 +1,24 @@ #pragma once -#include "drivers.hpp" +#include "tap/communication/sensors/buzzer/buzzer.hpp" #include "tap/control/command.hpp" #include "tap/control/subsystem.hpp" -#include "tap/communication/sensors/buzzer/buzzer.hpp" -using namespace tap::control; +#include "drivers.hpp" namespace subsystems::control { -class ClientDisplaySubsystem : public Subsystem +class ClientDisplaySubsystem : public tap::control::Subsystem { public: - ClientDisplaySubsystem(tap::Drivers*); - virtual ~ClientDisplaySubsystem() {} + ClientDisplaySubsystem(tap::Drivers*); + + void initialize() override; + + void refresh() override; - void initialize() override {}; + void runHardwareTests() override; - const char* getName() override { return "client display"; } + const char* getName() override { return "Client Display subsystem"; } }; -} \ No newline at end of file +} // namespace subsystems::control \ No newline at end of file diff --git a/ut-robomaster/src/control/client-display/command_client_display.cpp b/ut-robomaster/src/control/client-display/command_client_display.cpp index b9ea243a..0f5de75a 100644 --- a/ut-robomaster/src/control/client-display/command_client_display.cpp +++ b/ut-robomaster/src/control/client-display/command_client_display.cpp @@ -1,72 +1,59 @@ #include "command_client_display.hpp" - -modm::ResumableResult BeybladeIndicator::sendInitialGraphics() +modm::ResumableResult BeybladeIndicator::sendInitialGraphics(src::Drivers *drivers) { - // The number represents the index of the resumable function in this class - RF_BEGIN(0); - - RF_CALL(refSerialTransmitter.sendGraphic(&msg)); + // The number represents the index of the resumable function in this class + RF_BEGIN(0); + + tap::buzzer::playNote(&drivers->pwm, 880); + RF_CALL(refSerialTransmitter.sendGraphic(&msg)); - RF_END(); + RF_END(); } modm::ResumableResult BeybladeIndicator::update() { - // This is the second resumable function so its index is 1 - RF_BEGIN(1); + // This is the second resumable function so its index is 1 + RF_BEGIN(1); - RF_CALL(refSerialTransmitter.sendGraphic(&msg)); + RF_CALL(refSerialTransmitter.sendGraphic(&msg)); - RF_END(); + RF_END(); } void BeybladeIndicator::initialize() { - RefSerialTransmitter::configGraphicGenerics( - &msg.graphicData[0], - graphicName, - RefSerialData::Tx::GRAPHIC_ADD, - 1, // Graphic layer can be 0-9 - RefSerialData::Tx::GraphicColor::PINK - ); - RefSerialTransmitter::configCircle( - 50, - 1920/2, - 1080/2, - 200, - &msg.graphicData[0] - ); - } + RefSerialTransmitter::configGraphicGenerics( + &msg.graphicData[0], + graphicName, + RefSerialData::Tx::GRAPHIC_ADD, + 1, // Graphic layer can be 0-9 + RefSerialData::Tx::GraphicColor::PINK); + RefSerialTransmitter::configCircle(10, 400, 400, 200, &msg.graphicData[0]); +} namespace commands { -void CommandClientDisplay::restartHud() +void CommandClientDisplay::initialize() { - beybladeIndicator.initialize(); - - this->restarting = false; + beybladeIndicator.initialize(); + restart(); } -bool CommandClientDisplay::run() -{ - if (!this->isRunning()) { - restart(); - this->restartHud(); - } +void CommandClientDisplay::execute() { run(); } + +void CommandClientDisplay::end(bool) { tap::buzzer::silenceBuzzer(&drivers->pwm); } - PT_BEGIN(); - - PT_WAIT_UNTIL(drivers->refSerial.getRefSerialReceivingData()); +bool CommandClientDisplay::isFinished() const { return !isRunning(); } - PT_CALL(beybladeIndicator.sendInitialGraphics()); +bool CommandClientDisplay::run() +{ + PT_BEGIN(); - while (!this->restarting) { - PT_CALL(beybladeIndicator.update()); - PT_YIELD(); - } + PT_WAIT_UNTIL(drivers->refSerial.getRefSerialReceivingData()); + PT_CALL(beybladeIndicator.sendInitialGraphics(drivers)); - PT_END(); + PT_END(); } -} \ No newline at end of file +} // namespace commands \ No newline at end of file diff --git a/ut-robomaster/src/control/client-display/command_client_display.hpp b/ut-robomaster/src/control/client-display/command_client_display.hpp index 2300978d..15d519bf 100644 --- a/ut-robomaster/src/control/client-display/command_client_display.hpp +++ b/ut-robomaster/src/control/client-display/command_client_display.hpp @@ -1,41 +1,40 @@ #pragma once -#include "tap/control/command.hpp" -#include "tap/communication/serial/ref_serial_transmitter.hpp" +#include "tap/communication/sensors/buzzer/buzzer.hpp" #include "tap/communication/serial/ref_serial_data.hpp" +#include "tap/communication/serial/ref_serial_transmitter.hpp" +#include "tap/control/command.hpp" + +#include "control/client-display/client_display_subsystem.hpp" #include "modm/processing/protothread.hpp" #include "modm/processing/resumable.hpp" - -#include "tap/communication/sensors/buzzer/buzzer.hpp" +#include "subsystems/flywheel/flywheel_subsystem.hpp" #include "drivers.hpp" -#include "control/client-display/client_display_subsystem.hpp" - -#include "subsystems/chassis/chassis_subsystem.hpp" - using namespace tap::control; using namespace tap::communication::serial; using subsystems::control::ClientDisplaySubsystem; -using subsystems::chassis::ChassisSubsystem; +using subsystems::flywheel::FlywheelSubsystem; class BeybladeIndicator : protected modm::Resumable<2> { private: - const uint8_t* graphicName = (uint8_t*)"\x00\x00\x01"; - RefSerialTransmitter &refSerialTransmitter; - RefSerialData::Tx::Graphic5Message msg; + const uint8_t *graphicName = (uint8_t *)"\x00\x00\x01"; + RefSerialTransmitter &refSerialTransmitter; + RefSerialData::Tx::Graphic5Message msg; public: - BeybladeIndicator(RefSerialTransmitter refSerialTransmitter) - : refSerialTransmitter(refSerialTransmitter) - {} + BeybladeIndicator(RefSerialTransmitter refSerialTransmitter) + : refSerialTransmitter(refSerialTransmitter) + { + } + + modm::ResumableResult sendInitialGraphics(src::Drivers *drivers); + modm::ResumableResult update(); - modm::ResumableResult sendInitialGraphics(); - modm::ResumableResult update(); - - void initialize(); + void initialize(); }; namespace commands @@ -43,38 +42,26 @@ namespace commands class CommandClientDisplay : public Command, modm::pt::Protothread { private: - src::Drivers* drivers; - RefSerialTransmitter refSerialTransmitter; - BeybladeIndicator beybladeIndicator; - bool restarting = true; + src::Drivers *drivers; + RefSerialTransmitter refSerialTransmitter; + BeybladeIndicator beybladeIndicator; - void restartHud(); public: - CommandClientDisplay( - src::Drivers *drivers, - ChassisSubsystem *chassis) - : Command(), - drivers(drivers), - refSerialTransmitter(drivers), - beybladeIndicator(refSerialTransmitter) - { - addSubsystemRequirement(chassis); - } - - bool run(); - - const char *getName() const override { return "client display"; } - void initialize() override - { - tap::buzzer::playNote(&drivers->pwm, 880); - this->restarting = true; - }; + CommandClientDisplay(src::Drivers *drivers, FlywheelSubsystem *flywheel) + : Command(), + drivers(drivers), + refSerialTransmitter(drivers), + beybladeIndicator(refSerialTransmitter) + { + addSubsystemRequirement(flywheel); + } + + bool run(); - void execute() override - { - run(); - } - void end(bool) override {} - bool isFinished() const override { return false; } + void initialize() override; + void execute() override; + void end(bool) override; + bool isFinished() const override; + const char *getName() const override { return "client display"; } }; -} \ No newline at end of file +} // namespace commands \ No newline at end of file diff --git a/ut-robomaster/src/robots/standard/standard_control.hpp b/ut-robomaster/src/robots/standard/standard_control.hpp index d9aa5d20..651113e1 100644 --- a/ut-robomaster/src/robots/standard/standard_control.hpp +++ b/ut-robomaster/src/robots/standard/standard_control.hpp @@ -1,3 +1,4 @@ +#include "control/client-display/command_client_display.hpp" #include "robots/common/common_control_manual.hpp" #include "subsystems/agitator/command_agitator_continuous.hpp" @@ -15,6 +16,8 @@ class StandardControl : CommonControlManual drivers->commandMapper.addMap(&leftMouseDown); drivers->commandMapper.addMap(&leftSwitchUp); + + drivers->commandMapper.addMap(&hudTestKey); } private: @@ -29,6 +32,8 @@ class StandardControl : CommonControlManual BarrelId::STANDARD1, true}; + commands::CommandClientDisplay hudTest{drivers, &flywheel}; + // Mappings HoldCommandMapping leftMouseDown{ drivers, @@ -39,4 +44,6 @@ class StandardControl : CommonControlManual drivers, {&rotateAgitator_SwitchUp, &rotateFlywheel_SwitchMid}, RemoteMapState(Remote::Switch::LEFT_SWITCH, Remote::SwitchState::UP)}; + + HoldCommandMapping hudTestKey{drivers, {&hudTest}, RemoteMapState({Remote::Key::Q})}; }; \ No newline at end of file From 28b77bee7473b5b35fa142c55e131bd68549df63 Mon Sep 17 00:00:00 2001 From: Caleb Chalmers Date: Sun, 10 Nov 2024 01:24:41 +0000 Subject: [PATCH 4/4] Add basic working example that actually works --- .../client-display/command_client_display.cpp | 58 ++++++++----------- .../client-display/command_client_display.hpp | 33 +++-------- .../src/robots/standard/standard_control.hpp | 2 +- 3 files changed, 33 insertions(+), 60 deletions(-) diff --git a/ut-robomaster/src/control/client-display/command_client_display.cpp b/ut-robomaster/src/control/client-display/command_client_display.cpp index 0f5de75a..3e0c3dd4 100644 --- a/ut-robomaster/src/control/client-display/command_client_display.cpp +++ b/ut-robomaster/src/control/client-display/command_client_display.cpp @@ -1,58 +1,50 @@ #include "command_client_display.hpp" -modm::ResumableResult BeybladeIndicator::sendInitialGraphics(src::Drivers *drivers) +namespace commands { - // The number represents the index of the resumable function in this class - RF_BEGIN(0); - - tap::buzzer::playNote(&drivers->pwm, 880); - RF_CALL(refSerialTransmitter.sendGraphic(&msg)); - - RF_END(); -} -modm::ResumableResult BeybladeIndicator::update() +void CommandClientDisplay::initialize() { - // This is the second resumable function so its index is 1 - RF_BEGIN(1); - - RF_CALL(refSerialTransmitter.sendGraphic(&msg)); - - RF_END(); -} + tap::buzzer::playNote(&drivers->pwm, 440); + restart(); -void BeybladeIndicator::initialize() -{ RefSerialTransmitter::configGraphicGenerics( - &msg.graphicData[0], - graphicName, + &msg.graphicData, + graphicId, RefSerialData::Tx::GRAPHIC_ADD, - 1, // Graphic layer can be 0-9 + 0, RefSerialData::Tx::GraphicColor::PINK); - RefSerialTransmitter::configCircle(10, 400, 400, 200, &msg.graphicData[0]); -} -namespace commands -{ - -void CommandClientDisplay::initialize() -{ - beybladeIndicator.initialize(); - restart(); + // RESOLUTION HAS TO BE 1920x1080 OR HUD WILL NOT WORK PROPERLY + RefSerialTransmitter::configCircle(10, 1920 / 2, 1080 / 2, 100, &msg.graphicData); } void CommandClientDisplay::execute() { run(); } void CommandClientDisplay::end(bool) { tap::buzzer::silenceBuzzer(&drivers->pwm); } -bool CommandClientDisplay::isFinished() const { return !isRunning(); } +bool CommandClientDisplay::isFinished() const { return false; } bool CommandClientDisplay::run() { + float t = sinf(tap::arch::clock::getTimeMilliseconds() / 1000.0f * 4.0f) * 0.5f + 0.5f; + PT_BEGIN(); PT_WAIT_UNTIL(drivers->refSerial.getRefSerialReceivingData()); - PT_CALL(beybladeIndicator.sendInitialGraphics(drivers)); + + // setup new graphic (GRAPHIC_ADD operation) + PT_CALL(refSerialTransmitter.sendGraphic(&msg)); + + while (true) + { + msg.graphicData.operation = RefSerialData::Tx::GRAPHIC_MODIFY; + msg.graphicData.lineWidth = 5.0f + 25.0f * t; + msg.graphicData.radius = 100.0f + 300.0f * t; + + // modify existing graphic based on the ID (GRAPHIC_MODIFY operation) + PT_CALL(refSerialTransmitter.sendGraphic(&msg)); + } PT_END(); } diff --git a/ut-robomaster/src/control/client-display/command_client_display.hpp b/ut-robomaster/src/control/client-display/command_client_display.hpp index 15d519bf..c6593f59 100644 --- a/ut-robomaster/src/control/client-display/command_client_display.hpp +++ b/ut-robomaster/src/control/client-display/command_client_display.hpp @@ -18,40 +18,15 @@ using namespace tap::communication::serial; using subsystems::control::ClientDisplaySubsystem; using subsystems::flywheel::FlywheelSubsystem; -class BeybladeIndicator : protected modm::Resumable<2> -{ -private: - const uint8_t *graphicName = (uint8_t *)"\x00\x00\x01"; - RefSerialTransmitter &refSerialTransmitter; - RefSerialData::Tx::Graphic5Message msg; - -public: - BeybladeIndicator(RefSerialTransmitter refSerialTransmitter) - : refSerialTransmitter(refSerialTransmitter) - { - } - - modm::ResumableResult sendInitialGraphics(src::Drivers *drivers); - modm::ResumableResult update(); - - void initialize(); -}; - namespace commands { class CommandClientDisplay : public Command, modm::pt::Protothread { -private: - src::Drivers *drivers; - RefSerialTransmitter refSerialTransmitter; - BeybladeIndicator beybladeIndicator; - public: CommandClientDisplay(src::Drivers *drivers, FlywheelSubsystem *flywheel) : Command(), drivers(drivers), - refSerialTransmitter(drivers), - beybladeIndicator(refSerialTransmitter) + refSerialTransmitter(drivers) { addSubsystemRequirement(flywheel); } @@ -63,5 +38,11 @@ class CommandClientDisplay : public Command, modm::pt::Protothread void end(bool) override; bool isFinished() const override; const char *getName() const override { return "client display"; } + +private: + src::Drivers *drivers; + RefSerialTransmitter refSerialTransmitter; + const uint8_t graphicId[3] = {0, 0, 1}; // 3 byte identifier for this graphic element + RefSerialData::Tx::Graphic1Message msg; }; } // namespace commands \ No newline at end of file diff --git a/ut-robomaster/src/robots/standard/standard_control.hpp b/ut-robomaster/src/robots/standard/standard_control.hpp index 651113e1..02d43400 100644 --- a/ut-robomaster/src/robots/standard/standard_control.hpp +++ b/ut-robomaster/src/robots/standard/standard_control.hpp @@ -45,5 +45,5 @@ class StandardControl : CommonControlManual {&rotateAgitator_SwitchUp, &rotateFlywheel_SwitchMid}, RemoteMapState(Remote::Switch::LEFT_SWITCH, Remote::SwitchState::UP)}; - HoldCommandMapping hudTestKey{drivers, {&hudTest}, RemoteMapState({Remote::Key::Q})}; + HoldCommandMapping hudTestKey{drivers, {&hudTest}, RemoteMapState({Remote::Key::Z})}; }; \ No newline at end of file