pub struct CuCollisionCheckTask<const N: usize, const M: usize = N, const MAX_OBS: usize = DEFAULT_MAX_OBSTACLES, const MAX_ATTACHED: usize = DEFAULT_MAX_ATTACHED, const MAX_CONTACTS: usize = DEFAULT_MAX_CONTACTS, const MAX_EXCL: usize = DEFAULT_MAX_EXCLUSIONS> { /* private fields */ }Expand description
Stateless CuTask evaluating self-collision, environment obstacles, and attached shapes in place.
Node config: CuCollisionCheckParams. Inputs: joint positions, planning scene, exclusions.
Implementations§
Source§impl<const N: usize, const M: usize, const MAX_OBS: usize, const MAX_ATTACHED: usize, const MAX_CONTACTS: usize, const MAX_EXCL: usize> CuCollisionCheckTask<N, M, MAX_OBS, MAX_ATTACHED, MAX_CONTACTS, MAX_EXCL>
impl<const N: usize, const M: usize, const MAX_OBS: usize, const MAX_ATTACHED: usize, const MAX_CONTACTS: usize, const MAX_EXCL: usize> CuCollisionCheckTask<N, M, MAX_OBS, MAX_ATTACHED, MAX_CONTACTS, MAX_EXCL>
Sourcepub fn from_params(
chain: CuKinematicChain<N>,
model: CuRobotCollisionModel<N, M>,
) -> CuResult<Self>
pub fn from_params( chain: CuKinematicChain<N>, model: CuRobotCollisionModel<N, M>, ) -> CuResult<Self>
Creates a collision check task from a kinematic chain and robot collision model.
Sourcepub const fn chain(&self) -> &CuKinematicChain<N>
pub const fn chain(&self) -> &CuKinematicChain<N>
Borrows the kinematic chain.
Sourcepub const fn model(&self) -> &CuRobotCollisionModel<N, M>
pub const fn model(&self) -> &CuRobotCollisionModel<N, M>
Borrows the robot collision model.
Sourcepub fn check_configuration(
&self,
q: &[CuJointPosition; N],
scene: Option<&CuPlanningScene<MAX_OBS, MAX_ATTACHED>>,
exclusions: Option<&CuSceneExclusions<MAX_EXCL>>,
out_report: &mut CuCollisionReport<MAX_CONTACTS>,
) -> CuResult<()>
pub fn check_configuration( &self, q: &[CuJointPosition; N], scene: Option<&CuPlanningScene<MAX_OBS, MAX_ATTACHED>>, exclusions: Option<&CuSceneExclusions<MAX_EXCL>>, out_report: &mut CuCollisionReport<MAX_CONTACTS>, ) -> CuResult<()>
Checks self-collision, environment obstacles, and attached shapes for configuration q
against an optional planning scene snapshot, populating out_report in place.
Stable-ID exclusions are validated against scene; invalid references, or non-empty
exclusions without a scene, fail the check.
Trait Implementations§
Source§impl<const N: usize, const M: usize, const MAX_OBS: usize, const MAX_ATTACHED: usize, const MAX_CONTACTS: usize, const MAX_EXCL: usize> CuTask for CuCollisionCheckTask<N, M, MAX_OBS, MAX_ATTACHED, MAX_CONTACTS, MAX_EXCL>
impl<const N: usize, const M: usize, const MAX_OBS: usize, const MAX_ATTACHED: usize, const MAX_CONTACTS: usize, const MAX_EXCL: usize> CuTask for CuCollisionCheckTask<N, M, MAX_OBS, MAX_ATTACHED, MAX_CONTACTS, MAX_EXCL>
type Input<'m> = (&'m CuStampedData<CuJointPositionsPayload<N>, CuMsgMetadata>, &'m CuStampedData<CuPlanningScene<MAX_OBS, MAX_ATTACHED>, CuMsgMetadata>, &'m CuStampedData<CuSceneExclusions<MAX_EXCL>, CuMsgMetadata>)
type Output<'m> = CuStampedData<CuCollisionReport<MAX_CONTACTS>, CuMsgMetadata>
Source§fn new(
cfg: Option<&ComponentConfig>,
_res: Self::Resources<'_>,
) -> CuResult<Self>where
Self: Sized,
fn new(
cfg: Option<&ComponentConfig>,
_res: Self::Resources<'_>,
) -> CuResult<Self>where
Self: Sized,
Here you need to initialize everything your task will need for the duration of its lifetime.
The config allows you to access the configuration of the task.
Source§fn process<'i, 'o>(
&mut self,
_ctx: &CuContext,
input: &Self::Input<'i>,
output: &mut Self::Output<'o>,
) -> CuResult<()>
fn process<'i, 'o>( &mut self, _ctx: &CuContext, input: &Self::Input<'i>, output: &mut Self::Output<'o>, ) -> CuResult<()>
Process is the most critical execution of the task.
The goal will be to produce the output message as soon as possible.
Use preprocess to prepare the task to make this method as short as possible.
§fn register_debug_state_types(registry: &mut TypeRegistry)where
Self: Sized + GetTypeRegistration,
fn register_debug_state_types(registry: &mut TypeRegistry)where
Self: Sized + GetTypeRegistration,
Registers the reflected type used as this task’s debug-state contract. Read more
§fn debug_state_type_path() -> &'static strwhere
Self: Sized + TypePath,
fn debug_state_type_path() -> &'static strwhere
Self: Sized + TypePath,
Returns the reflected type path used as this task’s debug-state schema.
§fn with_debug_state<R>(
&self,
f: impl FnOnce(&(dyn Reflect + 'static)) -> R,
) -> Rwhere
Self: Sized,
fn with_debug_state<R>(
&self,
f: impl FnOnce(&(dyn Reflect + 'static)) -> R,
) -> Rwhere
Self: Sized,
Borrows this task’s current debug-state view. Read more
§fn start(&mut self, _ctx: &CuContext) -> Result<(), CuError>
fn start(&mut self, _ctx: &CuContext) -> Result<(), CuError>
Start is called between the creation of the task and the first call to pre/process.
§fn preprocess(&mut self, _ctx: &CuContext) -> Result<(), CuError>
fn preprocess(&mut self, _ctx: &CuContext) -> Result<(), CuError>
This is a method called by the runtime before “process”. This is a kind of best effort,
as soon as possible call to give a chance for the task to do some work before to prepare
to make “process” as short as possible.
§fn postprocess(&mut self, _ctx: &CuContext) -> Result<(), CuError>
fn postprocess(&mut self, _ctx: &CuContext) -> Result<(), CuError>
This is a method called by the runtime after “process”. It is best effort a chance for
the task to update some state after process is out of the way.
It can be use for example to maintain statistics etc. that are not time-critical for the robot.
Source§impl<const N: usize, const M: usize, const MAX_OBS: usize, const MAX_ATTACHED: usize, const MAX_CONTACTS: usize, const MAX_EXCL: usize> Freezable for CuCollisionCheckTask<N, M, MAX_OBS, MAX_ATTACHED, MAX_CONTACTS, MAX_EXCL>
impl<const N: usize, const M: usize, const MAX_OBS: usize, const MAX_ATTACHED: usize, const MAX_CONTACTS: usize, const MAX_EXCL: usize> Freezable for CuCollisionCheckTask<N, M, MAX_OBS, MAX_ATTACHED, MAX_CONTACTS, MAX_EXCL>
Source§impl<const N: usize, const M: usize, const MAX_OBS: usize, const MAX_ATTACHED: usize, const MAX_CONTACTS: usize, const MAX_EXCL: usize> TypePath for CuCollisionCheckTask<N, M, MAX_OBS, MAX_ATTACHED, MAX_CONTACTS, MAX_EXCL>
impl<const N: usize, const M: usize, const MAX_OBS: usize, const MAX_ATTACHED: usize, const MAX_CONTACTS: usize, const MAX_EXCL: usize> TypePath for CuCollisionCheckTask<N, M, MAX_OBS, MAX_ATTACHED, MAX_CONTACTS, MAX_EXCL>
fn type_path() -> &'static str
fn short_type_path() -> &'static str
fn type_ident() -> Option<&'static str>
fn crate_name() -> Option<&'static str>
fn module_path() -> Option<&'static str>
Auto Trait Implementations§
impl<const N: usize, const M: usize, const MAX_OBS: usize, const MAX_ATTACHED: usize, const MAX_CONTACTS: usize, const MAX_EXCL: usize> Freeze for CuCollisionCheckTask<N, M, MAX_OBS, MAX_ATTACHED, MAX_CONTACTS, MAX_EXCL>
impl<const N: usize, const M: usize, const MAX_OBS: usize, const MAX_ATTACHED: usize, const MAX_CONTACTS: usize, const MAX_EXCL: usize> RefUnwindSafe for CuCollisionCheckTask<N, M, MAX_OBS, MAX_ATTACHED, MAX_CONTACTS, MAX_EXCL>
impl<const N: usize, const M: usize, const MAX_OBS: usize, const MAX_ATTACHED: usize, const MAX_CONTACTS: usize, const MAX_EXCL: usize> Send for CuCollisionCheckTask<N, M, MAX_OBS, MAX_ATTACHED, MAX_CONTACTS, MAX_EXCL>
impl<const N: usize, const M: usize, const MAX_OBS: usize, const MAX_ATTACHED: usize, const MAX_CONTACTS: usize, const MAX_EXCL: usize> Sync for CuCollisionCheckTask<N, M, MAX_OBS, MAX_ATTACHED, MAX_CONTACTS, MAX_EXCL>
impl<const N: usize, const M: usize, const MAX_OBS: usize, const MAX_ATTACHED: usize, const MAX_CONTACTS: usize, const MAX_EXCL: usize> Unpin for CuCollisionCheckTask<N, M, MAX_OBS, MAX_ATTACHED, MAX_CONTACTS, MAX_EXCL>
impl<const N: usize, const M: usize, const MAX_OBS: usize, const MAX_ATTACHED: usize, const MAX_CONTACTS: usize, const MAX_EXCL: usize> UnsafeUnpin for CuCollisionCheckTask<N, M, MAX_OBS, MAX_ATTACHED, MAX_CONTACTS, MAX_EXCL>
impl<const N: usize, const M: usize, const MAX_OBS: usize, const MAX_ATTACHED: usize, const MAX_CONTACTS: usize, const MAX_EXCL: usize> UnwindSafe for CuCollisionCheckTask<N, M, MAX_OBS, MAX_ATTACHED, MAX_CONTACTS, MAX_EXCL>
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
impl<T> GetTypeRegistration for T
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