mechanism_simulate_submit
Simulate rigid-link mechanism dynamics asynchronously via PyBullet. Returns a job ID; poll for trajectories, torques, collisions, and reachable envelope.
Instructions
Simulate a rigid-link mechanism's DYNAMICS with PyBullet, asynchronously (the
MBD family; requires the mbd extra — pip install 'ankusdrive[mbd]'). Use
mechanism_kinematics first for the exact closed-form gates (DOF, Grashof, stroke).
links is a tree: [{name, box_mm:[lx,ly,lz], mass_g, parent (link index, −1 =
fixed base), joint_type ('revolute'|'prismatic'|'fixed'), joint_axis:[x,y,z],
joint_at_mm:[x,y,z] (in the parent frame), com_mm:[x,y,z]}]. drivers:
[{link, rate_dps}] (revolute) or [{link, rate_mm_s}] (prismatic). Optional
obstacles ([{box_mm, at_mm}]) for through-motion contact, base, gravity
(m/s², default [0,0,−9.81]), dt_s, duration_s. gears
([{link_a, link_b, ratio, axis?, max_force?}]) couples two revolute links by
ω_b = −ω_a/ratio (ratio = Nb/Na for an Na/Nb external mesh) — the moving image of
the gear-train ratio gate.
Returns immediately. If PyBullet is absent: {ok:false, reason, install, mobility_dof, n_links}. Otherwise {job_id, status, cache_hit, mobility_dof}; poll job_result(job_id) for {trajectories, orientations (per-link world quaternion, sampled with trajectories), max_torques, collisions_through_motion (with the sim time of each contact), reachable_envelope {bbox_mm}, mobility_dof}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| base | No | ||
| dt_s | No | ||
| gears | No | ||
| links | Yes | ||
| drivers | No | ||
| gravity | No | ||
| obstacles | No | ||
| duration_s | No | ||
| loop_closures | No |