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

update steady timer PR #1

Merged
merged 2 commits into from
Jul 19, 2017
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
2 changes: 1 addition & 1 deletion clients/roscpp/CMakeLists.txt
Original file line number Diff line number Diff line change
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 chrono)
find_package(Boost REQUIRED COMPONENTS chrono filesystem signals system)

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

Expand Down
8 changes: 4 additions & 4 deletions clients/roscpp/include/ros/node_handle.h
Original file line number Diff line number Diff line change
Expand Up @@ -1487,7 +1487,7 @@ if (service) // Enter if advertised service is valid
*/
template<class T>
SteadyTimer createSteadyTimer(WallDuration period, void(T::*callback)(const SteadyTimerEvent&), T* obj,
bool oneshot = false, bool autostart = true) const
bool oneshot = false, bool autostart = true) const
{
return createSteadyTimer(period, boost::bind(callback, obj, _1), oneshot, autostart);
}
Expand All @@ -1509,8 +1509,8 @@ if (service) // Enter if advertised service is valid
*/
template<class T>
SteadyTimer createSteadyTimer(WallDuration period, void(T::*callback)(const SteadyTimerEvent&),
const boost::shared_ptr<T>& obj,
bool oneshot = false, bool autostart = true) const
const boost::shared_ptr<T>& obj,
bool oneshot = false, bool autostart = true) const
{
SteadyTimerOptions ops(period, boost::bind(callback, obj.get(), _1), 0);
ops.tracked_object = obj;
Expand All @@ -1532,7 +1532,7 @@ if (service) // Enter if advertised service is valid
* \param oneshot If true, this timer will only fire once
*/
SteadyTimer createSteadyTimer(WallDuration period, const SteadyTimerCallback& callback,
bool oneshot = false, bool autostart = true) const;
bool oneshot = false, bool autostart = true) const;

/**
* \brief Create a timer which will call a callback at the specified rate, using wall time to determine
Expand Down
2 changes: 1 addition & 1 deletion clients/roscpp/include/ros/steady_timer_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct ROSCPP_DECL SteadyTimerOptions
* \param
*/
SteadyTimerOptions(WallDuration _period, const SteadyTimerCallback& _callback, CallbackQueueInterface* _queue,
bool oneshot = false, bool autostart = true)
bool oneshot = false, bool autostart = true)
: period(_period)
, callback(_callback)
, callback_queue(_queue)
Expand Down
2 changes: 1 addition & 1 deletion clients/roscpp/include/ros/timer_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ void TimerManager<T, D, E>::threadFunc()
{
// On system time we can simply sleep for the rest of the wait time, since anything else requiring processing will
// signal the condition variable
int32_t remaining_time = std::max((int32_t) ((sleep_end - current).toSec() * 1000.0f), 1);
int32_t remaining_time = std::max((int32_t)((sleep_end - current).toSec() * 1000.0f), 1);
timers_cond_.timed_wait(lock, boost::posix_time::milliseconds(remaining_time));
}
}
Expand Down
4 changes: 2 additions & 2 deletions clients/roscpp/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<build_depend version_gte="0.3.17">roscpp_traits</build_depend>
<build_depend version_gte="1.10.3">rosgraph_msgs</build_depend>
<build_depend>roslang</build_depend>
<build_depend>rostime</build_depend>
<build_depend version_gte="0.6.4">rostime</build_depend>
<build_depend>std_msgs</build_depend>
<build_depend>xmlrpcpp</build_depend>

Expand All @@ -41,7 +41,7 @@
<run_depend>roscpp_serialization</run_depend>
<run_depend version_gte="0.3.17">roscpp_traits</run_depend>
<run_depend version_gte="1.10.3">rosgraph_msgs</run_depend>
<run_depend>rostime</run_depend>
<run_depend version_gte="0.6.4">rostime</run_depend>
<run_depend>std_msgs</run_depend>
<run_depend>xmlrpcpp</run_depend>
</package>
2 changes: 1 addition & 1 deletion clients/roscpp/src/libros/node_handle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ WallTimer NodeHandle::createWallTimer(WallTimerOptions& ops) const
}

SteadyTimer NodeHandle::createSteadyTimer(WallDuration period, const SteadyTimerCallback& callback,
bool oneshot, bool autostart) const
bool oneshot, bool autostart) const
{
SteadyTimerOptions ops;
ops.period = period;
Expand Down