welcome: please sign in
location: wiki / pyrobots

pyRobots

Installation

> git clone git://trac.laas.fr/robots/pyrobots
> cd pyrobots
> python setup.py install --prefix=<your prefix>

First example

Let consider we are on the PR2, after the 'standard' initialization (TODO: link to the doc).

Start Python in interactive mode:

> python

Then:

   1 >>> import robots
   2 >>> pr2 = robots.PR2()
   3 >>> pr2.goto([1.0, -2.0, 0.0])  # move to (1.0,-2.0) using the ROS navigation stack
   4 >>> pr2.close()

Writing scripts

   1 import robots
   2 
   3 # the Robot class provides a context manager. Useful to properly close
   4 # everything at end or when an exception is thrown.
   5 with robots.PR2() as pr2:
   6     pr2.lookat(pr2.poses["HERAKLES_HUMAN1"])
   7     # ...

With knowledge management...

   1 import robots
   2 import pyoro
   3 
   4 with robots.PR2(knowledge = pyoro.Oro()) as pr2:
   5 
   6     if "HERAKLES_HUMAN1 isVisible true" in pr2.knowledge:
   7         pr2.lookat(pr2.poses["HERAKLES_HUMAN1"])
   8     # ...

Actions

Numerous actions are currently available:

Poses management

Several positions source can be used transparently. When you have to specify a position, you can give:

When required, conversions are done automatically.

Except if you give a ROS frame (where you can explicitly specify the reference frame), all positions are understood in the global world reference.

Planning functions

Computation of hand-over waypoints

Example:

   1 >>> import robots
   2 >>> pr2 = robots.PR2()
   3 >>> pr2.planning.gethandoverwaypoints("HERAKLES_HUMAN1")

OpenrobotsWiki: wiki/pyrobots (last edited 2014-02-14 16:06:06 by mallet)