pymoveit2:基于 ROS 2 的 MoveIt 2 Python 接口项目

用户可借助此项目便捷地在 Python 中控制 MoveIt 2,实现机器人运动规划与控制。它基于 ROS 2 动作和服务构建,提供关节目标、笛卡尔位姿运动、 gripper 控制、Servo 实时控制及碰撞对象管理等核心功能。【此简介由AI生成】

分支5Tags12
文件最后提交记录最后更新时间
Enable execution of bash scripts via symlinks Signed-off-by: Andrej Orsula <orsula.andrej@gmail.com> 3 年前
build(deps): bump dependabot/fetch-metadata from 2 to 3 (#129) Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2 to 3. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v2...v3) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-version: '3' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>1 个月前
pre-commit: Update hooks Signed-off-by: Andrej Orsula <orsula.andrej@gmail.com> 1 年前
Apply the custom start joint state to the request (#127) * Apply the custom start joint state to the request * pre-commit: Apply suggestions Signed-off-by: Andrej Orsula <orsula.andrej@gmail.com> --------- Signed-off-by: Andrej Orsula <orsula.andrej@gmail.com> Co-authored-by: Mark Finean <33692727+mfinean@users.noreply.github.com>3 个月前
Initial commit Signed-off-by: Andrej Orsula <orsula.andrej@gmail.com> 4 年前
pre-commit: Update hooks Signed-off-by: Andrej Orsula <orsula.andrej@gmail.com> 1 年前
Allow clearing all collision objects (#69) * Enable clearing all collision objects * Added example2 年前
Add LICENSE Signed-off-by: Andrej Orsula <orsula.andrej@gmail.com> 3 年前
docs: Update naming from Ignition to Gazebo (#125) Signed-off-by: Andrej Orsula <orsula.andrej@gmail.com>3 个月前
update the release version in the package.xml 7 个月前

pymoveit2

Basic Python interface for MoveIt 2 built on top of ROS 2 actions and services.

Note: The official Python library for MoveIt 2 moveit_py is now available. Check the announcement here!

Animation of ex_joint_goal.py Animation of ex_pose_goal.py Animation of ex_gripper.py Animation of ex_servo.py
Joint Goal
Pose Goal
Gripper Action
MoveIt 2 Servo

Instructions

Dependencies

These are the primary dependencies required to use this project.

All additional dependencies are installed via rosdep during the building process below.

Building

Clone this repository, install dependencies and build with colcon.

# Clone this repository into your favourite ROS 2 workspace
git clone https://github.com/AndrejOrsula/pymoveit2.git
# Install dependencies
rosdep install -y -r -i --rosdistro ${ROS_DISTRO} --from-paths .
# Build
colcon build --merge-install --symlink-install --cmake-args "-DCMAKE_BUILD_TYPE=Release"

Sourcing

Before utilising this package, remember to source the ROS 2 workspace.

source install/local_setup.bash

This enables importing of pymoveit2 module from external workspaces.

Examples

To demonstrate pymoveit2 usage, examples directory contains scripts that demonstrate the basic functionality. Additional examples can be found under gz_moveit2_examples repository.

Prior to running the examples, configure an environment for control of a robot with MoveIt 2. For instance, one of the following launch scripts from panda_gz_moveit2 repository can be used.

# RViz (fake) ROS 2 control
ros2 launch panda_moveit_config ex_fake_control.launch.py
# Gazebo (simulated) ROS 2 control
ros2 launch panda_moveit_config ex_gz_control.launch.py

After that, the individual scripts can be run.

# Move to joint configuration
ros2 run pymoveit2 ex_joint_goal.py --ros-args -p joint_positions:="[1.57, -1.57, 0.0, -1.57, 0.0, 1.57, 0.7854]"
# Move to Cartesian pose (motion in either joint or Cartesian space)
ros2 run pymoveit2 ex_pose_goal.py --ros-args -p position:="[0.25, 0.0, 1.0]" -p quat_xyzw:="[0.0, 0.0, 0.0, 1.0]" -p cartesian:=False
# Repeatadly toggle the gripper (or use "open"/"close" actions)
ros2 run pymoveit2 ex_gripper.py --ros-args -p action:="toggle"
# Example of using MoveIt 2 Servo to move the end-effector in a circular motion
ros2 run pymoveit2 ex_servo.py
# Example of adding a collision object with primitive geometry to the planning scene of MoveIt 2
ros2 run pymoveit2 ex_collision_primitive.py --ros-args -p shape:="sphere" -p position:="[0.5, 0.0, 0.5]" -p dimensions:="[0.04]"
# Example of adding a collision object with mesh geometry to the planning scene of MoveIt 2
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]"

Directory Structure

The following directory structure is utilised for this package.

.
├── examples/              # [dir] Examples demonstrating the use of `pymoveit2`
├── pymoveit2/             # [dir] ROS 2 launch scripts
    ├── robots/            # [dir] Presets for robots (data that can be extracted from URDF/SRDF)
    ├── gripper_command.py # Interface for Gripper that is controlled by GripperCommand
    ├── moveit2_gripper.py # Interface for MoveIt 2 Gripper that is controlled by JointTrajectoryController
    ├── moveit2_servo.py   # Interface for MoveIt 2 Servo that enables real-time control in Cartesian Space
    └── moveit2.py         # Interface for MoveIt 2 that enables planning and execution of trajectories
├── CMakeLists.txt         # Colcon-enabled CMake recipe
└── package.xml            # ROS 2 package metadata

项目介绍

用户可借助此项目便捷地在 Python 中控制 MoveIt 2,实现机器人运动规划与控制。它基于 ROS 2 动作和服务构建,提供关节目标、笛卡尔位姿运动、 gripper 控制、Servo 实时控制及碰撞对象管理等核心功能。【此简介由AI生成】

定制我的领域

下载使用量

0

项目总下载次数(含Clone、Pull、 zip 包及 release 下载),每日凌晨更新

语言类型

Python99.26%
CMake0.54%
Shell0.2%