robotics_toolbox.robots.planar_manipulator.PlanarManipulator
- class robotics_toolbox.robots.planar_manipulator.PlanarManipulator(link_parameters=None, structure=None, base_pose=None, gripper_length=0.2)
Bases:
RobotBase- Parameters:
link_parameters (ArrayLike | None)
structure (list[str] | str | None)
base_pose (SE2 | None)
gripper_length (float)
- __init__(link_parameters=None, structure=None, base_pose=None, gripper_length=0.2)
Creates a planar manipulator composed by rotational and prismatic joints.
- The manipulator kinematics is defined by following kinematics chain:
T_flange = (T_base) T(q_0) T(q_1) … T_n(q_n),
- where
T_i describes the pose of the next link w.r.t. the previous link computed as: T_i = R(q_i) Tx(l_i) if joint is revolute, T_i = R(l_i) Tx(q_i) if joint is prismatic,
- with
l_i is taken from @param link_parameters; type of joint is defined by the @param structure.
- Parameters:
link_parameters (_SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] | None) – either the lengths of links attached to revolute joints in [m] or initial rotation of prismatic joint [rad].
structure (list[str] | str | None) – sequence of joint types, either R or P, [R]*n by default
base_pose (SE2 | None) – mounting of the robot, identity by default
gripper_length (float) – length of the gripper measured from the flange
- Return type:
None
Methods
__init__([link_parameters, structure, ...])Creates a planar manipulator composed by rotational and prismatic joints.
Get the robot configuration.
Compute FK for frames that are attached to the links of the robot.
Return the pose of the flange in the reference frame.
ik_analytical(flange_pose_desired)Compute IK analytically, return all solutions for joint limits being from -pi to pi for revolute joints -inf to inf for prismatic joints.
ik_numerical(flange_pose_desired[, ...])Compute IK numerically.
Check if robot in its current pose is in collision.
jacobian()Computes jacobian of the manipulator for the given structure and configuration.
jacobian_finite_difference([delta])Sample robot configuration inside the configuration space.
set_configuration(configuration)Set configuration of the robot, return self for chaining.
Attributes
Return number of degrees of freedom.
- property dof
Return number of degrees of freedom.
- fk_all_links()
Compute FK for frames that are attached to the links of the robot. The first frame is base_frame, the next frames are described in the constructor.
- Return type:
list[SE2]
- ik_analytical(flange_pose_desired)
Compute IK analytically, return all solutions for joint limits being from -pi to pi for revolute joints -inf to inf for prismatic joints.
- Parameters:
flange_pose_desired (SE2)
- Return type:
list[ndarray]
- ik_numerical(flange_pose_desired, max_iterations=1000, acceptable_err=0.0001)
Compute IK numerically. Value self.q is used as an initial guess and updated to solution of IK. Returns True if converged, False otherwise.
- Parameters:
flange_pose_desired (SE2)
- Return type:
bool
- in_collision()
Check if robot in its current pose is in collision.
- Return type:
bool
- jacobian()
Computes jacobian of the manipulator for the given structure and configuration.
- Return type:
ndarray
- sample_configuration()
Sample robot configuration inside the configuration space. Will change internal state.