#[repr(u8)]pub enum TimerClockSource {
Steady = 0,
Ros = 1,
System = 2,
}Expand description
Which clock advances a timer (phase-425 W4, RFC-0075-adjacent: this is the
distinction rclcpp draws between create_wall_timer and create_timer).
The default is Steady and it is the only source that costs
nothing: it consumes the spin delta the executor already measured. The other
two READ a clock on every poll of the timer, which is one relaxed atomic load
plus whatever the platform’s time call costs.
Variants§
Steady = 0
The executor’s monotonic spin delta — a WALL timer in rclcpp’s sense.
Unaffected by /clock: a paused simulator does not pause it, which is
exactly what a watchdog or a transport keep-alive wants.
Ros = 1
ClockType::RosTime: simulated time when a /clock source is active,
and system time when none is (the same fallback rclcpp::Clock has, so
a node built for simulation still runs standalone).
System = 2
ClockType::SystemTime: the wall clock, NTP steps and all. Present
because rclrs offers it (TimerClock::SystemTime); a timer that must
not jump wants Steady.
Trait Implementations§
Source§impl Clone for TimerClockSource
impl Clone for TimerClockSource
Source§fn clone(&self) -> TimerClockSource
fn clone(&self) -> TimerClockSource
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for TimerClockSource
Source§impl Debug for TimerClockSource
impl Debug for TimerClockSource
Source§impl Default for TimerClockSource
impl Default for TimerClockSource
Source§fn default() -> TimerClockSource
fn default() -> TimerClockSource
impl Eq for TimerClockSource
Source§impl PartialEq for TimerClockSource
impl PartialEq for TimerClockSource
Source§fn eq(&self, other: &TimerClockSource) -> bool
fn eq(&self, other: &TimerClockSource) -> bool
self and other values to be equal, and is used by ==.