From ea5e1cc0aea726d93ffd038b2c9cd18d5254220b Mon Sep 17 00:00:00 2001 From: Rayy0527 <1668834312@qq.com> Date: Sun, 1 Dec 2024 21:44:17 +0800 Subject: [PATCH] Maintain Rc wheel function. --- src/chassis_gimbal_shooter_cover_manual.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/chassis_gimbal_shooter_cover_manual.cpp b/src/chassis_gimbal_shooter_cover_manual.cpp index 0e5c1c74..d7f8b0d7 100644 --- a/src/chassis_gimbal_shooter_cover_manual.cpp +++ b/src/chassis_gimbal_shooter_cover_manual.cpp @@ -155,6 +155,22 @@ void ChassisGimbalShooterCoverManual::sendCommand(const ros::Time& time) } ChassisGimbalShooterManual::sendCommand(time); cover_command_sender_->sendCommand(time); + if (state_ == PC && is_gyro_) + { + if (switch_buff_srv_->getTarget() != rm_msgs::StatusChangeRequest::ARMOR) + if (x_scale_ != 0.0 || y_scale_ != 0.0) + vel_cmd_sender_->setAngularZVel(gyro_rotate_reduction_, gyro_speed_limit_); + else + vel_cmd_sender_->setAngularZVel(1.0, gyro_speed_limit_); + else if (x_scale_ != 0.0 || y_scale_ != 0.0) + vel_cmd_sender_->setAngularZVel( + getDynamicScale(sin_gyro_base_scale_, sin_gyro_amplitude_, sin_gyro_period_, sin_gyro_phase_) * + gyro_rotate_reduction_); + else + vel_cmd_sender_->setAngularZVel( + getDynamicScale(sin_gyro_base_scale_, sin_gyro_amplitude_, sin_gyro_period_, sin_gyro_phase_)); + vel_cmd_sender_->sendCommand(time); + } } void ChassisGimbalShooterCoverManual::rightSwitchDownRise()