Code Monkey home page Code Monkey logo

pymoveit2's Introduction

pymoveit2

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

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 ign_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_ign_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_ign_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 to the planning scene of MoveIt 2
ros2 run pymoveit2 ex_collision_object.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

pymoveit2's People

Contributors

andrejorsula avatar pre-commit-ci[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.