Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Class for person in Omnet++

I found a quick hack to get coordinates of all pedestrians in personFlow.
In the source code of SUMO, edit the file: GUIEdge.cpp. More specifically, find the statement:
person->drawGL(s);
and then write a new line: std::cout<<person->getPosition()<<std::endl;
It works, the position will be printed as sumo-gui runs alone.
However, a new problem arises: My project needs positions to be available while the simulation is running. But the data of position is not printed as choosing "Run as Omnet++ simulation". The simulation should end and a user should close the Qtenv, the data would be available in the terminal. I tried other ways (such as writing a file) but it doesn't change: data only is printed after a user closes Qtenv.

Attachment: Screenshot from 2022-04-22 09-15-27.png
Description: PNG image


Back to the top