• Stars
    star
    134
  • Rank 270,967 (Top 6 %)
  • Language
    Python
  • License
    BSD 2-Clause "Sim...
  • Created over 10 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Pure Python Bindings to ROS MoveIt!

moveit_python

This is a set of pure-python bindings to the ROS interface of MoveIt! based on the earlier moveit_utils package that was developed as part of the chess_player package.

Overview

There are three interfaces currently:

  • MoveGroupInterface -- used to move the arm using the move_group action.
  • PlanningSceneInterface -- used to add/remove collision and attached objects. Can also set the colors of objects.
  • PickPlaceInterface -- used to interface to the pick and place actions.

MoveGroupInterface

The MoveGroupInterface is quite easy to use:

import rospy
from moveit_python import *

rospy.init_node("moveit_py")
g = MoveGroupInterface("planning_group_name", "base_link")

Obviously, you might need different values for base_link, and your planning group is probably not called "planning_group_name".

PlanningSceneInterface

The PlanningSceneInterface allows you to easily insert and remove objects from the MoveIt! planning scene. Starting with version 0.3.0, this module will try to use the newer service-based approach to apply planning scene updates, as this is much more robust than publishing messages over topics asynchronously.

import rospy
from moveit_python import *

rospy.init_node("moveit_py")
# create a planning scene interface, provide name of root link
p = PlanningSceneInterface("base_link")

# add a cube of 0.1m size, at [1, 0, 0.5] in the base_link frame
p.addCube("my_cube", 0.1, 1, 0, 0.5)

# do something

# remove the cube
p.removeCollisionObject("my_cube")

If for some reason you would prefer to not use the service, simply set "use_service" to false in the various add/remove calls. Calling waitForSync will republish messages as needed to synchronize the planning scene between your script and MoveIt.

p.addCube("my_cube", 0.1, 1, 0, 0.5, use_service=False)
p.addCube("my_other_cube", 0.1, 2, 0, 0.5, use_service=False)
p.waitForSync()

PickPlaceInterface

import rospy
from moveit_python import *
from moveit_msgs.msg import Grasp, PlaceLocation

rospy.init_node("moveit_py")
# provide arm group and gripper group names
# also takes a third parameter "plan_only" which defaults to False
p = PickPlaceInterface("arm", "gripper")

g = Grasp()
# fill in g
# setup object named object_name using PlanningSceneInterface
p.pickup("object_name", [g, ], support_name = "supporting_surface")

l = PlaceLocation()
# fill in l
p.place("object_name" [l, ], goal_is_eef = True, support_name = "supporting_surface")

Migration from moveit_utils

  • GraspingInterface renamed to PickPlaceInterface
    • The pick/place functions now return the entire action result, in moveit_utils they returned only the error_code. To access the error code as it used to be returned, you would use result.error_code.val
  • ObjectManager renamed to PlanningSceneInterface
    • remove function is now removeCollisionObject and removeAttachedObject
  • ArmInterface renamed to MoveGroupInterface

More Repositories

1

ros2_cookbook

Code snippets for ROS2
Shell
875
star
2

robot_calibration

Generic calibration for robots
C++
368
star
3

stm32

stuff/garbage for the STM32
C
93
star
4

graceful_controller

A better local controller for ROS Navigation.
C++
69
star
5

pocketsphinx

ROS bindings to pocketsphinx, using gstreamer
Python
58
star
6

buildbot-ros

A buildbot configuration for building ROS debians, docs, and tests.
Python
50
star
7

simple_grasping

ROS components for grasping
C++
44
star
8

neato_robot

Drivers and ROS bindings for the Neato XV-11 robot.
Python
44
star
9

code_coverage

ROS package to run coverage testing
CMake
37
star
10

ubr_reloaded

Updated packages for the UBR-1
C++
22
star
11

ndt_2d

2D NDT Mapping and Localization
C++
21
star
12

robomagellan

Stuff/Garbage for RoboMagellan
Python
12
star
13

chessbox

It's like a sandbox -- for robot chess
Python
8
star
14

eagle

Eagle 7.1 Libraries and Board Designs
7
star
15

libam7xxx

fork http://git.ao2.it/libam7xxx.git, intended for packaging for Ubuntu 12.04
C
6
star
16

maxwell

Maxwell is a custom mobile manipulator.
C++
6
star
17

smaldog

Code for Ethbridge-Based SMALdog
C++
5
star
18

egraphs

experience graphs for SBPL
C++
4
star
19

sandbox

Sandbox for ROS packages
C++
4
star
20

ndt_2d_karto

C++
4
star
21

stuff

notes and stuff and garbage and stuff
C++
2
star
22

ar_kinect

C++
2
star
23

crater

Source to Crater, winner of the 2009 TCFFHRC
C
2
star
24

firebot

ROS2-based Robogames Fire Fighter
Python
1
star
25

grasping_msgs

Messages for describing objects and how to grasp them
CMake
1
star
26

people_experimental

C++
1
star
27

rosdistro-buildbot-example

Simple example rosdistro for buildbot-ros
1
star
28

graceful_controller-gbp

Release repository for graceful_controller
1
star
29

etherbotix

ROS drivers for Etherbotix
C++
1
star
30

energy_efficient_mm

Python
1
star
31

grasping_msgs-ros2-gbp

GBP for ROS2 release of grasping_msgs package
1
star