Skip to content
Prev Previous commit
Next Next commit
Add param sign assert
Signed-off-by: RBT22 <rozgonyibalint@gmail.com>
  • Loading branch information
RBT22 committed Jan 27, 2025
commit a854c74035aa4ab933dc6e6372d7288835290df2
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