Coder Social home page Coder Social logo

sidewalklabs / sumo-web3d Goto Github PK

View Code? Open in Web Editor NEW
158.0 13.0 63.0 27.01 MB

Web-based 3D visualization of SUMO microsimulations using TraCI and three.js.

License: Eclipse Public License 2.0

Python 17.62% TypeScript 79.65% CSS 1.38% HTML 0.21% JavaScript 0.66% Shell 0.31% Dockerfile 0.16%

sumo-web3d's People

Contributors

danvk avatar eugenevinitsky avatar uwmyuan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sumo-web3d's Issues

Failed to start server

From a fresh install of sumo-web3d and SUMO_HOME set to C:/Program Files (x86)/DLR/Sumo
sumo-web3d fails to run

See below for the error log:

$ sumo-web3d
Traceback (most recent call last):
  File "c:\tools\anaconda\lib\runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\tools\anaconda\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Tools\anaconda\Scripts\sumo-web3d.exe\__main__.py", line 9, in <module>
  File "c:\tools\anaconda\lib\site-packages\sumo_web3d\server\server.py", line 596, in run
    main(args)
  File "c:\tools\anaconda\lib\site-packages\sumo_web3d\server\server.py", line 560, in main
    scenarios = load_scenarios_file({}, SCENARIOS_PATH)
  File "c:\tools\anaconda\lib\site-packages\sumo_web3d\server\server.py", line 471, in load_scenarios_file
    scenario = Scenario.from_config_json(new_scenario)
  File "c:\tools\anaconda\lib\site-packages\sumo_web3d\server\server.py", line 119, in from_config_json
    for xml in [parse_xml_file(f) for f in additional_files]:
  File "c:\tools\anaconda\lib\site-packages\sumo_web3d\server\server.py", line 119, in <listcomp>
    for xml in [parse_xml_file(f) for f in additional_files]:
  File "c:\tools\anaconda\lib\site-packages\sumo_web3d\server\xml_utils.py", line 10, in parse_xml_file
    return xmltodict.parse(f.read(), attr_prefix='')
  File "c:\tools\anaconda\lib\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 27814: character maps to <undefined>

Vehicle seen on only one of multiple clients

I created a multi client by adding a unique tag when starting traci. After i opened two browser extension (it works). But when i added to car, sometimes ı just see vehicles on one of browser. How can i fix this problem?

Does not load a saved traffic state

Hi,
I am trying to load a saved state using the --load-state option under --sumo-args. Although both Sumo and the web browser are opening, the simulation does not work either in Sumo or in the browser. Any idea how to fix this??

Thanks in advance

Coloring Scheme

Hi,

Thanks for putting this project together! Is there some way to control the controls of the vehicles? It doesn't seem to be drawing the colors from the traci colors and I'm having trouble figuring out where to control the color choices.

Thanks!

Eugene

Support changing the step length from the web UI

It defaults to 1 second which is too jerky for smooth playback.

You can change this via sumo-web3d --sumo-args "--step-length 0.01", but that requires restarting the simulation. SUMO doesn't currently support changing the step length after the simulation has started.

Increasing performance with 10000 cars and bigger maps

I have a project that requires the simulating a network which is quite large, The UI renders it quickly in the beginning but as ore cars are added to the network, the flow slows down. The animation becomes choppy.

The fps gets dropped to 4-5 frames per second which is quite choppy.

In order to reduce the time taken for simulation, I am actually reading the states of the simulation from a DB that I have created. So there is essentially no simulation involved, it is just visualizing how the network performed.

Is there a limit to how many cars/ how large a network can be simulated with this?

When I inspect the performance using chrome webtools, I can see that initially the webGLRenderer takes around 40 milli seconds, but later on it takes up 100ms when there are more cars. See attached figfure.

Screen Shot 2020-08-19 at 2 39 08 PM (2)

Do you have any suggestion in order to speed up rendering for a smooth playback?

Run with Traci

Hello,

Is it possible to start the simulation with TRACI start() method? If not, how can I use Traci with sumo-web3d?

Thanks!

I have successfully installed sumo-web3d, but the following error appears when starting the server. How can I solve it?


$ python setup.py install
running install
running bdist_egg
running egg_info
creating sumo_web3d.egg-info
writing sumo_web3d.egg-info\PKG-INFO
writing dependency_links to sumo_web3d.egg-info\dependency_links.txt
writing entry points to sumo_web3d.egg-info\entry_points.txt
writing requirements to sumo_web3d.egg-info\requires.txt
writing top-level names to sumo_web3d.egg-info\top_level.txt
writing manifest file 'sumo_web3d.egg-info\SOURCES.txt'
reading manifest file 'sumo_web3d.egg-info\SOURCES.txt'

I have successfully installed sumo-web3d, but the following error appears when starting the server. How can I solve it?

 sumo-web3d
Traceback (most recent call last):
  File "D:\Users\Anaconda3\envs\tf2-gpu\Scripts\sumo-web3d-script.py", line 33, in <module>
    sys.exit(load_entry_point('sumo-web3d', 'console_scripts', 'sumo-web3d')())
  File "c:\sumo\tools\sumo-web3d\sumo_web3d\server\server.py", line 608, in run
    main(args)
  File "c:\sumo\tools\sumo-web3d\sumo_web3d\server\server.py", line 588, in main
    app = setup_http_server(task, SCENARIOS_PATH, scenarios)
  File "c:\sumo\tools\sumo-web3d\sumo_web3d\server\server.py", line 518, in setup_http_server
    functools.partial(scenario_attribute_route, scenario_file, scenarios, 'additional', None)
  File "D:\Users\Anaconda3\envs\tf2-gpu\lib\site-packages\aiohttp-4.0.0a1-py3.7-win-amd64.egg\aiohttp\web_urldispatcher.py", line 1069, in add_get
    resource.add_route(hdrs.METH_HEAD, handler, **kwargs)
  File "D:\Users\Anaconda3\envs\tf2-gpu\lib\site-packages\aiohttp-4.0.0a1-py3.7-win-amd64.egg\aiohttp\web_urldispatcher.py", line 294, in add_route
    expect_handler=expect_handler)
  File "D:\Users\Anaconda3\envs\tf2-gpu\lib\site-packages\aiohttp-4.0.0a1-py3.7-win-amd64.egg\aiohttp\web_urldispatcher.py", line 817, in __init__
    resource=resource)
  File "D:\Users\Anaconda3\envs\tf2-gpu\lib\site-packages\aiohttp-4.0.0a1-py3.7-win-amd64.egg\aiohttp\web_urldispatcher.py", line 144, in __init__
    ", got {!r}".format(handler))
TypeError: Only async functions are allowed as web-handlers , got functools.partial(<function send_as_http_response.<locals>.func_wrapper at 0x000001A7A4098048>, 'c:\\sumo\\tools\\sumo-web3d\\sumo_web3d\\server\\..\\scenarios.json', {'bologna-acosta': <sumo_web3d.server.server.Scenario object at 0x000001A7A40A3E48>, 'downtown-toronto': <sumo_web3d.server.server.Scenario object at 0x000001A7A6512B88>, 'queens-quay': <sumo_web3d.server.server.Scenario object at 0x000001A7A4099848>, 'cross3ltl': <sumo_web3d.server.server.Scenario object at 0x000001A7A40C8108>, 'pedestring-striping': <sumo_web3d.server.server.Scenario object at 0x000001A7A4099A48>, 'person-number': <sumo_web3d.server.server.Scenario object at 0x000001A7A4F70BC8>}, 'additional', None)
(tf2-gpu)

frontend code edit

Hi,

I want to change the colour of the roads in frontend. After editing the material.ts file on ubuntu. How to build it so as to see the effect in visualization.

Thanks

Sumo-web3d shows only the word 'loading...' in browser

Hi,
when I run sumo-web3d and point my browser to local host at port 5000, I get the blank page with the word 'loading...'.
From the web console in Firefox, the problem appears to do with a

failure to load index.bundle.js

and also something to do with

index.bundle.js being loaded with the MIME type text/plain which it doesn't regard as a valid JavaScript MIME type.

please does anyone have any idea how I could resolve this.
I have attached screenshots below
Screenshot from 2019-04-01 18-18-44
Screenshot from 2019-04-01 18-14-55

Connection Refused

I want to see SUMO in the web browser with another computer connected to the same network, but I can't. Does sumoweb3d support this? If so, what should I pay attention to in order to do this?

Vehicles are not showing

Hello everyone,

I was able to to visualize map but I did't see any vehicles on road?
How can I fix this issue?

Thank you

No cars etc. in Simulation

Hi,
I am able to run the simulation but I don't any movement in there, just the scenarios can be loaded. Any help will be highly appreciated.

Thank you.
Regards
Nasim

Security Policy violation SECURITY.md

This issue was automatically created by Allstar.

Security Policy Violation
Security policy not enabled.
A SECURITY.md file can give users information about what constitutes a vulnerability and how to report one securely so that information about a bug is not publicly visible. Examples of secure reporting methods include using an issue tracker with private issue support, or encrypted email with a published key.

To fix this, add a SECURITY.md file that explains how to handle vulnerabilities found in your repository. Go to https://github.com/sidewalklabs/sumo-web3d/security/policy to enable.

For more information, see https://docs.github.com/en/code-security/getting-started/adding-a-security-policy-to-your-repository.


This issue will auto resolve when the policy is in compliance.

Issue created by Allstar. See https://github.com/ossf/allstar/ for more information. For questions specific to the repository, please contact the owner or maintainer.

Error in connection handler

Server starts successfully but I get an error when attempting to load a model (any model):

Error in connection handler
Traceback (most recent call last):
File "C:\Python\Python38-32\lib\site-packages\websockets\server.py", line 192, in handler
await self.ws_handler(self, path)
File "C:\Dev\Traffic\SUMO\sumo-web3d-master\sumo-web3d-master\sumo_web3d\server\server.py", line 313, in websocket_simulation_control
sumo_start_fn()
File "C:\Dev\Traffic\SUMO\sumo-web3d-master\sumo-web3d-master\sumo_web3d\server\server.py", line 578, in
lambda: sumo_start_fn(getattr(current_scenario, 'config_file')),
File "C:\Dev\Traffic\SUMO\sumo-web3d-master\sumo-web3d-master\sumo_web3d\server\server.py", line 347, in start_sumo_executable
for light_id in traci.trafficlights.getIDList():
AttributeError: module 'traci' has no attribute 'trafficlights'

Any ideas as to why and how to fix?

Sumo-web3d loads a blank screen for one configuration file

Hi,

I am able to get sumo-web3d to work on all of my sumo config files but for reasons unknown it fails silently on the last one.
The screen looks like so:
image
The relevant config files are attached. I'm really not sure what is happening, nor can I trace the error so any help is appreciated!

cfg.zip

connect SUM to Unity3D

Hello, how can I connect SUMO to Unity3D? I have cloned your projects and simulation is running but unfortunately connection between Unity3D with SUMO is not working.

rou file not accessible

Hi, this is a nice work. I tried it, however, got the following error on Win10 with SUMO 1.1.0. Maybe the mixed use of slash and backslack and bad path .../joined.rou.xml joined_busses.rou.xml lead the problem.

(base) ...>sumo-web3d
Listening on:
    127.0.0.1:5000 (HTTP)
    127.0.0.1:5678 (WebSockets)

Switching to bologna-acosta
Executing ...\Sumo\bin\sumo -c ...\sumo_web3d\server\..\scenarios/bologna-acosta/run.sumo.cfg
Loading configuration... done.
Error: The route file '...\sumo_web3d\server\..\scenarios/bologna-acosta/joined.rou.xml joined_busses.rou.xml' is not accessible.
Quitting (on error).
Error in connection handler
Traceback (most recent call last):
  File "...\websockets\server.py", line 152, in handler
    yield from self.ws_handler(self, path)
  File "...\sumo_web3d\server\server.py", line 309, in websocket_simulation_control
    sumo_start_fn()
  File "...\sumo_web3d\server\server.py", line 565, in <lambda>
    lambda: sumo_start_fn(getattr(current_scenario, 'config_file')),
  File "...\sumo_web3d\server\server.py", line 339, in start_sumo_executable
    traci.start(args)
  File "...\Sumo\tools\traci\__init__.py", line 99, in start
    return getVersion()
  File "...\Sumo\tools\traci\__init__.py", line 208, in getVersion
    return _connections[""].getVersion()
  File "...\Sumo\tools\traci\connection.py", line 337, in getVersion
    result = self._sendExact()
  File "...\Sumo\tools\traci\connection.py", line 99, in _sendExact
    raise FatalTraCIError("connection closed by SUMO")
traci.exceptions.FatalTraCIError: connection closed by SUMO
Traceback (most recent call last):
  File "...\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "...\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "...\sumo-web3d.exe\__main__.py", line 9, in <module>
  File "...\sumo_web3d\server\server.py", line 596, in run
    main(args)
  File "...\sumo_web3d\server\server.py", line 591, in main
    loop.run_forever()
  File "...\lib\asyncio\base_events.py", line 421, in run_forever
    self._run_once()
  File "...\lib\asyncio\base_events.py", line 1390, in _run_once
    event_list = self._selector.select(timeout)
  File "...\lib\selectors.py", line 323, in select
    r, w, _ = self._select(self._readers, self._writers, [], timeout)
  File "...\lib\selectors.py", line 314, in _select
    r, w, x = select.select(r, w, w, timeout)
KeyboardInterrupt

After avoiding use of the relative dir in myown testing files, I cannot get the vehicle animation either.
In the browser,

Stats
time: 0.000 s
payload: 0.0 KB
simulate: 0.00 ms
snapshot: 0.00 ms
Vehicle Summary
Click Summary
N/A

In the cmd,

(base) ...>sumo-web3d -c "...\sim.sumocfg"
Listening on:
    127.0.0.1:5000 (HTTP)
    127.0.0.1:5678 (WebSockets)

Switching to sim.sumocfg
Switching to sim.sumocfg
Executing ...\Sumo\bin\sumo -c ...\sim.sumocfg
Loading configuration... done.
***Starting server on port 16902 ***
Loading net-file from '...\sim.net.xml'... done (2ms).
Warning: Missing yellow phase in tlLogic '65', program '65' for tl-index 0 when switching to phase 1
Loading done.
Simulation started with time: 0.00
...\Sumo\tools\traci\domain.py:113: UserWarning: The domain trafficlights is deprecated, use trafficlight instead.
  self._name, self._deprecatedFor))  # , DeprecationWarning)

Error on installation:sumo-web3d

Complete output (1 lines):
error in sumo-web3d setup command: "values of 'package_data' dict" must be a list of strings (got 'sumo_web3d/static/*')
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Got error while installing web3d

Hello

I tried to install sumo-web3d but I got the error as below:
pip3 install sumo-web3d

 ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-l1m2n5og/sumo-web3d/setup.py'"'"'; __file__='"'"'/tmp/pip-install-l1m2n5og/sumo-web3d/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-l1m2n5og/sumo-web3d/pip-egg-info
         cwd: /tmp/pip-install-l1m2n5og/sumo-web3d/
    Complete output (1 lines):
    error in sumo-web3d setup command: "values of 'package_data' dict" must be a list of strings (got 'sumo_web3d/static/*')
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

I also modified the setup file by changin in to list as it was mentioned in previous issue but it still doesn't work.

Any idea to solve this problem?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.