pub enum ClockType {
SystemTime,
SteadyTime,
RosTime,
}Expand description
Type of clock to use for time queries
Variants§
SystemTime
System time (wall clock)
This clock reflects the system’s real-time clock and may be affected by NTP adjustments, user changes, or daylight saving time. Use for timestamps that need to correlate with real-world time.
SteadyTime
Steady/monotonic time
This clock is guaranteed to be monotonically increasing and is
not affected by system time changes. Use for measuring durations
and timeouts. Reads the port’s nros_platform_clock_ns where one is
linked, and the caller-advanced counter where none is.
RosTime
ROS time (simulation time)
This clock can be overridden for simulation purposes. When a
ROS time override is active — a simulator’s or a bag player’s
/clock — now() returns the overridden time. Otherwise it IS
SystemTime, which is what rclcpp’s
ClockType::ROS_TIME reads with use_sim_time false, so a node
written for simulation still runs standalone.