API reference¤
compas_fab_native is a compas_fab backend: you use it through the regular compas_fab
planner API (set_robot_cell, inverse_kinematics, check_collision,
plan_cartesian_motion, plan_motion, ...). The pages of compas_fab document those calls;
this page covers what is specific to the native backend: its constructor options and the
planner options it understands.
compas_fab_native.NativePlanner ¤
NativePlanner(kinematics_solver=None, sphere_options: Optional[dict] = None, exact: bool = True, obstacles: str = 'boxes', esdf_options: Optional[dict] = None, exact_links=None)
Bases: SetRobotCell, SetRobotCellState, ForwardKinematics, InverseKinematics, CheckCollision, PlanCartesianMotion, PlanMotion, PlannerInterface
Planner backed by the native (Rust) motion core.
Parameters:
-
kinematics_solver–compas_fab analytical solver of the robot (e.g.
UR5Kinematics()); its parameters are handed to the core's closed-form IK. -
sphere_options(Optional[dict], default:None) –Sphere fitting options (see
model.fit_sphere_sets). -
exact(bool, default:True) –Keep the exact collision meshes in the core. Planned Cartesian paths are then validated on the meshes (parry3d) after the sphere search, and the search continues until the path is collision-free under both models. Default True.
-
obstacles(str, default:'boxes') –How the sphere search sees static rigid bodies:
"boxes"(oriented bounding boxes, default) or"esdf"(a signed distance field of their meshes; bodies with touch links, like a floor, stay boxes). -
esdf_options(Optional[dict], default:None) –voxel(0.02 m),truncation(0.3 m) andmargin(0.01 m) of the ESDF. -
exact_links–Links to check on their exact geometry inside planning too, not only in the final exact check:
None(default),"auto"(the links spheres represent poorly, seepoorly_fitted_links) or a list of link names. They are tested as convex hulls (conservative) against each other and the scene's boxes, on every configuration the spheres find free. Useful when the final check keeps rejecting paths near large flat links (a gantry carriage); it slows planning down, and the hulls take free space away. Needsexact=True.
poorly_fitted_links
property
¤
Links whose collision spheres miss their mesh by more than
model.EXACT_LINK_MISS (95th percentile): the spheres cannot represent them (a
gantry carriage, a tall base), so collisions with them are only caught by the
exact check. See the exact_links option.
check_collision ¤
Collision check on the sphere model, or on the exact meshes with options["exact"].
iter_inverse_kinematics ¤
IK solutions of a FrameTarget or PointAxisTarget, collision-free unless
options["check_collision"] is False.
Robots with a closed form (kinematics_solver, or a spherical wrist the core
derives one for) get all of its solutions; for a PointAxisTarget, those of
axis_samples rotations about the axis. Other robots (redundant arms, external
axes) use the core's numerical IK, which treats the rotation about a point-axis
target's axis as free.
plan_cartesian_motion ¤
Cartesian path through FrameWaypoints or PointAxisWaypoints.
The tool moves in straight lines between waypoints: frames are interpolated every
max_step metres and max_step_angle radians (like MoveIt and PyBullet), and the
trajectory has one point per interpolated frame, passing through every waypoint.
Robots with a closed form plan over all IK branches at once (layered graph search).
Other robots (redundant arms, external axes) follow the path with numerical IK from
several starting solutions and keep the cheapest that stays collision-free.
Point-axis waypoints leave the rotation about the axis free: continuously with
numerical IK, sampled (free_axis_samples) with the closed form.
plan_motion ¤
Collision-free joint-space motion from start_state to target.
The straight joint-space motion is tried first, then RRT-Connect from the start and from every goal at once, then shortcutting and B-spline smoothing. The result is checked on the exact meshes and re-planned with another seed if it touches them.
Targets
ConfigurationTarget
One goal.
FrameTarget
Every IK solution is a goal; the planner picks whichever it reaches.
PointAxisTarget
IK solutions of axis_samples rotations about the axis.