node_with_optional_master.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: BSD-3-Clause
2 // SPDX-FileCopyrightText: Czech Technical University in Prague
3 
10 #pragma once
11 
12 #include <memory>
13 #include <string>
14 
17 #include <ros/datatypes.h>
18 
19 namespace cras
20 {
21 
22 struct NodeWithOptionalMasterPrivate;
23 
34 {
35 public:
40  virtual ~NodeWithOptionalMaster();
41 
48  void init(const ::ros::M_string& remappings, const ::std::string& name, uint32_t options);
49 
57  void init(int& argc, char** argv, const ::std::string& name, uint32_t options);
58 
65  void init(const ::ros::VP_string& remappings, const ::std::string& name, uint32_t options);
66 
70  void shutdown();
71 
75  bool isInitialized() const;
76 
80  bool usesMaster() const;
81 
85  bool ok() const;
86 
93  ::std::string resolveName(const ::std::string& name, bool remap = true) const;
94 
101 
102 private:
103  ::std::unique_ptr<NodeWithOptionalMasterPrivate> data;
104 };
105 
106 }
datatypes.h
cras
Definition: any.hpp:15
cras::BoundParamHelperPtr
::std::shared_ptr<::cras::BoundParamHelper > BoundParamHelperPtr
Definition: bound_param_helper.hpp:24
cras::HasLogger
Convenience base class for providing this->log and getCrasLogger(). Just add it as a base to your cla...
Definition: log_utils.h:229
cras::NodeWithOptionalMaster::NodeWithOptionalMaster
NodeWithOptionalMaster(const ::cras::LogHelperPtr &log)
cras::NodeWithOptionalMaster::init
void init(const ::ros::M_string &remappings, const ::std::string &name, uint32_t options)
Initialize the node, autodetecting whether a ros master is running or not.
bound_param_helper.hpp
Bound param helper (allows omitting the param adapter in each getParam call).
cras::NodeWithOptionalMaster::data
::std::unique_ptr< NodeWithOptionalMasterPrivate > data
PIMPL.
Definition: node_with_optional_master.h:103
cras::NodeWithOptionalMaster
Node that can run both with and without a ROS master. This can be useful for one-off scripts that do ...
Definition: node_with_optional_master.h:33
cras::NodeWithOptionalMaster::getPrivateParams
::cras::BoundParamHelperPtr getPrivateParams() const
Get private parameters of the node.
cras::NodeWithOptionalMaster::~NodeWithOptionalMaster
virtual ~NodeWithOptionalMaster()
cras::NodeWithOptionalMaster::usesMaster
bool usesMaster() const
Is a live ROS master being used?
cras::NodeWithOptionalMaster::isInitialized
bool isInitialized() const
Has init() been called?
remap
ROSCPP_DECL std::string remap(const std::string &name)
log_utils.h
ROS logging helpers.
cras::NodeWithOptionalMaster::resolveName
::std::string resolveName(const ::std::string &name, bool remap=true) const
Resolve a name relative to the global namespace.
cras::LogHelperPtr
::cras::LogHelper::Ptr LogHelperPtr
Pointer to LogHelper.
Definition: log_utils.h:202
cras::NodeWithOptionalMaster::ok
bool ok() const
Equivalent of ros::ok() .
cras::HasLogger::log
::cras::LogHelperPtr log
Log helper.
Definition: log_utils.h:252
cras::NodeWithOptionalMaster::shutdown
void shutdown()
Shutdown the node.


cras_cpp_common
Author(s): Martin Pecka
autogenerated on Sun Jan 5 2025 03:50:32