AayDee
AayDee

Reputation: 181

How do I find a car's vehicle type in Veins?

In my scenario in Veins 3.0, I want to find the vType for a given car node. How do I extract this information from TraCI? In the TraCICommandInterface.h file, a function getVehicleTypeID() is declared but is not defined in the code. Another function getVehicleTypeIDs() is defined but it returns a list of the IDs only. How do I match my car with it's type?

Thanks in advance.

Upvotes: 0

Views: 449

Answers (1)

Christoph Sommer
Christoph Sommer

Reputation: 6943

You are right: this method is not implemented - you will need to implement it yourself. The following code might help...

std::string TraCICommandInterface::getVehicleTypeId(std::string nodeId) {
  return genericGetString(CMD_GET_VEHICLE_VARIABLE, nodeId, VAR_TYPE, RESPONSE_GET_VEHICLE_VARIABLE);
}

Upvotes: 1

Related Questions