[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [sumo-user] I am unable to start sumo from c++ by using libtraci
|
Dear Milad,
there are two things to consider:
- libtraci namespace (but as long as you have libsumo installed, the actual code for running sumo is the same)
- libtraci::Simulation::start will take the full call to sumo (path to sumo and command line arguments) - you don't separate that into two arguments but have to provide one vector of strings containing all (as in the example you adapted)
Best regards
Mirko
-----Original-Nachricht-----
Betreff: [sumo-user] I am unable to start sumo from c++ by using libtraci
Datum: 2024-01-16T02:06:57+0100
Von: "Milad Sasha via sumo-user" <sumo-user@xxxxxxxxxxx>
An: "sumo-user@xxxxxxxxxxx" <sumo-user@xxxxxxxxxxx>
Good Morning
I hope this email finds you well. I am currently trying to start sumo from an unreal engine c++ program. importing libtraci library was successful. However , I cannot start sumo based on the sample in libtraci documentation. here is my code:
std::string sumoPath = "C:\Users\simone\Downloads\sumo-1.19.0\bin\sumo-gui";
std::vector<std::string> sumoArgs = { "-n", "C:\Users\simone\Downloads\sumo-1.19.0\bin\
montreal1.net" };
libsumo::Simulation::start(sumoPath, sumoArgs);
// Simulate for 5 steps
for (int i = 0; i < 5; i++) {
libsumo::Simulation::step();
}
libsumo::Simulation::close();
However, I think I am entering the argument wrong. What should be the argument of the start method?
start({"sumo", "-n", "net.net.xml"});
I appreciate your help and answer my question. Thank you so much.
Best regards,
Milad