Skip to content

Commit

Permalink
refactor(oepration__mode_transition_manager): improve visibility for …
Browse files Browse the repository at this point in the history
…debug topic (#2573)

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>
  • Loading branch information
TakaHoribe authored Dec 23, 2022
1 parent 065affc commit 03facbf
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
4 changes: 3 additions & 1 deletion control/operation_mode_transition_manager/src/state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

#include "state.hpp"

#include "util.hpp"

#include <motion_utils/motion_utils.hpp>
#include <tier4_autoware_utils/tier4_autoware_utils.hpp>

Expand Down Expand Up @@ -197,7 +199,7 @@ std::pair<bool, bool> AutonomousMode::hasDangerLateralAcceleration()
bool AutonomousMode::isModeChangeAvailable()
{
if (!check_engage_condition_) {
debug_info_.is_all_ok = true;
setAllOk(debug_info_);
return true;
}

Expand Down
37 changes: 37 additions & 0 deletions control/operation_mode_transition_manager/src/util.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Copyright 2022 Autoware Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef UTIL_HPP_
#define UTIL_HPP_

#include "operation_mode_transition_manager/msg/operation_mode_transition_manager_debug.hpp"

using DebugInfo = operation_mode_transition_manager::msg::OperationModeTransitionManagerDebug;

void setAllOk(DebugInfo & debug_info)
{
debug_info.is_all_ok = true;
debug_info.engage_allowed_for_stopped_vehicle = true;
debug_info.large_acceleration_ok = true;
debug_info.large_lateral_acceleration_diff_ok = true;
debug_info.large_lateral_acceleration_ok = true;
debug_info.lateral_deviation_ok = true;
debug_info.speed_lower_deviation_ok = true;
debug_info.speed_upper_deviation_ok = true;
debug_info.stop_ok = true;
debug_info.trajectory_available_ok = true;
debug_info.yaw_deviation_ok = true;
}

#endif // UTIL_HPP_

0 comments on commit 03facbf

Please sign in to comment.