rclcpp
master
C++ ROS Client Library API
|
Go to the documentation of this file.
15 #ifndef RCLCPP__UTILITIES_HPP_
16 #define RCLCPP__UTILITIES_HPP_
56 init(
int argc,
char const *
const argv[],
const InitOptions & init_options = InitOptions());
110 char const *
const argv[],
111 const InitOptions & init_options = InitOptions());
144 ok(rclcpp::Context::SharedPtr context =
nullptr);
156 [[deprecated(
"use the function ok() instead, which has the same usage.")]]
178 rclcpp::Context::SharedPtr context =
nullptr,
179 const std::string & reason =
"user called rclcpp::shutdown()");
217 rclcpp::Context::SharedPtr context =
nullptr);
309 #endif // RCLCPP__UTILITIES_HPP_
bool sub_will_overflow(const T x, const T y)
Safely check if subtraction will overflow.
Definition: utilities.hpp:265
bool ok(rclcpp::Context::SharedPtr context=nullptr)
Check rclcpp's status.
This header provides the get_node_base_interface() template function.
Definition: allocator_common.hpp:24
bool sleep_for(const std::chrono::nanoseconds &nanoseconds, rclcpp::Context::SharedPtr context=nullptr)
Use the global condition variable to block for the specified amount of time.
#define RCLCPP_PUBLIC
Definition: visibility_control.hpp:50
std::vector< std::string > init_and_remove_ros_arguments(int argc, char const *const argv[], const InitOptions &init_options=InitOptions())
Initialize communications via the rmw implementation and set up a global signal handler.
void init(int argc, char const *const argv[], const InitOptions &init_options=InitOptions())
Initialize communications via the rmw implementation and set up a global signal handler.
bool is_initialized(rclcpp::Context::SharedPtr context=nullptr)
Return true if init() has already been called for the given context.
bool add_will_overflow(const T x, const T y)
Safely check if addition will overflow.
Definition: utilities.hpp:231
bool sub_will_underflow(const T x, const T y)
Safely check if subtraction will underflow.
Definition: utilities.hpp:282
const char * get_c_string(const char *string_in)
Return the given string.
std::vector< std::string > remove_ros_arguments(int argc, char const *const argv[])
Remove ROS-specific arguments from argument vector.
bool install_signal_handlers()
Install the global signal handler for rclcpp.
bool signal_handlers_installed()
Return true if the signal handlers are installed, otherwise false.
bool uninstall_signal_handlers()
Uninstall the global signal handler for rclcpp.
void on_shutdown(std::function< void()> callback, rclcpp::Context::SharedPtr context=nullptr)
Register a function to be called when shutdown is called on the context.
bool add_will_underflow(const T x, const T y)
Safely check if addition will underflow.
Definition: utilities.hpp:248
bool shutdown(rclcpp::Context::SharedPtr context=nullptr, const std::string &reason="user called rclcpp::shutdown()")
Shutdown rclcpp context, invalidating it for derived entities.