Expand description
Deterministic, allocation-free capsule and sphere robot collision checking for copper-rs.
CuRobotCollisionModel: robot link shapes (CuLinkShape) on joint frames, built withCuRobotCollisionModel::newandCuCollisionModelParams, or from RON viaCuCollisionModelSpec.CuCollisionEnv: borrowed view of obstacles, attached shapes, and exclusions that every check takes;CuPlanningScene::collision_envprovides one without copying.CuCollisionCheckTask: theCuTaskwrapper, configured byCuCollisionCheckParams.
§Example
use repose_collision::{CuCollisionEnv, CuCollisionReport, CuCollisionShape, CuSphere};
use repose_collision::igus_rebel_collision_model;
use repose_kinematics::igus_rebel_chain;
use cu29::units::si::angle::radian;
use cu29::units::si::f64::{Angle, Length};
use cu29::units::si::length::meter;
let chain = igus_rebel_chain();
let model = igus_rebel_collision_model();
let q_home = [Angle::new::<radian>(0.0).into(); 6];
let mut report = CuCollisionReport::<8>::default();
model.check_configuration(&chain, &q_home, &CuCollisionEnv::EMPTY, &mut report).unwrap();
assert!(report.is_collision_free());
let m = Length::new::<meter>;
let obstacles = [CuCollisionShape::Sphere(CuSphere::new([m(0.0), m(0.0), m(0.87)], m(0.08)).unwrap())];
model.check_configuration(&chain, &q_home, &CuCollisionEnv::new(&obstacles), &mut report).unwrap();
assert!(!report.is_collision_free());Structs§
- CuAttached
Shape - A collision shape rigidly attached to a robot frame or the base.
- CuAttached
Update - Changes applied by
CuPlanningScene::update_attached; unset parts are kept. - CuCapsule
- 3D capsule (swept sphere along line segment
a->b) with radius. - CuCollision
Check Params - Node config of
CuCollisionCheckTask. - CuCollision
Check Task - Stateless
CuTaskevaluating self-collision, environment obstacles, and attached shapes in place. - CuCollision
Contact - Single contact or clearance violation between a robot link and another link or obstacle.
- CuCollision
Env - Borrowed view of the collision environment: world obstacles, attached shapes, and exclusions.
- CuCollision
Model Params - Parameters of a
CuRobotCollisionModel. - CuCollision
Report - Fixed-capacity collision report populated in place (
CuMsgPayload-compliant). - CuLink
Shape - A robot collision shape and the frame it is expressed in.
- CuObject
Id - Strongly typed, stable object identifier for obstacles and attached shapes in a planning scene.
- CuPlanning
Scene - Fixed-capacity, versioned planning scene storage (
CuMsgPayload-compliant). - CuRobot
Collision Model - Fixed-capacity model for
Nmovable frames and up toMcollision shapes. - CuScene
Exclusion - One excluded attached-shape pair, addressed by stable IDs where the scene owns them.
- CuScene
Exclusions - Fixed-capacity stable-ID exclusion set (
CuMsgPayload-compliant). - CuScene
Obstacle - An environment obstacle in world coordinates, as stored in a planning scene.
- CuScene
Revision - Monotonically increasing revision counter tracking changes to the planning scene.
- CuSphere
- 3D sphere primitive defined by a center point and radius.
Enums§
- CuCollision
Model Spec - Source of a robot collision model in RON: a preset name or an inline model.
- CuCollision
Shape - Convex collision shape primitive (
SphereorCapsule). - CuContact
Kind - Category of a detected collision or safety-margin violation.
- CuScene
Error - Errors that can occur during planning scene modifications and queries.
- CuScene
Exclusion Partner - Partner of an attached shape in a
CuSceneExclusion.
Constants§
- DEFAULT_
MAX_ ATTACHED - Default attached shape capacity of
CuPlanningSceneandCuCollisionCheckTask. - DEFAULT_
MAX_ CONTACTS - Default contact capacity of
CuCollisionCheckTask. - DEFAULT_
MAX_ EXCLUSIONS - Default capacity for stable-ID exclusions in
CuSceneExclusions. - DEFAULT_
MAX_ OBSTACLES - Default obstacle capacity of
CuPlanningSceneandCuCollisionCheckTask.
Functions§
- capsule_
capsule_ signed_ distance - Computes the exact signed surface-to-surface distance between two capsules.
- capsule_
sphere_ signed_ distance - Computes the exact signed surface-to-surface distance between a capsule and a sphere.
- igus_
rebel_ collision_ model - Returns the 6-link capsule/sphere collision model for the igus ReBeL 6-DOF cobot.
- shape_
signed_ distance - Computes the exact signed surface-to-surface distance between any two
CuCollisionShapeprimitives. - shapes_
violate_ margin - Returns
trueif the signed distance betweenaandbis strictly less thansafety_margin. - sphere_
sphere_ signed_ distance - Computes the exact signed surface-to-surface distance between two spheres.
- transform_
shape - Transforms a local
CuCollisionShapebyframeand writes the world-space shape intoout_world.