robot_fingers.robot module

Classes and functions to easily set up robot demo scripts.

class robot_fingers.robot.Robot(robot_module, create_backend_function, config, logger_buffer_size=0)[source]

Bases: object

classmethod create_by_name(robot_name: str, logger_buffer_size: int = 0)[source]

Create a Robot instance for the specified robot.

Parameters:

robot_name – Name of the robots. See

:param Robot.get_supported_robots() for a list of supported robots.: :param logger_buffer_size: See Robot.__init__().

Returns:

A Robot instance for the specified robot.

Return type:

Robot

frontend

The frontend is used to send actions and get observations.

static get_supported_robots()[source]

Get list of robots supported by create_by_name.

Returns:

List of supported robot names.

initialize()[source]

Initialize the robot.

logger

The logger can be used to log robot data to a file

robot_fingers.robot.demo_print_position(robot)[source]

Send zero-torque commands to the robot and print the joint positions.

Parameters:

robot (Robot) – The robot environment.

robot_fingers.robot.get_config_dir() PurePath[source]

Get path to the configuration directory.

robot_fingers.robot.robot_configs = {'fingeredu': (<module 'robot_interfaces.py_finger_types' from '/opt/blmc_ei/install/robot_interfaces/local/lib/python3.10/dist-packages/robot_interfaces/py_finger_types.cpython-310-x86_64-linux-gnu.so'>, <built-in method create_real_finger_backend of PyCapsule object>, 'fingeredu.yml'), 'fingerone': (<module 'robot_interfaces.py_finger_types' from '/opt/blmc_ei/install/robot_interfaces/local/lib/python3.10/dist-packages/robot_interfaces/py_finger_types.cpython-310-x86_64-linux-gnu.so'>, <built-in method create_real_finger_backend of PyCapsule object>, 'finger.yml'), 'fingerpro': (<module 'robot_interfaces.py_finger_types' from '/opt/blmc_ei/install/robot_interfaces/local/lib/python3.10/dist-packages/robot_interfaces/py_finger_types.cpython-310-x86_64-linux-gnu.so'>, <built-in method create_real_finger_backend of PyCapsule object>, 'fingerpro.yml'), 'onejoint': (<module 'robot_interfaces.py_one_joint_types' from '/opt/blmc_ei/install/robot_interfaces/local/lib/python3.10/dist-packages/robot_interfaces/py_one_joint_types.cpython-310-x86_64-linux-gnu.so'>, <built-in method create_one_joint_backend of PyCapsule object>, 'onejoint.yml'), 'solo8': (<module 'robot_interfaces.py_solo_eight_types' from '/opt/blmc_ei/install/robot_interfaces/local/lib/python3.10/dist-packages/robot_interfaces/py_solo_eight_types.cpython-310-x86_64-linux-gnu.so'>, <built-in method create_solo_eight_backend of PyCapsule object>, 'soloeight.yml'), 'trifingeredu': (<module 'robot_interfaces.py_trifinger_types' from '/opt/blmc_ei/install/robot_interfaces/local/lib/python3.10/dist-packages/robot_interfaces/py_trifinger_types.cpython-310-x86_64-linux-gnu.so'>, <built-in method create_trifinger_backend of PyCapsule object>, 'trifingeredu.yml'), 'trifingerone': (<module 'robot_interfaces.py_trifinger_types' from '/opt/blmc_ei/install/robot_interfaces/local/lib/python3.10/dist-packages/robot_interfaces/py_trifinger_types.cpython-310-x86_64-linux-gnu.so'>, <built-in method create_trifinger_backend of PyCapsule object>, 'trifinger.yml'), 'trifingerpro': (<module 'robot_interfaces.py_trifinger_types' from '/opt/blmc_ei/install/robot_interfaces/local/lib/python3.10/dist-packages/robot_interfaces/py_trifinger_types.cpython-310-x86_64-linux-gnu.so'>, <built-in method create_trifinger_backend of PyCapsule object>, '/etc/trifingerpro/trifingerpro.yml'), 'trifingerpro_calib': (<module 'robot_interfaces.py_trifinger_types' from '/opt/blmc_ei/install/robot_interfaces/local/lib/python3.10/dist-packages/robot_interfaces/py_trifinger_types.cpython-310-x86_64-linux-gnu.so'>, <built-in method create_trifinger_backend of PyCapsule object>, 'trifingerpro_for_calib.yml'), 'trifingerpro_default': (<module 'robot_interfaces.py_trifinger_types' from '/opt/blmc_ei/install/robot_interfaces/local/lib/python3.10/dist-packages/robot_interfaces/py_trifinger_types.cpython-310-x86_64-linux-gnu.so'>, <built-in method create_trifinger_backend of PyCapsule object>, 'trifingerpro.yml'), 'twojoint': (<module 'robot_interfaces.py_two_joint_types' from '/opt/blmc_ei/install/robot_interfaces/local/lib/python3.10/dist-packages/robot_interfaces/py_two_joint_types.cpython-310-x86_64-linux-gnu.so'>, <built-in method create_two_joint_backend of PyCapsule object>, 'twojoint.yml')}

Default configurations for various robots. Maps robot names to a tuple of

  1. the module defining the corresponding types for this robot,

  2. a function to create the backend, and

  3. the name of the configuration file

This corresponds to the arguments of the Robot class.