-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
Copy pathlifecycle_bringup_commandline.cpp
47 lines (43 loc) · 1.38 KB
/
lifecycle_bringup_commandline.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright (c) 2019 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <vector>
#include <string>
#include <iostream>
#include <cstdlib>
#include <chrono>
#include "rclcpp/rclcpp.hpp"
#include "nav2_util/lifecycle_utils.hpp"
using std::cerr;
using namespace std::chrono_literals;
void usage()
{
cerr << "Invalid command line.\n\n";
cerr << "This command will take a set of unconfigured lifecycle nodes through the\n";
cerr << "CONFIGURED to the ACTIVATED state\n";
cerr << "The nodes are brought up in the order listed on the command line\n\n";
cerr << "Usage:\n";
cerr << " > lifecycle_startup <node name> ...\n";
std::exit(1);
}
int main(int argc, char * argv[])
{
if (argc == 1) {
usage();
}
rclcpp::init(0, nullptr);
nav2_util::startup_lifecycle_nodes(
std::vector<std::string>(argv + 1, argv + argc),
10s);
rclcpp::shutdown();
}