Skip to content

Commit 7a45912

Browse files
flixrjihoonl
authored andcommitted
fix SteadyTimer check for backported ROS versions (#71)
i.e. on current kinetic
1 parent 97ac8e4 commit 7a45912

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

include/web_video_server/web_video_server.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#include "async_web_server_cpp/http_request.hpp"
1010
#include "async_web_server_cpp/http_connection.hpp"
1111

12+
#define ROS_HAS_STEADYTIMER (ROS_VERSION_MINIMUM(1, 13, 1) || ((ROS_VERSION_MINOR == 12) && (ROS_VERSION_PATCH >= 8)))
13+
1214
namespace web_video_server
1315
{
1416

@@ -51,7 +53,7 @@ class WebVideoServer
5153
void cleanup_inactive_streams();
5254

5355
ros::NodeHandle nh_;
54-
#if ROS_VERSION_MINIMUM(1, 13, 1) || defined USE_STEADY_TIMER
56+
#if ROS_HAS_STEADYTIMER || defined USE_STEADY_TIMER
5557
ros::SteadyTimer cleanup_timer_;
5658
#else
5759
ros::Timer cleanup_timer_;

src/web_video_server.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ WebVideoServer::WebVideoServer(ros::NodeHandle &nh, ros::NodeHandle &private_nh)
4444
nh_(nh), handler_group_(
4545
async_web_server_cpp::HttpReply::stock_reply(async_web_server_cpp::HttpReply::not_found))
4646
{
47-
#if ROS_VERSION_MINIMUM(1, 13, 1) || defined USE_STEADY_TIMER
47+
#if ROS_HAS_STEADYTIMER || defined USE_STEADY_TIMER
4848
cleanup_timer_ = nh.createSteadyTimer(ros::WallDuration(0.5), boost::bind(&WebVideoServer::cleanup_inactive_streams, this));
4949
#else
5050
cleanup_timer_ = nh.createTimer(ros::Duration(0.5), boost::bind(&WebVideoServer::cleanup_inactive_streams, this));

0 commit comments

Comments
 (0)