Hello, thank you for pointing out this error in the documentation. It has been fixed at http://sumo.dlr.de/wiki/TraCI/Simulation_Value_Retrieval#Command_0x83:_Distance_Request regards, Jakob
2017-06-21 10:47 GMT+02:00 Husen, Wim van <[email protected]>: > Hello, > > I'm heaving some troubles with the Traci Distance request. > > According to the documentation the message has the following parameters: > > byte > > integer > > Position > > Position > > byte > > ubyte > > value type compound > > item number (always 3) > > start position > > end position > > value type ubyte > > Distance Type > > > > When I send the message according to this format, the simulation crashed. > > I've taken a look in the source code of the TraCIServerAPI_Simulation.cpp > and discovered the reason of the crash. > The message has a checked unsigned byte for the distance type. At line 451 > a call is made to read a 'normal' unsigned byte. The distType gets the > wrong value (0x07 = UBYTE) and the number of byte read doesn't match the > length of the message. > > The following code change solved the problem: > > // read distance type > //int distType = inputStorage.readUnsignedByte(); > int distType = 0; > if (!server.readTypeCheckingUnsignedByte(inputStorage, distType)) { > server.writeStatusCmd(commandId, RTYPE_ERR, "Destination position type > must be of type ubyte."); > return false; > } > > Another possible bug-fix is sending the distance type as an unchecked > unsigned byte and leave the cpp code unchanged. > > What is the preferred solution? > > Met vriendelijke groet, > > > > > > > > Wim van Husen > Engineer Productontwikkeling > > T +31 88 811 56 27 > M +31 6 22 60 93 12 > [email protected]<mailto:[email protected]> > > Sweco Nederland B.V. > De Holle Bilt 22 > 3732 HM De Bilt > T +31 88 811 66 00 > Handelsregister 30129769 > www.sweco.nl<http://www.sweco.nl> > > > > [cid:[email protected]] > > > > > > > > > > > ------------------------------------------------------------ > ------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > sumo-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/sumo-user > > ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ sumo-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sumo-user
