Skip to content

Commit

Permalink
feat(transition_manager): add param to ignore autonomous transition c…
Browse files Browse the repository at this point in the history
…ondition (autowarefoundation#2453)

* feat(transition_manager): add param to ignore autonomous transition condition

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

* same for modeChangeCompleted

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

* remove debug print

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

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>
  • Loading branch information
TakaHoribe authored Dec 6, 2022
1 parent d3e640d commit f984fbb
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
ros__parameters:
transition_timeout: 10.0
frequency_hz: 10.0
check_engage_condition: false # set false if you do not want to care about the engage condition.
engage_acceptable_limits:
allow_autonomous_in_stopped: true # no check if the velocity is zero, always allowed.
dist_threshold: 1.5
Expand Down
11 changes: 11 additions & 0 deletions control/operation_mode_transition_manager/src/state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ AutonomousMode::AutonomousMode(rclcpp::Node * node)
sub_trajectory_ = node->create_subscription<Trajectory>(
"trajectory", 1, [this](const Trajectory::SharedPtr msg) { trajectory_ = *msg; });

check_engage_condition_ = node->declare_parameter<bool>("check_engage_condition");

// params for mode change available
{
auto & p = engage_acceptable_param_;
Expand Down Expand Up @@ -80,6 +82,10 @@ void AutonomousMode::update(bool transition)

bool AutonomousMode::isModeChangeCompleted()
{
if (!check_engage_condition_) {
return true;
}

constexpr auto dist_max = 5.0;
constexpr auto yaw_max = M_PI_4;

Expand Down Expand Up @@ -188,6 +194,11 @@ std::pair<bool, bool> AutonomousMode::hasDangerLateralAcceleration()

bool AutonomousMode::isModeChangeAvailable()
{
if (!check_engage_condition_) {
debug_info_.is_all_ok = true;
return true;
}

constexpr auto dist_max = 100.0;
constexpr auto yaw_max = M_PI_4;

Expand Down
1 change: 1 addition & 0 deletions control/operation_mode_transition_manager/src/state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class AutonomousMode : public ModeChangeBase
rclcpp::Logger logger_;
rclcpp::Clock::SharedPtr clock_;

bool check_engage_condition_ = true; // if false, the vehicle is engaged without any checks.
EngageAcceptableParam engage_acceptable_param_;
StableCheckParam stable_check_param_;
AckermannControlCommand control_cmd_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
ros__parameters:
transition_timeout: 10.0
frequency_hz: 10.0
check_engage_condition: false # set false if you do not want to care about the engage condition.
engage_acceptable_limits:
allow_autonomous_in_stopped: true # no check if the velocity is zero, always allowed.
dist_threshold: 1.5
Expand Down

0 comments on commit f984fbb

Please sign in to comment.