Initial import: robot firmware + PlatformIO two-env scaffold
Robot-side firmware (Teensy 4.0) imported unchanged as extracted. platformio.ini defines [env:robot] (teensy40) and [env:remote] (teensy41); scripts/select_src_dir.py points each env at its own sketch folder so robot/ and remote/ stay Arduino-style sketches. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
ad77b06c36
27 files changed
+1107
No files matched your search
@@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
enum class RobotState { DISARMED, SIT, STAND, WALKING };
|
||||
|
||||
class StateMachine {
|
||||
public:
|
||||
void begin() { state_ = RobotState::DISARMED; blend_ = 0; }
|
||||
void update(bool armed_request, bool stand_request, bool walk_active_request, float dt);
|
||||
|
||||
RobotState state() const { return state_; }
|
||||
float sitStandBlend() const { return blend_; } // 0 = sit pose, 1 = stand pose
|
||||
|
||||
private:
|
||||
RobotState state_ = RobotState::DISARMED;
|
||||
float blend_ = 0;
|
||||
static constexpr float BLEND_RATE = 1.0f; // per second - full sit->stand in ~1s
|
||||
};
|
||||
Reference in new issue
Block a user