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:
mangavalkandClaude Opus 5.5 committed 2026-09-28 18:14:00 +02:00
1 parent ad77b06c36
commit 91dac16fca
30 files changed
+1706 -57

No files matched your search

+1 -21
View File
@@ -1,26 +1,6 @@
#pragma once
#include <Arduino.h>
// Remote -> robot, sent at a fixed rate. Kept as the single source of truth
// here so a future remote sketch just has to fill this same struct and
// radio.write() it - nothing on the robot side needs to change.
struct CmdPacket {
int16_t vx = 0, vy = 0; // left stick: strafe / forward-back, -1000..1000
int16_t yaw_rate = 0; // left stick twist, -1000..1000
int16_t rx = 0, ry = 0, rz = 0; // right stick: roll/pitch/yaw OR X/Y/height, per flags
uint8_t speed_scale = 128; // 0-255
uint8_t flags = 0; // bit-packed, see FLAG_* below
uint8_t seq = 0;
};
constexpr uint8_t FLAG_ARMED = 1 << 0;
constexpr uint8_t FLAG_STAND = 1 << 1; // 0 = sit requested, 1 = stand requested
constexpr uint8_t FLAG_WALK = 1 << 2; // stick past deadzone -> walking
constexpr uint8_t FLAG_MODE_B = 1 << 3; // 0 = mode A direct, 1 = mode B heading-hold
constexpr uint8_t FLAG_RSTICK_XLATE = 1 << 4; // 0 = right stick = rotation, 1 = translation
constexpr uint8_t FLAG_GAIT_WAVE = 1 << 5; // 0 = tripod requested, 1 = wave requested
constexpr uint8_t FLAG_REMOTE_GYRO = 1 << 6; // remote tilt feedforward enabled
constexpr uint8_t FLAG_ROBOT_GYRO = 1 << 7; // robot stabilization feedback enabled
#include <HexapodProtocol.h> // CmdPacket + FLAG_* + radio settings, shared with the remote (shared/)
class Comms {
public: