Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/39-Pedestrians-have-no-obstacle-…
Browse files Browse the repository at this point in the history
…force' into 39-Pedestrians-have-no-obstacle-force
  • Loading branch information
ll7 committed Dec 4, 2024
2 parents 562c16a + 713d01b commit 4e8b05c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion robot_sf/gym_env/robot_env_with_pedestrian_obstacle_forces.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,15 @@ def __init__(self, map_def=None, debug=False):
# Load the default map
if map_def is None:
logger.warning("No map_def provided. Using default map")
map_def = convert_map("maps/svg_maps/example_map_with_obstacles.svg")
default_map_path = "maps/svg_maps/example_map_with_obstacles.svg"
try:
map_def = convert_map(default_map_path)
except FileNotFoundError:
logger.error(f"Default map not found at {default_map_path}")
raise
except Exception as e:
logger.error(f"Failed to load default map: {str(e)}")
raise

# create map pool with one map
map_pool = MapDefinitionPool(map_defs={"my_map": map_def})
Expand Down
2 changes: 1 addition & 1 deletion test_pygame/test_ped_obstacle_forces.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def test_pedestrian_obstacle_avoidance():
map_def = convert_map("maps/svg_maps/example_map_with_obstacles.svg")
logger.debug(f"type map_def: {type(map_def)}")
env = RobotEnvWithPedestrianObstacleForces(map_def=map_def, debug=True)
logger.info("created envirnoment")
logger.info("created environment")
env.reset()
for _ in range(1000):
rand_action = env.action_space.sample()
Expand Down

0 comments on commit 4e8b05c

Please sign in to comment.