0

At first, I share my action and error reporting.

My action:

1. I added the following code to the TraCIDemo11p.cc file:

 std::string edgeId ="1i";
 traciVehicle->moveToXY(edgeId, 0,mobility->getCurrentPosition().x+2,mobility->getCurrentPosition().y,mobility->getAngleRad());

2. I added the following code to the TraCICommandInterface.cc file:

void TraCICommandInterface::Vehicle::moveToXY(std::string edgeId,int32_t laneid,double x,double y,double angle){
    uint8_t variableId = CMD_MOVEXY;
    uint8_t variableType = TYPE_COMPOUND;
    int32_t count = 5;
    uint8_t edgeType = TYPE_STRING;
    uint8_t lanidType = TYPE_INTEGER;
    uint8_t postionType = TYPE_DOUBLE;
    uint8_t routeType = TYPE_BYTE;
    uint8_t route = 1;
    TraCIBuffer buf = connection->query(CMD_SET_VEHICLE_VARIABLE, TraCIBuffer() << variableId << nodeId << variableType <<
               count <<edgeType << edgeId << lanidType << laneid << postionType << x << postionType << y <<postionType <<
               angle << routeType << route );
    ASSERT(buf.eof());
}

Error reporting:

Then, when I run the simulation of veins, the Traci Server gives the following error:

Error: Answered with error to command 0xc4: Wrong position in requestMessage after dispatching command. Expected command length was 61 but 59 Bytes were read.

Can anyone help me with how to solve this error?

Roy Scheffers
  • 3,832
  • 11
  • 31
  • 36
Peter
  • 1

0 Answers0