Skip to content

Commit

Permalink
Revert "fixed cntrl & tracker switching while rc mode active"
Browse files Browse the repository at this point in the history
This reverts commit f3d5d5d.
  • Loading branch information
klaxalk committed Aug 28, 2024
1 parent c520c0d commit 9736826
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/control_manager/control_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6950,8 +6950,6 @@ void ControlManager::bumperPushFromObstacle(void) {

if (!bumper_repulsing_) {

bumper_repulsing_ = true;

if (_bumper_switch_tracker_) {

auto active_tracker_idx = mrs_lib::get_mutexed(mutex_tracker_list_, active_tracker_idx_);
Expand Down Expand Up @@ -6981,6 +6979,8 @@ void ControlManager::bumperPushFromObstacle(void) {
}
}

bumper_repulsing_ = true;

callbacks_enabled_ = false;

mrs_msgs::ReferenceSrvResponse::ConstPtr tracker_response;
Expand Down Expand Up @@ -8075,9 +8075,7 @@ std::tuple<bool, std::string> ControlManager::switchTracker(const std::string& t
return std::tuple(false, ss.str());
}

if (rc_goto_active_ && tracker_name != _ehover_tracker_name_ && tracker_name != _landoff_tracker_name_ && tracker_name != _null_tracker_name_ &&
!bumper_repulsing_) {

if (rc_goto_active_) {
ss << "can not switch tracker, the RC joystick is active";
ROS_WARN_STREAM_THROTTLE(1.0, "[ControlManager]: " << ss.str());
return std::tuple(false, ss.str());
Expand Down Expand Up @@ -8217,9 +8215,7 @@ std::tuple<bool, std::string> ControlManager::switchController(const std::string
return std::tuple(false, ss.str());
}

if (rc_goto_active_ && controller_name != _failsafe_controller_name_ && controller_name != _eland_controller_name_ &&
controller_name != _bumper_controller_name_ && !bumper_repulsing_) {

if (rc_goto_active_) {
ss << "can not switch controller, the RC joystick is active";
ROS_WARN_STREAM_THROTTLE(1.0, "[ControlManager]: " << ss.str());
return std::tuple(false, ss.str());
Expand Down

0 comments on commit 9736826

Please sign in to comment.