pyrobot.core.Arm(configs, moveit_planner='ESTkConfigDefault', analytical_ik=None, use_moveit=True)[source]¶Bases: object
This is a parent class on which the robot specific Arm classes would be built.
__init__(configs, moveit_planner='ESTkConfigDefault', analytical_ik=None, use_moveit=True)[source]¶Constructor for Arm parent class.
| Parameters: |
|
|---|
compute_fk_position(joint_positions, des_frame)[source]¶Given joint angles, compute the pose of desired_frame with respect to the base frame (self.configs.ARM.ARM_BASE_FRAME). The desired frame must be in self.arm_link_names
| Parameters: |
|
|---|---|
| Returns: | translational vector and rotational matrix |
| Return type: | np.ndarray, np.ndarray |
compute_fk_velocity(joint_positions, joint_velocities, des_frame)[source]¶Given joint_positions and joint velocities, compute the velocities of des_frame with respect to the base frame
| Parameters: |
|
|---|---|
| Returns: | translational and rotational velocities (vx, vy, vz, wx, wy, wz) |
| Return type: | np.ndarray |
compute_ik(position, orientation, qinit=None, numerical=True)[source]¶Inverse kinematics
| Parameters: |
|
|---|---|
| Returns: | None or joint positions |
| Return type: | np.ndarray |
get_ee_pose(base_frame)[source]¶Return the end effector pose with respect to the base_frame
| Parameters: | base_frame (string) – reference frame |
|---|---|
| Returns: | tuple (trans, rot_mat, quat) trans: translational vector (shape: \([3, 1]\)) rot_mat: rotational matrix (shape: \([3, 3]\)) quat: rotational matrix in the form of quaternion (shape: \([4,]\)) |
| Return type: | tuple or ROS PoseStamped |
get_jacobian(joint_angles)[source]¶Return the geometric jacobian on the given joint angles. Refer to P112 in “Robotics: Modeling, Planning, and Control”
| Parameters: | joint_angles (list or flattened np.ndarray) – joint_angles |
|---|---|
| Returns: | jacobian |
| Return type: | np.ndarray |
get_joint_angle(joint)[source]¶Return the joint angle of the ‘joint’
| Parameters: | joint (string) – joint name |
|---|---|
| Returns: | joint angle |
| Return type: | float |
get_joint_torque(joint)[source]¶Return the joint torque of the ‘joint’
| Parameters: | joint (string) – joint name |
|---|---|
| Returns: | joint torque |
| Return type: | float |
get_joint_velocities()[source]¶Return the joint velocities
| Returns: | joint_vels |
|---|---|
| Return type: | np.ndarray |
get_joint_velocity(joint)[source]¶Return the joint velocity of the ‘joint’
| Parameters: | joint (string) – joint name |
|---|---|
| Returns: | joint velocity |
| Return type: | float |
get_transform(src_frame, dest_frame)[source]¶Return the transform from the src_frame to dest_frame
| Parameters: |
|
|---|---|
| Returns: | tuple (trans, rot_mat, quat ) trans: translational vector (shape: \([3, 1]\)) rot_mat: rotational matrix (shape: \([3, 3]\)) quat: rotational matrix in the form of quaternion (shape: \([4,]\)) |
| Return type: | tuple or ROS PoseStamped |
move_ee_xyz(displacement, eef_step=0.005, numerical=True, plan=True, **kwargs)[source]¶Keep the current orientation fixed, move the end effector in {xyz} directions
| Parameters: |
|
|---|---|
| Returns: | whether the movement is successful or not |
| Return type: | bool |
pose_ee¶Return the end effector pose w.r.t ‘ARM_BASE_FRAME’
| Returns: | trans: translational vector (shape: \([3, 1]\)) rot_mat: rotational matrix (shape: \([3, 3]\)) quat: rotational matrix in the form of quaternion (shape: \([4,]\)) |
|---|---|
| Return type: | tuple (trans, rot_mat, quat) |
set_ee_pose(position, orientation, plan=True, wait=True, numerical=True, **kwargs)[source]¶Commands robot arm to desired end-effector pose (w.r.t. ‘ARM_BASE_FRAME’). Computes IK solution in joint space and calls set_joint_positions. Will wait for command to complete if wait is set to True.
| Parameters: |
|
|---|---|
| Returns: | Returns True if command succeeded, False otherwise |
| Return type: | bool |
set_joint_positions(positions, plan=True, wait=True, **kwargs)[source]¶Sets the desired joint angles for all arm joints
| Parameters: |
|
|---|---|
| Returns: | True if successful; False otherwise (timeout, etc.) |
| Return type: | bool |