arms¶
Submodules¶
Classes¶
- class brom_drake.control.arms.arm_control_mode.ArmControlMode(*values)[source]¶
Description
An enum describing the multiple control types that can be used for an arm in Brom.
- Options are:
kJoint or kEndEffector
Usage
from brom_drake.control.arms.arm_control_mode import ArmControlMode # or # from brom_drake.all import ArmControlMode # Selecting the joint control mode arm_control_mode = ArmControlMode.kJoint
- class brom_drake.control.arms.base_arm_controller.BaseArmController(plant: MultibodyPlant, arm_model: ModelInstanceIndex, end_effector_frame_name: str = 'end_effector_frame')[source]¶
Description
A controller which provides the basic functionality for controlling a robotic arm.
A block diagram will be included in the docstring below this comment.
------------------------ | | | | ee_target ----------------> | BaseArmController | ----> applied_arm_torque ee_target_type -----------> | | | | | | ----> measured_ee_pose arm_joint_position -------> | | ----> measured_ee_twist arm_joint_velocity ------> | | | | | | ------------------------
The type of target is determined by ee_target_type, and the options are defined in the end effector target.
Parameters
- plant: pydrake.multibody.plant.MultibodyPlant
The multibody plant containing the arm to be controlled. This plant is assumed to be finalized.
- arm_model: pydrake.multibody.tree.ModelInstanceIndex
The model instance index of the arm to be controlled.
- end_effector_frame_name: str, optional
The name of the end-effector frame in the plant, by default “end_effector_frame”.
- CalcEndEffectorPose(context: Context, output: BasicVector)[source]¶
Description
This method is called each timestep to determine the end-effector pose
- CalcEndEffectorTwist(context: Context, output: BasicVector)[source]¶
Description
Callback for the measured_ee_twist output port. This method computes the end-effector twist based on the current joint positions and velocities.
- GetJointLimits()[source]¶
Description
Iterate through the associated plant to determine the joint limits (i.e., on position and velocity) of all joints associated with the arm.
Notes
Sets the following internal variables:
q_min
q_max
qd_min
qd_max
- class brom_drake.control.arms.cartesian_arm_controller.CartesianArmController(plant: MultibodyPlant, arm_model: ModelInstanceIndex, end_effector_frame_name: str = 'end_effector_frame')[source]¶
Description
Warning
This controller appears to be only partially tested/implemented. Use at your own risk. As usual, if you find any issues/problems, then please report them on the GitHub issue tracker!
A LeafSystem controller for any arm that imitates the cartesian control mode of the Kinova Gen3 arm.
A block diagram explaining the LeafSystem’s input and output ports will be included below this comment.
----------------------------- | | | | ee_target ----------------> | CartesianArmController | ----> applied_arm_torque ee_target_type -----------> | | | | | | ----> measured_ee_pose arm_joint_position -------> | | ----> measured_ee_twist arm_joint_velocity ------> | | | | | | -----------------------------
Note that many ports are defined by the base class (BaseArmController).
- CalcArmTorques(context, output)[source]¶
Description
This method is called each timestep to determine output torques
- define_cartesian_target_input_ports()[source]¶
Description
Define the input ports for the CartesianArmController system
This method should instantiate the following input ports:
ee_target: A vector input port of size 7 representing the desired end-effector target. It’s a bit strange that this is always 7 dimensional, given the types of targets that are possible.
ee_target_type: An abstract input port representing the type of end-effector target. Recall the types of targets are defined in the EndEffectorTarget class.
arm_joint_position: A vector input port representing the current joint positions of the arm.
arm_joint_velocity: A vector input port representing the current joint velocities of the arm.
- class brom_drake.control.arms.end_effector_target.EndEffectorTarget(*values)[source]¶
Description The type of target being given for the control of a robot’s end effector.
Usage
from brom_drake.control.arms.end_effector_target import EndEffectorTarget # or # from brom_drake.all import EndEffectorTarget # Selecting the pose target type ee_target_type = EndEffectorTarget.kPose
- class brom_drake.control.arms.joint_arm_controller.JointArmController(plant: MultibodyPlant, arm_model: ModelInstanceIndex, end_effector_frame_name: str = 'end_effector_frame', joint_target_type: JointTarget = JointTarget.kPosition)[source]¶
Description
A controller which imitates the joint control mode of the Kinova gen3 arm. This is designed to work with any arm.
The controller is an extension of the pydrake.systems.framework.LeafSystem. As such, it has input and output ports which are described in detail in the following block diagram
------------------------ | | | | joint_target -------------> | JointArmController | ----> applied_arm_torque joint_target_type --------> | | | | | | ----> measured_ee_pose arm_joint_position -------> | | ----> measured_ee_twist arm_joint_velocity ------> | | | | | | ------------------------
The type of target is determined by ee_target_type, and the options are defined in the end effector target.
- CalcArmTorques(context: Context, output: BasicVector)[source]¶
Description
Calculate the arm torques based on the joint target and the current state of the arm.
Parameters
- context: pydrake.systems.framework.Context
The context of the system at the current timestep.
- output: pydrake.systems.framework.BasicVector
The output vector where the calculated torques will be stored.
- define_joint_target_input_ports(joint_target_type: JointTarget)[source]¶
Description
Define the input ports for the JointArmController system
Parameters
- joint_target_type: JointTarget
The type of joint target being provided to the controller.
- class brom_drake.control.arms.joint_target.JointTarget(*values)[source]¶
Description The type of target being given for the control of a robot’s joints.
Usage
from brom_drake.control.arms.joint_target import JointTarget # or # from brom_drake.all import JointTarget # Selecting the position target type joint_target_type = JointTarget.kPosition
Functions¶
(None found)
Variables¶
(None found)