SMACC
Loading...
Searching...
No Matches
smacc_client_library
ros_timer_client
src
ros_timer_client
timer_client.cpp
Go to the documentation of this file.
1
#include <
ros_timer_client/cl_ros_timer.h
>
2
3
namespace
cl_ros_timer
4
{
5
6
ClRosTimer::ClRosTimer
(ros::Duration duration,
bool
oneshot)
7
{
8
this->duration =
duration
;
9
this->oneshot =
oneshot
;
10
}
11
12
ClRosTimer::~ClRosTimer
()
13
{
14
timer
.stop();
15
}
16
17
void
ClRosTimer::initialize
()
18
{
19
timer
=
nh_
.createTimer(
duration
, boost::bind(&
ClRosTimer::timerCallback
,
this
, _1),
oneshot
);
20
}
21
22
void
ClRosTimer::timerCallback
(
const
ros::TimerEvent &timedata)
23
{
24
if
(!
onTimerTick_
.empty())
25
{
26
this->
onTimerTick_
();
27
}
28
postTimerEvent_
();
29
}
30
31
}
// namespace cl_ros_timer
cl_ros_timer.h
cl_ros_timer::ClRosTimer::timerCallback
void timerCallback(const ros::TimerEvent &timedata)
Definition:
timer_client.cpp:22
cl_ros_timer::ClRosTimer::oneshot
bool oneshot
Definition:
cl_ros_timer.h:52
cl_ros_timer::ClRosTimer::onTimerTick_
smacc::SmaccSignal< void()> onTimerTick_
Definition:
cl_ros_timer.h:56
cl_ros_timer::ClRosTimer::nh_
ros::NodeHandle nh_
Definition:
cl_ros_timer.h:48
cl_ros_timer::ClRosTimer::duration
ros::Duration duration
Definition:
cl_ros_timer.h:51
cl_ros_timer::ClRosTimer::timer
ros::Timer timer
Definition:
cl_ros_timer.h:50
cl_ros_timer::ClRosTimer::initialize
virtual void initialize()
Definition:
timer_client.cpp:17
cl_ros_timer::ClRosTimer::~ClRosTimer
virtual ~ClRosTimer()
Definition:
timer_client.cpp:12
cl_ros_timer::ClRosTimer::postTimerEvent_
std::function< void()> postTimerEvent_
Definition:
cl_ros_timer.h:55
cl_ros_timer::ClRosTimer::ClRosTimer
ClRosTimer(ros::Duration duration, bool oneshot=false)
Definition:
timer_client.cpp:6
cl_ros_timer
Definition:
cl_ros_timer.h:8
Generated by
1.9.5