Skip to content

Commit

Permalink
fix timer_manager to really use a steady clock when needed
Browse files Browse the repository at this point in the history
This is a bit of a hack, since up to boost version 1.61 the time of the steady clock is always converted to system clock,
which is then used for the wait... which obviously doesn't help if we explicitly want the steady clock.

So as a workaround, include the backported versions of the boost condition variable if boost version is not recent enough.
  • Loading branch information
flixr committed Mar 8, 2017
1 parent 31e90c2 commit 29c2116
Show file tree
Hide file tree
Showing 6 changed files with 860 additions and 6 deletions.
2 changes: 1 addition & 1 deletion clients/roscpp/CMakeLists.txt
Expand Up @@ -22,7 +22,7 @@ list(GET roscpp_VERSION_LIST 2 roscpp_VERSION_PATCH)

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/ros/common.h.in ${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_INCLUDE_DESTINATION}/ros/common.h)

find_package(Boost REQUIRED COMPONENTS signals filesystem system)
find_package(Boost REQUIRED COMPONENTS signals filesystem system chrono)

include_directories(include ${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_INCLUDE_DESTINATION}/ros ${catkin_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})

Expand Down
23 changes: 23 additions & 0 deletions clients/roscpp/include/boost_161_condition_variable.h
@@ -0,0 +1,23 @@
#ifndef BOOST_THREAD_CONDITION_VARIABLE_HPP
#define BOOST_THREAD_CONDITION_VARIABLE_HPP

// condition_variable.hpp
//
// (C) Copyright 2007 Anthony Williams
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#include <boost/thread/detail/platform.hpp>
#if defined(BOOST_THREAD_PLATFORM_WIN32)
#include <boost/thread/win32/condition_variable.hpp>
#elif defined(BOOST_THREAD_PLATFORM_PTHREAD)
//#include <boost/thread/pthread/condition_variable.hpp>
#include "boost_161_pthread_condition_variable.h"
#else
#error "Boost threads unavailable on this platform"
#endif

#endif

0 comments on commit 29c2116

Please sign in to comment.