0

I tried to establish a connection through TRACL command in the TRaCICommandInterface.cc and TraciCommandInterface.h (SetAcceleration)

This is my code in the cc file:

    void TraCICommandInterface::Vehicle::setAcc(double Acc, double Dur)
{
    uint8_t commandType = TYPE_COMPOUND;
    int count = 2;
    uint8_t variableId = VAR_ACCELERATION;
    TraCIBuffer buf = traci->connection.query(CMD_SET_VEHICLE_VARIABLE,
            TraCIBuffer() << variableId << nodeId << commandType <<count <<static_cast<uint8_t>(TYPE_DOUBLE)  << Acc << static_cast<uint8_t>(TYPE_DOUBLE)<<Dur);
    ASSERT(buf.eof());
}

and in the .h file:

void setAcc(double Acc, double Dur);

and Im getting this error:

A runtime error occurred:

TraCI server reported status 255 executing command 0xc4 ("Change Vehicle State: unsupported variable 0x72 specified").

What does he mean by unsupported variable 0x72 even though its clearly in the sumo documentation that the setAcceleration variable is 0x72 in the change vehicle state? link for that: https://sumo.dlr.de/docs/TraCI/Change_Vehicle_State.html

Jerzy D.
  • 6,707
  • 2
  • 16
  • 22

2 Answers2

1

The online documentation in SUMO always refers to the current state of the git repo. So unless you are using a nightly build of SUMO which is at most a week old, it is likely that your SUMO version simply does not have the command yet because it has been added only a week ago.

Michael
  • 3,510
  • 1
  • 11
  • 23
  • Thanks for the reply, I saw that and I updated SUMO. However, it still doesnt work. But I saw in the github issues, they recommended other people to use setSpeed instead which I did. So thanks for directing me there! – Anas Ashraf Mar 09 '22 at 09:18
0

traciVehicle->setSpeed(mobility->getSpeed() + acc*sim_step)