Skip to main content

Module collision

Module collision 

Source
Expand description

Obstacles of the config and the clearance the machine keeps from them: along a path before it runs (check_path, check_cycle), and in the simulation as it runs (Sim). The machine tells which of its parts can hit an obstacle (Machine::collision_bodies, collision_capsules); obstacles are boxes along the scene’s axes, the parts boxes too or, slanted, capsules.

Structs§

Bodies
The parts of a machine that can hit an obstacle at a state: its boxes and its capsules.
PlanCheck
What a path keeps from the obstacles before it runs: the least clearance along it (m, infinite without obstacles), the first pose at which a part of the machine touches one (clearance 0 or less), and the first pose at the least clearance (None without obstacles). own is the least clearance between the machine’s own parts that are not joined (Machine::connected_bodies), a figure apart from the obstacles’; None where nothing was checked (fewer than two parts, or all of them joined), which is not the same as clear.
SelfClearance
The least clearance between two of the machine’s own parts that are not joined along a path: m (negative in an overlap), the two parts, and the first pose at it.

Enums§

Body
One of the machine’s own parts, by its place among Machine::collision_bodies (a box) or Machine::self_collision_capsules (a capsule), counted from 0.

Constants§

CONTACT_DAMPING
CONTACT_STIFFNESS
An obstacle’s contact stiffness and damping where its entry gives none (effects.crash): [estimate] a fixture of steel profile on a machine bed, some 10 N/um at the point of contact, damped near critically for a few kilograms (2 sqrt(k m) = 2 sqrt(1e7 * 2.5) = 1e4 N s/m). [bounds] 1e6 to 1e8 N/m: from an aluminium profile on a slender stand to a solid steel block.

Functions§

check_cycle
The configured cycle checked as check_path does, before it runs: from the start pose to the first segment’s target with the payload attached (as the controller starts), then each segment from the target before it with the payload as that one left it, and round from the last to the first again. A segment with via points takes the path the planner times through them; the straight moves are taken as lines, which corner blending would cut short (the simulation itself is checked as it runs). The machine’s own parts are checked against each other along the way (PlanCheck::own, with profile.min_clearance_m as the distance under which parts at the start pose are joined, PlanCheck::at_start). None without obstacles where the machine has no two parts to check (or the cycle cannot be read: then it is not checked, where with obstacles it is an error). With [conveyor] the passes are checked instead (check_passes).
check_path
Adds the path through poses to check: straight from pose to pose, looked at every millimetre (every thousandth of an axis unit) or closer, the machine at rest at each pose with the payload as it is set.
nearest
The least clearance between the parts bodies and the obstacles: which obstacle, the nearest points and the clearance (negative in an overlap). None without parts or obstacles.
obstacles
The obstacles of the config: obstacles, a list of tables each with a name, the box’s centre_m and size_m (three numbers each, in scene coordinates; the sizes above 0), and optionally its contact stiffness_n_m (above 0) and damping_n_s_m (not negative), by default CONTACT_STIFFNESS and CONTACT_DAMPING. A config without the list has none.