pub struct TeleopInput {
pub source: String,
pub priority: u8,
pub linear: f32,
pub angular: f32,
pub timestamp: u64,
pub emergency_stop: bool,
}Expand description
Input command from any teleoperation source
Multiple sources can send commands, and the teleop node will arbitrate between them based on priority and timestamps.
Fields§
§source: StringSource identifier (e.g., “cli”, “dashboard”, “gamepad”)
priority: u8Priority level (0-255, higher = more important) Typical values:
- 255: Emergency stop
- 200: Safety operator override
- 100: Primary operator (gamepad)
- 50: Secondary operator (dashboard)
- 10: Autonomous fallback
linear: f32Linear velocity command in m/s
angular: f32Angular velocity command in rad/s
timestamp: u64Timestamp in microseconds (from now_micros)
emergency_stop: boolEmergency stop flag - immediately halt all motion
Implementations§
Source§impl TeleopInput
impl TeleopInput
Sourcepub fn new(
source: impl Into<String>,
linear: f32,
angular: f32,
timestamp: u64,
) -> Self
pub fn new( source: impl Into<String>, linear: f32, angular: f32, timestamp: u64, ) -> Self
Create a new teleop input with standard priority
Sourcepub fn emergency_stop(source: impl Into<String>, timestamp: u64) -> Self
pub fn emergency_stop(source: impl Into<String>, timestamp: u64) -> Self
Create an emergency stop command
Sourcepub fn with_priority(self, priority: u8) -> Self
pub fn with_priority(self, priority: u8) -> Self
Set the priority level
Sourcepub fn is_expired(&self, current_time: u64, timeout_ms: u64) -> bool
pub fn is_expired(&self, current_time: u64, timeout_ms: u64) -> bool
Check if command is expired (older than timeout_ms milliseconds)
Trait Implementations§
Source§impl Clone for TeleopInput
impl Clone for TeleopInput
Source§fn clone(&self) -> TeleopInput
fn clone(&self) -> TeleopInput
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TeleopInput
impl Debug for TeleopInput
Source§impl<'de> Deserialize<'de> for TeleopInput
impl<'de> Deserialize<'de> for TeleopInput
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for TeleopInput
impl Serialize for TeleopInput
impl Message for TeleopInput
Auto Trait Implementations§
impl Freeze for TeleopInput
impl RefUnwindSafe for TeleopInput
impl Send for TeleopInput
impl Sync for TeleopInput
impl Unpin for TeleopInput
impl UnwindSafe for TeleopInput
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more