I'm new to Omnetpp and Veins. I'm triyng to write an application modifyng the existing TraciDemo11p application in Veins. Now I'm stuck since I don't know how to get the coordinate of the next junction for the vehicle. I saw this: how to calculate distance between car and next junction in veins
since it is what I need, but it is really old (Veins 3) and I saw the interface are changed.
I tried to serch online without good results. I also saw that in the TraciCommandInterface there is this part of code:
// Junction methods
std::list<std::string> getJunctionIds();
class VEINS_API Junction {
public:
Junction(TraCICommandInterface* traci, std::string junctionId)
: traci(traci)
, junctionId(junctionId)
{
connection = &traci->connection;
}
Coord getPosition();
std::list<Coord> getShape();
protected:
TraCICommandInterface* traci;
TraCIConnection* connection;
std::string junctionId;
};
Junction junction(std::string junctionId)
{
return Junction(this, junctionId);
}
I think that what I need is to call the getPosition() method, but I don't know how since I think I have to refer to the next junction object. How to do this? Thank you.
Thanks