From 0eec28325ecf192f386a6894526e97a462e68802 Mon Sep 17 00:00:00 2001 From: Crozet Sébastien Date: Mon, 22 Feb 2021 14:20:06 +0100 Subject: Fix warnings. --- src/dynamics/joint/ball_joint.rs | 6 ++++++ src/dynamics/joint/generic_joint.rs | 2 +- src/dynamics/joint/joint.rs | 1 + src/dynamics/joint/prismatic_joint.rs | 4 ++++ src/dynamics/joint/revolute_joint.rs | 4 ++++ 5 files changed, 16 insertions(+), 1 deletion(-) (limited to 'src/dynamics/joint') diff --git a/src/dynamics/joint/ball_joint.rs b/src/dynamics/joint/ball_joint.rs index 47c90ab..8481961 100644 --- a/src/dynamics/joint/ball_joint.rs +++ b/src/dynamics/joint/ball_joint.rs @@ -74,20 +74,24 @@ impl BallJoint { self.motor_max_impulse == 0.0 || (self.motor_stiffness == 0.0 && self.motor_damping == 0.0) } + /// Set the spring-like model used by the motor to reach the desired target velocity and position. pub fn configure_motor_model(&mut self, model: SpringModel) { self.motor_model = model; } + /// Sets the target velocity and velocity correction factor this motor. #[cfg(feature = "dim2")] pub fn configure_motor_velocity(&mut self, target_vel: Real, factor: Real) { self.configure_motor(self.motor_target_pos, target_vel, 0.0, factor) } + /// Sets the target velocity and velocity correction factor this motor. #[cfg(feature = "dim3")] pub fn configure_motor_velocity(&mut self, target_vel: Vector, factor: Real) { self.configure_motor(self.motor_target_pos, target_vel, 0.0, factor) } + /// Sets the target orientation this motor needs to reach. pub fn configure_motor_position( &mut self, target_pos: Rotation, @@ -97,6 +101,7 @@ impl BallJoint { self.configure_motor(target_pos, na::zero(), stiffness, damping) } + /// Sets the target orientation this motor needs to reach. #[cfg(feature = "dim2")] pub fn configure_motor( &mut self, @@ -111,6 +116,7 @@ impl BallJoint { self.motor_damping = damping; } + /// Configure both the target orientation and target velocity of the motor. #[cfg(feature = "dim3")] pub fn configure_motor( &mut self, diff --git a/src/dynamics/joint/generic_joint.rs b/src/dynamics/joint/generic_joint.rs index 5d776b0..c1549ff 100644 --- a/src/dynamics/joint/generic_joint.rs +++ b/src/dynamics/joint/generic_joint.rs @@ -1,5 +1,5 @@ use crate::dynamics::{BallJoint, FixedJoint, PrismaticJoint, RevoluteJoint}; -use crate::math::{Isometry, Real, SpacialVector, SPATIAL_DIM}; +use crate::math::{Isometry, Real, SpacialVector}; use crate::na::{Rotation3, UnitQuaternion}; #[derive(Copy, Clone, Debug)] diff --git a/src/dynamics/joint/joint.rs b/src/dynamics/joint/joint.rs index 290c34c..e0a9d38 100644 --- a/src/dynamics/joint/joint.rs +++ b/src/dynamics/joint/joint.rs @@ -130,6 +130,7 @@ pub struct Joint { } impl Joint { + /// Can this joint use SIMD-accelerated constraint formulations? pub fn supports_simd_constraints(&self) -> bool { match &self.params { JointParams::PrismaticJoint(joint) => joint.supports_simd_constraints(), diff --git a/src/dynamics/joint/prismatic_joint.rs b/src/dynamics/joint/prismatic_joint.rs index 4f5c984..3736b7f 100644 --- a/src/dynamics/joint/prismatic_joint.rs +++ b/src/dynamics/joint/prismatic_joint.rs @@ -217,18 +217,22 @@ impl PrismaticJoint { Isometry::from_parts(translation, rotation) } + /// Set the spring-like model used by the motor to reach the desired target velocity and position. pub fn configure_motor_model(&mut self, model: SpringModel) { self.motor_model = model; } + /// Sets the target velocity this motor needs to reach. pub fn configure_motor_velocity(&mut self, target_vel: Real, factor: Real) { self.configure_motor(self.motor_target_pos, target_vel, 0.0, factor) } + /// Sets the target position this motor needs to reach. pub fn configure_motor_position(&mut self, target_pos: Real, stiffness: Real, damping: Real) { self.configure_motor(target_pos, 0.0, stiffness, damping) } + /// Configure both the target position and target velocity of the motor. pub fn configure_motor( &mut self, target_pos: Real, diff --git a/src/dynamics/joint/revolute_joint.rs b/src/dynamics/joint/revolute_joint.rs index 6895d3d..d1181e9 100644 --- a/src/dynamics/joint/revolute_joint.rs +++ b/src/dynamics/joint/revolute_joint.rs @@ -85,18 +85,22 @@ impl RevoluteJoint { self.motor_max_impulse == 0.0 || (self.motor_stiffness == 0.0 && self.motor_damping == 0.0) } + /// Set the spring-like model used by the motor to reach the desired target velocity and position. pub fn configure_motor_model(&mut self, model: SpringModel) { self.motor_model = model; } + /// Sets the target velocity this motor needs to reach. pub fn configure_motor_velocity(&mut self, target_vel: Real, factor: Real) { self.configure_motor(self.motor_target_pos, target_vel, 0.0, factor) } + /// Sets the target angle this motor needs to reach. pub fn configure_motor_position(&mut self, target_pos: Real, stiffness: Real, damping: Real) { self.configure_motor(target_pos, 0.0, stiffness, damping) } + /// Configure both the target angle and target velocity of the motor. pub fn configure_motor( &mut self, target_pos: Real, -- cgit