项目作者: AndrejOrsula

项目描述 :
Example of using MoveIt2 inside Ignition Gazebo simulation environment
高级语言: Python
项目地址: git://github.com/AndrejOrsula/ign_moveit2.git
创建时间: 2020-11-01T23:18:13Z
项目社区:https://github.com/AndrejOrsula/ign_moveit2

开源协议:

下载


ign_moveit2_examples

C++ and Python examples of using MoveIt 2 for planning motions that are executed inside Ignition Gazebo simulation environment. These examples make use of ros2_control via gz_ros2_control.

The interaction among different ROS 2, MoveIt 2 and Gazebo components is further documented in docs/README.md, alongside suggestions for implementing a similar setup on your custom robot.

For legacy approach using JointTrajectoryController Ignition plugin, please see legacy_jtc_ign_plugin branch.

Animation of ex_follow_target Animation of ex_throw_object
Follow Target Throw Object

At the time of writing these examples, there were no official Python bindings for MoveIt 2. Therefore, pymoveit2 module is employed as the MoveIt 2 interface in all Python examples.

Instructions

Dependencies

These are the primary dependencies required to use this project.

All additional dependencies are either pulled via vcstool (ign_moveit2_examples.repos) or installed via rosdep during the building process below.

Building

Clone this repository, import dependencies, install dependencies and build with colcon.

  1. # Clone this repository into your favourite ROS 2 workspace
  2. git clone https://github.com/AndrejOrsula/ign_moveit2_examples.git
  3. # Import dependencies
  4. vcs import < ign_moveit2_examples/ign_moveit2_examples.repos
  5. # Install dependencies
  6. IGNITION_VERSION=fortress rosdep install -y -r -i --rosdistro ${ROS_DISTRO} --from-paths .
  7. # Build
  8. colcon build --merge-install --symlink-install --cmake-args "-DCMAKE_BUILD_TYPE=Release"

Sourcing

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

  1. source install/local_setup.bash

This enables:

  • Execution of binaries, scripts and examples via ros2 run ign_moveit2_examples <executable>
  • Launching of setup scripts via ros2 launch ign_moveit2_examples <launch_script>
  • Discoverability of shared resources

Examples

In order to run any of the included examples, just launch the corresponding script.

Follow Target

  1. # C++
  2. ros2 launch ign_moveit2_examples ex_cpp_follow_target.launch.py
  3. # Python
  4. ros2 launch ign_moveit2_examples ex_py_follow_target.launch.py

Throw Object

  1. # Python
  2. ros2 launch ign_moveit2_examples ex_py_throw_object.launch.py

Directory Structure

  1. .
  2. ├── examples/ # [dir] Nodes used for examples
  3. ├── cpp/ # [dir] C++ nodes
  4. └── py/ # [dir] Python nodes
  5. ├── launch/ # [dir] Launch scripts for examples
  6. ├── robots/ # [dir] Launch scripts that spawn robots into environment
  7. ├── worlds/ # [dir] Launch scripts that setup the environment
  8. ├── default.launch.py # Default launch script used by all edxamples
  9. ├── ex_cpp_*.launch.py # C++ launch scripts
  10. └── ex_py_*.launch.py # Python launch scripts
  11. ├── rviz/ign_moveit2_examples.rviz # RViz2 config for motion planning with MoveIt 2
  12. ├── worlds/ # [dir] World descriptors
  13. ├── CMakeLists.txt # Colcon-enabled CMake recipe
  14. └── package.xml # ROS 2 package metadata