robot_fingers package

Submodules

robot_fingers.curses module

Tools for creating simple curses interfaces.

class robot_fingers.curses.SimpleCursesGUI(win, title, status_line=None)[source]

Bases: object

Wrapper around curses to manage simple generic GUIs.

A very simple curses interface with a title at the top, a static status line at the bottom and some arbitrary text in between that can be updated.

display_error(message)[source]

Display error message and wait until user presses a key.

Parameters

message – The error message that is displayed.

get_pressed_key()[source]

Get key pressed by the user.

update_screen(lines)[source]

Update the screen with the given lines of text.

Parameters

lines (list) – List of strings. They are drawn in separate lines.

robot_fingers.py_one_joint module

class robot_fingers.py_one_joint.OneJointConfig

Bases: pybind11_object

class CalibrationParameters

Bases: pybind11_object

property endstop_search_torques_Nm

Torque that is used to find the end stop.

property move_steps

Number of time steps for reaching the initial position.

class PositionControlGains

Bases: pybind11_object

property kd
property kp
class TrajectoryStep

Bases: pybind11_object

property move_steps

Number of time steps for reaching the target position.

property target_position_rad

Target position to which the joints should move.

property calibration

Parameters related to calibration.

property can_ports

List of CAN port names used by the robot.

property hard_position_limits_lower

Hard lower limits for joint positions.

property hard_position_limits_upper

Hard upper limits for joint positions.

property has_endstop

Whether the joints have physical end stops or not.

property home_offset_rad

Offset between home and zero position.

property initial_position_rad

Initial position to which the robot moves during initialisation.

is_within_hard_position_limits(self: robot_fingers.py_one_joint.OneJointConfig, position: numpy.ndarray[float64[1, 1]]) bool

is_within_hard_position_limits(position: list) -> bool

Check if the given position is within the hard limits.

Parameters

position – Joint positions.

Returns

True if hard_position_limits_lower <= position <= hard_position_limits_upper.

static load_config(config_file_name: str) robot_fingers.py_one_joint.OneJointConfig

load_config(config_file_name: str) -> Config

Load driver configuration from a YAML file.

Parameters

config_file_name – Path to the config file.

Returns

The configuration loaded from the given file.

property max_current_A

Maximum current that can be sent to the motor [A].

property move_to_position_tolerance_rad

Tolerance for reaching the target with NJointBlmcRobotDriver::move_to_position()

property position_control_gains

Default control gains for the position controller.

print(self: robot_fingers.py_one_joint.OneJointConfig) None

print()

Print the configuration.

property safety_kd

D-gain to dampen velocity. Set to zero to disable damping.

property shutdown_trajectory

Trajectory which is executed during shutdown.

property soft_position_limits_lower

Soft lower limits for joint positions.

property soft_position_limits_upper

Soft upper limits for joint positions.

robot_fingers.py_one_joint.create_one_joint_backend(*args, **kwargs)

Overloaded function.

  1. create_one_joint_backend(robot_data: robot_interfaces.py_one_joint_types.BaseData, config: robot_fingers::NJointBlmcRobotDriver<robot_interfaces::NJointObservation<1ul>, 1ul, 1ul>::Config, first_action_timeout: float = inf, max_number_of_actions: int = 0) -> robot_interfaces.py_one_joint_types.Backend

  2. create_one_joint_backend(robot_data: robot_interfaces.py_one_joint_types.BaseData, config_file: str, first_action_timeout: float = inf, max_number_of_actions: int = 0) -> robot_interfaces.py_one_joint_types.Backend

robot_fingers.py_real_finger module

class robot_fingers.py_real_finger.FingerConfig

Bases: pybind11_object

class CalibrationParameters

Bases: pybind11_object

property endstop_search_torques_Nm

Torque that is used to find the end stop.

property move_steps

Number of time steps for reaching the initial position.

class PositionControlGains

Bases: pybind11_object

property kd
property kp
class TrajectoryStep

Bases: pybind11_object

property move_steps

Number of time steps for reaching the target position.

property target_position_rad

Target position to which the joints should move.

property calibration

Parameters related to calibration.

property can_ports

List of CAN port names used by the robot.

property hard_position_limits_lower

Hard lower limits for joint positions.

property hard_position_limits_upper

Hard upper limits for joint positions.

property has_endstop

Whether the joints have physical end stops or not.

property home_offset_rad

Offset between home and zero position.

property initial_position_rad

Initial position to which the robot moves during initialisation.

is_within_hard_position_limits(self: robot_fingers.py_real_finger.FingerConfig, position: numpy.ndarray[float64[3, 1]]) bool

is_within_hard_position_limits(position: list) -> bool

Check if the given position is within the hard limits.

Parameters

position – Joint positions.

Returns

True if hard_position_limits_lower <= position <= hard_position_limits_upper.

static load_config(config_file_name: str) robot_fingers.py_real_finger.FingerConfig

load_config(config_file_name: str) -> Config

Load driver configuration from a YAML file.

Parameters

config_file_name – Path to the config file.

Returns

The configuration loaded from the given file.

property max_current_A

Maximum current that can be sent to the motor [A].

property move_to_position_tolerance_rad

Tolerance for reaching the target with NJointBlmcRobotDriver::move_to_position()

property position_control_gains

Default control gains for the position controller.

print(self: robot_fingers.py_real_finger.FingerConfig) None

print()

Print the configuration.

property safety_kd

D-gain to dampen velocity. Set to zero to disable damping.

property shutdown_trajectory

Trajectory which is executed during shutdown.

property soft_position_limits_lower

Soft lower limits for joint positions.

property soft_position_limits_upper

Soft upper limits for joint positions.

robot_fingers.py_real_finger.create_fake_finger_backend(arg0: robot_interfaces::RobotData<robot_interfaces::NJointAction<3ul>, robot_interfaces::NFingerObservation<1ul> >) robot_interfaces::RobotBackend<robot_interfaces::NJointAction<3ul>, robot_interfaces::NFingerObservation<1ul> >
robot_fingers.py_real_finger.create_real_finger_backend(*args, **kwargs)

Overloaded function.

  1. create_real_finger_backend(robot_data: robot_interfaces::RobotData<robot_interfaces::NJointAction<3ul>, robot_interfaces::NFingerObservation<1ul> >, config: robot_fingers::NJointBlmcRobotDriver<robot_interfaces::NFingerObservation<1ul>, 3ul, 2ul>::Config, first_action_timeout: float = inf, max_number_of_actions: int = 0) -> robot_interfaces::RobotBackend<robot_interfaces::NJointAction<3ul>, robot_interfaces::NFingerObservation<1ul> >

  2. create_real_finger_backend(robot_data: robot_interfaces::RobotData<robot_interfaces::NJointAction<3ul>, robot_interfaces::NFingerObservation<1ul> >, config_file: str, first_action_timeout: float = inf, max_number_of_actions: int = 0) -> robot_interfaces::RobotBackend<robot_interfaces::NJointAction<3ul>, robot_interfaces::NFingerObservation<1ul> >

robot_fingers.py_solo_eight module

class robot_fingers.py_solo_eight.SoloEightConfig

Bases: pybind11_object

class CalibrationParameters

Bases: pybind11_object

property endstop_search_torques_Nm

Torque that is used to find the end stop.

property move_steps

Number of time steps for reaching the initial position.

class PositionControlGains

Bases: pybind11_object

property kd
property kp
class TrajectoryStep

Bases: pybind11_object

property move_steps

Number of time steps for reaching the target position.

property target_position_rad

Target position to which the joints should move.

property calibration

Parameters related to calibration.

property can_ports

List of CAN port names used by the robot.

property hard_position_limits_lower

Hard lower limits for joint positions.

property hard_position_limits_upper

Hard upper limits for joint positions.

property has_endstop

Whether the joints have physical end stops or not.

property home_offset_rad

Offset between home and zero position.

property initial_position_rad

Initial position to which the robot moves during initialisation.

is_within_hard_position_limits(self: robot_fingers.py_solo_eight.SoloEightConfig, position: numpy.ndarray[float64[8, 1]]) bool

is_within_hard_position_limits(position: list) -> bool

Check if the given position is within the hard limits.

Parameters

position – Joint positions.

Returns

True if hard_position_limits_lower <= position <= hard_position_limits_upper.

static load_config(config_file_name: str) robot_fingers.py_solo_eight.SoloEightConfig

load_config(config_file_name: str) -> Config

Load driver configuration from a YAML file.

Parameters

config_file_name – Path to the config file.

Returns

The configuration loaded from the given file.

property max_current_A

Maximum current that can be sent to the motor [A].

property move_to_position_tolerance_rad

Tolerance for reaching the target with NJointBlmcRobotDriver::move_to_position()

property position_control_gains

Default control gains for the position controller.

print(self: robot_fingers.py_solo_eight.SoloEightConfig) None

print()

Print the configuration.

property safety_kd

D-gain to dampen velocity. Set to zero to disable damping.

property shutdown_trajectory

Trajectory which is executed during shutdown.

property soft_position_limits_lower

Soft lower limits for joint positions.

property soft_position_limits_upper

Soft upper limits for joint positions.

robot_fingers.py_solo_eight.create_solo_eight_backend(*args, **kwargs)

Overloaded function.

  1. create_solo_eight_backend(robot_data: robot_interfaces.py_solo_eight_types.BaseData, config: robot_fingers::NJointBlmcRobotDriver<robot_interfaces::NJointObservation<8ul>, 8ul, 4ul>::Config, first_action_timeout: float = inf, max_number_of_actions: int = 0) -> robot_interfaces.py_solo_eight_types.Backend

  2. create_solo_eight_backend(robot_data: robot_interfaces.py_solo_eight_types.BaseData, config_file: str, first_action_timeout: float = inf, max_number_of_actions: int = 0) -> robot_interfaces.py_solo_eight_types.Backend

robot_fingers.py_trifinger module

class robot_fingers.py_trifinger.TriFingerConfig

Bases: pybind11_object

class CalibrationParameters

Bases: pybind11_object

property endstop_search_torques_Nm

Torque that is used to find the end stop.

property move_steps

Number of time steps for reaching the initial position.

class PositionControlGains

Bases: pybind11_object

property kd
property kp
class TrajectoryStep

Bases: pybind11_object

property move_steps

Number of time steps for reaching the target position.

property target_position_rad

Target position to which the joints should move.

property calibration

Parameters related to calibration.

property can_ports

List of CAN port names used by the robot.

property hard_position_limits_lower

Hard lower limits for joint positions.

property hard_position_limits_upper

Hard upper limits for joint positions.

property has_endstop

Whether the joints have physical end stops or not.

property home_offset_rad

Offset between home and zero position.

property initial_position_rad

Initial position to which the robot moves during initialisation.

is_within_hard_position_limits(position: list) bool

Check if the given position is within the hard limits.

Parameters

position – Joint positions.

Returns

True if hard_position_limits_lower <= position <= hard_position_limits_upper.

static load_config(config_file_name: str) Config

Load driver configuration from a YAML file.

Parameters

config_file_name – Path to the config file.

Returns

The configuration loaded from the given file.

property max_current_A

Maximum current that can be sent to the motor [A].

property move_to_position_tolerance_rad

Tolerance for reaching the target with NJointBlmcRobotDriver::move_to_position()

property position_control_gains

Default control gains for the position controller.

print()

Print the configuration.

property safety_kd

D-gain to dampen velocity. Set to zero to disable damping.

property shutdown_trajectory

Trajectory which is executed during shutdown.

property soft_position_limits_lower

Soft lower limits for joint positions.

property soft_position_limits_upper

Soft upper limits for joint positions.

class robot_fingers.py_trifinger.TriFingerPlatformFrontend

Bases: pybind11_object

class Action(torque=[0] * n_joints, position=[nan] * n_joints, position_kp=[nan] * n_joints, position_kd=[nan] * n_joints)

Bases: pybind11_object

Action with desired torque and (optional) position.

The resulting torque command sent to the robot is:

torque_command = torque + PD(position)

To disable the position controller, set the target position to NaN. The controller is executed joint-wise, so it is possible to run it only for some joints by setting a target position for these joints and setting the others to NaN.

The specified torque is always added to the result of the position controller, so if you only want to run the position controller, make sure to set torque to zero for all joints.

Parameters
  • torque – Desired torque.

  • position – Desired position. Set values to NaN to disable position controller for the corresponding joints

  • position_kp – P-gains for the position controller. Set to NaN to use default values.

  • position_kd – D-gains for the position controller. Set to NaN to use default values.

property position

List of desired positions, one per joint. If set, a PD position controller is run and the resulting torque is added to torque. Set to NaN to disable position controller (default).

property position_kd

D-gains for position controller, one per joint. If NaN, default is used.

property position_kp

P-gains for position controller, one per joint. If NaN, default is used.

property torque

List of desired torques, one per joint.

append_desired_action(action: robot_interfaces.trifinger.Action) int

Append a desired action to the action time series.

Append an action to the “desired actions” time series. Note that this does not block until the action is actually executed. The time series acts like a queue from which the actions are taken one by one to send them to the actual robot. It is possible to call this method multiple times in a row to already provide actions for the next time steps.

The time step at which the given action will be applied is returned by this method.

Parameters

desired_action – The action that shall be applied on the robot. Note that the actually applied action might be different (see get_applied_action()).

Returns

Time step at which the action will be applied.

get_applied_action(t: int) robot_interfaces.trifinger.Action

Get actually applied action of time step t.

The applied action is the one that was actually applied to the robot based on the desired action of that time step. It may differ from the desired one e.g. due to safety checks which limit the maximum torque and enforce the position limits.

If t is in the future, this method will block and wait.

get_camera_observation(t: int)

Get camera images of time step t.

If t is in the future, this method will block and wait.

Parameters

t – Time index of the robot time series. This is internally mapped to the corresponding time index of the camera time series.

Returns

Camera images of time step t.

Raises

Exception – if t is too old and not in the time series buffer anymore.

get_current_timeindex() int

Get the current time index.

get_desired_action(t: int) robot_interfaces.trifinger.Action

Get desired action of time step t.

This corresponds to the action that was appended using append_desired_action(). Note that the actually applied action may differ, see get_applied_action().

If t is in the future, this method will block and wait.

get_robot_observation(t: int) robot_interfaces.trifinger.Observation

Get robot observation of time step t.

If t is in the future, this method will block and wait.

Parameters

t – Index of the time step.

Returns

Robot observation of time step t.

Raises

Exception – if t is too old and not in the time series buffer anymore.

get_robot_status(t: int) robot_interfaces.Status

Get robot status of time step t.

If t is in the future, this method will block and wait.

get_timestamp_ms(t: int) float

Get timestamp in milliseconds of time step t.

If t is in the future, this method will block and wait.

wait_until_timeindex(t: int)

Wait until time step t is reached.

class robot_fingers.py_trifinger.TriFingerPlatformLog(robot_log_file: str, camera_log_file: str)

Bases: pybind11_object

Load robot and camera log and match observations like during runtime.

The robot and camera observations are provided asynchronously. To access both through a common time index, TriFingerPlatformFrontend maps “robot time indices” to the corresponding camera observations based on the time stamps. This mapping is not explicitly saved in the log files. Therefore, TriFingerPlatformLog class provides an interface to load robot and camera logs together and performs the mapping from robot to camera time index in the same way as it is happening in TriFingerPlatformFrontend.

Parameters
  • robot_log_file (str) – Path to the robot log file.

  • camera_log_file (str) – Path to the camera log file.

get_applied_action(t: int) Action

Get actually applied action of time step t.

get_camera_log()
get_camera_observation(t: int)

Get camera observation of robot time step t.

get_desired_action(t: int) Action

Get desired action of time step t.

get_first_timeindex() int

Get the first time index in the log file.

get_last_timeindex() int

Get the last time index in the log file.

get_map_robot_to_camera_index()
get_robot_log()
get_robot_observation(t: int) Observation

Get robot observation of time step t.

get_robot_status(t: int) Status

Get robot status of time step t.

get_timestamp_ms(t: int) float

Get timestamp (in milliseconds) of time step t.

class robot_fingers.py_trifinger.TriFingerPlatformWithObjectFrontend

Bases: pybind11_object

class Action(torque=[0] * n_joints, position=[nan] * n_joints, position_kp=[nan] * n_joints, position_kd=[nan] * n_joints)

Bases: pybind11_object

Action with desired torque and (optional) position.

The resulting torque command sent to the robot is:

torque_command = torque + PD(position)

To disable the position controller, set the target position to NaN. The controller is executed joint-wise, so it is possible to run it only for some joints by setting a target position for these joints and setting the others to NaN.

The specified torque is always added to the result of the position controller, so if you only want to run the position controller, make sure to set torque to zero for all joints.

Parameters
  • torque – Desired torque.

  • position – Desired position. Set values to NaN to disable position controller for the corresponding joints

  • position_kp – P-gains for the position controller. Set to NaN to use default values.

  • position_kd – D-gains for the position controller. Set to NaN to use default values.

property position

List of desired positions, one per joint. If set, a PD position controller is run and the resulting torque is added to torque. Set to NaN to disable position controller (default).

property position_kd

D-gains for position controller, one per joint. If NaN, default is used.

property position_kp

P-gains for position controller, one per joint. If NaN, default is used.

property torque

List of desired torques, one per joint.

append_desired_action(action: robot_interfaces.trifinger.Action) int

Append a desired action to the action time series.

Append an action to the “desired actions” time series. Note that this does not block until the action is actually executed. The time series acts like a queue from which the actions are taken one by one to send them to the actual robot. It is possible to call this method multiple times in a row to already provide actions for the next time steps.

The time step at which the given action will be applied is returned by this method.

Parameters

desired_action – The action that shall be applied on the robot. Note that the actually applied action might be different (see get_applied_action()).

Returns

Time step at which the action will be applied.

get_applied_action(t: int) robot_interfaces.trifinger.Action

Get actually applied action of time step t.

The applied action is the one that was actually applied to the robot based on the desired action of that time step. It may differ from the desired one e.g. due to safety checks which limit the maximum torque and enforce the position limits.

If t is in the future, this method will block and wait.

get_camera_observation(t: int)

Get camera images of time step t.

If t is in the future, this method will block and wait.

Parameters

t – Time index of the robot time series. This is internally mapped to the corresponding time index of the camera time series.

Returns

Camera images of time step t.

Raises

Exception – if t is too old and not in the time series buffer anymore.

get_current_timeindex() int

Get the current time index.

get_desired_action(t: int) robot_interfaces.trifinger.Action

Get desired action of time step t.

This corresponds to the action that was appended using append_desired_action(). Note that the actually applied action may differ, see get_applied_action().

If t is in the future, this method will block and wait.

get_robot_observation(t: int) robot_interfaces.trifinger.Observation

Get robot observation of time step t.

If t is in the future, this method will block and wait.

Parameters

t – Index of the time step.

Returns

Robot observation of time step t.

Raises

Exception – if t is too old and not in the time series buffer anymore.

get_robot_status(t: int) robot_interfaces.Status

Get robot status of time step t.

If t is in the future, this method will block and wait.

get_timestamp_ms(t: int) float

Get timestamp in milliseconds of time step t.

If t is in the future, this method will block and wait.

wait_until_timeindex(t: int)

Wait until time step t is reached.

class robot_fingers.py_trifinger.TriFingerPlatformWithObjectLog

Bases: pybind11_object

TriFingerPlatformLog(robot_log_file: str, camera_log_file: str)

Load robot and camera log and match observations like during runtime.

The robot and camera observations are provided asynchronously. To access both through a common time index, TriFingerPlatformFrontend maps “robot time indices” to the corresponding camera observations based on the time stamps. This mapping is not explicitly saved in the log files. Therefore, TriFingerPlatformLog class provides an interface to load robot and camera logs together and performs the mapping from robot to camera time index in the same way as it is happening in TriFingerPlatformFrontend.

Parameters
  • robot_log_file (str) – Path to the robot log file.

  • camera_log_file (str) – Path to the camera log file.

get_applied_action(t: int) Action

Get actually applied action of time step t.

get_camera_log()
get_camera_observation(t: int)

Get camera observation of robot time step t.

get_desired_action(t: int) Action

Get desired action of time step t.

get_first_timeindex() int

Get the first time index in the log file.

get_last_timeindex() int

Get the last time index in the log file.

get_map_robot_to_camera_index()
get_robot_log()
get_robot_observation(t: int) Observation

Get robot observation of time step t.

get_robot_status(t: int) Status

Get robot status of time step t.

get_timestamp_ms(t: int) float

Get timestamp (in milliseconds) of time step t.

robot_fingers.py_trifinger.create_trifinger_backend()

robot_fingers.py_two_joint module

class robot_fingers.py_two_joint.TwoJointConfig

Bases: pybind11_object

class CalibrationParameters

Bases: pybind11_object

property endstop_search_torques_Nm

Torque that is used to find the end stop.

property move_steps

Number of time steps for reaching the initial position.

class PositionControlGains

Bases: pybind11_object

property kd
property kp
class TrajectoryStep

Bases: pybind11_object

property move_steps

Number of time steps for reaching the target position.

property target_position_rad

Target position to which the joints should move.

property calibration

Parameters related to calibration.

property can_ports

List of CAN port names used by the robot.

property hard_position_limits_lower

Hard lower limits for joint positions.

property hard_position_limits_upper

Hard upper limits for joint positions.

property has_endstop

Whether the joints have physical end stops or not.

property home_offset_rad

Offset between home and zero position.

property initial_position_rad

Initial position to which the robot moves during initialisation.

is_within_hard_position_limits(self: robot_fingers.py_two_joint.TwoJointConfig, position: numpy.ndarray[float64[2, 1]]) bool

is_within_hard_position_limits(position: list) -> bool

Check if the given position is within the hard limits.

Parameters

position – Joint positions.

Returns

True if hard_position_limits_lower <= position <= hard_position_limits_upper.

static load_config(config_file_name: str) robot_fingers.py_two_joint.TwoJointConfig

load_config(config_file_name: str) -> Config

Load driver configuration from a YAML file.

Parameters

config_file_name – Path to the config file.

Returns

The configuration loaded from the given file.

property max_current_A

Maximum current that can be sent to the motor [A].

property move_to_position_tolerance_rad

Tolerance for reaching the target with NJointBlmcRobotDriver::move_to_position()

property position_control_gains

Default control gains for the position controller.

print(self: robot_fingers.py_two_joint.TwoJointConfig) None

print()

Print the configuration.

property safety_kd

D-gain to dampen velocity. Set to zero to disable damping.

property shutdown_trajectory

Trajectory which is executed during shutdown.

property soft_position_limits_lower

Soft lower limits for joint positions.

property soft_position_limits_upper

Soft upper limits for joint positions.

robot_fingers.py_two_joint.create_two_joint_backend(*args, **kwargs)

Overloaded function.

  1. create_two_joint_backend(robot_data: robot_interfaces.py_two_joint_types.BaseData, config: robot_fingers::NJointBlmcRobotDriver<robot_interfaces::NJointObservation<2ul>, 2ul, 1ul>::Config, first_action_timeout: float = inf, max_number_of_actions: int = 0) -> robot_interfaces.py_two_joint_types.Backend

  2. create_two_joint_backend(robot_data: robot_interfaces.py_two_joint_types.BaseData, config_file: str, first_action_timeout: float = inf, max_number_of_actions: int = 0) -> robot_interfaces.py_two_joint_types.Backend

robot_fingers.pybullet_drivers module

robot_fingers.pybullet_drivers.create_single_finger_backend(robot_data: robot_interfaces.py_finger_types.BaseData, real_time_mode: bool, visualize: bool, first_action_timeout: float = inf, max_number_of_actions: int = 0) robot_interfaces.py_finger_types.Backend

Create backend for the Single Finger robot using pyBullet simulation.

Parameters
  • robot_data (robot_interfaces.finger.Data) – Robot data instance for the Finger robot.

  • real_time_mode (bool) – If True, step the simulation in real time, otherwise as fast as possible.

  • visualize (bool) – If True, the pyBullet GUI is started for visualization.

  • first_action_timeout (float) – Timeout for the first action to arrive. If exceeded, the backend shuts down. Set to infinity to disable the timeout.

  • max_number_of_actions (int) – Maximum number of actions that are executed by the backend. If set to a value greater than zero, the backend will automatically shut down after the specified number of actions is executed.

Returns

Finger backend using simulation instead of the real robot.

robot_fingers.pybullet_drivers.create_trifinger_backend(robot_data: robot_interfaces.py_trifinger_types.BaseData, real_time_mode: bool, visualize: bool, first_action_timeout: float = inf, max_number_of_actions: int = 0) robot_interfaces.py_trifinger_types.Backend

Create a backend for the TriFinger robot using pyBullet simulation.

Parameters
  • robot_data (robot_interfaces.trifinger.Data) – Robot data instance for the TriFinger robot.

  • real_time_mode (bool) – If True, step the simulation in real time, otherwise as fast as possible.

  • visualize (bool) – If True, the pyBullet GUI is started for visualization.

  • first_action_timeout (float) – Timeout for the first action to arrive. If exceeded, the backend shuts down. Set to infinity to disable the timeout.

  • max_number_of_actions (int) – Maximum number of actions that are executed by the backend. If set to a value greater than zero, the backend will automatically shut down after the specified number of actions is executed.

Returns

TriFinger backend using simulation instead of the real robot.

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 '/home/bambooagent/bamboo-agent-home/xml-data/build-dir/MGC-BE-U2C/mpi_is_tmp/workspace/install/lib/python3.8/site-packages/robot_interfaces/py_finger_types.cpython-38-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 '/home/bambooagent/bamboo-agent-home/xml-data/build-dir/MGC-BE-U2C/mpi_is_tmp/workspace/install/lib/python3.8/site-packages/robot_interfaces/py_finger_types.cpython-38-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 '/home/bambooagent/bamboo-agent-home/xml-data/build-dir/MGC-BE-U2C/mpi_is_tmp/workspace/install/lib/python3.8/site-packages/robot_interfaces/py_finger_types.cpython-38-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 '/home/bambooagent/bamboo-agent-home/xml-data/build-dir/MGC-BE-U2C/mpi_is_tmp/workspace/install/lib/python3.8/site-packages/robot_interfaces/py_one_joint_types.cpython-38-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 '/home/bambooagent/bamboo-agent-home/xml-data/build-dir/MGC-BE-U2C/mpi_is_tmp/workspace/install/lib/python3.8/site-packages/robot_interfaces/py_solo_eight_types.cpython-38-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 '/home/bambooagent/bamboo-agent-home/xml-data/build-dir/MGC-BE-U2C/mpi_is_tmp/workspace/install/lib/python3.8/site-packages/robot_interfaces/py_trifinger_types.cpython-38-x86_64-linux-gnu.so'>, <built-in method create_trifinger_backend of PyCapsule object>, 'trifingeredu.yml'), 'trifingerone': (<module 'robot_interfaces.py_trifinger_types' from '/home/bambooagent/bamboo-agent-home/xml-data/build-dir/MGC-BE-U2C/mpi_is_tmp/workspace/install/lib/python3.8/site-packages/robot_interfaces/py_trifinger_types.cpython-38-x86_64-linux-gnu.so'>, <built-in method create_trifinger_backend of PyCapsule object>, 'trifinger.yml'), 'trifingerpro': (<module 'robot_interfaces.py_trifinger_types' from '/home/bambooagent/bamboo-agent-home/xml-data/build-dir/MGC-BE-U2C/mpi_is_tmp/workspace/install/lib/python3.8/site-packages/robot_interfaces/py_trifinger_types.cpython-38-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 '/home/bambooagent/bamboo-agent-home/xml-data/build-dir/MGC-BE-U2C/mpi_is_tmp/workspace/install/lib/python3.8/site-packages/robot_interfaces/py_trifinger_types.cpython-38-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 '/home/bambooagent/bamboo-agent-home/xml-data/build-dir/MGC-BE-U2C/mpi_is_tmp/workspace/install/lib/python3.8/site-packages/robot_interfaces/py_trifinger_types.cpython-38-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 '/home/bambooagent/bamboo-agent-home/xml-data/build-dir/MGC-BE-U2C/mpi_is_tmp/workspace/install/lib/python3.8/site-packages/robot_interfaces/py_two_joint_types.cpython-38-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.

robot_fingers.utils module

class robot_fingers.utils.TimePrinter(interval_s: float = 3600.0)[source]

Bases: object

Regularly print the current date/time and the passed duration in hours.

interval_s

Print interval in seconds

start_time

Timestamp when the printer started

update()[source]

Print time if the interval_s has passed since the last call.

Module contents

class robot_fingers.FingerConfig

Bases: pybind11_object

class CalibrationParameters

Bases: pybind11_object

property endstop_search_torques_Nm

Torque that is used to find the end stop.

property move_steps

Number of time steps for reaching the initial position.

class PositionControlGains

Bases: pybind11_object

property kd
property kp
class TrajectoryStep

Bases: pybind11_object

property move_steps

Number of time steps for reaching the target position.

property target_position_rad

Target position to which the joints should move.

property calibration

Parameters related to calibration.

property can_ports

List of CAN port names used by the robot.

property hard_position_limits_lower

Hard lower limits for joint positions.

property hard_position_limits_upper

Hard upper limits for joint positions.

property has_endstop

Whether the joints have physical end stops or not.

property home_offset_rad

Offset between home and zero position.

property initial_position_rad

Initial position to which the robot moves during initialisation.

is_within_hard_position_limits(self: robot_fingers.py_real_finger.FingerConfig, position: numpy.ndarray[float64[3, 1]]) bool

is_within_hard_position_limits(position: list) -> bool

Check if the given position is within the hard limits.

Parameters

position – Joint positions.

Returns

True if hard_position_limits_lower <= position <= hard_position_limits_upper.

static load_config(config_file_name: str) robot_fingers.py_real_finger.FingerConfig

load_config(config_file_name: str) -> Config

Load driver configuration from a YAML file.

Parameters

config_file_name – Path to the config file.

Returns

The configuration loaded from the given file.

property max_current_A

Maximum current that can be sent to the motor [A].

property move_to_position_tolerance_rad

Tolerance for reaching the target with NJointBlmcRobotDriver::move_to_position()

property position_control_gains

Default control gains for the position controller.

print(self: robot_fingers.py_real_finger.FingerConfig) None

print()

Print the configuration.

property safety_kd

D-gain to dampen velocity. Set to zero to disable damping.

property shutdown_trajectory

Trajectory which is executed during shutdown.

property soft_position_limits_lower

Soft lower limits for joint positions.

property soft_position_limits_upper

Soft upper limits for joint positions.

class robot_fingers.OneJointConfig

Bases: pybind11_object

class CalibrationParameters

Bases: pybind11_object

property endstop_search_torques_Nm

Torque that is used to find the end stop.

property move_steps

Number of time steps for reaching the initial position.

class PositionControlGains

Bases: pybind11_object

property kd
property kp
class TrajectoryStep

Bases: pybind11_object

property move_steps

Number of time steps for reaching the target position.

property target_position_rad

Target position to which the joints should move.

property calibration

Parameters related to calibration.

property can_ports

List of CAN port names used by the robot.

property hard_position_limits_lower

Hard lower limits for joint positions.

property hard_position_limits_upper

Hard upper limits for joint positions.

property has_endstop

Whether the joints have physical end stops or not.

property home_offset_rad

Offset between home and zero position.

property initial_position_rad

Initial position to which the robot moves during initialisation.

is_within_hard_position_limits(self: robot_fingers.py_one_joint.OneJointConfig, position: numpy.ndarray[float64[1, 1]]) bool

is_within_hard_position_limits(position: list) -> bool

Check if the given position is within the hard limits.

Parameters

position – Joint positions.

Returns

True if hard_position_limits_lower <= position <= hard_position_limits_upper.

static load_config(config_file_name: str) robot_fingers.py_one_joint.OneJointConfig

load_config(config_file_name: str) -> Config

Load driver configuration from a YAML file.

Parameters

config_file_name – Path to the config file.

Returns

The configuration loaded from the given file.

property max_current_A

Maximum current that can be sent to the motor [A].

property move_to_position_tolerance_rad

Tolerance for reaching the target with NJointBlmcRobotDriver::move_to_position()

property position_control_gains

Default control gains for the position controller.

print(self: robot_fingers.py_one_joint.OneJointConfig) None

print()

Print the configuration.

property safety_kd

D-gain to dampen velocity. Set to zero to disable damping.

property shutdown_trajectory

Trajectory which is executed during shutdown.

property soft_position_limits_lower

Soft lower limits for joint positions.

property soft_position_limits_upper

Soft upper limits for joint positions.

class robot_fingers.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

class robot_fingers.SoloEightConfig

Bases: pybind11_object

class CalibrationParameters

Bases: pybind11_object

property endstop_search_torques_Nm

Torque that is used to find the end stop.

property move_steps

Number of time steps for reaching the initial position.

class PositionControlGains

Bases: pybind11_object

property kd
property kp
class TrajectoryStep

Bases: pybind11_object

property move_steps

Number of time steps for reaching the target position.

property target_position_rad

Target position to which the joints should move.

property calibration

Parameters related to calibration.

property can_ports

List of CAN port names used by the robot.

property hard_position_limits_lower

Hard lower limits for joint positions.

property hard_position_limits_upper

Hard upper limits for joint positions.

property has_endstop

Whether the joints have physical end stops or not.

property home_offset_rad

Offset between home and zero position.

property initial_position_rad

Initial position to which the robot moves during initialisation.

is_within_hard_position_limits(self: robot_fingers.py_solo_eight.SoloEightConfig, position: numpy.ndarray[float64[8, 1]]) bool

is_within_hard_position_limits(position: list) -> bool

Check if the given position is within the hard limits.

Parameters

position – Joint positions.

Returns

True if hard_position_limits_lower <= position <= hard_position_limits_upper.

static load_config(config_file_name: str) robot_fingers.py_solo_eight.SoloEightConfig

load_config(config_file_name: str) -> Config

Load driver configuration from a YAML file.

Parameters

config_file_name – Path to the config file.

Returns

The configuration loaded from the given file.

property max_current_A

Maximum current that can be sent to the motor [A].

property move_to_position_tolerance_rad

Tolerance for reaching the target with NJointBlmcRobotDriver::move_to_position()

property position_control_gains

Default control gains for the position controller.

print(self: robot_fingers.py_solo_eight.SoloEightConfig) None

print()

Print the configuration.

property safety_kd

D-gain to dampen velocity. Set to zero to disable damping.

property shutdown_trajectory

Trajectory which is executed during shutdown.

property soft_position_limits_lower

Soft lower limits for joint positions.

property soft_position_limits_upper

Soft upper limits for joint positions.

class robot_fingers.TriFingerConfig

Bases: pybind11_object

class CalibrationParameters

Bases: pybind11_object

property endstop_search_torques_Nm

Torque that is used to find the end stop.

property move_steps

Number of time steps for reaching the initial position.

class PositionControlGains

Bases: pybind11_object

property kd
property kp
class TrajectoryStep

Bases: pybind11_object

property move_steps

Number of time steps for reaching the target position.

property target_position_rad

Target position to which the joints should move.

property calibration

Parameters related to calibration.

property can_ports

List of CAN port names used by the robot.

property hard_position_limits_lower

Hard lower limits for joint positions.

property hard_position_limits_upper

Hard upper limits for joint positions.

property has_endstop

Whether the joints have physical end stops or not.

property home_offset_rad

Offset between home and zero position.

property initial_position_rad

Initial position to which the robot moves during initialisation.

is_within_hard_position_limits(position: list) bool

Check if the given position is within the hard limits.

Parameters

position – Joint positions.

Returns

True if hard_position_limits_lower <= position <= hard_position_limits_upper.

static load_config(config_file_name: str) Config

Load driver configuration from a YAML file.

Parameters

config_file_name – Path to the config file.

Returns

The configuration loaded from the given file.

property max_current_A

Maximum current that can be sent to the motor [A].

property move_to_position_tolerance_rad

Tolerance for reaching the target with NJointBlmcRobotDriver::move_to_position()

property position_control_gains

Default control gains for the position controller.

print()

Print the configuration.

property safety_kd

D-gain to dampen velocity. Set to zero to disable damping.

property shutdown_trajectory

Trajectory which is executed during shutdown.

property soft_position_limits_lower

Soft lower limits for joint positions.

property soft_position_limits_upper

Soft upper limits for joint positions.

class robot_fingers.TriFingerPlatformFrontend

Bases: pybind11_object

class Action(torque=[0] * n_joints, position=[nan] * n_joints, position_kp=[nan] * n_joints, position_kd=[nan] * n_joints)

Bases: pybind11_object

Action with desired torque and (optional) position.

The resulting torque command sent to the robot is:

torque_command = torque + PD(position)

To disable the position controller, set the target position to NaN. The controller is executed joint-wise, so it is possible to run it only for some joints by setting a target position for these joints and setting the others to NaN.

The specified torque is always added to the result of the position controller, so if you only want to run the position controller, make sure to set torque to zero for all joints.

Parameters
  • torque – Desired torque.

  • position – Desired position. Set values to NaN to disable position controller for the corresponding joints

  • position_kp – P-gains for the position controller. Set to NaN to use default values.

  • position_kd – D-gains for the position controller. Set to NaN to use default values.

property position

List of desired positions, one per joint. If set, a PD position controller is run and the resulting torque is added to torque. Set to NaN to disable position controller (default).

property position_kd

D-gains for position controller, one per joint. If NaN, default is used.

property position_kp

P-gains for position controller, one per joint. If NaN, default is used.

property torque

List of desired torques, one per joint.

append_desired_action(action: robot_interfaces.trifinger.Action) int

Append a desired action to the action time series.

Append an action to the “desired actions” time series. Note that this does not block until the action is actually executed. The time series acts like a queue from which the actions are taken one by one to send them to the actual robot. It is possible to call this method multiple times in a row to already provide actions for the next time steps.

The time step at which the given action will be applied is returned by this method.

Parameters

desired_action – The action that shall be applied on the robot. Note that the actually applied action might be different (see get_applied_action()).

Returns

Time step at which the action will be applied.

get_applied_action(t: int) robot_interfaces.trifinger.Action

Get actually applied action of time step t.

The applied action is the one that was actually applied to the robot based on the desired action of that time step. It may differ from the desired one e.g. due to safety checks which limit the maximum torque and enforce the position limits.

If t is in the future, this method will block and wait.

get_camera_observation(t: int)

Get camera images of time step t.

If t is in the future, this method will block and wait.

Parameters

t – Time index of the robot time series. This is internally mapped to the corresponding time index of the camera time series.

Returns

Camera images of time step t.

Raises

Exception – if t is too old and not in the time series buffer anymore.

get_current_timeindex() int

Get the current time index.

get_desired_action(t: int) robot_interfaces.trifinger.Action

Get desired action of time step t.

This corresponds to the action that was appended using append_desired_action(). Note that the actually applied action may differ, see get_applied_action().

If t is in the future, this method will block and wait.

get_robot_observation(t: int) robot_interfaces.trifinger.Observation

Get robot observation of time step t.

If t is in the future, this method will block and wait.

Parameters

t – Index of the time step.

Returns

Robot observation of time step t.

Raises

Exception – if t is too old and not in the time series buffer anymore.

get_robot_status(t: int) robot_interfaces.Status

Get robot status of time step t.

If t is in the future, this method will block and wait.

get_timestamp_ms(t: int) float

Get timestamp in milliseconds of time step t.

If t is in the future, this method will block and wait.

wait_until_timeindex(t: int)

Wait until time step t is reached.

class robot_fingers.TriFingerPlatformLog(robot_log_file: str, camera_log_file: str)

Bases: pybind11_object

Load robot and camera log and match observations like during runtime.

The robot and camera observations are provided asynchronously. To access both through a common time index, TriFingerPlatformFrontend maps “robot time indices” to the corresponding camera observations based on the time stamps. This mapping is not explicitly saved in the log files. Therefore, TriFingerPlatformLog class provides an interface to load robot and camera logs together and performs the mapping from robot to camera time index in the same way as it is happening in TriFingerPlatformFrontend.

Parameters
  • robot_log_file (str) – Path to the robot log file.

  • camera_log_file (str) – Path to the camera log file.

get_applied_action(t: int) Action

Get actually applied action of time step t.

get_camera_log()
get_camera_observation(t: int)

Get camera observation of robot time step t.

get_desired_action(t: int) Action

Get desired action of time step t.

get_first_timeindex() int

Get the first time index in the log file.

get_last_timeindex() int

Get the last time index in the log file.

get_map_robot_to_camera_index()
get_robot_log()
get_robot_observation(t: int) Observation

Get robot observation of time step t.

get_robot_status(t: int) Status

Get robot status of time step t.

get_timestamp_ms(t: int) float

Get timestamp (in milliseconds) of time step t.

class robot_fingers.TriFingerPlatformWithObjectFrontend

Bases: pybind11_object

class Action(torque=[0] * n_joints, position=[nan] * n_joints, position_kp=[nan] * n_joints, position_kd=[nan] * n_joints)

Bases: pybind11_object

Action with desired torque and (optional) position.

The resulting torque command sent to the robot is:

torque_command = torque + PD(position)

To disable the position controller, set the target position to NaN. The controller is executed joint-wise, so it is possible to run it only for some joints by setting a target position for these joints and setting the others to NaN.

The specified torque is always added to the result of the position controller, so if you only want to run the position controller, make sure to set torque to zero for all joints.

Parameters
  • torque – Desired torque.

  • position – Desired position. Set values to NaN to disable position controller for the corresponding joints

  • position_kp – P-gains for the position controller. Set to NaN to use default values.

  • position_kd – D-gains for the position controller. Set to NaN to use default values.

property position

List of desired positions, one per joint. If set, a PD position controller is run and the resulting torque is added to torque. Set to NaN to disable position controller (default).

property position_kd

D-gains for position controller, one per joint. If NaN, default is used.

property position_kp

P-gains for position controller, one per joint. If NaN, default is used.

property torque

List of desired torques, one per joint.

append_desired_action(action: robot_interfaces.trifinger.Action) int

Append a desired action to the action time series.

Append an action to the “desired actions” time series. Note that this does not block until the action is actually executed. The time series acts like a queue from which the actions are taken one by one to send them to the actual robot. It is possible to call this method multiple times in a row to already provide actions for the next time steps.

The time step at which the given action will be applied is returned by this method.

Parameters

desired_action – The action that shall be applied on the robot. Note that the actually applied action might be different (see get_applied_action()).

Returns

Time step at which the action will be applied.

get_applied_action(t: int) robot_interfaces.trifinger.Action

Get actually applied action of time step t.

The applied action is the one that was actually applied to the robot based on the desired action of that time step. It may differ from the desired one e.g. due to safety checks which limit the maximum torque and enforce the position limits.

If t is in the future, this method will block and wait.

get_camera_observation(t: int)

Get camera images of time step t.

If t is in the future, this method will block and wait.

Parameters

t – Time index of the robot time series. This is internally mapped to the corresponding time index of the camera time series.

Returns

Camera images of time step t.

Raises

Exception – if t is too old and not in the time series buffer anymore.

get_current_timeindex() int

Get the current time index.

get_desired_action(t: int) robot_interfaces.trifinger.Action

Get desired action of time step t.

This corresponds to the action that was appended using append_desired_action(). Note that the actually applied action may differ, see get_applied_action().

If t is in the future, this method will block and wait.

get_robot_observation(t: int) robot_interfaces.trifinger.Observation

Get robot observation of time step t.

If t is in the future, this method will block and wait.

Parameters

t – Index of the time step.

Returns

Robot observation of time step t.

Raises

Exception – if t is too old and not in the time series buffer anymore.

get_robot_status(t: int) robot_interfaces.Status

Get robot status of time step t.

If t is in the future, this method will block and wait.

get_timestamp_ms(t: int) float

Get timestamp in milliseconds of time step t.

If t is in the future, this method will block and wait.

wait_until_timeindex(t: int)

Wait until time step t is reached.

class robot_fingers.TriFingerPlatformWithObjectLog

Bases: pybind11_object

TriFingerPlatformLog(robot_log_file: str, camera_log_file: str)

Load robot and camera log and match observations like during runtime.

The robot and camera observations are provided asynchronously. To access both through a common time index, TriFingerPlatformFrontend maps “robot time indices” to the corresponding camera observations based on the time stamps. This mapping is not explicitly saved in the log files. Therefore, TriFingerPlatformLog class provides an interface to load robot and camera logs together and performs the mapping from robot to camera time index in the same way as it is happening in TriFingerPlatformFrontend.

Parameters
  • robot_log_file (str) – Path to the robot log file.

  • camera_log_file (str) – Path to the camera log file.

get_applied_action(t: int) Action

Get actually applied action of time step t.

get_camera_log()
get_camera_observation(t: int)

Get camera observation of robot time step t.

get_desired_action(t: int) Action

Get desired action of time step t.

get_first_timeindex() int

Get the first time index in the log file.

get_last_timeindex() int

Get the last time index in the log file.

get_map_robot_to_camera_index()
get_robot_log()
get_robot_observation(t: int) Observation

Get robot observation of time step t.

get_robot_status(t: int) Status

Get robot status of time step t.

get_timestamp_ms(t: int) float

Get timestamp (in milliseconds) of time step t.

class robot_fingers.TwoJointConfig

Bases: pybind11_object

class CalibrationParameters

Bases: pybind11_object

property endstop_search_torques_Nm

Torque that is used to find the end stop.

property move_steps

Number of time steps for reaching the initial position.

class PositionControlGains

Bases: pybind11_object

property kd
property kp
class TrajectoryStep

Bases: pybind11_object

property move_steps

Number of time steps for reaching the target position.

property target_position_rad

Target position to which the joints should move.

property calibration

Parameters related to calibration.

property can_ports

List of CAN port names used by the robot.

property hard_position_limits_lower

Hard lower limits for joint positions.

property hard_position_limits_upper

Hard upper limits for joint positions.

property has_endstop

Whether the joints have physical end stops or not.

property home_offset_rad

Offset between home and zero position.

property initial_position_rad

Initial position to which the robot moves during initialisation.

is_within_hard_position_limits(self: robot_fingers.py_two_joint.TwoJointConfig, position: numpy.ndarray[float64[2, 1]]) bool

is_within_hard_position_limits(position: list) -> bool

Check if the given position is within the hard limits.

Parameters

position – Joint positions.

Returns

True if hard_position_limits_lower <= position <= hard_position_limits_upper.

static load_config(config_file_name: str) robot_fingers.py_two_joint.TwoJointConfig

load_config(config_file_name: str) -> Config

Load driver configuration from a YAML file.

Parameters

config_file_name – Path to the config file.

Returns

The configuration loaded from the given file.

property max_current_A

Maximum current that can be sent to the motor [A].

property move_to_position_tolerance_rad

Tolerance for reaching the target with NJointBlmcRobotDriver::move_to_position()

property position_control_gains

Default control gains for the position controller.

print(self: robot_fingers.py_two_joint.TwoJointConfig) None

print()

Print the configuration.

property safety_kd

D-gain to dampen velocity. Set to zero to disable damping.

property shutdown_trajectory

Trajectory which is executed during shutdown.

property soft_position_limits_lower

Soft lower limits for joint positions.

property soft_position_limits_upper

Soft upper limits for joint positions.

robot_fingers.create_fake_finger_backend(arg0: robot_interfaces::RobotData<robot_interfaces::NJointAction<3ul>, robot_interfaces::NFingerObservation<1ul> >) robot_interfaces::RobotBackend<robot_interfaces::NJointAction<3ul>, robot_interfaces::NFingerObservation<1ul> >
robot_fingers.create_one_joint_backend(*args, **kwargs)

Overloaded function.

  1. create_one_joint_backend(robot_data: robot_interfaces.py_one_joint_types.BaseData, config: robot_fingers::NJointBlmcRobotDriver<robot_interfaces::NJointObservation<1ul>, 1ul, 1ul>::Config, first_action_timeout: float = inf, max_number_of_actions: int = 0) -> robot_interfaces.py_one_joint_types.Backend

  2. create_one_joint_backend(robot_data: robot_interfaces.py_one_joint_types.BaseData, config_file: str, first_action_timeout: float = inf, max_number_of_actions: int = 0) -> robot_interfaces.py_one_joint_types.Backend

robot_fingers.create_real_finger_backend(*args, **kwargs)

Overloaded function.

  1. create_real_finger_backend(robot_data: robot_interfaces::RobotData<robot_interfaces::NJointAction<3ul>, robot_interfaces::NFingerObservation<1ul> >, config: robot_fingers::NJointBlmcRobotDriver<robot_interfaces::NFingerObservation<1ul>, 3ul, 2ul>::Config, first_action_timeout: float = inf, max_number_of_actions: int = 0) -> robot_interfaces::RobotBackend<robot_interfaces::NJointAction<3ul>, robot_interfaces::NFingerObservation<1ul> >

  2. create_real_finger_backend(robot_data: robot_interfaces::RobotData<robot_interfaces::NJointAction<3ul>, robot_interfaces::NFingerObservation<1ul> >, config_file: str, first_action_timeout: float = inf, max_number_of_actions: int = 0) -> robot_interfaces::RobotBackend<robot_interfaces::NJointAction<3ul>, robot_interfaces::NFingerObservation<1ul> >

robot_fingers.create_solo_eight_backend(*args, **kwargs)

Overloaded function.

  1. create_solo_eight_backend(robot_data: robot_interfaces.py_solo_eight_types.BaseData, config: robot_fingers::NJointBlmcRobotDriver<robot_interfaces::NJointObservation<8ul>, 8ul, 4ul>::Config, first_action_timeout: float = inf, max_number_of_actions: int = 0) -> robot_interfaces.py_solo_eight_types.Backend

  2. create_solo_eight_backend(robot_data: robot_interfaces.py_solo_eight_types.BaseData, config_file: str, first_action_timeout: float = inf, max_number_of_actions: int = 0) -> robot_interfaces.py_solo_eight_types.Backend

robot_fingers.create_trifinger_backend()
robot_fingers.create_two_joint_backend(*args, **kwargs)

Overloaded function.

  1. create_two_joint_backend(robot_data: robot_interfaces.py_two_joint_types.BaseData, config: robot_fingers::NJointBlmcRobotDriver<robot_interfaces::NJointObservation<2ul>, 2ul, 1ul>::Config, first_action_timeout: float = inf, max_number_of_actions: int = 0) -> robot_interfaces.py_two_joint_types.Backend

  2. create_two_joint_backend(robot_data: robot_interfaces.py_two_joint_types.BaseData, config_file: str, first_action_timeout: float = inf, max_number_of_actions: int = 0) -> robot_interfaces.py_two_joint_types.Backend

robot_fingers.demo_print_position(robot)[source]

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

Parameters

robot (Robot) – The robot environment.