From d7a6bffe0a08edfb7b66d3acb3ac00435068efc8 Mon Sep 17 00:00:00 2001 From: Rune Harlyk Date: Mon, 1 Sep 2025 22:37:58 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Update=20the=20rotation=20comman?= =?UTF-8?q?d=20handling?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/lib/gait.ts | 4 ++-- esp32/include/motion.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/lib/gait.ts b/app/src/lib/gait.ts index df8e504..f77b24b 100644 --- a/app/src/lib/gait.ts +++ b/app/src/lib/gait.ts @@ -111,8 +111,8 @@ export class StandState extends GaitState { step(body_state: body_state_t, command: ControllerCommand, dt: number = 0.02) { body_state.omega = 0 - body_state.phi = command.rx - body_state.psi = command.ry + body_state.phi = command.rx * 10 * (Math.PI / 2) + body_state.psi = command.ry * 10 * (Math.PI / 2) body_state.xm = command.ly / 4 body_state.zm = command.lx / 4 body_state.feet = this.default_feet_pos diff --git a/esp32/include/motion.h b/esp32/include/motion.h index 5c6e363..4c6920d 100644 --- a/esp32/include/motion.h +++ b/esp32/include/motion.h @@ -64,8 +64,8 @@ class MotionService { switch (motionState) { case MOTION_STATE::STAND: { - body_state.phi = command.rx; // * 0.254f; - body_state.psi = command.ry; // * 0.254f; + body_state.phi = command.rx * 10 * (float)M_PI_2; + body_state.psi = command.ry * 10 * (float)M_PI_2; body_state.xm = command.ly / 4; body_state.zm = command.lx / 4; body_state.updateFeet(kinematics.default_feet_positions);