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

[nav2_behavior_tree] Add force_use_current_pose to ComputePathToPoseAction #4925

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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 @@ -80,6 +80,9 @@ class ComputePathToPoseAction : public BtActionNode<nav2_msgs::action::ComputePa
BT::InputPort<geometry_msgs::msg::PoseStamped>("goal", "Destination to plan to"),
BT::InputPort<geometry_msgs::msg::PoseStamped>(
"start", "Start pose of the path if overriding current robot pose"),
BT::InputPort<bool>(
"force_use_current_pose", "Use current robot pose, even if `start` is provided "
"(effectively ignoring it)"),
BT::InputPort<std::string>(
"planner_id", "",
"Mapped name to the planner plugin type to use"),
Expand Down
1 change: 1 addition & 0 deletions nav2_behavior_tree/nav2_tree_nodes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
<Action ID="ComputePathToPose">
<input_port name="goal">Destination to plan to</input_port>
<input_port name="start">Start pose of the path if overriding current robot pose</input_port>
<input_port name="force_use_current_pose">Use current robot pose, even if `start` is provided (effectively ignoring it)</input_port>
<input_port name="planner_id">Mapped name to the planner plugin type to use</input_port>
<input_port name="server_name">Server name</input_port>
<input_port name="server_timeout">Server timeout</input_port>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ void ComputePathToPoseAction::on_tick()
getInput("goal", goal_.goal);
getInput("planner_id", goal_.planner_id);
if (getInput("start", goal_.start)) {
goal_.use_start = true;
bool force_use_current_pose = false;
getInput("force_use_current_pose", force_use_current_pose);
if (force_use_current_pose) {
goal_.use_start = false;
} else {
goal_.use_start = true;
}
}
}

Expand Down
Loading