pyrep.robots package

Submodules

pyrep.robots.robot_component module

class pyrep.robots.robot_component.RobotComponent(count: int, name: str, joint_names: List[str], base_name: str = None)

Bases: pyrep.objects.object.Object

Collection of joints representing arms, end effectors, mobile bases, etc.

copy() → pyrep.robots.robot_component.RobotComponent

Copy and pastes the arm in the scene.

The arm is copied together with all its associated calculation objects and associated scripts.

Returns:The new pasted arm.
get_joint_count() → int

Gets the number of joints in this component.

Returns:The number of joints.
get_joint_forces() → List[float]

Retrieves the forces or torques of the joints.

See Joint.get_joint_force() for more information.

Returns:A list of the forces or the torques applied to the joints along/about their z-axis.
get_joint_intervals() → Tuple[List[bool], List[List[float]]]

Retrieves the interval parameters of the joints.

See Joint.get_joint_interval() for more information.

Returns:A tuple containing a list of bools indicates whether the joint is cyclic (the joint varies between -pi and +pi in a cyclic manner), and a 2D list containing the interval of the joints.
get_joint_modes() → List[pyrep.const.JointMode]

Gets the operation mode of the joint group.

Returns:A list of joint modes.
get_joint_positions() → List[float]

Retrieves the intrinsic position of the joints.

See Joint.get_joint_position() for more information.

Returns:A list of intrinsic position of the joints.
get_joint_target_positions() → List[float]

Retrieves the target positions of the joints.

Returns:A list of target position of the joints (angular or linear values depending on the joint type).
get_joint_target_velocities() → List[float]

Retrieves the intrinsic target velocities of the joints.

Returns:List of the target velocity of the joints (linear or angular velocity depending on the joint-type).
get_joint_types() → List[pyrep.const.JointType]

Retrieves the type of the joints in this component.

Returns:A list containing the types of the joints.
get_joint_upper_velocity_limits() → List[float]

Gets upper velocity limits of the joints.

Returns:List of the upper velocity limits.
get_joint_velocities() → List[float]

Get the current joint velocities.

Returns:List containing the velocities of the joints (linear or angular velocities depending on the joint-type).
get_visuals() → List[pyrep.objects.object.Object]

Gets a list of the visual elements of this component.

Can be useful for methods such as domain randomization. Should ideally be overridden for each robot.

Returns:A list of visual shapes.
set_control_loop_enabled(value: bool) → None

Sets whether the control loop is enable for all joints.

Parameters:value – The new value for the control loop state.
set_joint_forces(forces: List[float]) → None

Sets the maximum force or torque that the joints can exert.

See Joint.set_joint_force() for more information.

Parameters:forces – The maximum force or torque that the joints can exert. These cannot be negative values.
set_joint_intervals(cyclic: List[bool], intervals: List[List[float]]) → None

Sets the interval parameters of the joints (i.e. range values).

See Joint.set_joint_interval() for more information.

Parameters:
  • cyclic – List of bools indicates whether the joint is cyclic. Only revolute joints with a pitch of 0 can be cyclic.
  • intervals – 2D list containing the intervals of the joints.
set_joint_mode(value: pyrep.const.JointMode) → None

Sets the operation mode of the joint group.

Parameters:value – The new joint mode value.
set_joint_positions(positions: List[float], disable_dynamics: bool = False) → None

Sets the intrinsic position of the joints.

See Joint.set_joint_position() for more information.

Parameters:
  • disable_dynamics – If True, then the position can be set even when the joint mode is in Force mode. It will disable dynamics, move the joint, and then re-enable dynamics.
  • positions – A list of positions of the joints (angular or linear values depending on the joint type).
set_joint_target_positions(positions: List[float]) → None

Sets the target positions of the joints.

See Joint.set_joint_target_position() for more information.

Parameters:positions – List of target position of the joints (angular or linear values depending on the joint type).
set_joint_target_velocities(velocities: List[float]) → None

Sets the intrinsic target velocities of the joints.

Parameters:velocities – List of the target velocity of the joints (linear or angular velocities depending on the joint-type).
set_motor_locked_at_zero_velocity(value: bool) → None

Sets if motor is locked when target velocity is zero for all joints.

When enabled in velocity mode and its target velocity is zero, then the joint is locked in place.

Parameters:value – If the motors should be locked at zero velocity.

Module contents