Skip to content

Commit

Permalink
Update robot_sf/gym_env/robot_env_with_pedestrian_obstacle_forces.py
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
ll7 and coderabbitai[bot] authored Dec 3, 2024
1 parent 95df208 commit 713d01b
Showing 1 changed file with 9 additions and 1 deletion.
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

0 comments on commit 713d01b

Please sign in to comment.