I am trying to implement a TraCi command for my sumo scenario (traci.lane.setDisallowed) while using veins. I created a new command in the TraciCommandInterface.cpp like:
void TraCICommandInterface::Lane::setDisallowed(std::list<std::string> disallowedClasses) {
TraCIBuffer buf = connection->query(CMD_SET_LANE_VARIABLE, TraCIBuffer() << LANE_DISALLOWED << laneId << TYPE_STRINGLIST << disallowedClasses); ASSERT(buf.eof());
}
and called like:
std::list<std::string> disallowedClasses = {"all"};
if (simTime()==20) {
TraCICommandInterface* cInt = getCommandInterface();
cInt->lane("ed_1_0").setDisallowed(disallowedClasses);
}
The problem is that i get the error:
Answered with error to command 0xc3: Wrong position in requestMessage after dispatching command 195. Expected command length was 38 but 18 Bytes were read.
By disabling the "wrong position...." command at TraciAPI i can force the lane to be dissallowed but some error keep apearing (without terminating my simulation thought)
Is there something wrong with the way i implemented the command? and why that error occures? How can i fix it?