Skip to main content

Joint

Struct Joint 

Source
pub struct Joint {
    pub joint_type: JointType,
    pub parent_to_joint: SpatialTransform,
    pub axis: Vec3,
    pub damping: f64,
    pub limits: Option<[f64; 2]>,
}
Expand description

A joint connecting two bodies.

Fields§

§joint_type: JointType

Joint type.

§parent_to_joint: SpatialTransform

Transform from parent body frame to joint frame (constant).

§axis: Vec3

Joint axis in local frame (for revolute: typically Z).

§damping: f64

Damping coefficient.

§limits: Option<[f64; 2]>

Joint position limits [lower, upper] (None = unlimited).

Implementations§

Source§

impl Joint

Source

pub fn revolute(parent_to_joint: SpatialTransform) -> Self

Create a revolute joint with the given parent-to-joint transform.

Source

pub fn prismatic(parent_to_joint: SpatialTransform, axis: Vec3) -> Self

Create a prismatic joint with the given parent-to-joint transform and axis.

Source

pub fn spherical(parent_to_joint: SpatialTransform) -> Self

Create a spherical (ball) joint with the given parent-to-joint transform.

Source

pub fn free(parent_to_joint: SpatialTransform) -> Self

Create a free joint with the given parent-to-joint transform.

Source

pub fn fixed(parent_to_joint: SpatialTransform) -> Self

Create a fixed joint (rigid attachment).

Source

pub fn ndof(&self) -> usize

Number of degrees of freedom for this joint type.

Source

pub fn joint_transform_slice(&self, q: &[f64]) -> SpatialTransform

Compute the joint transform for the given joint position(s).

Returns the Plücker transform from predecessor to successor frame. q slice should have length >= ndof().

Source

pub fn joint_transform(&self, q: f64) -> SpatialTransform

Compute the joint transform for a single-DOF joint (backward compat). For multi-DOF joints, use joint_transform_slice instead.

Source

pub fn motion_subspace_matrix(&self) -> DMat

Motion subspace matrix S for this joint. Returns a matrix of size 6 × ndof. For single-DOF joints, returns a 6×1 column vector.

Source

pub fn motion_subspace(&self) -> SpatialVec

Motion subspace for single-DOF joints (backward compat). For multi-DOF joints, use motion_subspace_matrix instead. Fixed joints return a zero vector.

Trait Implementations§

Source§

impl Clone for Joint

Source§

fn clone(&self) -> Joint

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Joint

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Joint

§

impl RefUnwindSafe for Joint

§

impl Send for Joint

§

impl Sync for Joint

§

impl Unpin for Joint

§

impl UnsafeUnpin for Joint

§

impl UnwindSafe for Joint

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

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

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.