Main Page
Namespaces
Classes
Files
File List
File Members
src
Node.cpp
Go to the documentation of this file.
1
7
#include <csignal>
8
9
#include "
bota_node/Node.hpp
"
10
11
namespace
bota_node
12
{
13
Node::Node
(
NodeHandlePtr
nh) : nh_(
std
::move(nh)), workerManager_()
14
{
15
}
16
17
void
Node::shutdown
()
18
{
19
// raise SIGINT, which will be caught by the owner of the node instance and initiates the shutdown
20
// todo: is there a better way?
21
raise
(SIGINT);
22
}
23
24
bool
setProcessPriority
(
int
priority)
25
{
26
sched_param params{};
27
params.sched_priority = priority;
28
if
(sched_setscheduler(getpid(), SCHED_FIFO, ¶ms) != 0)
29
{
30
ROS_WARN
(
"Failed to set process priority to %d: %s. Check /etc/security/limits.conf for the rights."
, priority,
31
std::strerror(errno));
32
return
false
;
33
}
34
return
true
;
35
}
36
37
}
// namespace bota_node
bota_node
Definition:
Node.hpp:17
bota_node::Node::shutdown
void shutdown()
Definition:
Node.cpp:17
std
ROS_WARN
#define ROS_WARN(...)
Node.hpp
bota_node::Node::NodeHandlePtr
std::shared_ptr< ros::NodeHandle > NodeHandlePtr
Definition:
Node.hpp:24
bota_node::setProcessPriority
bool setProcessPriority(int priority)
Definition:
Node.cpp:24
bota_node::Node::Node
Node()=delete
bota_node
Author(s):
autogenerated on Wed Mar 3 2021 03:09:11