Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -180,6 +186,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