pub struct JointMotor {
pub target_velocity: f32,
pub target_position: Option<f32>,
pub stiffness: f32,
pub max_speed: f32,
pub max_torque: f32,
}Fields§
§target_velocity: f32§target_position: Option<f32>§stiffness: f32§max_speed: f32§max_torque: f32Implementations§
Source§impl JointMotor
impl JointMotor
pub fn velocity(speed: f32, max_torque: f32) -> JointMotor
pub fn position( angle: f32, stiffness: f32, max_speed: f32, max_torque: f32, ) -> JointMotor
Sourcepub fn validate(self) -> Result<(), JointValidationError>
pub fn validate(self) -> Result<(), JointValidationError>
Checks the existing motor bounds without changing any value.
Velocity is in [-1000, 1000] rad/s, position in [-pi, pi] radians, stiffness and maximum torque in [0, 1e9], and maximum speed in [0, 1000] rad/s. Zero torque or speed is allowed. The solver clamps a position target to the joint’s limits; a target outside those limits is therefore valid if it remains within [-pi, pi].
use ferravex_physics::JointMotor;
JointMotor::position(0.5, 20., 8., 80.).validate().unwrap();
let error = JointMotor::velocity(f32::NAN, 1.).validate().unwrap_err();
assert_eq!(error.field(), "motor.target_velocity");Trait Implementations§
Source§impl Clone for JointMotor
impl Clone for JointMotor
Source§fn clone(&self) -> JointMotor
fn clone(&self) -> JointMotor
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 JointMotor
impl Debug for JointMotor
Source§impl PartialEq for JointMotor
impl PartialEq for JointMotor
impl Copy for JointMotor
impl StructuralPartialEq for JointMotor
Auto Trait Implementations§
impl Freeze for JointMotor
impl RefUnwindSafe for JointMotor
impl Send for JointMotor
impl Sync for JointMotor
impl Unpin for JointMotor
impl UnwindSafe for JointMotor
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