pub struct DriveMotor {Show 13 fields
pub motor_id: Option<String>,
pub name: Option<String>,
pub status: Option<MotorStatus>,
pub velocity_rpm: Option<f64>,
pub commanded_rpm: Option<f64>,
pub current_a: Option<f64>,
pub voltage_v: Option<f64>,
pub power_w: Option<f64>,
pub temperature_c: Option<f64>,
pub torque_nm: Option<f64>,
pub encoder_position: Option<f64>,
pub is_enabled: Option<bool>,
pub error_code: Option<String>,
}Expand description
Drive motor information.
Fields§
§motor_id: Option<String>Motor ID
name: Option<String>Motor name/location (e.g., “left_wheel”, “right_wheel”)
status: Option<MotorStatus>Motor status
velocity_rpm: Option<f64>Current velocity in RPM
commanded_rpm: Option<f64>Commanded velocity in RPM
current_a: Option<f64>Current in amps
voltage_v: Option<f64>Voltage in volts
power_w: Option<f64>Power consumption in watts
temperature_c: Option<f64>Temperature in Celsius
torque_nm: Option<f64>Torque in Newton-meters
encoder_position: Option<f64>Encoder position (ticks or radians)
is_enabled: Option<bool>Whether motor is enabled
error_code: Option<String>Error code if any
Implementations§
Source§impl DriveMotor
impl DriveMotor
Sourcepub fn with_velocity(self, rpm: f64) -> Self
pub fn with_velocity(self, rpm: f64) -> Self
Set velocity.
Sourcepub fn with_current(self, amps: f64) -> Self
pub fn with_current(self, amps: f64) -> Self
Set current.
Sourcepub fn with_temperature(self, temp_c: f64) -> Self
pub fn with_temperature(self, temp_c: f64) -> Self
Set temperature.
Trait Implementations§
Source§impl Clone for DriveMotor
impl Clone for DriveMotor
Source§fn clone(&self) -> DriveMotor
fn clone(&self) -> DriveMotor
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 DriveMotor
impl Debug for DriveMotor
Source§impl Default for DriveMotor
impl Default for DriveMotor
Source§fn default() -> DriveMotor
fn default() -> DriveMotor
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for DriveMotor
impl<'de> Deserialize<'de> for DriveMotor
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 DriveMotor
impl Serialize for DriveMotor
Auto Trait Implementations§
impl Freeze for DriveMotor
impl RefUnwindSafe for DriveMotor
impl Send for DriveMotor
impl Sync for DriveMotor
impl Unpin for DriveMotor
impl UnwindSafe for DriveMotor
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