mirror of
https://github.com/bjoernellens1/rmp220_middleware.git
synced 2024-11-21 23:43:46 +00:00
update
This commit is contained in:
parent
338c67eb85
commit
99c0a95338
@ -105,9 +105,21 @@ private:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
std::shared_ptr<rmp220_middleware> node; // Declare the node as a global variable
|
||||||
|
|
||||||
|
void signal_handler(int signum) {
|
||||||
|
(void)signum;
|
||||||
|
RCLCPP_INFO(node->get_logger(), "Received Ctrl+C. Shutting down...");
|
||||||
|
rclcpp::shutdown();
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char * argv[]) {
|
int main(int argc, char * argv[]) {
|
||||||
rclcpp::init(argc, argv);
|
rclcpp::init(argc, argv);
|
||||||
auto node = std::make_shared<rmp220_middleware>();
|
auto node = std::make_shared<rmp220_middleware>();
|
||||||
|
|
||||||
|
// Register the Ctrl+C signal handler
|
||||||
|
signal(SIGINT, signal_handler);
|
||||||
|
|
||||||
rclcpp::spin(node);
|
rclcpp::spin(node);
|
||||||
rclcpp::shutdown();
|
rclcpp::shutdown();
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user