Skip to content

Bug Report: Index error when setting --ego-num to 2 or higher #42

@JoFrc

Description

@JoFrc

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

  1. Run the simulation with the command line argument --ego-num 2.
  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:

  1. The error originates in the _load_and_run_scenario method of the LeaderboardEvaluator class, specifically at the line:
    self.manager.run_scenario()

  2. This then calls the _tick_scenario method in the ScenarioManager class, where the error occurs at:
    ego_action = self._agent()

  3. The execution then proceeds to the run_step method of the PnP_Agent class, calling:
    control_all = self.infer.get_action_from_list_inter(...)

  4. Finally, inside the get_action_from_list_inter method, the self.generate_planning_input() function is called. The root of the problem seems to be within this function. The occ_map has a shape of (1, 1, 192, 96). When the loop for agent_i in range(self.ego_vehicles_num): reaches agent_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_map is 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions