15 #ifndef RCLCPP__CLOCK_HPP_
16 #define RCLCPP__CLOCK_HPP_
22 #include "rclcpp/contexts/default_context.hpp"
23 #include "rclcpp/macros.hpp"
24 #include "rclcpp/time.hpp"
25 #include "rclcpp/visibility_control.hpp"
28 #include "rcutils/time.h"
29 #include "rcutils/types/rcutils_ret.h"
41 using pre_callback_t = std::function<void ()>;
45 pre_callback_t pre_callback,
46 post_callback_t post_callback,
49 pre_callback_t pre_callback;
50 post_callback_t post_callback;
57 RCLCPP_SMART_PTR_DEFINITIONS(
Clock)
121 Context::SharedPtr context = contexts::get_global_default_context());
145 Context::SharedPtr context = contexts::get_global_default_context());
171 wait_until_started(Context::SharedPtr context = contexts::get_global_default_context());
189 Context::SharedPtr context = contexts::get_global_default_context(),
210 get_clock_type()
const noexcept;
239 JumpHandler::SharedPtr
241 JumpHandler::pre_callback_t pre_callback,
242 JumpHandler::post_callback_t post_callback,
257 std::shared_ptr<Impl> impl_;
RCLCPP_PUBLIC rcl_clock_t * get_clock_handle() noexcept
Return the rcl_clock_t clock handle.
RCLCPP_PUBLIC bool ros_time_is_active()
RCLCPP_PUBLIC bool wait_until_started(Context::SharedPtr context=contexts::get_global_default_context())
RCLCPP_PUBLIC bool started()
RCLCPP_PUBLIC JumpHandler::SharedPtr create_jump_callback(JumpHandler::pre_callback_t pre_callback, JumpHandler::post_callback_t post_callback, const rcl_jump_threshold_t &threshold)
RCLCPP_PUBLIC Clock(rcl_clock_type_t clock_type=RCL_SYSTEM_TIME)
Default c'tor.
RCLCPP_PUBLIC bool sleep_until(Time until, Context::SharedPtr context=contexts::get_global_default_context())
RCLCPP_PUBLIC std::mutex & get_clock_mutex() noexcept
Get the clock's mutex.
RCLCPP_PUBLIC bool sleep_for(Duration rel_time, Context::SharedPtr context=contexts::get_global_default_context())
Versions of rosidl_typesupport_cpp::get_message_type_support_handle that handle adapted types.
Encapsulation of a time source.
Describe the prerequisites for calling a time jump callback.
Struct to describe a jump in time.
enum rcl_clock_type_e rcl_clock_type_t
Time source type, used to indicate the source of a time measurement.
@ RCL_SYSTEM_TIME
Use system time.