add rclcpp::shutdown() function
This commit is contained in:
parent
bf61c2d196
commit
e720daf1a7
2 changed files with 10 additions and 0 deletions
|
@ -60,6 +60,7 @@ using rclcpp::timer::TimerBase;
|
||||||
using rclcpp::timer::WallTimer;
|
using rclcpp::timer::WallTimer;
|
||||||
typedef rclcpp::context::Context::SharedPtr ContextSharedPtr;
|
typedef rclcpp::context::Context::SharedPtr ContextSharedPtr;
|
||||||
using rclcpp::utilities::ok;
|
using rclcpp::utilities::ok;
|
||||||
|
using rclcpp::utilities::shutdown;
|
||||||
using rclcpp::utilities::init;
|
using rclcpp::utilities::init;
|
||||||
using rclcpp::utilities::sleep_for;
|
using rclcpp::utilities::sleep_for;
|
||||||
|
|
||||||
|
|
|
@ -127,6 +127,15 @@ ok()
|
||||||
return ::g_signal_status == 0;
|
return ::g_signal_status == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
shutdown()
|
||||||
|
{
|
||||||
|
g_signal_status = SIGINT;
|
||||||
|
rmw_trigger_guard_condition(g_sigint_guard_cond_handle);
|
||||||
|
g_interrupt_condition_variable.notify_all();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
rmw_guard_condition_t *
|
rmw_guard_condition_t *
|
||||||
get_global_sigint_guard_condition()
|
get_global_sigint_guard_condition()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue