Skip to content

Commit 30e61c9

Browse files
jmachowinskiJanosch Machowinskifujitatomoya
authored
doc: Added warning to not instantiate Clock directly with RCL_ROS_TIME (#2768)
Signed-off-by: Janosch Machowinski <[email protected]> Signed-off-by: Janosch Machowinski <[email protected]> Co-authored-by: Janosch Machowinski <[email protected]> Co-authored-by: Tomoya Fujita <[email protected]>
1 parent 687057f commit 30e61c9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

rclcpp/include/rclcpp/clock.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ class Clock
6060
/**
6161
* Initializes the clock instance with the given clock_type.
6262
*
63+
* WARNING Don't instantiate a clock using RCL_ROS_TIME directly,
64+
* unless you really know what you are doing. By default no TimeSource
65+
* is attached to a new clock. This will lead to the unexpected behavior,
66+
* that your RCL_ROS_TIME will run always on system time. If you want
67+
* a RCL_ROS_TIME use Node::get_clock(), or make sure to attach a
68+
* TimeSource yourself.
69+
*
6370
* \param clock_type type of the clock.
6471
* \throws anything rclcpp::exceptions::throw_from_rcl_error can throw.
6572
*/

0 commit comments

Comments
 (0)