Skip to content

Commit

Permalink
updated env.py file
Browse files Browse the repository at this point in the history
  • Loading branch information
flimdejong committed Nov 13, 2024
1 parent 8e7adc1 commit 2af8274
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions roboteam_ai/src/RL/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,22 @@
import numpy as np
from google.protobuf.message import DecodeError
import time
import os
import sys

# Make root folder /roboteam
current_dir = os.path.dirname(os.path.abspath(__file__))
roboteam_path = os.path.abspath(os.path.join(current_dir, "../../.."))

# Add to sys.path
sys.path.append(roboteam_path)

# Now import the functions
from src.sentActionCommand import send_action_command
from src.getState import get_ball_state, get_robot_state, get_referee_state
from src.teleportBall import teleport_ball
from src.resetRefereeAPI import reset_referee_state
from src.changeGameState import start_game
from roboteam_ai.src.RL.src.sentActionCommand import send_action_command
from roboteam_ai.src.RL.src.getState import get_ball_state, get_robot_state, get_referee_state
from roboteam_ai.src.RL.src.teleportBall import teleport_ball
from roboteam_ai.src.RL.src.resetRefereeAPI import reset_referee_state
from roboteam_ai.src.RL.src.changeGameState import start_game

"""
This environment file is in the form of a gymnasium environment.
Expand All @@ -22,7 +31,9 @@

class RoboTeamEnv(gymnasium.Env):

def __init__(self):
def __init__(self, config=None):
self.config = config or {} # Config placeholder


self.MAX_ROBOTS_US = 10

Expand Down Expand Up @@ -242,6 +253,8 @@ def reset(self, seed=None):
self.is_blue_dribbling = False

observation, _ = self.get_observation()

print("Reset completed")
return observation,{}


Expand Down

0 comments on commit 2af8274

Please sign in to comment.