def centralize_to_ego_car_initial_position(scenario):
        """
        All positions of polylines/polygons/objects are offset to ego car's first frame position.
        Returns: a modified scenario file
        """
        sdc_id = scenario[ScenarioDescription.METADATA][ScenarioDescription.SDC_ID]
        initial_pos = np.array(scenario[ScenarioDescription.TRACKS][sdc_id]["state"]["position"][0], copy=True)[:2]
        if abs(np.sum(initial_pos)) < 1e-3:
            return scenario
        return ScenarioDescription.offset_scenario_with_new_origin(scenario, initial_pos)

        All positions of polylines/polygons/objects are offset to ego car's first frame position.
        Returns: a modified scenario file
        
metadrive/scenario/scenario_description.py