From a76825b83e2ad572e06e3e7162d06862412df94f Mon Sep 17 00:00:00 2001 From: liyixin135 <421159734@qq.com> Date: Sun, 12 May 2024 01:47:36 +0800 Subject: [PATCH] Modify switch_camera method. --- src/chassis_gimbal_shooter_manual.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/chassis_gimbal_shooter_manual.cpp b/src/chassis_gimbal_shooter_manual.cpp index 2fcffb68..91882699 100644 --- a/src/chassis_gimbal_shooter_manual.cpp +++ b/src/chassis_gimbal_shooter_manual.cpp @@ -370,6 +370,8 @@ void ChassisGimbalShooterManual::mouseRightPress() void ChassisGimbalShooterManual::ePress() { + if (camera_switch_cmd_sender_) + camera_switch_cmd_sender_->switchCamera(); switch_armor_target_srv_->setArmorTargetType(rm_msgs::StatusChangeRequest::ARMOR_OUTPOST_BASE); switch_armor_target_srv_->callService(); shooter_cmd_sender_->setArmorType(switch_armor_target_srv_->getArmorTarget()); @@ -377,6 +379,8 @@ void ChassisGimbalShooterManual::ePress() void ChassisGimbalShooterManual::eRelease() { + if (camera_switch_cmd_sender_) + camera_switch_cmd_sender_->switchCamera(); switch_armor_target_srv_->setArmorTargetType(rm_msgs::StatusChangeRequest::ARMOR_ALL); switch_armor_target_srv_->callService(); shooter_cmd_sender_->setArmorType(switch_armor_target_srv_->getArmorTarget()); @@ -414,8 +418,6 @@ void ChassisGimbalShooterManual::bRelease() void ChassisGimbalShooterManual::rPress() { - if (camera_switch_cmd_sender_) - camera_switch_cmd_sender_->switchCamera(); if (scope_cmd_sender_) { use_scope_ = !scope_cmd_sender_->getState();