KinematicsWithShape

Struct KinematicsWithShape 

Source
pub struct KinematicsWithShape {
    pub kinematics: Arc<dyn Kinematics>,
    pub body: RobotBody,
}
Expand description

Struct that combines the kinematic model of a robot with its geometrical shape. This struct provides both the kinematic functionality for computing joint positions and the physical structure used for collision detection and other geometric calculations.

Fields§

§kinematics: Arc<dyn Kinematics>

The kinematic model of the robot, typically used to compute forward and inverse kinematics. This is an abstract trait (Kinematics), allowing for different implementations of kinematic models.

§body: RobotBody

The physical structure of the robot, represented by its joint geometries. This RobotBody contains information about the geometrical shapes of the joints and provides functionality for collision detection.

Implementations§

Source§

impl KinematicsWithShape

Source

pub fn new( opw_parameters: Parameters, constraints: Constraints, joint_meshes: [TriMesh; 6], base_mesh: TriMesh, base_transform: Isometry3<f64>, tool_mesh: TriMesh, tool_transform: Isometry3<f64>, collision_environment: Vec<CollisionBody>, first_collision_only: bool, ) -> Self

Constructs a new KinematicsWithShape instance for a 6DOF robot. This method consumes all parameters, moving them inside the robot. This is important for meshes that are bulky.

§Parameters
  • opw_parameters - OPW parameters defining this robot

  • constraints: joint constraint limits

  • joint_meshes - An array of [TriMesh; 6] representing the meshes for each joint’s body.

  • base_mesh - The mesh of the robot base.

  • base_transform - The transform to apply to the base mesh. This transform brings the robot into its intended location inside the robotic cell.

  • tool_mesh - The mesh of the robot’s tool, which will also be checked for collisions.

  • tool_transform - The transform to apply to the tool mesh. It defines the location of the “action point” of the robot whose location and rotation (pose) is the pose for direct and inverse kinematics calls.

  • collision_environment - A vector of collision objects represented by CollisionBody, where each object includes a mesh and its transform.

  • first_pose_only - As collision check may be expensive, check if we need multiple checked solutions if inverse kinematics, or the first (best) is enough

§Returns

A KinematicsWithShape instance with defined kinematic structure and shapes for collision detection.

Source

pub fn with_safety( opw_parameters: Parameters, constraints: Constraints, joint_meshes: [TriMesh; 6], base_mesh: TriMesh, base_transform: Isometry3<f64>, tool_mesh: TriMesh, tool_transform: Isometry3<f64>, collision_environment: Vec<CollisionBody>, safety: SafetyDistances, ) -> Self

Constructs a new KinematicsWithShape instance for a 6DOF robot. This method consumes all parameters, moving them inside the robot. This is important for meshes that are bulky.

§Parameters
  • opw_parameters - OPW parameters defining this robot

  • constraints: joint constraint limits

  • joint_meshes - An array of [TriMesh; 6] representing the meshes for each joint’s body.

  • base_mesh - The mesh of the robot base.

  • base_transform - The transform to apply to the base mesh. This transform brings the robot into its intended location inside the robotic cell.

  • tool_mesh - The mesh of the robot’s tool, which will also be checked for collisions.

  • tool_transform - The transform to apply to the tool mesh. It defines the location of the “action point” of the robot whose location and rotation (pose) is the pose for direct and inverse kinematics calls.

  • collision_environment - A vector of collision objects represented by CollisionBody, where each object includes a mesh and its transform.

  • safety - defines the minimal allowed distances between collision objects and specifies other details on how collisions are checked. In practice robot must stay at some safe distance from collision objects rather than touching them.

§Returns

A KinematicsWithShape instance with defined kinematic structure and shapes for collision detection.

Source§

impl KinematicsWithShape

Source

pub fn positioned_robot(&self, joint_positions: &Joints) -> PositionedRobot<'_>

Method to compute and return a PositionedRobot from the current RobotBody and a set of joint positions.

This method uses the forward kinematics to compute the global transforms of each joint and then creates the corresponding PositionedJoint instances, which are collected into a PositionedRobot.

§Arguments
  • joint_positions - A reference to the joint values (angles/positions) to compute the forward kinematics.
§Returns
  • A new instance of PositionedRobot containing the positioned joints with precomputed transforms.
Source§

impl KinematicsWithShape

Source

pub fn collides(&self, joints: &Joints) -> bool

Check for collisions for the given joint position. Both self-collisions and collisions with environment are checked. This method simply returns true (if collides) or false (if not)

Source

pub fn non_colliding_offsets( &self, joints: &Joints, from: &Joints, to: &Joints, ) -> Solutions

Return non colliding offsets, tweaking each joint plus minus either side, either into ‘to’ or into ‘from’. This is required for planning algorithms like A*. We can do less collision checks as we only need to check the joint branch of the robot we moved.

Source

pub fn collision_details(&self, joints: &Joints) -> Vec<(usize, usize)>

Provide details about he collision, who with whom collides or comes too near. Depending on if the RobotBody has been configured for complete check, either all collisions or only the first found colliding pair is returned.

Source

pub fn near( &self, joints: &Joints, safety: &SafetyDistances, ) -> Vec<(usize, usize)>

Allows overriding collision check with the custom instance of safety distance. This is needed when the safety configuration is adaptive/dynamic rather than fixed.

Trait Implementations§

Source§

impl Kinematics for KinematicsWithShape

Source§

fn inverse(&self, pose: &Pose) -> Solutions

Delegates call to underlying Kinematics, but will filter away colliding poses

Source§

fn inverse_continuing(&self, pose: &Pose, previous: &Joints) -> Solutions

Delegates call to underlying Kinematics, but will filter away colliding poses

Source§

fn inverse_5dof(&self, pose: &Pose, j6: f64) -> Solutions

Delegates call to underlying Kinematics, but will filter away colliding poses

Source§

fn inverse_continuing_5dof(&self, pose: &Pose, prev: &Joints) -> Solutions

Delegates call to underlying Kinematics, but will filter away colliding poses

Source§

fn forward(&self, qs: &Joints) -> Pose

Find forward kinematics (pose from joint positions). For 5 DOF robot, the rotation of the joint 6 should normally be 0.0 but some other value can be given, meaning the tool is mounted with fixed rotation offset.
Source§

fn constraints(&self) -> &Option<Constraints>

Returns constraints under what the solver is operating. Constraints are remembered here and can be used for generating random joint angles needed by RRT, or say providing limits of sliders in GUI.
Source§

fn kinematic_singularity(&self, qs: &Joints) -> Option<Singularity>

Detect the singularity. Returns either A type singularity or None if no singularity detected.
Source§

fn forward_with_joint_poses(&self, joints: &Joints) -> [Pose; 6]

Computes the forward kinematics for a 6-DOF robotic arm and returns an array of poses representing the position and orientation of each joint, including the final end-effector. Read more

Auto Trait Implementations§

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, U> AsBindGroupShaderType<U> for T
where U: ShaderType, &'a T: for<'a> Into<U>,

Source§

fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U

Return the T ShaderType for self. When used in AsBindGroup derives, it is safe to assume that all images in self exist.
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> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &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)

Converts &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> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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> DowncastSend for T
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Send + Sync>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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, 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.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ConditionalSend for T
where T: Send,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T

Source§

impl<T> Settings for T
where T: 'static + Send + Sync,

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,