Main Page
Namespaces
Classes
Files
File List
File Members
src
daemon_node.cpp
Go to the documentation of this file.
1
23
#include <signal.h>
24
#include <
time.h
>
25
#include "
micros_swarm/runtime_core.h
"
26
27
boost::shared_ptr<micros_swarm::RuntimeCore>
rtp_core_
;
28
29
void
rtpManagerDestroySigintHandler
(
int
sig)
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
time.h
ros::init
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
main
int main(int argc, char **argv)
Definition:
daemon_node.cpp:39
rtp_core_
boost::shared_ptr< micros_swarm::RuntimeCore > rtp_core_
Definition:
daemon_node.cpp:27
boost::shared_ptr
runtime_core.h
rtpManagerDestroySigintHandler
void rtpManagerDestroySigintHandler(int sig)
Definition:
daemon_node.cpp:29
micros_swarm::RuntimeCore
Definition:
runtime_core.h:42
ros::spin
ROSCPP_DECL void spin()
ros::shutdown
ROSCPP_DECL void shutdown()
micros_swarm
Author(s):
autogenerated on Mon Jun 10 2019 14:02:06