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>
16 lines
611 B
C++
16 lines
611 B
C++
#pragma once
|
|
#include "Kinematics.h"
|
|
|
|
class Limits {
|
|
public:
|
|
// Clamps a foot target into a conservative safe envelope around the leg's neutral stance.
|
|
static FootTarget clampWorkspace(int leg_index, const FootTarget& target);
|
|
|
|
// Rate-limits a joint angle change to the servo's real max speed.
|
|
static float clampJointRate(float current_deg, float target_deg, float max_deg_per_sec, float dt);
|
|
|
|
// Coarse safety check: are enough legs grounded right now to be stable.
|
|
// A real support-polygon/center-of-mass check is a good later upgrade.
|
|
static bool stancePolygonOk(const bool in_stance[6]);
|
|
};
|