Skip to content

Commit e52663a

Browse files
committed
Check service server before calling
1 parent d4da1cf commit e52663a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

behaviortree_ros2/include/behaviortree_ros2/bt_service_node.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,10 @@ template<class T> inline
278278
return CheckStatus( onFailure(INVALID_REQUEST) );
279279
}
280280

281+
// Check if server is ready
282+
if(!service_client_->service_is_ready())
283+
return onFailure(SERVICE_UNREACHABLE);
284+
281285
future_response_ = service_client_->async_send_request(request).share();
282286
time_request_sent_ = node_->now();
283287

0 commit comments

Comments
 (0)