Software
pymoveit2
From github.com/AndrejOrsula/pymoveit2 (opens in a new tab)
- Robot arms and industry
- Library
- BSD-3-Clause
A Python library for moving robots through MoveIt 2 over ROS 2 actions and services, with examples for joint goals, poses, servoing, gripper control and planning scene edits.
Facts
- GitHub stars
- 368read on 28 Nov 2026
- Last update
- 6 Nov 2026Newest commit on main
- Maintenance
- Activea commit in the last 90 days
- Difficulty
- Intermediate
- Hardware it needs, as the project states it
- It also says mesh collision objects require the trimesh Python package.
Checked on GitHub on 28 Nov 2026.
Licenses
- Code
- BSD-3-Clause (opens in a new tab)
Read by Robotheca from LICENSE (opens in a new tab) (BSD-3-Clause) at commit 9359b83 (opens in a new tab), on 6 Nov 2026.
- Commercial use
- Yes
At a glance
- What it is
- Plans and executes joint-space and Cartesian motions by talking to MoveIt 2 from Python.
- Provides forward and inverse kinematics examples.
- Supports real-time servoing through MoveIt 2 Servo.
- Controls a gripper with toggle, open and close actions.
- Adds, removes and allows collisions with primitive shapes and meshes in the planning scene.
- Offers a RobotSession context manager via connect() that discovers the robot description automatically.
Robotheca's summary of the project's documents, not the creator's words.
- Robots on Robotheca
- No robot on Robotheca uses it yet.
- Licence
- BSD-3-Clause. Commercial use: Yes. Where it was read
- Install
- In the creator's words: The project's README (opens in a new tab)
- Maintenance
- Active, last commit on 6 Nov 2026.
Use it
How to install it, in the creator's words: The project's README (opens in a new tab)
Robotheca doesn't review code. Read it before running it.
Files and versions
- Repository on GitHubgithub.com/AndrejOrsula/pymoveit2 (opens in a new tab)
- The version Robotheca read9359b83 (opens in a new tab)
- Latest release5.1.0 (6 Nov 2026)
Robotheca read the repository at two versions: the summary at a4e5662 and the facts and the README at 9359b83 (read on 28 Nov 2026).
Robotheca never hosts the code: each link goes to the creator's own page.
The README
The creator's own README, copied as written: README.md by @AndrejOrsula, at commit 9359b83, under BSD-3-Clause (opens in a new tab). The original on GitHub (opens in a new tab).
Read the README here
pymoveit2
Move a robot from Python by communicating with MoveIt 2 over ROS 2 actions and services
Joint Configuration
Cartesian Pose
Gripper Action
Real-Time Servoing
Installation
Binary package
(opens in a new tab) (opens in a new tab) (opens in a new tab) (opens in a new tab)
sudo apt install ros-$ROS_DISTRO-pymoveit2
Python package
pip install pymoveit2
Docker image
cd $WS
git clone https://github.com/AndrejOrsula/pymoveit2.git
pymoveit2/.docker/run.bash $ROS_DISTRO --network-host --ipc-host --gui
Source build
cd $COLCON_WS
git clone https://github.com/AndrejOrsula/pymoveit2.git src/pymoveit2
rosdep install -y -r -i --rosdistro $ROS_DISTRO --from-paths src/pymoveit2
colcon build --merge-install --symlink-install --cmake-args "-DCMAKE_BUILD_TYPE=Release"
source install/local_setup.bash
Quick start (demo with Franka Emika Panda)
-
Configure MoveIt 2 for your robot (install for widely available robots, or build one on your own):
sudo apt install ros-$ROS_DISTRO-moveit-resources-panda-moveit-config ros-$ROS_DISTRO-controller-manager -
Launch the MoveIt 2 setup for your robot:
ros2 launch moveit_resources_panda_moveit_config demo.launch.py -
Move the robot via
pymoveit2examples:ros2 run pymoveit2 ex_joint_goal.py
Nothing moved? Run ros2 run pymoveit2 ex_doctor.py to investigate the problem.
Examples
Kinematics
# Forward (joint positions -> end effector pose)
ros2 run pymoveit2 ex_fk.py
# Inverse (end effector pose -> joint positions)
ros2 run pymoveit2 ex_ik.py --ros-args -p position:="[0.3, 0.0, 0.3]" -p quat_xyzw:="[0.0, 0.0, 0.0, 1.0]"
Motion planning and execution
# Move to a joint configuration (default to SRDF group state)
ros2 run pymoveit2 ex_joint_goal.py
# Move to a pose (motion in joint space or Cartesian space)
ros2 run pymoveit2 ex_pose_goal.py --ros-args -p position:="[0.3, 0.0, 0.3]" -p quat_xyzw:="[0.0, 0.0, 0.0, 1.0]" -p cartesian:=False
# Move while maintaining a fixed orientation of the end effector
ros2 run pymoveit2 ex_orientation_path_constraint.py --ros-args -p use_orientation_constraint:=True
# Move via real-time servoing (MoveIt 2 Servo)
ros2 run pymoveit2 ex_servo.py
# Actuate the gripper (action: {toggle, open, close})
ros2 run pymoveit2 ex_gripper.py --ros-args -p action:="toggle"
Session
# Move the robot through `RobotSession` (initialized via `connect()`)
ros2 run pymoveit2 ex_session.py --ros-args -p position:="[0.3, 0.0, 0.3]" -p quat_xyzw:="[0.0, 0.0, 0.0, 1.0]"
Planning scene
# Add a primitive shape to the planning scene (shape: {box, sphere, cone, cylinder})
ros2 run pymoveit2 ex_collision_primitive.py --ros-args -p shape:="sphere" -p position:="[0.5, 0.0, 0.5]" -p dimensions:="[0.04]"
# Add a triangular mesh to the planning scene (action: {add, remove}) [Note: Requires `trimesh` Python package]
ros2 run pymoveit2 ex_collision_mesh.py --ros-args -p action:="add" -p position:="[0.5, 0.0, 0.5]" -p quat_xyzw:="[0.0, 0.0, -0.707, 0.707]"
# Allow or forbid collisions with a planning scene object (allow: {true, false})
ros2 run pymoveit2 ex_allow_collisions.py --ros-args -p id:="sphere" -p allow:=true
# Remove all objects from the planning scene
ros2 run pymoveit2 ex_clear_planning_scene.py
Python API
RobotSession
The simplest way to use pymoveit2 is via connect() that provides a context manager for your robot:
from pymoveit2 import connect
with connect() as robot:
# Move to a pose while checking for failures
if not robot.move_to_pose([0.4, 0.0, 0.4], [1.0, 0.0, 0.0, 0.0]):
print(robot.last_failure())
exit(1)
# Actuate the gripper
robot.gripper.close()
# Move to SRDF group state
robot.move_to_configuration()
The robot object represents a RobotSession that manages:
| Attribute | Manages |
|---|---|
robot.node | ROS 2 node |
robot.executor | ROS 2 executor |
robot.description | Robot description (automatically discovered) |
robot.arm | MoveIt 2 interface for the motion planning |
robot.gripper | MoveIt 2 Gripper interface (optional) |
robot.servo | MoveIt 2 Servo interface (optional) |
RobotDescription + MoveIt2 + GripperInterface + MoveIt2Servo
Alternatively, you can build and customize the interfaces while managing the ROS 2 node and executor yourself:
from pymoveit2 import RobotDescription, MoveIt2, GripperInterface, MoveIt2Servo
node = ... # your rclpy node
description = RobotDescription.from_node(node) # note: in the unlikely case of failure, `pymoveit2.robots` provides static robot presets
moveit2 = MoveIt2(node=node, **description.moveit2_kwargs())
gripper = GripperInterface(node=node, **description.moveit2_gripper_kwargs()) if description.gripper_group_name else None
servo = MoveIt2Servo(node=node, frame_id=str(description.moveit2_kwargs()["base_link_name"]))
Robotheca lists software as a reference: nothing is hosted or run here, and every fact links to where it was read.