pub enum Sensor {
JointState {
joint_idx: usize,
},
BodyAccel {
body_idx: usize,
},
BodyAngularVel {
body_idx: usize,
},
ForceTorque {
body_idx: usize,
},
Rangefinder {
body_idx: usize,
max_dist: f64,
},
Imu {
body_idx: usize,
},
FrameCapture {
body_idx: usize,
},
}Expand description
Sensor types for extracting observations from simulation.
Variants§
JointState
Joint position and velocity sensor.
BodyAccel
Body linear acceleration in world frame.
BodyAngularVel
Body angular velocity in body frame.
ForceTorque
Reaction force/torque at body.
Rangefinder
Distance to nearest obstacle (placeholder - requires collision detection).
Imu
IMU: acceleration + angular velocity in body frame.
FrameCapture
Snapshot of body transform.
Implementations§
Source§impl Sensor
impl Sensor
Sourcepub fn read(
&self,
model: &Model,
state: &State,
sensor_id: usize,
) -> SensorOutput
pub fn read( &self, model: &Model, state: &State, sensor_id: usize, ) -> SensorOutput
Read sensor output from current state.
Returns a SensorOutput with sensor_id set to 0 (caller should update).
Sourcepub fn output_dim(&self) -> usize
pub fn output_dim(&self) -> usize
Get expected output dimension for this sensor.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Sensor
impl RefUnwindSafe for Sensor
impl Send for Sensor
impl Sync for Sensor
impl Unpin for Sensor
impl UnsafeUnpin for Sensor
impl UnwindSafe for Sensor
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.