matlab-model-robot-kinematics

Build rigidBodyTree robot models and validate inverse kinematics solutions in MATLAB.

995|122|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill matlab-model-robot-kinematics
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: matlab-model-robot-kinematics
Source: https://github.com/matlab/matlab-agentic-toolkit/tree/main/skills-catalog/robotics-and-autonomous-systems/matlab-model-robot-kinematics
Command: npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill matlab-model-robot-kinematics

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Building manipulator models in MATLAB often leads to silent failures: missing collision meshes, misaligned end-effector frames, unconverged IK solutions, and grippers attached in the wrong orientation. This Skill guides the correct construction, configuration, and validation of rigidBodyTree robot models so downstream simulation, planning, and pick-and-place tasks behave as expected.

Core Features & Use Cases

  • Model Loading and Construction: Choose between loadrobot, importrobot (URDF/Xacro/SDF), or building from DH parameters, with guidance on collision mesh generation via VHACD decomposition.
  • Gripper Attachment: Select and attach Robotiq parallel-jaw or vacuum grippers with correct frame alignment, including the KUKA iiwa tool0 correction and contact-frame IK targeting pattern.
  • Kinematics Solving and Validation: Decide between inverseKinematics and generalizedInverseKinematics, then mandatorily validate exit flags, position error, constraint violations, and joint continuity across waypoints.
  • Use Case: A user asks to simulate a UR5e picking up a box. The Skill loads the robot with loadrobot, attaches a robotiq2F85 gripper with ReplaceBase=false, adds a grasp-center contact frame, solves IK to each waypoint, and validates every solution before visualization.

Quick Start

Ask your AI agent to load a UR5e robot model in MATLAB, attach a Robotiq gripper, and solve validated inverse kinematics for a target pick-and-place pose.

Frequently Asked Questions about matlab-model-robot-kinematics

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I load a robot model in MATLAB?

Use loadrobot with the robot name, such as loadrobot("universalUR5e", DataFormat="row"), to get a rigidBodyTree with collision meshes and inertias included. For custom robots, use importrobot with a URDF, Xacro, or SDF file, or build from DH parameters with rigidBodyTree.

What is the difference between inverseKinematics and generalizedInverseKinematics?

inverseKinematics solves for a single target end-effector pose, while generalizedInverseKinematics handles multiple simultaneous constraints such as position targets, aiming, joint bounds, and Cartesian bounds. Use GIK when the task needs more than one pose constraint.

How do I attach a gripper to a robot in MATLAB?

Load a gripper model such as robotiq2F85 with loadrobot, then attach it using addSubtree(robot, "tool0", gripper, ReplaceBase=false). The ReplaceBase=false flag is required to preserve the gripper's base visual mesh, and KUKA iiwa models need a corrective tool0 frame first.

Why does my imported URDF robot have no collision geometry?

Many URDF, Simscape Multibody, and CAD exports include only visual meshes without collision tags. Generate collision geometry at import time using importrobot with CollisionDecomposition set to vhacdOptions with SourceMesh="VisualGeometry", or run collisionVHACD per body on already-loaded models.

Can rigidBodyTree model parallel robots like delta or Stewart platforms?

No, rigidBodyTree only represents open-chain serial mechanisms and cannot model closed kinematic chains. For parallel robots such as delta robots or Stewart platforms, use Simscape Multibody with KinematicsSolver instead.

Why does my IK solution fail silently in MATLAB?

IK failures are silent unless you check solnInfo.ExitFlag, where values at or below zero indicate non-convergence. Always verify the solution by computing FK with getTransform and confirming the position error is below threshold, and check joint continuity between sequential waypoints.