Nav2 Navigation Stack - kilted  kilted
ROS 2 Navigation Stack
lifecycle_utils.hpp
1 // Copyright (c) 2018 Intel Corporation
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef NAV2_UTIL__LIFECYCLE_UTILS_HPP_
16 #define NAV2_UTIL__LIFECYCLE_UTILS_HPP_
17 
18 #include <vector>
19 #include <string>
20 #include <chrono>
21 #include "nav2_util/string_utils.hpp"
22 
23 namespace nav2_util
24 {
25 
27 
36 void startup_lifecycle_nodes(
37  const std::vector<std::string> & node_names,
38  const std::chrono::seconds service_call_timeout = std::chrono::seconds::max(),
39  const int retries = 3);
40 
42 
45 void startup_lifecycle_nodes(
46  const std::string & nodes,
47  const std::chrono::seconds service_call_timeout = std::chrono::seconds::max(),
48  const int retries = 3)
49 {
50  startup_lifecycle_nodes(split(nodes, ':'), service_call_timeout, retries);
51 }
52 
54 
63 void reset_lifecycle_nodes(
64  const std::vector<std::string> & node_names,
65  const std::chrono::seconds service_call_timeout = std::chrono::seconds::max(),
66  const int retries = 3);
67 
69 
72 void reset_lifecycle_nodes(
73  const std::string & nodes,
74  const std::chrono::seconds service_call_timeout = std::chrono::seconds::max(),
75  const int retries = 3)
76 {
77  reset_lifecycle_nodes(split(nodes, ':'), service_call_timeout, retries);
78 }
79 
80 } // namespace nav2_util
81 
82 #endif // NAV2_UTIL__LIFECYCLE_UTILS_HPP_