garmi_parti.teleoperation package¶
Submodules¶
garmi_parti.teleoperation.client module¶
Networking teleoperation module for the client side.
- class garmi_parti.teleoperation.client.Client(teleoperator, host, port)¶
Bases:
objectNetwork client that connects a teleoperator input device (leader) to a teleoperated robot (follower).
- close(end_effector='')¶
Sends a request to close an end-effector.
- open(end_effector='')¶
Sends a request to open an end-effector.
- pause(end_effector='')¶
Pause the teleoperation service.
garmi_parti.teleoperation.containers module¶
Container dataclasses for robot and teleoperation entities.
- class garmi_parti.teleoperation.containers.Displacement(linear=<factory>, angular=<factory>)¶
Bases:
objectContainer holding a relative pose, i.e. SE3 displacement.
- Parameters:
linear (
ndarray)angular (
Rotation)
-
angular:
Rotation¶
-
linear:
ndarray¶
- class garmi_parti.teleoperation.containers.JointPositions(positions)¶
Bases:
objectJoint positions container.
- Parameters:
positions (
ndarray)
-
positions:
ndarray¶
- class garmi_parti.teleoperation.containers.JointStates(q, dq, tau_ext)¶
Bases:
objectJoint state container.
- Parameters:
q (
JointPositions)dq (
JointVelocities)tau_ext (
JointTorques)
-
dq:
JointVelocities¶
- classmethod from_state(state)¶
Construct a joint states container from a libfranka robot state.
- Parameters:
state (
RobotState)- Return type:
-
tau_ext:
JointTorques¶
- class garmi_parti.teleoperation.containers.JointTorques(torques)¶
Bases:
objectJoint torques container.
- Parameters:
torques (
ndarray)
-
torques:
ndarray¶
- class garmi_parti.teleoperation.containers.JointVelocities(velocites)¶
Bases:
objectJoint velocities container.
- Parameters:
velocites (
ndarray)
-
velocites:
ndarray¶
- class garmi_parti.teleoperation.containers.Pose(position=<factory>, orientation=<factory>)¶
Bases:
objectPose container.
- Parameters:
position (
ndarray)orientation (
Rotation)
-
orientation:
Rotation¶
-
position:
ndarray¶
- class garmi_parti.teleoperation.containers.TeleopContainer(arm, gripper, controller=None, params=<factory>, position_init=<factory>, orientation_init=<factory>, orientation_init_inv=<factory>, transform=<factory>, transform_inv=<factory>)¶
Bases:
objectContainer utility class for multi-arm teleoperation.
- Parameters:
arm (
Panda)gripper (
Gripper)controller (
Optional[TorqueController])params (
TeleopParams)position_init (
ndarray)orientation_init (
Rotation)orientation_init_inv (
Rotation)transform (
Rotation)transform_inv (
Rotation)
-
arm:
Panda¶
-
controller:
TorqueController= None¶
- get_rotation()¶
Get a scipy.spatial.tr.Rotation from the robot’s current end effector orientation.
- Returns:
- Unit quaternion representing the
the robot end effector’s orientation.
- Return type:
scipy.spatial.tr.Rotation
-
gripper:
Gripper¶
-
orientation_init:
Rotation¶
-
orientation_init_inv:
Rotation¶
-
params:
TeleopParams¶
-
position_init:
ndarray¶
-
transform:
Rotation¶
-
transform_inv:
Rotation¶
- class garmi_parti.teleoperation.containers.TeleopParams(hostname, transform=<factory>, q_idle=None, q_teleop=None, lock_translation=False, lock_rotation=False, stiffness=<factory>, damping=<factory>, linear_stiffness=400, angular_stiffness=20, nullspace_stiffness=0.5, damping_ratio=1.0, filter_coeff=1.0, gain_force=0.4, gain_torque=0.0, gain_joint_torque=0.8, speed_factor=0.2, gain_drift=8.0)¶
Bases:
objectParameters for a teleoperator.
- Parameters:
hostname (
str)transform (
Rotation)q_idle (
Optional[JointPositions])q_teleop (
Optional[JointPositions])lock_translation (
bool)lock_rotation (
bool)stiffness (
ndarray)damping (
ndarray)linear_stiffness (
float)angular_stiffness (
float)nullspace_stiffness (
float)damping_ratio (
float)filter_coeff (
float)gain_force (
float)gain_torque (
float)gain_joint_torque (
float)speed_factor (
float)gain_drift (
float)
-
damping:
ndarray¶
-
q_idle:
JointPositions|None= None¶
-
q_teleop:
JointPositions|None= None¶
-
stiffness:
ndarray¶
-
transform:
Rotation¶
- class garmi_parti.teleoperation.containers.TwoArmContainer(left, right)¶
-
Abstract base class for two-arm containers.
- class garmi_parti.teleoperation.containers.TwoArmDisplacement(left, right)¶
Bases:
TwoArmContainer[Displacement]Two-arm displacement container.
- class garmi_parti.teleoperation.containers.TwoArmJointPositions(left, right)¶
Bases:
TwoArmContainer[JointPositions|None]Two-arm joint positions container.
- class garmi_parti.teleoperation.containers.TwoArmJointStates(left, right)¶
Bases:
TwoArmContainer[JointStates|None]Two-arm joint states container.
- class garmi_parti.teleoperation.containers.TwoArmJointTorques(left, right)¶
Bases:
TwoArmContainer[JointTorques]Two-arm joint torques container.
- class garmi_parti.teleoperation.containers.TwoArmJointVelocities(left, right)¶
Bases:
TwoArmContainer[JointVelocities|None]Two-arm joint positions container.
- class garmi_parti.teleoperation.containers.TwoArmPose(left, right)¶
Bases:
TwoArmContainer[Pose]Two-arm pose container.
- class garmi_parti.teleoperation.containers.TwoArmTeleopContainer(left, right)¶
Bases:
TwoArmContainer[TeleopContainer]Two arm teleoperation container.
- class garmi_parti.teleoperation.containers.TwoArmWrench(left, right)¶
Bases:
TwoArmContainer[Wrench]Two-arm wrench container.
garmi_parti.teleoperation.interfaces module¶
This module defines interfaces for teleoperation. These include the most generic Interface class but also more device specific interfaces such as PandaInterface etc. The Interface class defines the interface as used by the networking modules, by implementing the abstract methods, you will have a teleoperator compatible with the garmi_parti.teleoperation module. Implementations of these interfaces are generally referred to as teleoperators. We think of server-side teleoperators as followers and client-side teleoperators as leaders.
- class garmi_parti.teleoperation.interfaces.Interface¶
Bases:
ABCGeneral teleoperator interface definition.
- abstract close(end_effector='')¶
This method is called by server (followers) and requested via network from clients (leaders). Use this method to close end effectors specified by end_effector. Refer to garmi_parti.teleoperation.client.close for the network call. :type end_effector:
str:param end_effector: End effector name- Return type:
- abstract get_sync_command()¶
Called by teleoperation clients to be sent to the server for synchronization. This call happens after a connection is established but before teleoperation starts, i.e. between the pre_teleop and start_teleop hooks.
- Return type:
- abstract open(end_effector='')¶
This method is called by server (followers) and requested via network from clients (leaders). Use this method to open end effectors specified by end_effector. Refer to garmi_parti.teleoperation.client.open for the network call. :type end_effector:
str:param end_effector: End effector name- Return type:
- abstract pause(end_effector='')¶
Executed when a pause was requested.
- abstract pre_teleop()¶
Executed after connection has been established but before teleoperation.
- Return type:
- abstract set_command(command)¶
Called when a new command has been received over the network.
- abstract set_sync_command(command, end_effector='')¶
Called by the network server. The command argument of this method is generated by get_sync_command on the client side. Use this mechanism to synchronize teleoperators before teleoperation begins.
- class garmi_parti.teleoperation.interfaces.PandaInterface(params, has_gripper=False)¶
-
Generic teleoperation interface for Panda robots.
- Parameters:
params (
TeleopParams)has_gripper (
bool)
- close(end_effector='')¶
This method is called by server (followers) and requested via network from clients (leaders). Use this method to close end effectors specified by end_effector. Refer to garmi_parti.teleoperation.client.close for the network call. :type end_effector:
str:param end_effector: End effector name- Return type:
- fdir(container)¶
Fault detection, isolation, and recovery.
- Parameters:
container (
TeleopContainer)- Return type:
- get_sync_command()¶
Called by teleoperation clients to be sent to the server for synchronization. This call happens after a connection is established but before teleoperation starts, i.e. between the pre_teleop and start_teleop hooks.
- Return type:
- init_gripper(hostname, has_gripper)¶
Connect to the hardware and initialize gripper.
- move_arm(joint_positions)¶
Move the robot arm into the given joint positions.
- Parameters:
joint_positions (
JointPositions|None)- Return type:
- open(end_effector='')¶
This method is called by server (followers) and requested via network from clients (leaders). Use this method to open end effectors specified by end_effector. Refer to garmi_parti.teleoperation.client.open for the network call. :type end_effector:
str:param end_effector: End effector name- Return type:
- pre_teleop()¶
Executed after connection has been established but before teleoperation.
- Return type:
- set_sync_command(command, end_effector='')¶
Called by the network server. The command argument of this method is generated by get_sync_command on the client side. Use this mechanism to synchronize teleoperators before teleoperation begins.
- class garmi_parti.teleoperation.interfaces.TwoArmLogger(interface, frequency=50, log_directory='./logs')¶
Bases:
objectLogs the robot states of two Panda robots.
- Parameters:
interface (
TwoArmPandaInterface)frequency (
float)log_directory (
str)
- class garmi_parti.teleoperation.interfaces.TwoArmPandaInterface(left, right, has_left_gripper=False, has_right_gripper=False)¶
Bases:
PandaInterface,ABCCommon base class for two-arm teleoperators.
- Parameters:
left (
TeleopParams)right (
TeleopParams)has_left_gripper (
bool)has_right_gripper (
bool)
- close(end_effector='')¶
This method is called by server (followers) and requested via network from clients (leaders). Use this method to close end effectors specified by end_effector. Refer to garmi_parti.teleoperation.client.close for the network call. :type end_effector:
str:param end_effector: End effector name- Return type:
- move_arms(joint_positions)¶
Move both arms to the given joint positions simultaneously.
- Parameters:
joint_positions (
TwoArmJointPositions)- Return type:
- open(end_effector='')¶
This method is called by server (followers) and requested via network from clients (leaders). Use this method to open end effectors specified by end_effector. Refer to garmi_parti.teleoperation.client.open for the network call. :type end_effector:
str:param end_effector: End effector name- Return type:
- pre_teleop()¶
Executed after connection has been established but before teleoperation.
- Return type:
garmi_parti.teleoperation.server module¶
Networking teleoperation module for the server side.
- class garmi_parti.teleoperation.server.Server(teleoperator, port, udp_timeout=1.0)¶
Bases:
objectTeleoperation network server for a teleoperated robot that accepts connection from teleoperation clients.
- close(end_effector='')¶
Close an end-effector on the teleoperation interface.
- open(end_effector='')¶
Open an end-effector on the teleoperation interface.
- pause(end_effector='')¶
Pause teleoperation service.
garmi_parti.teleoperation.utils module¶
Utility module.
- exception garmi_parti.teleoperation.utils.TeleopTimeoutError¶
Bases:
RuntimeErrorTeleoperation network timeout error.
- class garmi_parti.teleoperation.utils.Timer(timestep, timeout, buffer_size=100)¶
Bases:
objectUtility class to track timeouts.
- garmi_parti.teleoperation.utils.compute_displacement(container)¶
Compute the displacement between the teleoperator’s initial and its current pose.
- Parameters:
container (
TeleopContainer) – The teleoperator container.- Returns:
Container holding the relative pose.
- Return type: