Class PlayerRobot
source code
object --+
|
PlayerRobot
Player Robot interface.
A PlayerRobot instance encapsulates an interface to a Player
robot. It creates and manages a playerc.client object and a set of
device proxies wrapped in PlayerDevice objects. In addition, it
maintains a run-loop in a separate thread that calls the client's
.read() method at regular intervals. The devices are published
through standard interfaces on the PlayerRobot instance, and their
methods and properties are synchronized with the run thread
through a mutex.
Example:
# set up a robot object with position, laser, and camera objects
robot = PlayerRobot(host='myrobot.mydomain.edu',port=6665,
devices = [('position2d',0),
('laser',0),
('camera',1)])
# start the run thread, devices will be subscribed
# automatically.
robot.start()
# start the robot turning at 30 deg/sec
robot.position2d[0].set_cmd_vel(0, 0, 30*pi/180)
# wait for a while
time.sleep(5.0)
# all stop
robot.position2d[0].set_cmd_vel(0,0,0)
# shut down the robot's thread, unsubscribing all devices and
# disconnecting the client
robot.stop()
|
|
__init__(self,
host='localhost',
port=6665,
speed=20,
devices=[])
x.__init__(...) initializes x; see x.__class__.__doc__ for signature |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
run_queues(self,
run_state)
When using queues for communication with devices, this method
toggles queue processing. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Inherited from object:
__delattr__,
__getattribute__,
__hash__,
__new__,
__reduce__,
__reduce_ex__,
__repr__,
__setattr__,
__str__
|
|
Inherited from object:
__class__
|
__init__(self,
host='localhost',
port=6665,
speed=20,
devices=[])
(Constructor)
| source code
|
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
- Overrides:
object.__init__
- (inherited documentation)
|
When using queues for communication with devices, this method
toggles queue processing. It is often useful to turn off
queue processing, e.g. when a client does not plan on using queued
data for a while.
|