| Trees | Indices | Help |
|
|---|
|
|
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()
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from |
|||
|
|||
|
Inherited from |
|||
|
|||
|
|
| Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Thu Aug 5 14:59:38 2010 | http://epydoc.sourceforge.net |