eclipse-sumo / sumo

Eclipse SUMO is an open source, highly portable, microscopic and continuous traffic simulation package designed to handle large networks. It allows for intermodal simulation including pedestrians and comes with a large set of tools for scenario creation.
https://eclipse.dev/sumo
Eclipse Public License 2.0
2.51k stars 1.42k forks source link

Error reading byte, getting Trafficlight.getCompleteRedYellowGreenDefinition with Traas #5388

Closed stefanobortoli closed 4 years ago

stefanobortoli commented 5 years ago

controller = (SumoTLSController) conn .do_job_get(Trafficlight.getCompleteRedYellowGreenDefinition(tlId));

generates an exception reading byte:

java.lang.IllegalStateException: Error reading byte, invalid list position specified for reading: 1242 at de.uniluebeck.itm.tcpip.Storage.readByte(Storage.java:141) at de.uniluebeck.itm.tcpip.Storage.readString(Storage.java:502) at de.uniluebeck.itm.tcpip.Storage.readStringASCII(Storage.java:462) at de.tudresden.sumo.util.CommandProcessor.do_job_get(CommandProcessor.java:480) at it.polito.appeal.traci.SumoTraciConnection.do_job_get(SumoTraciConnection.java:382) ...

The first round works properly, the second fails as I enabled the prints.

I am trying to connect to sumo-gui 1.1.0 installed as a package on ubuntu 16.04.LTS. I had no problem with the old traas (0.32.0) that was working smoothly with SUMO 0.25. Any idea about what could be the problem?

behrisch commented 5 years ago

There have been recent bugfixes to TraaS especially 212d6cb632ba4868b08f93340427595473e1ed4a. Please try again with a nightly build.

stefanobortoli commented 5 years ago

I'm using the nightly build, but I have still problems. I will try building the whole sumo from scratch

stefanobortoli commented 5 years ago

I have checked out the code, and tried to build according to the readme instruction. I have problems with the cmake ../.. command. Fresh clone of the master branch. Should I clone some other branch?

`-- Setting build type to 'Release' as none was specified. -- The C compiler identification is GNU 5.4.0 -- The CXX compiler identification is GNU 5.4.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- CMAKE_BINARY_DIR: /home/sbortoli/dev/sumo/sumo/build/cmake-build -- CMAKE_SOURCE_DIR: /home/sbortoli/dev/sumo/sumo

-- Platform: -- Host: Linux-4.4.0-83-generic x86_64 -- Target: Linux-4.4.0-83-generic x86_64 -- CMake: 3.5.1 -- CMake generator: Unix Makefiles -- CMake build tool: /usr/bin/make -- Compiler: GNU 5.4.0

-- Found PythonInterp: /usr/bin/python (found version "2.7.12") -- Found Python: /usr/bin/python CMake Error at CMakeLists.txt:145 (elseif): given arguments:

"STREQUAL" "/machine:x64"

Unknown arguments specified

-- Configuring incomplete, errors occurred! `

stefanobortoli commented 5 years ago

I don't know whether it can help, but also running the example with the TestAPI fails for me. I copied the java classes in a new project, build it, pass the reference to local sumo /usr/bin/sumo-gui installed via ubuntu package, and run the test API. I get the same error as before. I modified the command processor to print the text (many SYSOUT commented) and I could see that at the "name" the string was some how corrupted. So, I guess reading the stringASCII could be the problem. The first one goes well, the second gives the exception. I hope it can help.

namdre commented 5 years ago

There was a regression in 1.0.0 which caused this function in TraaS to be broken. In the meantime, the TraCI protocol for this function changed due to new parameters. This means you need the latest development version of TraaS and SUMO. At least for me, the APITest is working on Ubuntu 16.04. Maybe @behrisch can help with the build issue.

behrisch commented 5 years ago

Did you set SUMO_LIBRARIES? This is in faxct not necessary under Linux and could lead to the observed building behavior (at least with the slightly outdated cmake version shipping with ubuntu 16) I will try to check whether it fails here to. Can you try putting quotes around ${CMAKE_MODULE_LINKER_FLAGS} in the line 145?

behrisch commented 4 years ago

No further feedback received.