Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSSDC SVL based simulator which doesn't require SVL cloud (wise.svlsimulator.com) #1994

Open
mslavescu opened this issue Feb 21, 2022 · 18 comments

Comments

@mslavescu
Copy link

mslavescu commented Feb 21, 2022

UPDATE:
Here is the newly released OSSDC SIM demo:
https://www.youtube.com/watch?v=fU_C38WEwGw

Check/open issues/discussions here:
https://github.com/OSSDC/OSSDC-SIM/issues

https://github.com/OSSDC/OSSDC-SIM-Demos/discussions

Original comment content bellow:

Here is my initial version of SVL simulator that can be used without wise.svlsimulator.com:
https://github.com/OSSDC/simulator/tree/release-2021.3

My plan is to continue the development of SVL Simulator as part of http://OSSDC.org project.
If you'll like to help, join OSSDC Slack at http://join.ossdc.org

A Windows build preset with a few simulations is available here:
https://race.ossdc.org/simulator/simulator-ossdc-20220221.zip

To easily test this build follow these steps::

  • unzip simulator-ossdc-20220221.zip
  • start OSSDC Simulator with run-svl-2021_3-no-svl-cloud.bat
  • launch OSSDC API simulation (already preset)
  • clone https://github.com/OSSDC/F1TENTH_SVL-Simulator
  • run one of these API based simulations scenarios:
    F1TENTH_SVL-Simulator/Python-Scripts$ python3 02_Pure_Pursuit.py
    F1TENTH_SVL-Simulator/Python-Scripts$ python3 03_Multi_Ego.py

I'll add later today a video with a sample run
In next few days I'll add more scripts to run with lgsvl_bridge inside AutowareAuto ADE env (like in my first video in the playlist bellow).

See more of my SVL test videos in this playlist:
SVL simulator racing tests

@JOLOC
Copy link

JOLOC commented Feb 23, 2022

Hi, I would like to know how to use this simulator you proposed, can you update an explanation video on your twitter if possible

@jimaldon
Copy link

@mslavescu any progress on the video? As far as I could find, this is the only effort to make svl independent of wise checks

@tuanngokien
Copy link

tuanngokien commented Apr 26, 2022

Thank you @mslavescu for modifying the simulator so now we don't need to worry much about LGSVL turning down the WISE cloud. Also, in the original post, the author only shared the built preset for Windows, but last time I saw that many people using this simulator were working on Ubuntu too. Thus, I have built @mslavescu's release on Ubuntu 18.04 and want to share the binary with you guys.

Download link: https://drive.google.com/file/d/1FjZSuV3MC8uqi8mvoyZVeN3YwkBwu31o/

Running instruction:

  1. Unzip linux-simulator-ossdc-20220426.zip to folder linux-simulator-ossdc-20220426
  2. Change directory cd linux-simulator-ossdc-20220426
  3. Because the simulator has been built, you only need to open terminal and run ./run_lgsvl_without_wise.sh (as Figure 1)
  4. Choose config OSSDC-API and click Start to have LGSVL run on Python API mode
  5. To run a demo, move inside folder ./F1TENTH_SVL-Simulator-main
    5.1. Install LGSVL Python API dependencies pip3 install --user -e lgsvl-PythonAPI-master/.
    5.2. Run demo script python3 Python-Scripts/01_Spawn_and_drive.py
    5.3. LGSVL now running the scenario (as Figure 2)
Figure 1 Figure 2
Screenshot from 2022-04-26 15-06-59 Screenshot from 2022-04-26 15-01-11

@lintglitch
Copy link

Thank you so much for the work! Do you know if there is a work-around for the Development Settings window when opening the simulator in Unity? With that new scenarios and sensor configuration can be defined.

The Development Settings window always checks for cloud connectivity first and will not open without the WISE server. I've tested it with this fork and the issue remains. If we could disable the check, we could still define new scenarios and test-vehicles after the sunset.

@tuanngokien
Copy link

tuanngokien commented May 6, 2022

Hi @lintglitch,
I took a look at Development Setting in Unity and seems that it's similar to which we have on WISE while creating new simulation. I think I could have idea for your issue, but I need more time to work on it.

Now from Unity, assuming that we could pass WISE connectivity check and have all options for a new simulation config. My question is how we could export this config for using it in simulator, because I don't see any SAVE button in Development Setting popup. If you have done that, could you record a video telling step-by-step that I can follow to create a scenario from Unity?

Screenshot from 2022-05-06 11-44-43

@lintglitch
Copy link

Hey @tuanngokien,
sorry for the late reply. Not sure if you could export the development settings, but I think it should be possible in principal.

The idea behind getting the Development Settings to work is that you can then define any scenario directly within Unity and run them from there. I have used that feature extensively for development of new maps and vehicles, since it allowed me to test them without exporting and uploading them first. If that interests you I can upload a video of my step-to-step to get that working.

Essentially if we can bypass the Development settings check we can create any new map, vehicle or sensor configuration we like. However, the disadvantage is that that approach only works from within Unity.

@tuanngokien
Copy link

Got it, @lintglitch!
Hope you could further give me the video. Thank you!

@lintglitch
Copy link

lintglitch commented May 16, 2022

No problem, here is the video @tuanngokien.

2022-05-16.15-13-45.mov

The feature itself is not well (or at all) documented, but works quite well. Here are the steps I took:

  1. Open a map inside Unity. Note that I haven't uploaded this map or exported it as an assetbundle. It is simply not necessary.
  2. Open the development settings and select the ego-vehicle and sensor configuration you want. Significantly, this step fails when not connected to the cloud. I have selected a custom ego-vehicle that was also not uploaded to the cloud or exported as an asset bundle
  3. Hit play and enjoy.

Everything else works as usual inside SVL. I have been using this approach for some time to accelerate development of new cars and maps. It also has the advantage of allowing you to edit the simulation while it is running, a nice functionality for testing.

Hope the video helps you.

@josh-wende
Copy link

josh-wende commented Jun 1, 2022

Hi,

Thank you for this @mslavescu! How do you launch simulations locally once the simulator executable is built? I can't seem to figure this out.

Also thank you @tuanngokien! How can I get the Python API to load assets from local files though? In Python-Scripts/01_Spawn_and_drive.py, the name parameter for sim.load and sim.add_agent are not the same as the GUIDs listed in 2021.3-ossdc/data.db. If I add a new AssetBundle to 2021.3-ossdc, how do I add that asset to the sim with the Python API? It's clearly getting the map from my local machine, but the different IDs is confusing me.

Thanks in advance for any help!

@mslavescu
Copy link
Author

Here is the OSSDC SIM, based on LG SVL Simulator, to further evolve this amazing project:
https://github.com/OSSDC/OSSDC-SIM

Will provide demos shortly.

@josh-wende
Copy link

@mslavescu great, thanks! I've kinda figured out how most of it works now, I'm currently just struggling to get it to connect to a locally-built Cyber bridge. Definitely going to keep up with the OSSDC project!

@mslavescu
Copy link
Author

mslavescu commented Jun 3, 2022

Here is the first AutowareAuto demo simulation using OSSDC-SIM:

https://github.com/OSSDC/OSSDC-SIM-Demos/blob/main/simulations/LVMS-Dallara-AutowareAuto-2-EGOs/README.md

Please open issues on that project and also join OSSDC Slack here http://join.ossdc.org for further discussions.

@josh-wende could you please open an issue there and add more details about Cyber bridge issues you have.

@lintglitch the latest OSSDC-SIM version supports running the simulation in the Unity editor, you just need to copy these files into the OSSDC-SIM source code project also:

https://github.com/OSSDC/OSSDC-SIM-Demos/blame/main/simulations/LVMS-Dallara-AutowareAuto-2-EGOs/README.md#L28

Open an issue there if you have any problems, and we can chat on OSSDC Slack also.

@josh-wende
Copy link

@mslavescu I will definitely open issues on the new project as they come up. In this case, it turned out that the template vehicle JSON that I was following (I was using the one included in @tuanngokien's shared zip) has the bridgePluginId and bridge fields within the sensorsConfigurations field, but once I moved both of these up to the top level of the JSON it fixed the issues. As such, it wasn't really an issue with the codebase.

@emocat
Copy link

emocat commented Jun 6, 2022

@josh-wende Hi, I'm currently also struggling to get it to connect to a locally-built Cyber bridge, but don't have any clue now. Could you please share your solutions on how to add assets and construct sensor configuration locally? Thanks a lot!

@josh-wende
Copy link

@emocat I was able to figure it out by following the template of the assets included in @tuanngokien's pre-built linux example. The AssetBundles go in the data folder (2021.3-ossdc in this example case), and you need to manually add entries for each new asset to data.db, which is in the data folder as well. Then the simulator looks locally for a JSON that defines the entire map/vehicle. In this example setup it looks for the JSON in wise/api/v1. Follow the template of the JSONs already in there for the map and vehicle, replacing asset GUIDs with the ones from your data.db. The only change to the template I needed was to move the bridgePluginId an bridge fields out of the sensorsConfigurations field and into the top level of the JSON. Hope this helps! (Also feel free to ask this same question at https://github.com/OSSDC/OSSDC-SIM/issues and I will copy my response over there)

@mslavescu
Copy link
Author

We just posted first OSSDC SIM demo video and simulation instructions, see details here:
OSSDC/OSSDC-SIM-Demos#2

@mslavescu
Copy link
Author

Check this comment on how to use other maps and vehicles configs in OSSDC SIM:

OSSDC/OSSDC-SIM#3 (comment)

I also cloned the https://www.svlsimulator.com/docs here:

https://race.ossdc.org/docs/

Search doesn't work but all pages should be there.

@Sam827-r
Copy link

Sam827-r commented Nov 29, 2022

Hi @josh-wende @tuanngokien

I am not able to load assets though Python API to load assets from local files, for while able launch simulator using script ./ run_lgsvl_without_wise.sh
i have gone through both binaries provided by @mslavescu @tuanngokien but no luck.
working on Ubuntu 20.04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants