dm_robotics.panda.hardware module

MoMa effectors and sensors for the Panda hardware.

class dm_robotics.panda.hardware.ArmEffector(robot_params: RobotParams, arm: RobotArm, hardware: Panda)[source]

Bases: ArmEffector

Panda hardware version of the ArmEffector.

__init__(robot_params: RobotParams, arm: RobotArm, hardware: Panda)[source]

Constructor.

Parameters:
  • robot_params – Dataclass containing robot parameters.

  • arm – The MoMa arm to control.

close()[source]

Clean up after we are done using the effector.

Called to clean up when we are done using the effector. This is mainly used for real effectors that might need to close all the connections to the robot.

fdir() None[source]

Error detection and recovery.

init_hardware(robot_params: RobotParams) None[source]

Initialize the hardware.

Initializes the necessary controllers based on actuation mode and moves the robot into the initial joint positions.

set_control(physics: Physics, command: ndarray) None[source]

Send either a joint velocity or joint torque signal to the physical robot, depending on current actuation mode.

class dm_robotics.panda.hardware.ExternalWrenchObserver(robot_params: RobotParams, arm: Panda, arm_sensor: RobotArmSensor, hardware: Panda)[source]

Bases: ExternalWrenchObserver

Reads the Panda robot’s estimate of external wrenches.

__init__(robot_params: RobotParams, arm: Panda, arm_sensor: RobotArmSensor, hardware: Panda) None[source]
close()[source]

Clean up after we are done using the sensor.

Called to clean up when we are done using the sensor. This is mainly used for real sensors that might need to close all the connections to the robot.

class dm_robotics.panda.hardware.PandaHandEffector(robot_params: RobotParams, gripper: RobotHand, panda_hand_sensor: PandaHandSensor, hardware: Gripper)[source]

Bases: PandaHandEffector

Hardware version of PandaHandEffector.

__init__(robot_params: RobotParams, gripper: RobotHand, panda_hand_sensor: PandaHandSensor, hardware: Gripper)[source]
close()[source]

Clean up after we are done using the effector.

Called to clean up when we are done using the effector. This is mainly used for real effectors that might need to close all the connections to the robot.

set_control(physics: Physics, command: ndarray) None[source]
class dm_robotics.panda.hardware.PandaHandSensor(robot_params: RobotParams, gripper: PandaHand, hardware: Gripper)[source]

Bases: PandaHandSensor

Hardware version of PandaHandSensor.

__init__(robot_params: RobotParams, gripper: PandaHand, hardware: Gripper) None[source]
close()[source]

Clean up after we are done using the sensor.

Called to clean up when we are done using the sensor. This is mainly used for real sensors that might need to close all the connections to the robot.

class dm_robotics.panda.hardware.RobotArmSensor(robot_params: RobotParams, arm: RobotArm, hardware: Panda)[source]

Bases: RobotArmSensor

Panda hardware version of the MoMa RobotArmSensor.

__init__(robot_params: RobotParams, arm: RobotArm, hardware: Panda)[source]
close()[source]

Clean up after we are done using the sensor.

Called to clean up when we are done using the sensor. This is mainly used for real sensors that might need to close all the connections to the robot.

initialize_episode(physics: Physics, random_state: RandomState) None[source]

Called on a new episode, after the environment has been reset.

This is called before the agent has got a timestep in the episode that is about to start. Sensors can reset any state they may have.

Parameters:
  • physics – The MuJoCo physics the environment uses.

  • random_state – A PRNG seed.

dm_robotics.panda.hardware.build_robot(robot_params: RobotParams, control_timestep: float = 0.1) Robot[source]

Builds a MoMa robot model of the Panda with hardware in the loop.