Skip to content

Commit

Permalink
pr comments fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Tony Najjar <[email protected]>
  • Loading branch information
tonynajjar committed Aug 8, 2024
1 parent dbd4565 commit 3f0c6c5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,9 @@ class RemoveInCollisionGoals : public BtServiceNode<nav2_msgs::srv::GetCosts>
{
return providedBasicPorts({
BT::InputPort<Goals>("input_goals", "Original goals to remove from"),
BT::InputPort<std::string>("costmap_cost_service",
"Service to get cost from costmap"),
BT::InputPort<double>("cost_threshold",
BT::InputPort<double>("cost_threshold", 254.0,
"Cost threshold for considering a goal in collision"),
BT::InputPort<bool>("use_footprint",
"Whether to use footprint cost"),
BT::InputPort<bool>("use_footprint", true, "Whether to use footprint cost"),
BT::OutputPort<Goals>("output_goals", "Goals with in-collision goals removed"),
});
}
Expand Down
8 changes: 8 additions & 0 deletions nav2_behavior_tree/nav2_tree_nodes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@
<output_port name="output_goals">Set of goals after removing any passed</output_port>
</Action>

<Action ID="RemoveInCollisionGoals">
<input_port name="service_name">Costmap service name responsible for getting the cost</input_port>
<input_port name="input_goals">A vector of goals to check if in collision</input_port>
<input_port name="use_footprint">Whether to use the footprint cost or the point cost.</input_port>
<input_port name="cost_threshold">The cost threshold above which a waypoint is considered in collision and should be removed.</input_port>
<output_port name="output_goals">A vector of goals containing only those that are not in collision.</output_port>
</Action>

<Action ID="SmoothPath">
<input_port name="smoother_id" default="SmoothPath"/>
<input_port name="unsmoothed_path">Path to be smoothed</input_port>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,15 @@ namespace nav2_behavior_tree
RemoveInCollisionGoals::RemoveInCollisionGoals(
const std::string & service_node_name,
const BT::NodeConfiguration & conf)
: BtServiceNode<nav2_msgs::srv::GetCosts>(service_node_name, conf),
use_footprint_(true),
cost_threshold_(253)
: BtServiceNode<nav2_msgs::srv::GetCosts>(service_node_name, conf,
"/global_costmap/get_cost_global_costmap")
{}


void RemoveInCollisionGoals::on_tick()
{
getInput("use_footprint", use_footprint_);
getInput("cost_threshold", cost_threshold_);

getInput("input_goals", input_goals_);

if (input_goals_.empty()) {
Expand Down

0 comments on commit 3f0c6c5

Please sign in to comment.