Robot Manipulator

Ver. 1.1.9 (2023-08-21)

This module provides an environment of a robot manipulator based on Homogeneous Matrix

class mlpro.rl.pool.envs.robotinhtm.RobotArm3D

Bases: object

Auxiliary class for the implementation of robotinhtm. Generate the Kinematic of a pre-defined robot in Homogeneous Matrix.

get_transformation_matrix(theta, lvector, rotAxis, adjustRots=None, adjustThetas=None)
update_joint_coords()
get_joint()
get_num_joint()
set_theta(theta)
get_homogeneous()
get_homogeneous_eef()
get_orientation()
update_theta(deltaTheta)
class mlpro.rl.pool.envs.robotinhtm.RobotHTM(p_num_joints=4, p_reset_seed=True, p_seed=None, p_target_mode: str = 'random', p_visualize: bool = True, p_logging=True)

Bases: Environment

Custom environment for an arm robot represented as Homogeneous Matrix. The goal is to reach a certain point.

Parameters:
  • p_num_joints (int) – Number of joints. Default = 4.

  • p_reset_seed (bool) – If True, random generator is reset. Default = True.

  • p_seed – Seeding value for the random generator. Default = None.

  • p_target_mode (str) – Target mode. Possible values are “random” (default) or “fixed”.

  • p_visualize (bool) – Boolean switch for env/agent visualisation. Default = True.

  • p_logging – Log level (see constants of class Log). Default = Log.C_LOG_ALL.

C_NAME = 'RobotHTM'
C_REWARD_TYPE = 0
C_LATENCY = datetime.timedelta(seconds=1)
C_INFINITY = 3.4028235e+38
C_CYCLE_LIMIT = 100
static setup_spaces()

Static template method to set up and return state and action space of environment.

Returns:

  • state_space (MSpace) – State space object

  • action_space (MSpace) – Action space object

_setup_spaces()

Implement this method to enrich the state and action space with specific dimensions.

_simulate_reaction(p_state: State, p_action: Action) State

Custom method for a simulated state transition. Implement this method if no external state transition function is used. See method simulate_reaction() for further details.

_compute_success(p_state: State = None) bool

Custom method for assessment for success. Implement this method if no external function is used. See method compute_success() for further details.

_compute_broken(p_state: State) bool

Custom method for assessment for breakdown. Implement this method if no external function is used. See method compute_broken() for further details.

_compute_reward(p_state_old: State, p_state_new: State) Reward

Custom reward method. See method compute_reward() for further details.

set_theta(theta)
_reset(p_seed=None) None

Custom method to reset the system to an initial/defined state. Use method _set_status() to set the state.

Parameters:

p_seed (int) – Seed parameter for an internal random generator