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