Skip to content

Commit

Permalink
Add param sign assert
Browse files Browse the repository at this point in the history
Signed-off-by: RBT22 <[email protected]>
  • Loading branch information
RBT22 committed Jan 24, 2025
1 parent 09947ca commit d4f32d7
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,11 @@ class DriveOnHeading : public TimedBehavior<ActionT>
node->get_parameter(this->behavior_name_ + ".acceleration_limit", acceleration_limit_);
node->get_parameter(this->behavior_name_ + ".deceleration_limit", deceleration_limit_);
node->get_parameter(this->behavior_name_ + ".minimum_speed", minimum_speed_);
if (acceleration_limit_ < 0.0 || deceleration_limit_ > 0.0) {
RCLCPP_ERROR(this->logger_, "DriveOnHeading: acceleration_limit and deceleration_limit must be "
"positive and negative respectively");
throw std::runtime_error{"Invalid parameter: acceleration_limit or deceleration_limit"};
}
}

typename ActionT::Feedback::SharedPtr feedback_;
Expand Down

0 comments on commit d4f32d7

Please sign in to comment.