Motion Planning logo

Motion Planning

Organization
google-deepmind
motion-planning

Plans collision-free 6-DoF grasped-object paths, coupled robot arm+object joint trajectories, and Cartesian contact strokes for manipulation arms (SO-101, I2RT YAM, ALOHA, or MuJoCo robots) with stereo triangulation, clearance diagnostics, and camera overlay checks. Use when planning robot arm trajectories near tabletop obstacles, containers, doors, or apertures. Don't use for eye-in-hand servoing (use visual-servoing) or non-robot pathfinding.

Overview

Publishergoogle-deepmind
Repositoryrobotics-antigravity-plugin
Skill namemotion-planning
Stars
490
Forks
45
Bundled files
1
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by google-deepmind on GitHub. Read the source before you install it.

Installation

Install the Motion Planning AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/google-deepmind/robotics-antigravity-plugin/tree/main/plugins/robotics/skills/motion-planning
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/google-deepmind/robotics-antigravity-plugin.git /tmp/robotics-antigravity-plugin
mkdir -p .claude/skills
cp -r /tmp/robotics-antigravity-plugin/plugins/robotics/skills/motion-planning .claude/skills/motion-planning
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Motion Planning in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Motion Planning on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Motion Planning is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Collision-Aware Motion Planning (motion_planner.py)

Import import motion_planner as mp (prepending <skill_dir>/scripts to sys.path if needed).

CRITICAL — Never cat, head, or tail motion_planner.py or raw robot XMLs! Check README.md/runtime specs for transport, action layout, control_dt_s, and camera intrinsics, write workspace .py scripts or python3 - << 'EOF' (avoid /tmp scripts or inline python3 -c quoting errors), and call mjcf_path = mp.resolve_mjcf_path(), print(mp.describe_robot(mjcf_path)["summary_text"]), and planner.gripper_frame_info(gripper_cmd) upfront for joints/limits, TCP axes (approach_axis_ee, closing_axis_ee, slim_axis_ee), jaw widths, and asymmetric_protrusions.

1. Calibration, Hollow Geometry & Immediate t = 0 Escape

  • MJCF Root Frame & Sparse Triangulation: Express all poses/primitives in the robot MJCF root frame (never assume z_support = 0.0 or mix external world extrinsics). Compute camera poses via mp.get_camera_poses_in_robot_frame(mjcf_path, joint_positions) ({"left": left_q, "right": right_q}, {joint_name: val}, or single-arm q) and triangulate 1–2 support points (z_support, max_ray_residual_m < 0.015) plus sparse landmarks across >= 2 views via mp.triangulate_pixels (standing height h = z_top - z_support, resting center z = z_support + 0.5 * h, or mp.intersect_ray_plane — never run dense stereo, RANSAC, or scipy.optimize silhouette fitters).
  • Safety-Margin Overlay Fit (~1–1.5 cm), Hollow Primitives & Door Padding: Persist scene_model.py (build_scene, build_object). Decompose hollow bowls, cups, racks, and cavities into thin wall, floor/sill, ceiling, and rim primitives (add_vertical_cylinder base + perimeter ring of vertical add_capsule walls for round vessels, or add_oriented_box panels for box cavities — never solid blocks sealing interior goals). Model support (group="table"), ungrasped target (group="target_init", removed via scene.without("target_init") once attached), and idle arms (planner.add_other_arm_to_scene). Pad fixed walls 3–5 mm and unlatched hinged doors ~18–25 mm (group="door") (>= 12–15 cm staging clearance). Calibrate to the safety margin (~1–1.5 cm), not subpixel perfection: once wireframes in mp.render_scene_overlay enclose obstacles/rims within ~1–1.5 cm (2–3 passes max), stop refining geometry and move to execution (avoid custom Canny, vanishing-point, or numerical solvers; use close-range wrist views at pre_grasp/pre_place if needed).
  • Immediate All-Arm t = 0 Escape: Check every arm at t = 0 via planner.check_arm_config(scene, q_init). If any arm has min_clearance_m < 0.025, execute planner.escape_initial_collision(scene, q_init, target_clearance_m=0.04)["q_trajectory"] right away before planning pick/place, re-observe, update the arm's parked pose, and only re-fit scene_model.py if an object shifted.

2. Motion Planning, Lookahead Feasibility & Checkpoint Execution

  • Free-Space plan_arm vs. Linear plan_cartesian_stroke: Use planner.plan_arm (safety_margin_m=0.015) between pre-contact poses (5–8 cm clear), attaching held objects via planner.attach_object_at_world_pose(obj, q_grasp, obj_pose6d) and planner.set_gripper_opening(gripper_cmd). Always use planner.plan_cartesian_stroke(..., max_joint_vel_rad_s=0.5) (never 2-point joint interpolation) for pre_grasp -> grasp, vertical lift clear of rims, pre_place -> place -> retract, and linear cavity insertions/pushes (ignore_obstacles=("table",) or clearance_tol_m=0.003 at contact). Hold targets ~0.4–0.5 s when closing or fully opening (0.0) the gripper before lifting/retracting. Center grasps on ee_site, align closing_axis_ee across the wider clearance axis so slim_axis_ee faces narrow jambs/neighbors (or along thin rims/rods), and flip wrist roll 180° (ee_rot @ np.diag([-1, -1, 1])) so asymmetric_protrusions face open space.
  • Single-Arm Reach First & Decoupled Regrasp Staging: First check whether a single arm can both pick and reach a valid goal feature directly. When reorientation or cross-workspace transfer is required, prefer placing stably on an unobstructed surface (clear of open doors/obstacles), releasing, re-observing, and regrasping to decouple the arms at a zero-risk checkpoint — reserve mid-air bimanual handover strictly for slender/non-standing objects that cannot rest stably on a surface, and if coupled two-arm or multi-stage planning fails once or twice offline, switch immediately to surface staging or an alternate reachable goal feature rather than tuning coupled IK in a loop.
  • Lookahead Endpoint Feasibility, Then Checkpoint-by-Checkpoint Execution: Reserve >= 75% of episode budget for execution. Before grasping, run a fast endpoint feasibility check (solve_ik + check_arm_config / check_se3_pose at grasp and goal placement) to avoid kinematic dead ends — but only synthesize plan_arm / plan_cartesian_stroke trajectories up to the next safe, reversible physical checkpoint (collision escape, lifted hover, surface staging, or single-item placement), then execute right away and re-observe real camera + joint feedback rather than pre-solving multi-stage trajectories or all N items offline. After each placement, update scene with placed items at their observed resting poses and triangulate 3D position to verify it lies deep inside the goal volume (following shallow doorway-sill releases with a closed-gripper linear centerline push, or using a secure upper support feature on tall stands), parking arms >= 10 cm clear when done.

3. motion_planner (mp) API (pose6d = [x, y, z, yaw, pitch, roll])

  • Introspection & SE(3): mp.resolve_mjcf_path() -> str, mp.describe_robot(mjcf_path=None) -> {"arms", "cameras", "summary_text"}, mp.rpy_to_matrix(r, p, y), mp.matrix_to_rpy(rot), mp.quat_wxyz_to_matrix(q_wxyz), mp.pose6d_from_pos_rot(pos, rot=None), mp.pos_rot_from_pose6d(pose6d) -> (pos, rot), mp.make_transform(pos, rot=None), mp.invert_transform(tf).
  • Scene3D & MultiSphereObject: scene = mp.Scene3D(): .add_sphere(name, center, radius, group=""), .add_aligned_box(name, center, half_extents, group=""), .add_oriented_box(name, center, half_extents, rotation, group=""), .add_capsule(name, point_a, point_b, radius, group=""), .add_vertical_cylinder(name, center, radius, height, group=""), .add_object_spheres(obj, pose6d, name_prefix="", group=""), .without(*names_or_groups), .clone(). obj = mp.MultiSphereObject(name="object"): .add_sphere(local_center, radius), .add_capsule_spheres(p0, p1, radius, num_spheres=5). mp.check_se3_pose(obj, scene, pose6d) -> {"valid", "collisions", "min_clearance_m"}, mp.plan_object_se3(obj, scene, start_pose6d, goal_pose6d, safety_margin_m=0.010) -> {"solved", "waypoints", "interpolated"}.
  • RobotArmPlanner: planner = mp.RobotArmPlanner(mjcf_path=None, arm="left", gripper_cmd=0.0) (.dof, .q_min, .q_max, .joint_names, .ee_site_name): .fk(q) -> (ee_pos, ee_rot), .gripper_frame_info(gripper_cmd=None) -> {"approach_axis_ee", "closing_axis_ee", "slim_axis_ee", "open_inner_gap_m", "closed_inner_gap_m", "open_outer_width_m", "slim_profile_width_m", "asymmetric_protrusions", "top_down_rot_hint"}, .set_gripper_opening(gripper_cmd), .attach_object_at_world_pose(obj, q_grasp, obj_world_pose6d) -> T_ee_obj, .ee_pose_for_object_pose(obj_world_pose6d) -> (ee_pos, ee_rot), .attached_object_pose(q) -> pose6d, .detach_object(), .add_other_arm_to_scene(scene, other_arm_q, other_gripper_cmd=0.0), .check_arm_config(scene, q, ignore_obstacles=(), clearance_tol_m=0.0) -> {"valid", "self_collisions", "collisions", "min_clearance_m", "nearest_pair"}, .solve_ik(target_pos, target_rot=None, q_seed=None, scene=None, num_restarts=16, ignore_obstacles=(), clearance_tol_m=0.0) -> {"success", "q", "pos_err_m", "rot_err_rad", "collision_check"}, .escape_initial_collision(scene, q_start, target_clearance_m=0.015, control_dt_s=0.04) -> {"escaped", "q_escaped", "q_trajectory"}, .plan_cartesian_stroke(q_start, target_pos, target_rot=None, num_waypoints=8, scene=None, ignore_obstacles=(), clearance_tol_m=0.0, max_joint_vel_rad_s=0.55, control_dt_s=0.04) -> {"solved", "waypoints", "q_trajectory", "min_clearance_m"}, .plan_arm(scene, q_start, q_goal, max_joint_vel_rad_s=1.25, control_dt_s=0.04, safety_margin_m=0.015) -> {"solved", "waypoints", "q_trajectory"}, mp.resample_waypoints_cosine(waypoints, max_joint_vel_rad_s=1.25, control_dt_s=0.04) -> np.ndarray.
  • Cameras & Overlay: mp.get_camera_poses_in_robot_frame(mjcf_path, joint_positions=None) -> {cam_key: {"pos", "rot", "convention", "mjcf_name"}} (MuJoCo -Z forward for mp.*), mp.get_camera_poses_opencv(mjcf_path, joint_positions=None, image_size=None) -> {cam_key: {"pos", "rot", "convention", "T_world_cam", "T_ee_cam", "K", "fx_px", "fy_px", "cx_px", "cy_px", "arm", "ee_site_name", "mjcf_name"}} (OpenCV +Z forward for rgb_localization / Ibvs; pass image_size=(W, H) when MJCF omits resolution), mp.triangulate_pixels(uv_by_camera, cam_poses, cam_intrinsics) -> {"point_3d", "max_ray_residual_m"}, mp.intersect_ray_plane(u_col, v_row, cam_pose, cam_intrinsics, plane_z=0.0), mp.render_scene_overlay(mjcf_path, joint_positions, camera_image_paths, scene, output_path, objects=(), camera_intrinsics=None) -> str.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Motion Planning AI skill do?

Plans collision-free 6-DoF grasped-object paths, coupled robot arm+object joint trajectories, and Cartesian contact strokes for manipulation arms (SO-101, I2RT YAM, ALOHA, or MuJoCo robots) with stereo triangulation, clearance diagnostics, and camera overlay checks. Use when planning robot arm trajectories near tabletop obstacles, containers, doors, or apertures. Don't use for eye-in-hand servoing (use visual-servoing) or non-robot pathfinding.

Why use Motion Planning on TypingMind?

Because you install it once and use it with any model. Motion Planning is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Motion Planning in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/google-deepmind/robotics-antigravity-plugin/tree/main/plugins/robotics/skills/motion-planning. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Motion Planning?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Motion Planning?

As many as you like. As long as a model supports skills, you can use Motion Planning with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Motion Planning AI skill free?

Yes. It is published on GitHub by google-deepmind under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇