daemon_node.cpp
Go to the documentation of this file.
1 
23 #include <signal.h>
24 #include <time.h>
26 
28 
30 {
31  // Do some custom action.
32  // For example, publish a stop message to some other nodes.
33  // All the default sigint handler does is call shutdown()
34  rtp_core_->shutdown();
35  rtp_core_.reset();
36  ros::shutdown();
37 }
38 
39 int main(int argc, char** argv)
40 {
41  ros::init(argc, argv, "micros_swarm_framework_rtp_node");
42 
43  rtp_core_.reset(new micros_swarm::RuntimeCore());
44  rtp_core_->initialize();
45 
46  // Override the default ros sigint handler.
47  // This must be set after the first NodeHandle is created.
48  signal(SIGINT, rtpManagerDestroySigintHandler);
49 
50  boost::thread t = boost::thread(boost::bind(&ros::spin));
51  t.join();
52  return 0;
53 }
54 
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
int main(int argc, char **argv)
Definition: daemon_node.cpp:39
boost::shared_ptr< micros_swarm::RuntimeCore > rtp_core_
Definition: daemon_node.cpp:27
void rtpManagerDestroySigintHandler(int sig)
Definition: daemon_node.cpp:29
ROSCPP_DECL void spin()
ROSCPP_DECL void shutdown()


micros_swarm
Author(s):
autogenerated on Mon Jun 10 2019 14:02:06