Skip to content

Commit

Permalink
fix init crash for maps with only one robot spawn zone
Browse files Browse the repository at this point in the history
  • Loading branch information
Bonifatius94 authored Dec 14, 2023
1 parent 86b01c6 commit 4dac2db
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion robot_sf/robot_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ def init_simulators(
sims: List[Simulator] = []

for i in range(num_sims):
n = map_def.num_start_pos if i < num_sims - 1 else num_robots % map_def.num_start_pos
n = map_def.num_start_pos if i < num_sims - 1 \
else max(1, num_robots % map_def.num_start_pos)
sim_robots = [env_config.robot_factory() for _ in range(n)]
sim = Simulator(
env_config.sim_config, map_def, sim_robots,
Expand Down

0 comments on commit 4dac2db

Please sign in to comment.