From 89092f771bafe6761c49767a7df6432c94f55911 Mon Sep 17 00:00:00 2001 From: Robofish <1683502971@qq.com> Date: Sun, 5 Oct 2025 19:10:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E8=BD=AE=E5=AD=90=E6=96=B9=E5=90=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- User/module/balance_chassis.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/User/module/balance_chassis.c b/User/module/balance_chassis.c index c661ecb..4ac57b2 100644 --- a/User/module/balance_chassis.c +++ b/User/module/balance_chassis.c @@ -73,9 +73,9 @@ static void Chassis_UpdateChassisState(Chassis_t *c) { return; // 从轮子编码器估计机体速度 (参考C++代码) - float left_wheel_speed_dps = c->feedback.wheel[0].rotor_speed; // dps (度每秒) + float left_wheel_speed_dps = -c->feedback.wheel[0].rotor_speed; // dps (度每秒) float right_wheel_speed_dps = - c->feedback.wheel[1].rotor_speed; // dps (度每秒) + -c->feedback.wheel[1].rotor_speed; // dps (度每秒) // 将dps转换为rad/s float left_wheel_speed = left_wheel_speed_dps * M_PI / 180.0f; // rad/s @@ -263,10 +263,10 @@ void Chassis_Output(Chassis_t *c) { // } float out[4] = { c->output.joint[0], c->output.joint[1], c->output.joint[2], c->output.joint[3]}; - // out[0] = -1.0f; - // out[1] = 1.0f; - // out[2] = 1.0f; - // out[3] = -1.0f; + // out[0] = 0.0f; + // out[1] = 0.0f; + // out[2] = 0.0f; + // out[3] = 0.0f; Virtual_Chassis_SendJointTorque(&virtual_chassis, out); Virtual_Chassis_SendWheelCommand(&virtual_chassis, c->output.wheel[0], c->output.wheel[1]); // for (int i = 0; i < 2; i++) {