Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix SteadyTimer check for backported ROS versions #71

Merged
merged 2 commits into from
Oct 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion include/web_video_server/web_video_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include "async_web_server_cpp/http_request.hpp"
#include "async_web_server_cpp/http_connection.hpp"

#define ROS_HAS_STEADYTIMER (ROS_VERSION_MINIMUM(1, 13, 1) || ((ROS_VERSION_MINOR == 12) && (ROS_VERSION_PATCH >= 8)))

namespace web_video_server
{

Expand Down Expand Up @@ -51,7 +53,7 @@ class WebVideoServer
void cleanup_inactive_streams();

ros::NodeHandle nh_;
#if ROS_VERSION_MINIMUM(1, 13, 1) || defined USE_STEADY_TIMER
#if ROS_HAS_STEADYTIMER || defined USE_STEADY_TIMER
ros::SteadyTimer cleanup_timer_;
#else
ros::Timer cleanup_timer_;
Expand Down
2 changes: 1 addition & 1 deletion src/web_video_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ WebVideoServer::WebVideoServer(ros::NodeHandle &nh, ros::NodeHandle &private_nh)
nh_(nh), handler_group_(
async_web_server_cpp::HttpReply::stock_reply(async_web_server_cpp::HttpReply::not_found))
{
#if ROS_VERSION_MINIMUM(1, 13, 1) || defined USE_STEADY_TIMER
#if ROS_HAS_STEADYTIMER || defined USE_STEADY_TIMER
cleanup_timer_ = nh.createSteadyTimer(ros::WallDuration(0.5), boost::bind(&WebVideoServer::cleanup_inactive_streams, this));
#else
cleanup_timer_ = nh.createTimer(ros::Duration(0.5), boost::bind(&WebVideoServer::cleanup_inactive_streams, this));
Expand Down