Billiard  1
A Gym Environment with a ball pushing arm
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
gym_billiard.envs.billiard_env.BilliardEnv Class Reference
Inheritance diagram for gym_billiard.envs.billiard_env.BilliardEnv:
Inheritance graph
[legend]
Collaboration diagram for gym_billiard.envs.billiard_env.BilliardEnv:
Collaboration graph
[legend]

Public Member Functions

def __init__ (self, seed=None, max_steps=500)
 
def seed (self, seed=None)
 
def reset (self)
 
def step (self, action)
 
def render (self, mode='human')
 

Public Attributes

 screen
 
 params
 
 physics_eng
 
 observation_space
 Ball XY positions can be between -1.5 and 1.5. More...
 
 action_space
 Joint commands can be between [-1, 1]. More...
 
 steps
 
 state
 
 clock
 

Static Public Attributes

dictionary metadata
 

Detailed Description

State is composed of:
s = ([ball_x, ball_y], [joint0_angle, joint1_angle], [joint0_speed, joint1_speed])

The values that these components can take are:
ball_x, ball_y -> [-1.5, 1.5]
joint0_angle -> [-pi/2, pi/2]
joint1_angle -> [-pi, pi]
joint0_speed, joint1_speed -> [-50, 50]

Constructor & Destructor Documentation

◆ __init__()

def gym_billiard.envs.billiard_env.BilliardEnv.__init__ (   self,
  seed = None,
  max_steps = 500 
)
Constructor
:param seed: the random seed for the environment
:param max_steps: the maximum number of steps the episode lasts
:return:

Member Function Documentation

◆ render()

def gym_billiard.envs.billiard_env.BilliardEnv.render (   self,
  mode = 'human' 
)
Rendering function
:param mode: if human, renders on screen. If rgb_array, renders as numpy array
:return: screen if mode=human, array if mode=rgb_array

◆ reset()

def gym_billiard.envs.billiard_env.BilliardEnv.reset (   self)
Function to reset the environment.
- If param RANDOM_BALL_INIT_POSE is set, the ball appears in a random pose, otherwise it will appear at [-0.5, 0.2]
- If param RANDOM_ARM_INIT_POSE is set, the arm joint positions will be set randomly, otherwise they will have [0, 0]
:return: Initial observation

◆ seed()

def gym_billiard.envs.billiard_env.BilliardEnv.seed (   self,
  seed = None 
)
Function to seed the environment
:param seed: The random seed
:return: [seed]

◆ step()

def gym_billiard.envs.billiard_env.BilliardEnv.step (   self,
  action 
)
Performs an environment step.
:param action: Arm Motor commands. Can be either torques or velocity, according to TORQUE_CONTROL parameter
:return: state, reward, final, info

Member Data Documentation

◆ action_space

gym_billiard.envs.billiard_env.BilliardEnv.action_space

Joint commands can be between [-1, 1].

◆ clock

gym_billiard.envs.billiard_env.BilliardEnv.clock

◆ metadata

dictionary gym_billiard.envs.billiard_env.BilliardEnv.metadata
static
Initial value:
= {'render.modes': ['human'],
'video.frames_per_second': 15
}

◆ observation_space

gym_billiard.envs.billiard_env.BilliardEnv.observation_space

Ball XY positions can be between -1.5 and 1.5.

Arm joint can have positons: Joint 0: [-Pi/2, Pi/2] Joint 1: [-Pi, Pi]

◆ params

gym_billiard.envs.billiard_env.BilliardEnv.params

◆ physics_eng

gym_billiard.envs.billiard_env.BilliardEnv.physics_eng

◆ screen

gym_billiard.envs.billiard_env.BilliardEnv.screen

◆ state

gym_billiard.envs.billiard_env.BilliardEnv.state

◆ steps

gym_billiard.envs.billiard_env.BilliardEnv.steps

The documentation for this class was generated from the following file: