-
Notifications
You must be signed in to change notification settings - Fork 18
Description
Description
First of all, thank you for your great contribution to this project.
I encountered an issue when trying to run the simulation with more than one ego vehicle. The program runs correctly with the default setting of --ego-num=1. However, when I set --ego-num to 2, an IndexError occurs.
Steps to Reproduce
- Run the simulation with the command line argument
--ego-num 2. - The program will terminate and throw an
IndexError.
Error Analysis
I've done some debugging and traced the error to the following call stack:
-
The error originates in the
_load_and_run_scenariomethod of theLeaderboardEvaluatorclass, specifically at the line:
self.manager.run_scenario() -
This then calls the
_tick_scenariomethod in theScenarioManagerclass, where the error occurs at:
ego_action = self._agent() -
The execution then proceeds to the
run_stepmethod of thePnP_Agentclass, calling:
control_all = self.infer.get_action_from_list_inter(...) -
Finally, inside the
get_action_from_list_intermethod, theself.generate_planning_input()function is called. The root of the problem seems to be within this function. Theocc_maphas a shape of(1, 1, 192, 96). When the loopfor agent_i in range(self.ego_vehicles_num):reachesagent_i=1, the following line fails with an index out of bounds error:occ_others = self.perception_memory_bank[t]["occ_map"][agent_i]
This is because the first dimension of
occ_mapis 1, but the code is trying to access the element at index 1.
Question
This behavior seems strange. Is this due to a misconfiguration on my part, or is it a bug in the current implementation for handling multiple ego vehicles?
Any help or clarification on this issue would be greatly appreciated.