pub struct RobotBody {
pub joint_meshes: [TriMesh; 6],
pub tool: Option<TriMesh>,
pub base: Option<BaseBody>,
pub collision_environment: Vec<CollisionBody>,
pub safety: SafetyDistances,
}
Expand description
Struct representing the geometry of a robot, which is composed of exactly 6 joints.
Fields§
§joint_meshes: [TriMesh; 6]
Joint meshes, one per joint
tool: Option<TriMesh>
Tool meshes, optional if the robot has no tool
base: Option<BaseBody>
Robot base specification
collision_environment: Vec<CollisionBody>
Environment objects arround the robot.
safety: SafetyDistances
Defines distances, how far the robot must stay from collision objects. Also specifies if we are interested in first collision only (like for path planning) or we need a detailed overview (like for diagnostics or visualization)
Implementations§
Source§impl RobotBody
impl RobotBody
Sourcepub fn collision_details(
&self,
qs: &Joints,
kinematics: &dyn Kinematics,
) -> Vec<(usize, usize)>
pub fn collision_details( &self, qs: &Joints, kinematics: &dyn Kinematics, ) -> Vec<(usize, usize)>
Returns detailed information about all collisions detected in the robot’s configuration.
This method uses default distance limits specified at creation.
Use near
if you need to change limits frequently as the part of your algorithm.
Sourcepub fn collides(&self, qs: &Joints, kinematics: &dyn Kinematics) -> bool
pub fn collides(&self, qs: &Joints, kinematics: &dyn Kinematics) -> bool
Returns true if any collision is detected in the robot’s configuration.
This method uses default distance limits specified at creation.
Use near
if you need to change limits frequently as the part of your algorithm.
Sourcepub fn near(
&self,
qs: &Joints,
kinematics: &dyn Kinematics,
safety_distances: &SafetyDistances,
) -> Vec<(usize, usize)>
pub fn near( &self, qs: &Joints, kinematics: &dyn Kinematics, safety_distances: &SafetyDistances, ) -> Vec<(usize, usize)>
Returns detailed information about all collisions detected in the robot’s configuration.
This method only checks for literally touching objects that limits its application.
Use near
to check if there are no objects closer than the given distance.
Sourcepub fn non_colliding_offsets(
&self,
initial: &Joints,
from: &Joints,
to: &Joints,
kinematics: &dyn Kinematics,
) -> Solutions
pub fn non_colliding_offsets( &self, initial: &Joints, from: &Joints, to: &Joints, kinematics: &dyn Kinematics, ) -> 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. Offset generation is accelerated via Rayon.
Auto Trait Implementations§
impl Freeze for RobotBody
impl RefUnwindSafe for RobotBody
impl Send for RobotBody
impl Sync for RobotBody
impl Unpin for RobotBody
impl UnwindSafe for RobotBody
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> 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.