Skip to content

Commit

Permalink
fix(emergency_handler): fix mrm handling when mrm behavior is none (a…
Browse files Browse the repository at this point in the history
…utowarefoundation#2476)

Signed-off-by: Makoto Kurihara <mkuri8m@gmail.com>

Signed-off-by: Makoto Kurihara <mkuri8m@gmail.com>
  • Loading branch information
mkuri authored Dec 8, 2022
1 parent 2dde073 commit d3b86a3
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ void EmergencyHandler::callMrmBehavior(
auto request = std::make_shared<tier4_system_msgs::srv::OperateMrm::Request>();
request->operate = true;

if (mrm_behavior == MrmState::NONE) {
RCLCPP_WARN(this->get_logger(), "MRM behavior is None. Do nothing.");
return;
}
if (mrm_behavior == MrmState::COMFORTABLE_STOP) {
auto result = client_mrm_comfortable_stop_->async_send_request(request).get();
if (result->response.success == true) {
Expand Down Expand Up @@ -253,6 +257,10 @@ void EmergencyHandler::cancelMrmBehavior(
auto request = std::make_shared<tier4_system_msgs::srv::OperateMrm::Request>();
request->operate = false;

if (mrm_behavior == MrmState::NONE) {
// Do nothing
return;
}
if (mrm_behavior == MrmState::COMFORTABLE_STOP) {
auto result = client_mrm_comfortable_stop_->async_send_request(request).get();
if (result->response.success == true) {
Expand Down

0 comments on commit d3b86a3

Please sign in to comment.