pub struct PyVehicle {Show 15 fields
pub mass: f64,
pub inertia: [f64; 3],
pub cog_height: f64,
pub position: [f64; 3],
pub velocity: [f64; 3],
pub orientation: [f64; 3],
pub angular_velocity: [f64; 3],
pub wheels: [PyWheelDynamics; 4],
pub wheel_positions: [[f64; 3]; 4],
pub suspensions: [PySuspension; 4],
pub tires: [PyTireModel; 4],
pub drivetrain: PyDrivetrain,
pub steering: PySteering,
pub stability: PyStabilityControl,
pub gear_display: u32,
}Expand description
Full vehicle state.
Fields§
§mass: f64Chassis mass (kg).
inertia: [f64; 3]Inertia tensor diagonal [Ixx, Iyy, Izz] (kg·m²).
cog_height: f64Center of mass height (m).
position: [f64; 3]World position of chassis center [x, y, z].
velocity: [f64; 3]Velocity [vx, vy, vz] in world frame.
orientation: [f64; 3]Euler angles [roll, pitch, yaw] (rad).
angular_velocity: [f64; 3]Angular velocity [wx, wy, wz] (rad/s).
wheels: [PyWheelDynamics; 4]Wheels: [FL, FR, RL, RR].
wheel_positions: [[f64; 3]; 4]Wheel positions in local frame [FL, FR, RL, RR].
suspensions: [PySuspension; 4]Suspensions [FL, FR, RL, RR].
tires: [PyTireModel; 4]Tire models [FL, FR, RL, RR].
drivetrain: PyDrivetrainDrivetrain.
steering: PySteeringSteering system.
stability: PyStabilityControlStability control.
gear_display: u32Current gear as display number (1-indexed).
Implementations§
Source§impl PyVehicle
impl PyVehicle
Sourcepub fn racing_car() -> Self
pub fn racing_car() -> Self
Create a racing car vehicle.
Sourcepub fn forward_speed(&self) -> f64
pub fn forward_speed(&self) -> f64
Get the forward speed (m/s).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PyVehicle
impl<'de> Deserialize<'de> for PyVehicle
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
Auto Trait Implementations§
impl Freeze for PyVehicle
impl RefUnwindSafe for PyVehicle
impl Send for PyVehicle
impl Sync for PyVehicle
impl Unpin for PyVehicle
impl UnsafeUnpin for PyVehicle
impl UnwindSafe for PyVehicle
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.