pub struct Parallelogram {
pub robot: Arc<dyn Kinematics>,
pub scaling: f64,
pub driven: usize,
pub coupled: usize,
}
Expand description
Parallelogram Mechanism: The parallelogram mechanism introduces a geometric dependency between two specific joints, typically to maintain the orientation of the end-effector as the robot arm moves. This is useful in tasks that require a constant tool orientation, such as welding or handling objects, ensuring that the tool or end-effector remains level.
The mechanism links two joints, referred to as joints[driven]
and joints[coupled]
. The movement
of the driven joint influences the coupled joint, maintaining the orientation of the end-effector
during motion. The scaling factor determines the proportional influence of the driven joint on the
coupled joint.
- Forward Kinematics: The coupled joint (
joints[coupled]
) is adjusted based on the driven joint:joints[coupled]' = joints[coupled] - scaling * joints[driven]
. This adjustment maintains the correct alignment of the end-effector. - Inverse Kinematics: The dependency is reversed, adding the influence of the driven joint to the
coupled joint:
joints[coupled]' = joints[coupled] + scaling * joints[driven]
. This ensures accurate calculation of joint angles to achieve the desired pose and orientation.
The Parallelogram
structure automatically adjusts joints[coupled]
based on joints[driven]
using
a scaling factor to account for the parallelogram mechanism.
§Fields:
robot
: The underlying robot’s kinematics model used to compute forward and inverse kinematics.scaling
: The factor that determines how much influencejoints[driven]
has onjoints[coupled]
.driven
: The index of the driven joint in the parallelogram mechanism (typically the primary joint).coupled
: The index of the coupled joint in the parallelogram mechanism (the secondary joint influenced by the driven joint).
§Example:
use std::sync::Arc;
// As J1 = 0, J2 = 1 and J3 = 2, so it is more clear with J-constants:
use rs_opw_kinematics::kinematic_traits::{J2, J3};
use rs_opw_kinematics::kinematics_impl::OPWKinematics;
use rs_opw_kinematics::parallelogram::Parallelogram;
use rs_opw_kinematics::parameters::opw_kinematics::Parameters;
// Assuming a robot that implements the Kinematics trait
let robot_kinematics = Arc::new(OPWKinematics::new(Parameters::irb2400_10()));
// Create the Parallelogram structure with a scaling factor of 0.5,
// where joints[1] is the driven joint and joints[2] is the coupled joint.
let parallelogram = Parallelogram {
robot: robot_kinematics,
scaling: 1.0, // typically there is 1-to-1 influence between driven and coupled joints
driven: J2, // Joint 2 is most often the driven joint.
coupled: J3, // Joint 3 is most often the coupled joint
};
As Parallelogram accepts and itself implements Kinematics, it is possible to chain multiple parallelograms if the robot has more than one.
Fields§
§robot: Arc<dyn Kinematics>
The underlying robot’s kinematics used for forward and inverse kinematics calculations.
scaling: f64
The scaling factor that determines the proportional influence of joints[driven]
on joints[coupled]
.
driven: usize
The index of the driven joint in the parallelogram mechanism (joints[driven]
).
coupled: usize
The index of the coupled joint in the parallelogram mechanism (joints[coupled]
).
Trait Implementations§
Source§impl Clone for Parallelogram
impl Clone for Parallelogram
Source§fn clone(&self) -> Parallelogram
fn clone(&self) -> Parallelogram
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Kinematics for Parallelogram
impl Kinematics for Parallelogram
Source§fn inverse(&self, tcp: &Pose) -> Solutions
fn inverse(&self, tcp: &Pose) -> Solutions
Source§fn inverse_5dof(&self, tcp: &Pose, j6: f64) -> Solutions
fn inverse_5dof(&self, tcp: &Pose, j6: f64) -> Solutions
Source§fn inverse_continuing_5dof(&self, tcp: &Pose, previous: &Joints) -> Solutions
fn inverse_continuing_5dof(&self, tcp: &Pose, previous: &Joints) -> Solutions
Source§fn inverse_continuing(&self, tcp: &Pose, previous: &Joints) -> Solutions
fn inverse_continuing(&self, tcp: &Pose, previous: &Joints) -> Solutions
Source§fn forward(&self, qs: &Joints) -> Pose
fn forward(&self, qs: &Joints) -> Pose
Source§fn forward_with_joint_poses(&self, joints: &Joints) -> [Pose; 6]
fn forward_with_joint_poses(&self, joints: &Joints) -> [Pose; 6]
Source§fn kinematic_singularity(&self, qs: &Joints) -> Option<Singularity>
fn kinematic_singularity(&self, qs: &Joints) -> Option<Singularity>
Source§fn constraints(&self) -> &Option<Constraints>
fn constraints(&self) -> &Option<Constraints>
Auto Trait Implementations§
impl Freeze for Parallelogram
impl !RefUnwindSafe for Parallelogram
impl Send for Parallelogram
impl Sync for Parallelogram
impl Unpin for Parallelogram
impl !UnwindSafe for Parallelogram
Blanket Implementations§
Source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
Source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
T
ShaderType
for self
. When used in AsBindGroup
derives, it is safe to assume that all images in self
exist.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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.