pub struct NLinkArm {
pub link_lengths: Vec<f64>,
pub joint_angles: Vec<f64>,
pub points: Vec<[f64; 2]>,
pub end_effector: [f64; 2],
pub n_links: usize,
}Expand description
A planar N-link arm with forward and inverse kinematics.
Fields§
§link_lengths: Vec<f64>Length of each link
joint_angles: Vec<f64>Current joint angles [rad]
points: Vec<[f64; 2]>Computed joint positions (n_links + 1 points, including the base at origin)
end_effector: [f64; 2]End-effector position
n_links: usizeNumber of links
Implementations§
Source§impl NLinkArm
impl NLinkArm
Sourcepub fn update_joints(&mut self, joint_angles: &[f64])
pub fn update_joints(&mut self, joint_angles: &[f64])
Updates joint angles and recomputes link positions.
Sourcepub fn update_points(&mut self)
pub fn update_points(&mut self)
Recomputes all joint positions from current angles.
Sourcepub fn workspace_radius(&self) -> f64
pub fn workspace_radius(&self) -> f64
Total workspace radius (sum of all link lengths).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NLinkArm
impl RefUnwindSafe for NLinkArm
impl Send for NLinkArm
impl Sync for NLinkArm
impl Unpin for NLinkArm
impl UnsafeUnpin for NLinkArm
impl UnwindSafe for NLinkArm
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§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 more§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).§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.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.