File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed
nav2_behavior_tree/include/nav2_behavior_tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -194,6 +194,10 @@ class BtActionNode : public BT::ActionNodeBase
194194 // reset the flag to send the goal or not, allowing the user the option to set it in on_tick
195195 should_send_goal_ = true ;
196196
197+ // Clear the input and output messages to make sure we have no leftover from previous calls
198+ goal_ = typename ActionT::Goal ();
199+ result_ = typename rclcpp_action::ClientGoalHandle<ActionT>::WrappedResult ();
200+
197201 // user defined callback, may modify "should_send_goal_".
198202 on_tick ();
199203
Original file line number Diff line number Diff line change @@ -138,6 +138,9 @@ class BtServiceNode : public BT::ActionNodeBase
138138 // allowing the user the option to set it in on_tick
139139 should_send_request_ = true ;
140140
141+ // Clear the input request to make sure we have no leftover from previous calls
142+ request_ = std::make_shared<typename ServiceT::Request>();
143+
141144 // user defined callback, may modify "should_send_request_".
142145 on_tick ();
143146
You can’t perform that action at this time.
0 commit comments