Back to Trending
RepositoryMATLAB
mathworks-robotics

mathworks-robotics/trajectory-planning-robot-manipulators

MATLAB and Simulink examples for trajectory generation and evaluation of robot manipulators.

168stars
43forks
0issues
1views

Copyright 2019 The MathWorks, Inc.

Description

This submission consists of educational MATLAB and Simulink examples for trajectory generation and evaluation of robot manipulators.

All examples feature the 7-DOF Kinova Gen3 Ultra lightweight robotic manipulator: https://www.kinovarobotics.com/en/products/robotic-arms/gen3-ultra-lightweight-robot

There is a presaved MATLAB rigid body tree model of the Kinova Gen3; however, you can access the 3D model description from the Kinova Kortex GitHub repository: https://github.com/Kinovarobotics/ros_kortex

For more information on the Robotics System Toolbox functionality for manipulators, see the documentation: https://www.mathworks.com/help/ros/robotic-manipulators-applications.html

For more background information on trajectory planning, refer to this presentation: https://cw.fel.cvut.cz/old/_media/courses/a3m33iro/080manipulatortrajectoryplanning.pdf

If you have any questions, email us at roboticsarena@mathworks.com.

Files

To get started, run the startupExample.m script. This will configure the MATLAB search path so all the examples run correctly.

matlab Folder

Contains MATLAB examples for trajectory planning.

  • manipTrajCartesian.m - Task space (translation only) trajectories
  • manipTrajJoint.m - Joint space trajectories. Contains an includeOrientation variable to toggle waypoint orientations on or off.
  • manipTrajLinearRotation.m - Task space (translation only) trajectories with linearly interpolated orientation
  • manipTrajTransform.m - Linearly interpolated transform trajectories (translation and orientation)
  • manipTrajTransformTimeScaling.m - Transform trajectories (translation and orientation) interpolated using nonlinear time scaling
  • compareTaskVsJointTraj.m - Comparison script that illustrates the difference between task space and joint space trajectories

NOTE: All the scripts above are configurable:

  • createWaypointData.m script - Generates sample waypoints, trajectory times, and other necessary planning variables.
  • trajType variable - Used to switch the trajectory type
  • plotMode variable - Used to switch the waypoint/trajectory visualization type

Contains Simulink examples for trajectory planning.

  • manipCartesianTrajectory.slx - Task space (translation only) trajectories
  • manipJointTrajectory.slx - Joint space trajectories.
  • manipRotationTrajectory.slx - Task space (translation only) trajectories with linearly interpolated orientation
  • manipTransformTrajectory.slx - Linearly interpolated transform trajectories (translation and orientation)
  • manipTransformTrajectoryTimeScaling.slx - Transform trajectories (translation and orientation) interpolated using nonlinear time scaling

NOTE: There are also models that work with Robot Operating System (ROS), which are identically named with the ros prefix. Instead of using variables in the MATLAB base workspace, waypoint information is communicated using ROS messages. To test this, you can use the Waypoint Publisher App or the publishWaypoints script (see the next section).

The ROS topics and message types are:

  • /waypoints - List of waypoints, message type geometry_msgs/PoseArray
  • /waypoint_times - List of waypoint target times, message type std_msgs/Float64MultiArray

utilities Folder

Contains several utilities for the MATLAB and Simulink examples above.

  • createWaypointData.m - Creates sample waypoints, waypoint times, and other necessary planning variables. If you want to change the waypoints or other trajectory reference values, modify this script (or we suggest creating a copy)
  • cylinder.stl - "Dummy" mesh file representing the end effector attached the arm
  • gen3.mat - Presaved rigid body tree containing the 3D model of the robot arm
  • gen3positions.mat - Presaved joint and end effector configurations for the "home" and "retract" positions of the robot arm
  • importGen3Model.m - Function to import the Kinova Gen3 manipulator model. Not needed by this example; you can use this if you want to import a new model yourself from the source URDF file.
  • plotTrajectory.m - Utility function to plot generated trajectory profiles (used with MATLAB examples)
  • publishWaypoints.m - Tests the publishing of waypoint information as ROS messages
  • trajExampleUtils.slx - Block library containing common components for the Simulink examples
  • visualizeRobot.m - Utility function used by the library above to plot the manipulator from a Simulink model
  • waypointPublisher.mlapp - MATLAB app used to modify waypoints and publish them to the base workspace or as ROS messages

Similar Projects

Discover other similar projects and AI models.

RepositoryMATLAB
mathworks-robotics/designing-robot-manipulator-algorithms

MATLAB and Simulink files for modeling and simulation of ROBOTIS OpenManipulator

59
Oct 14, 2025
RepositoryC++
petercorke/robotics-toolbox-python

Robotics Toolbox for Python

3.6k
Dec 1, 2026
RepositoryMATLAB
mathworks/awesome-matlab-students

An awesome list of helpful resources for students learning MATLAB & Simulink. List includes tips & tricks, tutorials, videos, cheat sheets, and opportunities to learn MATLAB & Simulink.

780
Nov 17, 2026
RepositoryMATLAB
mohammadrezwankhan/matlab-simulink-energy-lab

Run reduced-order battery, thermal, converter and BESS control models with transparent equations and repeatable testing.

383
Nov 23, 2026
RepositoryC++
stack-of-tasks/pinocchio

A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives

3.9k
Nov 30, 2026
RepositoryPython
NVlabs/curobo

CUDA Accelerated Robot Library

2.1k
Nov 21, 2026
RepositoryC++
pantor/ruckig

Motion Generation for Robots and Machines. Real-time. Jerk-constrained. Time-optimal.

1.5k
Nov 24, 2026
RepositoryHTML
matlab/simulink-agentic-toolkit

The Simulink Agentic Toolkit gives your AI agent both the tools and the expertise to work effectively with Simulink and Model-Based Design.

1.4k
Nov 25, 2026
RepositoryPython
openrobokit/robokit

A high-performance, general-purpose toolkit for versatile robotic tasks.

482
Nov 27, 2026