hylo.manip.planning¶
Package: hylo-manip · Core contracts
planning ¶
Motion planning for goals: IK over seeds, a collision-free joint path (straight interpolation, else RRT-Connect with shortcut smoothing), a straight Cartesian final approach, hand commands, and time parameterisation to control steps under per-joint velocity and acceleration limits.
PlannerConfig
dataclass
¶
PlannerConfig(control_hz: float = 20.0, max_vel: Any = 1.0, max_acc: Any = 2.0, hand_time: float = 1.0, margin: float = 0.01, table_clearance: float = 0.01, approach_clearance: float = 0.002, self_filter: float = 0.03, near_hand: float = 0.08, line_step: float = 0.01, line_jump: float = 0.25, edge_res: float = 0.03, rrt_step: float = 0.2, rrt_iters: int = 3000, rrt_time: float = 10.0, shortcut_iters: int = 60, ik_random: int = 12, ik_random_more: int = 48, ik_solutions: int = 4, seed: int = 0)
Attempt
dataclass
¶
Planner ¶
robot_points ¶
What cameras see of each robot model (every geom of its bodies, fixed base included) at the given joints, per arm; arms sharing a model are posed together and reported once.
obstacles ¶
obstacles(arm: str, q_now: dict[str, ndarray], hand_now: dict[str, Any], table: float | None, scene: ndarray | None, seen_at: Sequence[tuple[dict, dict]] = (), attached: ndarray | None = None) -> Obstacles
Observed points minus the table, the robot (now and at seen_at, the configurations the points were
observed in) and what the hand holds (points near the TCP; with attached, points held in the TCP frame,
within reach of those points where they are now); arms of other models added as points.
arms_clear ¶
None when the arms at joints q touch neither each other nor the rest of the robot, else a description.
Arms in one model: MuJoCo contacts among robot geoms (pairs touching at home and pairs within one hand
excepted); arms in different models: each arm's collision samples against the others' surfaces.
line ¶
Joint path following the straight TCP line T0 -> T1 (position lerp, rotation slerp) from q_start. A step
whose IK solution jumps more than line_jump is subdivided (up to 16 times finer) before giving up: near
joint limits and singular postures the joints move fast per centimetre of TCP travel.
plan_goal ¶
plan_goal(goal, q_now: dict[str, ndarray], hand_now: dict[str, Any], table: float | None, scene: ndarray | None, attached: ndarray | None = None, seen_at: Sequence[tuple[dict, dict]] = ()) -> Attempt
actions ¶
actions(goal, path: list[ndarray], q_now: dict[str, ndarray], hand_keep: dict[str, Any], action_dim: int) -> tuple[np.ndarray, dict[str, Any]]
Timed (T, action_dim) rows: the arm follows the path with hand_before, then holds with hand.
time_parameterize ¶
Positions at t = dt, 2 dt, ... along a piecewise-linear joint path, starting and ending at rest, whose finite
differences stay within vmax and amax (the profile is slowed down until they do).
check_limits ¶
check_limits(traj: ndarray, q0: ndarray, vmax: ndarray, amax: ndarray, dt: float) -> tuple[float, float]
Largest ratio of finite-difference velocity and acceleration to the limits (starting and ending at rest).
retime_together ¶
retime_together(paths: dict[str, Sequence[ndarray]], kin: Kinematics, vmax: dict[str, ndarray], amax: dict[str, ndarray], dt: float, min_steps: int = 2) -> dict[str, np.ndarray]
Joint trajectories of several arms that start and stop together and keep their TCPs in step: each path is parameterised by its TCP travel (plus a little joint travel, for turns on the spot), and every arm follows one shared minimum-jerk progress profile, lengthened until every arm keeps its velocity and acceleration limits.