NAME
-
pyrobot.robot - The main Pyrobot robot class and associated functions.
FILE
-
pyrobot/robot/__init__.py
DESCRIPTION
-
This file contains the class that represents a computer controlled physical agent (robot). A robot is a collection of interfaces to senses and controllers.
(c) 2005, PyrobRobotics.org. Licenced under the GNU GPL.
PACKAGE CONTENTS
-
aibo
-
device
-
driver (package)
-
khepera
-
player
-
robocup
-
symbolic
CLASSES
-
Robot
-
.x
-
.y
-
.thr
-
.stall
-
.brain = None
-
.timestamp = time.time()
-
.builtinDevices = [] # list of built-in devices
-
.supportedFeatures = [] # meta devices
-
.devices = []
-
'ROBOTS' - unit is given in terms of the robot's diameter
-
'METERS' - meters
-
'CM' - centimeters
-
'MM' - millimeters
-
'SCALED' - scaled [-1,1]
-
'RAW' - right from the sensor
class Robot
-
The object with which to interact with motors and sensors.
The base robot class. This class is the basis of all robots.
Primary attributes:
__init__(self, **kwargs)
-
The main robot object. Access the last loaded devices here, plus all of the robot-specific fields (such as x, y, and th). Use robot.move(translate, rotate) to move the robot. If you need to initialize things, put them in setup().
destroy(self)
-
This method removes all of the devices. Called by the system.
displayDevice(self, device, indent=0, count=0)
getDevice(self, item)
getDevices(self)
getSupportedDevices(self)
hasA(self, dtype)
-
Returns 1 if robot has a dtype, else 0.
motors(self, leftValue, rightValue)
-
Move function that takes desired motor values and converts to trans and rotate.
printView(self, thing=None, toplevel='robot', indent=0)
removeDevice(self, item, number=None)
requires(self, feature)
rotate(self, val)
setRangeSensor(self, name, index=0)
-
Change the default range sensor. By default the range sensor is set to be sonar, if a robot has it, or laser, if it has it, or IR if a robot has it. Otherwise, it is not set.
Takes the name of a range sensor, and an optional index identifier. An index of 0 is used if not given.
Examples:
>>> robot.setRangeSensor("sonar")
Ok
>>> robot.setRangeSensor("laser", 1)
Ok
returns "Ok" on success, otherwise raises an exception.
setup(self, **kwargs)
-
Is called from __init__ so users don't have to call parent constructor and all the gory details.
startDeviceBuiltin(self, item)
-
This method should be overloaded
-
Load devices: dict, list, builtin name, or filename
stopDevice(self, item)
supports(self, feature)
translate(self, val)
update(self)
updateDevices(self)
FUNCTIONS
-
commas(lyst)
-
Used to turn an enumeration into a comma-separated string of 'items'. Example: >>> commas([1, 2, 3, 4]) '1', '2', '3', '4'
DATA
-
COSDEG90RADS = 6.123031769111886e-20
-
DEG90RADS = 1.5707963267948966
-
False = 0
-
PIOVER180 = 0.017453292519943295
-
SINDEG90RADS = 0.001
-
True = 1
-
__author__ = 'Stephen McCaul, Douglas Blank'
-
__version__ = '$Revision: 1.116 $'
-
generators = _Feature((2, 2, 0, 'alpha', 1), (2, 3, 0, 'final', 0), 40...
VERSION
-
1.116
AUTHOR
-
Stephen McCaul, Douglas Blank
