Skip to content

Commit fc89dde

Browse files
committed
添加舵轮底盘
1 parent d3a0cde commit fc89dde

File tree

2 files changed

+1
-20
lines changed

2 files changed

+1
-20
lines changed

src/module/helm_chassis/mod_helm_chassis.cpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,6 @@ HelmChassis<Motor, MotorParam>::HelmChassis(Param& param, float control_freq)
8181
reinterpret_cast<float*>(System::Memory::Malloc(
8282
4 * sizeof(*this->setpoint_.motor_rotational_speed)));
8383
ASSERT(this->setpoint_.motor_rotational_speed);
84-
// this->setpoint_.wheel_pos = reinterpret_cast<float*>(
85-
// System::Memory::Malloc(4 * sizeof(*this->setpoint_.wheel_pos)));
86-
// ASSERT(this->setpoint_.wheel_pos);
8784
auto event_callback = [](ChassisEvent event, HelmChassis* chassis) {
8885
chassis->ctrl_lock_.Wait(UINT32_MAX);
8986

@@ -247,24 +244,8 @@ void HelmChassis<Motor, MotorParam>::Control() {
247244
case HelmChassis::BREAK:
248245
break;
249246
case HelmChassis::INDENPENDENT: /* 独立模式wz为0 */
250-
// // this->move_vec_.wz = this->cmd_.z;
251-
// for (int i = 0; i < 4; i++) {
252-
// this->setpoint_.wheel_pos[i] += this->gyro_angle_[i];
253-
// }
254-
// break;
255247
case HelmChassis::FOLLOW_GIMBAL: /* 跟随模式通过PID控制使车头跟随云台
256248
*/
257-
// // this->move_vec_.wz =
258-
// // this->follow_pid_.Calculate(0.0f, this->yaw_, this->dt_);
259-
260-
// // if (this->move_vec_.wz < 0.01 && this->move_vec_.wz > -0.01) {
261-
// // this->move_vec_.wz = 0;
262-
// // }
263-
264-
// for (int i = 0; i < 4; i++) {
265-
// this->setpoint_.wheel_pos[i] += this->gyro_angle_[i];
266-
// }
267-
// break;
268249
case HelmChassis::ROTOR: /* 小陀螺模式使底盘以一定速度旋转
269250
*/
270251
for (int i = 0; i < 4; i++) {

src/module/helm_chassis/mod_helm_chassis.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class HelmChassis {
139139
/* PID计算的目标值 */
140140
struct {
141141
float *motor_rotational_speed; /* 电机转速的动态数组,单位:RPM */
142-
std::array<float, 4> wheel_pos;
142+
std::array<float, 4> wheel_pos; /* 电机旋转角度数组 */
143143
} setpoint_;
144144

145145
/* 反馈控制用的PID */

0 commit comments

Comments
 (0)