pub struct CuCollisionEnv<'a> { /* private fields */ }Expand description
Borrowed view of the collision environment: world obstacles, attached shapes, and exclusions.
The view copies nothing. Build it from raw obstacle shapes with new, or from a
planning scene with CuPlanningScene::collision_env
(which also carries obstacle IDs, so obstacle exclusions resolve). EMPTY
checks the robot against itself only.
§Attached shapes
Attached shapes are transformed by their frame (None = base frame) and checked against each
other, the robot’s own shapes, and the obstacles:
- attached vs. robot and attached vs. attached report
CuContactKind::SelfCollision; - attached vs. obstacle reports
CuContactKind::EnvironmentCollision.
Attached shapes on the same frame (including two None) are one rigid body and are never
checked against each other. Attached-vs-robot pairs are never skipped automatically; exclude
mounting contact explicitly with CuSceneExclusions.
§Contact index encoding
For attached-shape contacts link_index is robot_shape_count + attached_index, so it never
collides with robot shape indices 0..robot_shape_count. partner_index is the robot shape
index, robot_shape_count + attached_index for attached partners, or the obstacle index.
§Exclusions
Exclusions are validated at the start of every check: unassigned IDs, IDs absent from the view, self-references, and out-of-range robot shape indices fail the check and leave the report unmodified.
Implementations§
Source§impl<'a> CuCollisionEnv<'a>
impl<'a> CuCollisionEnv<'a>
Sourcepub const EMPTY: CuCollisionEnv<'static>
pub const EMPTY: CuCollisionEnv<'static>
No obstacles, attached shapes, or exclusions: self-collision only.
Sourcepub const fn new(obstacles: &'a [CuCollisionShape]) -> Self
pub const fn new(obstacles: &'a [CuCollisionShape]) -> Self
Environment of anonymous world-frame obstacles.
Sourcepub const fn with_attached(self, attached: &'a [CuAttachedShape]) -> Self
pub const fn with_attached(self, attached: &'a [CuAttachedShape]) -> Self
Adds shapes attached to robot frames (or the base frame).
Sourcepub fn with_exclusions<const MAX_EXCLUSIONS: usize>(
self,
exclusions: &'a CuSceneExclusions<MAX_EXCLUSIONS>,
) -> Self
pub fn with_exclusions<const MAX_EXCLUSIONS: usize>( self, exclusions: &'a CuSceneExclusions<MAX_EXCLUSIONS>, ) -> Self
Adds stable-ID pair exclusions for the attached shapes.
Sourcepub const fn obstacles(&self) -> &'a [CuCollisionShape]
pub const fn obstacles(&self) -> &'a [CuCollisionShape]
World-frame obstacle shapes.
Sourcepub const fn attached(&self) -> &'a [CuAttachedShape]
pub const fn attached(&self) -> &'a [CuAttachedShape]
Attached shapes.
Sourcepub const fn exclusions(&self) -> &'a [CuSceneExclusion]
pub const fn exclusions(&self) -> &'a [CuSceneExclusion]
Stable-ID exclusions.
Trait Implementations§
Source§impl<'a> Clone for CuCollisionEnv<'a>
impl<'a> Clone for CuCollisionEnv<'a>
Source§fn clone(&self) -> CuCollisionEnv<'a>
fn clone(&self) -> CuCollisionEnv<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<'a> Copy for CuCollisionEnv<'a>
Source§impl<'a> Debug for CuCollisionEnv<'a>
impl<'a> Debug for CuCollisionEnv<'a>
Source§impl<'a> Default for CuCollisionEnv<'a>
impl<'a> Default for CuCollisionEnv<'a>
Source§fn default() -> CuCollisionEnv<'a>
fn default() -> CuCollisionEnv<'a>
Auto Trait Implementations§
impl<'a> Freeze for CuCollisionEnv<'a>
impl<'a> RefUnwindSafe for CuCollisionEnv<'a>
impl<'a> Send for CuCollisionEnv<'a>
impl<'a> Sync for CuCollisionEnv<'a>
impl<'a> Unpin for CuCollisionEnv<'a>
impl<'a> UnsafeUnpin for CuCollisionEnv<'a>
impl<'a> UnwindSafe for CuCollisionEnv<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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 more