Skip to content

Commit

Permalink
remove previous gotoball ssl envs v0
Browse files Browse the repository at this point in the history
  • Loading branch information
FelipeMartins96 authored and goncamateus committed Apr 30, 2021
1 parent 611e49f commit 66be861
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 25 deletions.
13 changes: 0 additions & 13 deletions rc_gym/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,12 @@
)

register(id='SSLGoToBall-v0',
entry_point='rc_gym.ssl.ssl_go_to_ball:SSLGoToBallEnv',
kwargs={'field_type': 2, 'n_robots_yellow': 0},
max_episode_steps=1200
)

register(id='SSLGoToBall-v1',
entry_point='rc_gym.ssl.ssl_go_to_ball:SSLGoToBallEnv',
kwargs={'field_type': 2, 'n_robots_yellow': 6},
max_episode_steps=1200
)

register(id='SSLGoToBallIR-v0',
entry_point='rc_gym.ssl.ssl_go_to_ball:SSLGoToBallIREnv',
kwargs={'field_type': 2, 'n_robots_yellow': 0},
max_episode_steps=1200
)

register(id='SSLGoToBallIR-v1',
entry_point='rc_gym.ssl.ssl_go_to_ball:SSLGoToBallIREnv',
kwargs={'field_type': 2, 'n_robots_yellow': 6},
max_episode_steps=1200
Expand All @@ -69,7 +57,6 @@

register(id='SSLContestedPossession-v0',
entry_point='rc_gym.ssl.ssl_hw_challenge.contested_possession:SSLContestedPossessionEnv',
kwargs={'random_init': True},
max_episode_steps=1200
)

Expand Down
15 changes: 4 additions & 11 deletions rc_gym/ssl/ssl_hw_challenge/contested_possession.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@ class SSLContestedPossessionEnv(SSLBaseEnv):
Episode Termination:
Goal, 30 seconds (1200 steps), or rule infraction
"""
def __init__(self, random_init=False):
def __init__(self):
super().__init__(field_type=2, n_robots_blue=1,
n_robots_yellow=1, time_step=0.025)
self.random_init = random_init
self.action_space = gym.spaces.Box(low=-1, high=1,
shape=(5, ), dtype=np.float32)

Expand Down Expand Up @@ -218,15 +217,9 @@ def _get_initial_positions_frame(self):
def x(): return random.uniform(pen_len, half_len - pen_len)
def y(): return random.uniform(-half_pen_wid, half_pen_wid)

if self.random_init:
pos_frame.robots_blue[0] = Robot(x=x()-pen_len, y=y(), theta=0.)
enemy_x = x()
enemy_y = y()
else:
pos_frame.robots_blue[0] = Robot(x=0, y=0, theta=0.)
enemy_x = x()
enemy_y = y()

pos_frame.robots_blue[0] = Robot(x=0, y=0, theta=0.)
enemy_x = x()
enemy_y = y()

pos_frame.ball = Ball(x=enemy_x-0.1, y=enemy_y)
pos_frame.robots_yellow[0] = Robot(x=enemy_x, y=enemy_y, theta=180.)
Expand Down
2 changes: 1 addition & 1 deletion rc_gym/ssl/ssl_hw_challenge/static_defenders.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def __init__(self, field_type=2):

# scale max energy rw to 1 Considering that max possible energy if max robot wheel speed sent every step
wheel_max_rad_s = 160
max_steps = 1200
max_steps = 1000
self.energy_scale = ((wheel_max_rad_s * 4) * max_steps)

# Limit robot speeds
Expand Down

0 comments on commit 66be861

Please sign in to comment.