graspplanning Module
Combine the power of grasp sets and randomized planners to get any robot arm picking up objects from a table and putting them in a dish rack.
Running the Example:
openrave.py --example graspplanning
Description
The example uses the powerful TaskManipulation problem interface, which takes advantage of many OpenRAVE features. It performs:
- Pick grasps and validate them with the grasper planner
- Move to the appropriate grasp preshape while avoiding obstacles
- Use an RRT and Jacobian-based gradient descent methods to safely move close to an obstacle
- Use CloseFingers to grasp the object while checking for collisions with other unwanted objects
- Use body grabbing to grasp the object and move it to its destination
- Lower the object until collision and then release and move away from it.
The scene is randomized every run in order to show the powerful of the planners.
Destinations
By default, the grasp planner will choose a grasp that is also valid at a destination point. If
running on custom environments, sometimes it is interesting to see if the robot can just grasp the
object, without moving it to the destination. To test planning without destinations use:
openrave.py --example graspplanning --nodestinations
5D IK Grasp Planning
It is possible to perform grasp planning with 5D IK.
Neuronics Katana
First create the grasp set with:
openrave.py --database grasping --robot=robots/neuronics-katana.zae --manipname=arm --target=data/box_frootloops.kinbody.xml --manipulatordirection="0 1 0"
Then execute:
openrave.py --example graspplanning --scene=data/katanatable.env.xml
Kuka Youbot
Grasp set generation:
openrave.py --database grasping --robot=robots/kuka-youbot.zae --manipulatordirection="0 1 0" --target=thinbox.kinbody.xml
Then execute:
openrave.py --example graspplanning --scene=data/youbot1.env.xml
Command-line
Usage: openrave.py [options]
Autonomous grasp and manipulation planning example.
Options:
-h, --help show this help message and exit
--scene=SCENE Scene file to load (default=data/lab1.env.xml)
--nodestinations If set, will plan without destinations.
--norandomize If set, will not randomize the bodies and robot
position in the scene.
--planner=PLANNER the planner to use
OpenRAVE Environment Options:
--loadplugin=_LOADPLUGINS
List all plugins and the interfaces they provide.
--collision=_COLLISION
Default collision checker to use
--physics=_PHYSICS physics engine to use (default=none)
--viewer=_VIEWER viewer to use (default=qtcoin)
--server=_SERVER server to use (default=None).
--serverport=_SERVERPORT
port to load server on (default=4765).
--module=_MODULES module to load, can specify multiple modules. Two
arguments are required: "name" "args".
-l _LEVEL, --level=_LEVEL, --log_level=_LEVEL
Debug level, one of
(fatal,error,warn,info,debug,verbose,verifyplans)
--testmode if set, will run the program in a finite amount of
time and spend computation time validating results.
Used for testing
Main Python Code
def main(env,options):
"Main example code."
env.Load(options.scene)
robot = env.GetRobots()[0]
env.UpdatePublishedBodies()
time.sleep(0.1) # give time for environment to update
self = GraspPlanning(robot,randomize=options.randomize,nodestinations=options.nodestinations,plannername=options.planner)
self.performGraspPlanning(withreplacement=not options.testmode)
Class Definitions
-
class openravepy.examples.graspplanning.GraspPlanning(robot, randomize=True, dests=None, nodestinations=False, switchpatterns=None, plannername=None, minimumgoalpaths=1)[source]
-
getGraspables(dests=None)[source]
-
graspAndPlaceObject(gmodel, dests, waitforkey=False, movehanddown=True, **kwargs)[source]
grasps an object and places it in one of the destinations. If no destination is specified, will just grasp it
-
performGraspPlanning(withreplacement=True, **kwargs)[source]
-
randomizeObjects()[source]
-
static setRandomDestinations(targets, table, transdelta=0.10000000000000001, zoffset=0.01, Trolls=None, randomize=False, preserverotation=True)[source]
-
viewDestinations(gmodel, Tdests, delay=0.5)[source]
-
waitrobot(robot=None)[source]
busy wait for robot completion
-
openravepy.examples.graspplanning.main(env, options)[source]
Main example code.
-
openravepy.examples.graspplanning.run(*args, **kwargs)[source]
Command-line execution of the example.
Parameters: | args – arguments for script to parse, if not specified will use sys.argv |
-
openravepy.examples.graspplanning.test()[source]