commonroad-sumo-interface issueshttps://gitlab.lrz.de/tum-cps/commonroad-sumo-interface/-/issues2019-07-15T15:59:22+02:00https://gitlab.lrz.de/tum-cps/commonroad-sumo-interface/-/issues/2Function create_video does not work properly2019-07-15T15:59:22+02:00Hanna KrasowskiFunction create_video does not work properlyDear all,
I implemented an minimal example to test if the sumo-cr-interface is working fine. The ego vehicle just stays at the initial position for all time steps simulated. The simulation loop runs fine but the video created is somehow...Dear all,
I implemented an minimal example to test if the sumo-cr-interface is working fine. The ego vehicle just stays at the initial position for all time steps simulated. The simulation loop runs fine but the video created is somehow messed up.
Can you find out why the video gets messed up and eventually fix the problem?
I attached the code I used and the generated video to make the issue more clear.
Thanks in advance.
```python
"""
Minimal example, plugging in of trajectory planner required.
"""
from sumo2cr.interface.sumo_simulation import SumoSimulation
from sumo2cr.visualization.video import create_video
from scenarios_sumo.a9.scenario_config import Conf as conf
from copy import deepcopy
__author__ = "Moritz Klischat"
__copyright__ = "TUM Cyber-Physical Systems Group"
__credits__ = ["ZIM Projekt ZF4086007BZ8"]
__version__ = "1.0.0"
__maintainer__ = "Moritz Klischat"
__email__ = "commonroad-i06@in.tum.de"
__status__ = "Released"
sumo_sim = SumoSimulation()
sumo_sim.initialize(conf)
output_folder = "/visualization"
print('Starting..')
ego_trajectory =[]
for t in range(conf.simulation_steps):
print('time step :' +str(t))
ego_vehicles = sumo_sim.ego_vehicles
commonroad_scenario = sumo_sim.commonroad_scenario_at_time_step(sumo_sim.current_time_step)
print(sumo_sim.current_time_step)
# plan trajectories for all ego vehicles
for id, ego_vehicle in ego_vehicles.items():
current_state = ego_vehicle.current_state
# own implementation for testing - ego vehicle just stays in the initial position
next_state = deepcopy(current_state)
next_state.time_step = sumo_sim.current_time_step +1
ego_trajectory.append(next_state)
ego_vehicle.set_planned_trajectory(ego_trajectory)
sumo_sim.simulate_step()
print('Finished')
create_video(sumo_sim, conf.video_start, conf.video_end, output_folder)
```
![sumo_cr_minimal_video](/uploads/e5d0da20139666ac4931de226d624a70/sumo_cr_minimal_video.gif)https://gitlab.lrz.de/tum-cps/commonroad-sumo-interface/-/issues/1No class ExtendedCommonRoadFileWriter in opendrive2lanlet.io 1.1.02019-07-09T19:26:58+02:00Hanna KrasowskiNo class ExtendedCommonRoadFileWriter in opendrive2lanlet.io 1.1.0Dear all,
I am a master student of Xiao and want to use the interface for my thesis.
I tried the minimal example for checking the installation. But I got this error from sumo2cr/maps/util:
ImportError: cannot import name 'ExtendedComm...Dear all,
I am a master student of Xiao and want to use the interface for my thesis.
I tried the minimal example for checking the installation. But I got this error from sumo2cr/maps/util:
ImportError: cannot import name 'ExtendedCommonRoadFileWriter'
Corresponding to line 13 in sumo2cr/maps/util:
`
from opendrive2lanelet.io.extended_file_writer import ExtendedCommonRoadFileWriter
`
I looked at the current opendrive2lanlet.io version 1.1.0, but it has this class commented out.
Can I just comment it in? Was it replaced by regular CommonRoadFileWriter from the commonroad package? Or is there a new version?
Thanks in advance.