rclcpp
master
C++ ROS Client Library API
|
Functions | |
void | init (int argc, char *argv[]) |
Initialize communications via the rmw implementation and set up a global signal handler. More... | |
bool | ok () |
Check rclcpp's status. More... | |
void | shutdown () |
Notify the signal handler and rmw that rclcpp is shutting down. More... | |
void | on_shutdown (std::function< void(void)> callback) |
Register a function to be called when shutdown is called. More... | |
rcl_guard_condition_t * | get_sigint_guard_condition (rcl_wait_set_t *waitset) |
Get a handle to the rmw guard condition that manages the signal handler. More... | |
void | release_sigint_guard_condition (rcl_wait_set_t *waitset) |
Release the previously allocated guard condition that manages the signal handler. More... | |
bool | sleep_for (const std::chrono::nanoseconds &nanoseconds) |
Use the global condition variable to block for the specified amount of time. More... | |
void rclcpp::utilities::init | ( | int | argc, |
char * | argv[] | ||
) |
Initialize communications via the rmw implementation and set up a global signal handler.
[in] | argc | Number of arguments. |
[in] | argv | Argument vector. Will eventually be used for passing options to rclcpp. |
bool rclcpp::utilities::ok | ( | ) |
Check rclcpp's status.
void rclcpp::utilities::shutdown | ( | ) |
Notify the signal handler and rmw that rclcpp is shutting down.
void rclcpp::utilities::on_shutdown | ( | std::function< void(void)> | callback | ) |
Register a function to be called when shutdown is called.
Calling the callbacks is the last thing shutdown() does.
rcl_guard_condition_t* rclcpp::utilities::get_sigint_guard_condition | ( | rcl_wait_set_t * | waitset | ) |
Get a handle to the rmw guard condition that manages the signal handler.
The first time that this function is called for a given waitset a new guard condition will be created and returned; thereafter the same guard condition will be returned for the same waitset. This mechanism is designed to ensure that the same guard condition is not reused across waitsets (e.g., when using multiple executors in the same process). Will throw an exception if initialization of the guard condition fails.
waitset | Pointer to the rcl_wait_set_t that will be using the resulting guard condition. |
void rclcpp::utilities::release_sigint_guard_condition | ( | rcl_wait_set_t * | waitset | ) |
Release the previously allocated guard condition that manages the signal handler.
If you previously called get_sigint_guard_condition() for a given waitset to get a sigint guard condition, then you should call release_sigint_guard_condition() when you're done, to free that condition. Will throw an exception if get_sigint_guard_condition() wasn't previously called for the given waitset.
waitset | Pointer to the rcl_wait_set_t that was using the resulting guard condition. |
bool rclcpp::utilities::sleep_for | ( | const std::chrono::nanoseconds & | nanoseconds | ) |
Use the global condition variable to block for the specified amount of time.
[in] | nanoseconds | A std::chrono::duration representing how long to sleep for. |