Package topo :: Package misc :: Module playerrobot
[hide private]
[frames] | no frames]

Module playerrobot

source code

High-level interface to the Player client libraries.

The Player client libraries allow Python code to communicate with hardware devices such as robots, cameras, and range sensors.

This is a temporary home for this file until it finds a permanent home (maybe in the PlayerStage project or in PLASTK?)

$Id: playerrobot.py 8356 2008-04-11 19:51:05Z jprovost $


Version: $Revision: 8356 $

Classes [hide private]
  PlayerException
  PlayerObject
A generic threadsafe wrapper for client and proxy objects from the playerc library.
  PlayerClient
Player object wrapper for playerc.client objects.
  PlayerDevice
Generic Player device object.
  PTZDevice
Player Pan/Tilt/Zoom (PTZ) device.
  CameraDevice
A Player camera device.
  PlayerRobot
Player Robot interface.
Functions [hide private]
 
use_processing()
Configure the module to use the processing library for asynchronous process support.
source code
 
use_threading()
Configure the module to use the threading library for asynchronous process support.
source code
 
player_fn(error_op=ne, error_val=0)
Player function decorator.
source code
 
synchronized(lock)
Simple synchronization decorator.
source code
 
synched_method(f)
Synchronized method decorator.
source code
Variables [hide private]
  device_table = {'ptz': PTZDevice, 'camera': CameraDevice,}
Function Details [hide private]

use_processing()

source code 
Configure the module to use the processing library for asynchronous process support. Use of the processing library requires the use of queues for communication with robot devices.

use_threading()

source code 
Configure the module to use the threading library for asynchronous process support. (the default)

player_fn(error_op=ne, error_val=0)

source code 

Player function decorator. Adds error checking.

Takes an operator and a value, and compares the result of the function call with the value using the operator. If the result is true, a PlayerException is raised. The default error condition is error_op = ne, error_value = 0, which raises an exception if fn(*args) != 0.

synchronized(lock)

source code 

Simple synchronization decorator.

Takes an existing lock and synchronizes a function or method on that lock. Code taken from the Python Wiki PythonDecoratorLibrary:

http://wiki.python.org/moin/PythonDecoratorLibrary

synched_method(f)

source code 

Synchronized method decorator.

Like synchronized() decorator, except synched_method assumes that the first argument of the function is an instance containing a Lock object, and this lock is used for synchronization.