I have the following traci client code:
#include <iostream>
#include <stdlib.h>
#include <string>
#include "TraCIAPI.h"
class Client : public TraCIAPI {
public:
Client() {};
~Client() {};
};
int main(int argc, char* argv[]) {
Client client;
int clientId = atoi(argv[1]);
client.connect("localhost", 47000);
TraCIAPI::VehicleScope vehicleScope(client);
while(true ) {
client.simulationStep();
libsumo::TraCIPosition pos =
vehicleScope.getPosition(std::to_string(clientId));
std::cout << pos.x << ", " << pos.y << std::endl;
}
client.close();
}
I run sumo like this: sudo sumo --remote-port 47000 -c map.sumocfg &
Then I run client program: ./client 1
So the program should continuously print the position of vehicle with id 1 till
the simulation ends. It is printing for some time, and after some time the
program exiting by throwing the following error:
terminate called after throwing an instance of 'tcpip::SocketException'
what(): .. Answered with error to command (164), [description: Vehicle '1'
is not known]
Aborted (core dumped)
What might have caused this error? Is it because the simulation
Muktadir
_______________________________________________
sumo-user mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from
this list, visit
https://dev.eclipse.org/mailman/listinfo/sumo-user