Draft: shared protocol, remote firmware, project docs
Not yet verified on hardware. - shared/HexapodProtocol: CmdPacket (now 20 bytes, adds remote_roll / remote_pitch), FLAG_* bits and radio settings as the single protocol definition; static payload size = sizeof(CmdPacket) on both radios. - robot: use the shared protocol; vx = forward (harness w/x <-> q/e); InputMapper adds remote tilt on top of the right stick when FLAG_REMOTE_GYRO is set, and robot.ino no longer zeroes stick roll/pitch when it's off. - remote (Teensy 4.1): Sticks (calibration, EEPROM), RemoteIMU, RemoteState (interlocks, link-loss disarm, smoothing), PacketBuilder, RadioLink, NextionUI, SerialConsole. - CLAUDE.md, README.md, remote/README.md, remote/NEXTION.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ad77b06c36
commit
91dac16fca
30 files changed
+1706
-57
No files matched your search
@@ -0,0 +1,30 @@
|
||||
#include "SerialConsole.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
bool SerialConsole::poll(UiEvent& ui, Local& local) {
|
||||
ui = UiEvent{};
|
||||
local = Local::None;
|
||||
while (Serial.available()) {
|
||||
char c = Serial.read();
|
||||
switch (c) {
|
||||
case 'a': ui.cmd = UiCmd::ToggleArm; return true;
|
||||
case 'k': ui.cmd = UiCmd::Disarm; return true;
|
||||
case 's': ui.cmd = UiCmd::ToggleStand; return true;
|
||||
case 'g': ui.cmd = UiCmd::ToggleGait; return true;
|
||||
case 'm': ui.cmd = UiCmd::ToggleWalkMode; return true;
|
||||
case 't': ui.cmd = UiCmd::ToggleRStickXlate; return true;
|
||||
case 'r': ui.cmd = UiCmd::ToggleRemoteGyro; return true;
|
||||
case 'b': ui.cmd = UiCmd::ToggleRobotGyro; return true;
|
||||
case '+': case '=': ui.cmd = UiCmd::SpeedUp; return true;
|
||||
case '-': case '_': ui.cmd = UiCmd::SpeedDown; return true;
|
||||
case 'z': ui.cmd = UiCmd::ZeroGyro; return true;
|
||||
case 'c': ui.cmd = UiCmd::CalStartSave; return true;
|
||||
case 'x': ui.cmd = UiCmd::CalCancel; return true;
|
||||
case 'p': local = Local::PrintStatus; return true;
|
||||
case 'd': local = Local::ToggleDump; return true;
|
||||
case 'R': local = Local::ResetCal; return true;
|
||||
default: break; // ignore line endings and unknown keys
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
Reference in new issue
Block a user