pub struct mjsSensor_ { /* private fields */ }Implementations§
Source§impl mjsSensor_
impl mjsSensor_
Source§impl mjsSensor_
impl mjsSensor_
Sourcepub fn intprm_mut(&mut self) -> &mut [i32; 3]
pub fn intprm_mut(&mut self) -> &mut [i32; 3]
Return a mutable reference to integer parameters.
Sourcepub fn interval(&self) -> &[f64; 2]
pub fn interval(&self) -> &[f64; 2]
Return an immutable reference to [period, time_prev] in seconds.
Sourcepub fn interval_mut(&mut self) -> &mut [f64; 2]
pub fn interval_mut(&mut self) -> &mut [f64; 2]
Return a mutable reference to [period, time_prev] in seconds.
Sourcepub fn with_intprm(&mut self, value: [i32; 3]) -> &mut Self
pub fn with_intprm(&mut self, value: [i32; 3]) -> &mut Self
Builder method for setting integer parameters.
Sourcepub fn with_interval(&mut self, value: [f64; 2]) -> &mut Self
pub fn with_interval(&mut self, value: [f64; 2]) -> &mut Self
Builder method for setting [period, time_prev] in seconds.
Sourcepub fn plugin_mut(&mut self) -> &mut MjsPlugin
pub fn plugin_mut(&mut self) -> &mut MjsPlugin
Return a mutable reference to sensor plugin.
Sourcepub fn datatype(&self) -> MjtDataType
pub fn datatype(&self) -> MjtDataType
Return value of data type.
Sourcepub fn set_objtype(&mut self, value: MjtObj) -> Result<(), MjEditError>
pub fn set_objtype(&mut self, value: MjtObj) -> Result<(), MjEditError>
Set object type the sensor refers to.
§Errors
Returns MjEditError::InvalidParameter when the object type is not a real object type (i.e. not below MjtObj::mjNOBJECT).
Sourcepub fn set_reftype(&mut self, value: MjtObj) -> Result<(), MjEditError>
pub fn set_reftype(&mut self, value: MjtObj) -> Result<(), MjEditError>
Set type of referenced object.
§Errors
Returns MjEditError::InvalidParameter when the reference type is not a real object type (i.e. not below MjtObj::mjNOBJECT).
Sourcepub fn set_datatype(&mut self, value: MjtDataType)
pub fn set_datatype(&mut self, value: MjtDataType)
Set data type.
Sourcepub fn set_cutoff(&mut self, value: f64)
pub fn set_cutoff(&mut self, value: f64)
Set cutoff for real and positive datatypes.
Sourcepub fn set_needstage(&mut self, value: MjtStage)
pub fn set_needstage(&mut self, value: MjtStage)
Set compute stage needed to simulate sensor.
Sourcepub fn set_nsample(&mut self, value: i32)
pub fn set_nsample(&mut self, value: i32)
Set number of samples in history buffer.
Sourcepub fn set_interp(&mut self, value: i32)
pub fn set_interp(&mut self, value: i32)
Set interpolation order (0=ZOH, 1=linear, 2=cubic).
Sourcepub fn with_type(&mut self, value: MjtSensor) -> &mut Self
pub fn with_type(&mut self, value: MjtSensor) -> &mut Self
Builder method for setting sensor type.
Sourcepub fn with_objtype(&mut self, value: MjtObj) -> &mut Self
pub fn with_objtype(&mut self, value: MjtObj) -> &mut Self
Builder method for setting object type the sensor refers to.
§Panics
Panics with MjEditError::InvalidParameter when the object type is not a real object type (i.e. not below MjtObj::mjNOBJECT).
Sourcepub fn with_reftype(&mut self, value: MjtObj) -> &mut Self
pub fn with_reftype(&mut self, value: MjtObj) -> &mut Self
Builder method for setting type of referenced object.
§Panics
Panics with MjEditError::InvalidParameter when the reference type is not a real object type (i.e. not below MjtObj::mjNOBJECT).
Sourcepub fn with_datatype(&mut self, value: MjtDataType) -> &mut Self
pub fn with_datatype(&mut self, value: MjtDataType) -> &mut Self
Builder method for setting data type.
Sourcepub fn with_cutoff(&mut self, value: f64) -> &mut Self
pub fn with_cutoff(&mut self, value: f64) -> &mut Self
Builder method for setting cutoff for real and positive datatypes.
Sourcepub fn with_noise(&mut self, value: f64) -> &mut Self
pub fn with_noise(&mut self, value: f64) -> &mut Self
Builder method for setting noise stdev.
Sourcepub fn with_needstage(&mut self, value: MjtStage) -> &mut Self
pub fn with_needstage(&mut self, value: MjtStage) -> &mut Self
Builder method for setting compute stage needed to simulate sensor.
Sourcepub fn with_dim(&mut self, value: i32) -> &mut Self
pub fn with_dim(&mut self, value: i32) -> &mut Self
Builder method for setting number of scalar outputs.
Sourcepub fn with_nsample(&mut self, value: i32) -> &mut Self
pub fn with_nsample(&mut self, value: i32) -> &mut Self
Builder method for setting number of samples in history buffer.
Sourcepub fn with_interp(&mut self, value: i32) -> &mut Self
pub fn with_interp(&mut self, value: i32) -> &mut Self
Builder method for setting interpolation order (0=ZOH, 1=linear, 2=cubic).
Sourcepub fn with_delay(&mut self, value: f64) -> &mut Self
pub fn with_delay(&mut self, value: f64) -> &mut Self
Builder method for setting delay time in seconds; 0: no delay.
Sourcepub fn set_userdata<T: AsRef<[f64]>>(&mut self, value: T)
pub fn set_userdata<T: AsRef<[f64]>>(&mut self, value: T)
Set userdata.
Sourcepub fn with_userdata<T: AsRef<[f64]>>(&mut self, value: T) -> &mut Self
pub fn with_userdata<T: AsRef<[f64]>>(&mut self, value: T) -> &mut Self
Builder method for setting userdata.
Sourcepub fn refname(&self) -> &str
pub fn refname(&self) -> &str
Return name of referenced object.
§Panics
Panics if the stored string is not valid UTF-8, which can only happen on internal memory corruption – MuJoCo only uses ASCII values.
Sourcepub fn set_refname(&mut self, value: &str)
pub fn set_refname(&mut self, value: &str)
Sourcepub fn with_refname(&mut self, value: &str) -> &mut Self
pub fn with_refname(&mut self, value: &str) -> &mut Self
Builder method for setting name of referenced object.
§Panics
When the value contains ‘\0’ characters, a panic occurs.
Sourcepub fn objname(&self) -> &str
pub fn objname(&self) -> &str
Return name of sensorized object.
§Panics
Panics if the stored string is not valid UTF-8, which can only happen on internal memory corruption – MuJoCo only uses ASCII values.
Sourcepub fn set_objname(&mut self, value: &str)
pub fn set_objname(&mut self, value: &str)
Sourcepub fn with_objname(&mut self, value: &str) -> &mut Self
pub fn with_objname(&mut self, value: &str) -> &mut Self
Builder method for setting name of sensorized object.
§Panics
When the value contains ‘\0’ characters, a panic occurs.
Trait Implementations§
Auto Trait Implementations§
impl !Send for mjsSensor_
impl !Sync for mjsSensor_
impl Freeze for mjsSensor_
impl RefUnwindSafe for mjsSensor_
impl Unpin for mjsSensor_
impl UnsafeUnpin for mjsSensor_
impl UnwindSafe for mjsSensor_
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.