fix 1
This commit is contained in:
parent
9ee45df660
commit
2427e36bba
@ -771,7 +771,7 @@ int8_t Chassis_LQRControl(Chassis_t *c, const Chassis_CMD_t *c_cmd) {
|
|||||||
float gimbal_offset = c->feedback.yaw.rotor_abs_angle - c->param->mech.mech_zero_yaw;
|
float gimbal_offset = c->feedback.yaw.rotor_abs_angle - c->param->mech.mech_zero_yaw;
|
||||||
float world_vx = c_cmd->move_vec.vx * c->param->rotor_ctrl.max_trans_speed;
|
float world_vx = c_cmd->move_vec.vx * c->param->rotor_ctrl.max_trans_speed;
|
||||||
float world_vy = c_cmd->move_vec.vy * c->param->rotor_ctrl.max_trans_speed;
|
float world_vy = c_cmd->move_vec.vy * c->param->rotor_ctrl.max_trans_speed;
|
||||||
c->chassis_state.target_velocity_x = world_vx * cosf(gimbal_offset) + world_vy * sinf(gimbal_offset);
|
c->chassis_state.target_velocity_x = world_vx * sinf(gimbal_offset) - world_vy * cosf(gimbal_offset);
|
||||||
c->chassis_state.last_target_velocity_x = c->chassis_state.target_velocity_x;
|
c->chassis_state.last_target_velocity_x = c->chassis_state.target_velocity_x;
|
||||||
c->chassis_state.target_x += c->chassis_state.target_velocity_x * c->dt;
|
c->chassis_state.target_x += c->chassis_state.target_velocity_x * c->dt;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -395,14 +395,11 @@ Config_RobotParam_t robot_config = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
.rotor_ctrl = {
|
.rotor_ctrl = {
|
||||||
.max_spin_speed = 5.0236f, /* 最大旋转角速度 (rad/s),0.5rpm */
|
.max_spin_speed = 6.0f, /* 最大旋转角速度 (rad/s),0.5rpm */
|
||||||
.max_trans_speed = 1.5f, /* 小陀螺时最大平移速度 (m/s) */
|
.max_trans_speed = 1.5f, /* 小陀螺时最大平移速度 (m/s) */
|
||||||
.spin_accel = 5.0f,
|
.spin_accel = 5.0f,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* 旋转加速度 (rad/s²) */
|
/* 旋转加速度 (rad/s²) */
|
||||||
.spin_decel = 8.0f, /* 退出减速度 (rad/s²),比加速更快 */
|
.spin_decel = 8.0f, /* 退出减速度 (rad/s²),比加速更快 */
|
||||||
.align_threshold = 0.15f, /* 退出对齐阈值 (rad),约8.6° */
|
.align_threshold = 0.15f, /* 退出对齐阈值 (rad),约8.6° */
|
||||||
@ -454,7 +451,7 @@ Config_RobotParam_t robot_config = {
|
|||||||
.lqr_offset = {
|
.lqr_offset = {
|
||||||
.theta = 0.0f,
|
.theta = 0.0f,
|
||||||
.x = 0.0f,
|
.x = 0.0f,
|
||||||
.phi = 0.0f,
|
.phi = 0.01f,
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user