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

[BtActionNode] [BtServiceNode] clear between calls #4887

Merged
merged 1 commit into from
Jan 30, 2025
Merged
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 @@ -194,6 +194,10 @@ class BtActionNode : public BT::ActionNodeBase
// reset the flag to send the goal or not, allowing the user the option to set it in on_tick
should_send_goal_ = true;

// Clear the input and output messages to make sure we have no leftover from previous calls
goal_ = typename ActionT::Goal();
result_ = typename rclcpp_action::ClientGoalHandle<ActionT>::WrappedResult();

// user defined callback, may modify "should_send_goal_".
on_tick();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ class BtServiceNode : public BT::ActionNodeBase
// allowing the user the option to set it in on_tick
should_send_request_ = true;

// Clear the input request to make sure we have no leftover from previous calls
request_ = std::make_shared<typename ServiceT::Request>();

// user defined callback, may modify "should_send_request_".
on_tick();

Expand Down
Loading