Skip to content

Commit

Permalink
feat: enhance pedestrian obstacle avoidance test with map conversion …
Browse files Browse the repository at this point in the history
…and debug logging
  • Loading branch information
ll7 committed Dec 3, 2024
1 parent f1e5b61 commit bde7241
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions test_pygame/test_ped_obstacle_forces.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@
from robot_sf.gym_env.robot_env_with_pedestrian_obstacle_forces import (
RobotEnvWithPedestrianObstacleForces,
)
from robot_sf.nav.svg_map_parser import convert_map
from loguru import logger


def test_pedestrian_obstacle_avoidance():
env = RobotEnvWithPedestrianObstacleForces(
map_def="maps/svg/map"
)
logger.info("Testing Pedestrian and Obstacle forces")
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")
env.reset()
for _ in range(1000):
rand_action = env.action_space.sample()
Expand All @@ -20,6 +24,8 @@ def test_pedestrian_obstacle_avoidance():
env.reset()
env.close()


if __name__ == "__main__":
logger.info("Testing Pedestrian and Obstacle forces")
test_pedestrian_obstacle_avoidance()
logger.info("All tests passed")

0 comments on commit bde7241

Please sign in to comment.