Empty ego_vehicles with simulate_with_planner

Dear Commonraod team,

I am using the interactive scenario USA_US101-22_1_I-1-1 with simulate_with_planner.

But from the output video, I did not find the ego vehicle.

And when I debugged the code, the ego_vehicles are empty.

Did I miss some steps?

Thank you!

The interactive scenario tutorial works on your system?
Did you get some warnings?
Can you debug the init_ego_vehicles_from_planning_problem inside sumo_simulation.py, i.e., whether you reach the call of _add_ego_vehicle?

Thank you for your reply.

Yes the tutorial works well.

I got a warning about

ShapelyDeprecationWarning: STRtree will be changed in 2.0.0 and will not be compatible with versions < 2.
  self._strtee = STRtree(list(self._buffered_polygons.values()))
Warning: Invalid departPos 56.22 given for vehicle '675'. Inserting at lane end instead.
Warning: Invalid departPos 56.59 given for vehicle '679'. Inserting at lane end instead.
MatplotlibDeprecationWarning: Support for FigureCanvases without a required_interactive_framework attribute was deprecated in Matplotlib 3.6 and will be removed two minor releases later.
  self.ax = plt.gca()

I found the problem might be that self.planning_problem_set is None and in USA_US101-22_1_I-1-1.vehicles.rou.xml, there is no vehicle id with ‘egoVehicle’,then else is executed:

    if self.planning_problem_set is not None and len(self._find_ego_vehicles_in_rou_file()) == 0:
        self.__presimulation_silent(max(0, self.conf.presimulation_steps-1), fetch_obstacles=False)
        if len(self.ego_vehicles) > 0:
            self.logger.warning('<SumoSimulation/init_ego_vehicles> Ego vehicles are already defined through .rou'
                                'file and planning problem!')
        self.initialized = True
        self.init_ego_vehicles_from_planning_problem(self.planning_problem_set)
        self.__presimulation_silent(1, fetch_obstacles=True)
    else:
        self.__presimulation_silent(self.conf.presimulation_steps, fetch_obstacles=True)
        self.initialized = True

What would you suggest to solve this problem?

the scenario contains a planning problem.
Maybe there went something wrong during the initialization?

Thank you, Sebastian!

I tried it once again. in conf, ego_ids is empty. Do you think this is a problem?

I tested the simulate_with_planner with DEU_Cologne-63_5_I-1, DEU_Frankfurt-34_11_I-1 .
A video with an ego vehicle was generated without any trouble.

What do you think might be the difference?

Thank you very much!

I solved the problem myself by putting “egovehicle” as prefix in the id of vehicle in USA_US101-22_3_I-1-1.vehicles.rou.xml.

like

<vehicle depart="0.1" departLane="0" departPos="56.59496615334058" departSpeed="13.0881" id="egoVehicle679" type="passenger">
	<route edges="21 20 22"/>
</vehicle>