Skip to content

Commit 29ea9f4

Browse files
committed
move the request initialization to the constructor
Signed-off-by: Daisuke Sato <[email protected]>
1 parent f7edfac commit 29ea9f4

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

nav2_behavior_tree/include/nav2_behavior_tree/bt_service_node.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ class BtServiceNode : public BT::SyncActionNode
8383
// The main override required by a BT service
8484
BT::NodeStatus tick() override
8585
{
86+
request_ = std::make_shared<typename ServiceT::Request>();
8687
on_tick();
8788
auto future_result = service_client_->async_send_request(request_);
8889
return check_future(future_result);
@@ -91,7 +92,6 @@ class BtServiceNode : public BT::SyncActionNode
9192
// Fill in service request with information if necessary
9293
virtual void on_tick()
9394
{
94-
request_ = std::make_shared<typename ServiceT::Request>();
9595
}
9696

9797
// Check the future and decide the status of Behaviortree

nav2_behavior_tree/plugins/action/clear_costmap_service.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ class ClearEntireCostmapService : public BtServiceNode<nav2_msgs::srv::ClearEnti
3737

3838
void on_tick() override
3939
{
40-
BtServiceNode::on_tick();
4140
increment_recovery_count();
4241
}
4342
};

0 commit comments

Comments
 (0)