Skip to content

Latest commit

 

History

History
58 lines (41 loc) · 1.3 KB

select_robot.md

File metadata and controls

58 lines (41 loc) · 1.3 KB
Robots

Select a robot

Robots are handled in TDW very similarly to objects. The robots are asset bundles stored on a remote S3 server. There is a corresponding RobotLibrarian collection of metadata records.

This will print the name of each robot that is included by default in TDW:

from tdw.librarian import RobotLibrarian

lib = RobotLibrarian()
for record in lib.records:
    print(record.name)

Output (this will change as more robots are added to TDW):

baxter
fetch
niryo_one
sawyer
shadowhand
ur10
ur3
ur5

To select a robot, simply set the name field in the Robot constructor to a valid robot:

from tdw.controller import Controller
from tdw.tdw_utils import TDWUtils
from tdw.add_ons.robot import Robot

c = Controller()
robot_id = c.get_unique_id()
robot = Robot(name="baxter",
              robot_id=robot_id)
c.add_ons.append(robot)
c.communicate(TDWUtils.create_empty_room(12, 12))
c.communicate({"$type": "terminate"})

Next: Add your own robots to TDW

Return to the README


Python API: