cnvp
cnvp

Reputation: 31

omnet++/veins : some sumo/traci commands seem to be not implemented

I would like to use some sumo/traci commands that seem to be not implemented in omnet++/veins, such as :

What is the simplest way to be able to use these commands from omnet++/veins?

Thank you very much for the help. Regards :)

Upvotes: 1

Views: 266

Answers (1)

Christoph Sommer
Christoph Sommer

Reputation: 6943

You can find the existing client source code for interacting with SUMO in TraCICommandInterface.cc, for example to set a TL program:

TraCIBuffer buf = connection->query(CMD_SET_TL_VARIABLE, TraCIBuffer()
  << static_cast<uint8_t>(TL_PROGRAM) 
  << trafficLightId 
  << static_cast<uint8_t>(TYPE_STRING)
  << program
);

The corresponding server source code can be found in TraCIServerAPI_TLS.cpp, for example to set a TL program:

// variable & id
int variable = inputStorage.readUnsignedByte();
std::string id = inputStorage.readString();
// [...] case TL_PROGRAM:
server.readTypeCheckingString(inputStorage, subID)

vars.switchTo(tlsControl, subID);

By investigating how the server is prepared to interact with the client (and how the client is already interacting with the server) you should be able to extend the client according to your wishes.

Upvotes: 2

Related Questions