From 2a42eb5f3c4e7de411990f41ab47dad361a6d07b Mon Sep 17 00:00:00 2001 From: Rune Harlyk Date: Mon, 27 May 2024 01:25:10 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=AA=A0=20Adds=20GaitPlanner=20interface?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- esp32/lib/ESP32-sveltekit/Kinematics.h | 34 ++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/esp32/lib/ESP32-sveltekit/Kinematics.h b/esp32/lib/ESP32-sveltekit/Kinematics.h index 3b0b721..8856e82 100644 --- a/esp32/lib/ESP32-sveltekit/Kinematics.h +++ b/esp32/lib/ESP32-sveltekit/Kinematics.h @@ -196,4 +196,38 @@ public: } }; +typedef struct { + float x, z, yaw; +} position_target_t; + +typedef struct { + float step_length; + float yaw_rate; + float lateral_shift; + float step_velocity; + float swing_period; + float clearance_height; + float penetration_depth; +} gait_state_t; + +class GaitPlanner +{ + public: + GaitPlanner() { } + + ~GaitPlanner() { } + + void update_trajectory(position_target_t position_target, float dt, body_state_t body_state) { + // for (int8_t i = 0; i < 4; i++) { + // body_state.feet_position[i][0] = position_target.x; + // body_state.feet_position[i][3] = position_target.z; + // } + } + + private: + uint16_t time; + uint16_t target_yaw; +}; + + #endif \ No newline at end of file