Skip to content

Commit

Permalink
[following] add lethal cost threshold config (#200)
Browse files Browse the repository at this point in the history
* Add lethal cost threshold config

* Format
  • Loading branch information
yambati03 authored Jun 1, 2024
1 parent 42bbe04 commit e977673
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ follower_action_server:
ros__parameters:
lookahead_distance: 0.9
desired_linear_velocity: 0.5
lethal_cost_threshold: 10
cmd_vel_stamped: true
cmd_vel_topic: "/rover_drivetrain_controller/cmd_vel"
odom_topic: "/rover_drivetrain_controller/odom"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ FollowerActionServer::FollowerActionServer(const rclcpp::NodeOptions & options)
declare_parameter("map_frame", "map");
declare_parameter("goal_tolerance", 0.1);
declare_parameter("cmd_vel_stamped", false);
declare_parameter("lethal_cost_threshold", 50);

tf_buffer_ = std::make_unique<tf2_ros::Buffer>(this->get_clock());
tf_listener_ = std::make_shared<tf2_ros::TransformListener>(*tf_buffer_);
Expand Down Expand Up @@ -219,7 +220,7 @@ void FollowerActionServer::execute(
break;
} else if (getCost(
current_costmap_, output.lookahead_point.point.x,
output.lookahead_point.point.y) > 0)
output.lookahead_point.point.y) > get_parameter("lethal_cost_threshold").as_int())
{
result->error_code = urc_msgs::action::FollowPath::Result::OBSTACLE_DETECTED;
goal_handle->abort(result);
Expand Down

0 comments on commit e977673

Please sign in to comment.