From 7e60bf481f06a2f4fc094e223751815728c48bc3 Mon Sep 17 00:00:00 2001 From: 321aurora <2508260166@qq.com> Date: Wed, 9 Jul 2025 17:34:58 +0800 Subject: [PATCH 1/2] Achieve a fixed speed for the first friction wheel and adjust secondary friction wheel. --- rm_shooter_controllers/src/standard.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/rm_shooter_controllers/src/standard.cpp b/rm_shooter_controllers/src/standard.cpp index c2e0d541..a1dfbc01 100644 --- a/rm_shooter_controllers/src/standard.cpp +++ b/rm_shooter_controllers/src/standard.cpp @@ -297,8 +297,14 @@ void Controller::setSpeed(const rm_msgs::ShootCmd& cmd) { for (size_t j = 0; j < ctrls_friction_[i].size(); j++) { - ctrls_friction_[i][j]->setCommand(wheel_speed_directions_[i][j] * - (cmd_.wheel_speed + config_.extra_wheel_speed + wheel_speed_offsets_[i][j])); + if (j == 0) + ctrls_friction_[i][j]->setCommand( + wheel_speed_directions_[i][j] * + (cmd_.wheel_speed + config_.extra_wheel_speed + cmd_.wheels_speed_offset_front)); + if (j == 1) + ctrls_friction_[i][j]->setCommand( + wheel_speed_directions_[i][j] * + (cmd_.wheel_speed + config_.extra_wheel_speed + cmd_.wheels_speed_offset_back)); } } } From a617778b880fd4e36c8f0edc0ec8b6db1cbbdbb5 Mon Sep 17 00:00:00 2001 From: 321aurora <2508260166@qq.com> Date: Sun, 20 Jul 2025 20:34:59 +0800 Subject: [PATCH 2/2] Fix logic wrong. --- rm_shooter_controllers/src/standard.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rm_shooter_controllers/src/standard.cpp b/rm_shooter_controllers/src/standard.cpp index a1dfbc01..07089712 100644 --- a/rm_shooter_controllers/src/standard.cpp +++ b/rm_shooter_controllers/src/standard.cpp @@ -297,14 +297,15 @@ void Controller::setSpeed(const rm_msgs::ShootCmd& cmd) { for (size_t j = 0; j < ctrls_friction_[i].size(); j++) { + // Used to distinguish the front and rear friction wheels. if (j == 0) ctrls_friction_[i][j]->setCommand( wheel_speed_directions_[i][j] * - (cmd_.wheel_speed + config_.extra_wheel_speed + cmd_.wheels_speed_offset_front)); + (cmd_.wheel_speed + config_.extra_wheel_speed + cmd_.wheels_speed_offset_back)); if (j == 1) ctrls_friction_[i][j]->setCommand( wheel_speed_directions_[i][j] * - (cmd_.wheel_speed + config_.extra_wheel_speed + cmd_.wheels_speed_offset_back)); + (cmd_.wheel_speed + config_.extra_wheel_speed + cmd_.wheels_speed_offset_front)); } } }