HARPLab / DReyeVR

VR driving 🚙 + eye tracking 👀 simulator based on CARLA for driving interaction research
https://arxiv.org/abs/2201.01931
MIT License
139 stars 37 forks source link

CarlaUE4 editor crashes after pressing play #97

Closed Dreyevr closed 1 year ago

Dreyevr commented 1 year ago

We tried to use a different map than the default ones from carla using Roadrunner. We followed the steps listed in the carla website and succesfully imported the map into carla (the map injestion steps). To open the map however, we are supposed to open it in the editor and then click on play to use it according to the steps.

But pressing play crashes the editor by displaying fatal error. We did however discover that we can launch DReyeVR by pressing launch instead.

We don't know how this will effect our future experiments. Do you perhaps know where the fault could lie?

We were able to change the default maps using a python script, but it isn't clear how we are supposed to do that with a map exported from roadrunner. Do you maybe know where we could find more info on this?

GustavoSilvera commented 1 year ago

I'm not very familiar with third-party maps and their compatibility with Carla, but I can take a look at your CarlaUE4.log error messages and see if DReyeVR has caused any of these issues. Also are you using the latest version of DReyeVR (0.1.2 as of writing)?

The new versions of DReyeVR (after 0.1.0) enable the EgoVehicle to be spawned into the world after the world has begun simulation.

Dreyevr commented 1 year ago

Here is the log file. The same problems occur for default maps as well, so this doesn't seem like a roadrunner issue.

I am using version 0.1.2. I just cloned the repository (last week) as instructed in the install.md file.

As i said in my previous post, we can open maps with unreal engine if we press launch. However this way we don't get a display in the VR-headset, only the audio.

CarlaUE4.log

GustavoSilvera commented 1 year ago

Okay so according to the logs it looks like not only the SteamVR device is failing to mount but also the SRanipal eye tracking is failing which may cause downstream problems.

Code-wise the HMD is failing because the call to UHeadMountedDisplayFunctionLibrary::IsHeadMountedDisplayEnabled() must be failing. I'm not immediately sure why this is the case, you have SteamVR enabled and running alongside DReyeVR (CarlaUE4 Editor)? This might be a benign warning and the HMD might not be initialized just yet (per this).

However, the SRanipal error is worrisome and the status indicator (3) indicates that the Status == SRanipalEye_Framework::FrameworkStatus::ERROR, suggesting something is awry with your SRanipal installation. For testing purposes can you try disabling SRanipal (in the build file) and trying again? We can diagnose whether SRanipal is the culprit here or something else is.

Dreyevr commented 1 year ago

Doing that does indeed 'solve' the issue.

During the installation of SRanipal, we had to use the following solution: https://www.reddit.com/r/Vive/comments/10ypn77/vive_face_facial_tracker_problems_solved_error/ :

Without this we kept getting errors. Could the problem be here?

When running the packaged version, SRanipal seemed to be working because we had to calibrate it and that went succesfully.

Now after setting the useSRanipal to false and using the editor, we still get a purple indicator that points to where our eyes point to. Does that mean SRanipal is still working then?

GustavoSilvera commented 1 year ago

Interesting, I have never seen this SRanipal installation issue... there could be something funky going on...

As long as the packaged version works with SRanipal then I imagine this is a bug with SRanipal rather than with DReyeVR/Carla/UE4, so I'm not sure we can do much here. The simplest "solution" is to disable SRanipal for your editor builds (make launch) but re-enable it for your shipping/package builds (make package) which you will deploy.

In the editor without SRanipal, the purple debug indicator (wireframe sphere) should just be going in circles, this is the default behavior for when there is no eye tracker attached. If the debug indicator (and screen-space reticle) is actually following your eye gaze then SRanipal is still enabled because otherwise it wouldn't get compiled.

Dreyevr commented 1 year ago

Do you know how to open a custom map using the packaged version? We only succeeded in changing to default maps. This because PythonAPI probably only looks at a specific directory when a map name is specified. After following the steps to import a map, we get a folder called map_packaged.

Should we transfer the files to the place where the default maps are? We wanted to try this but we weren't sure which filed go where.

GustavoSilvera commented 1 year ago

I have actually never tried opening a custom (non Carla default) map in the packaged version, so I may be underqualified to answer this. But I have experienced annoying "cooking" issues with the UE4 package mode and custom assets so I can try to help here:

You should first place your new custom map in the same Unreal/CarlaUE4/Content/Maps/ directory as all the rest, then you'll probably need to edit this config file (DefaultGame.ini) to tell UE4 to "cook" these assets as well.

Specifically you'll want to point UE4 to "Cook" your custom maps, then you should be able to open it in the package mode either through PythonAPI or by changing the default map in the Startup settings here (DefaultEngine.ini).

Dreyevr commented 1 year ago

Last time I said that the issue was resolved after disabling Sranipal. But it seems like the issue has returned.

I again made sure to disable sranipal before executing make launch, but the editor still crashes. I even tried to execute make rebuild and make pythonAPI before hand. Sometimes it does end up working, but only if I launch the editor with make launch. Another weird thing is that even after executing make launch again, the carlaue4 uproject file in carla/unreal/CarlaUE4 file which I use to open the editor shows an older modified date.

This is the log file: CarlaUE4.log

Could you please help me out with this?

GustavoSilvera commented 1 year ago

Interesting. There are no worrying error messages in the logfile which suggests a "FATAL ERROR" on Windows that is hard to debug.

But I do notice that there is a (DReyeVR) warning regarding "No SteamVR head mounted device enabled!" which means there might be some connection issue or you are starting the game in flat-screen-mode.

Unfortunately there is an issue where starting the DReyeVR game in flat-screen mode sometimes causes it to instantly crash like this (no error messages, just dies). But if we then open the game in VR-preview mode, it works fine. We are not sure if this is a bug with UE4, but are looking into it.

Can you try opening DReyeVR in VR-preview mode? What I've personally found is that every other time I open in VR-preview mode, it doesn't enable the VR anyways so its like "flat-screen-mode" but at least it doesn't crash.

Also I just want to make sure you can still run the packaged game, is this correct?

Dreyevr commented 1 year ago

Opening it up in VR-preview mode does seem to do the trick even with SRanipal enabled. We aren't interested in the "flat-screen-mode" anyway. The packaged version works as usual. Thanks for the help.

In an earlier post you told us to put our map in the Unreal/CarlaUE4/Content/Maps/ directory. But the contents of the that directory aren't exactly like the contents in out custom map.

After importing the map from roadrunner like suggested in carla/readthedocs, we have a map that contains 3 folder: Static, Maps and config. Maps contains a NAV, OpenDrive and TM folder along with uassets files and UMAP file. Config contains 2 JSON files and Static more uassets files.

The Unreal/CarlaUE4/Content/Maps/ directory only seems to contain one uasset file per UMAP file(town). They do however have a town11 folder that looks similar to our Maps folder, however it contains more than one UMAP file and also isn't accessible to us using the following script:

import carla

# connect to the CARLA server
client = carla.Client('localhost', 2000)
client.set_timeout(10.0)

# get the world object
world = client.get_world()

# load a new map
new_map = 'Town11'
world = client.load_world(new_map)

We are only able to change to maps 1-7 and 10. Simply moving our whole map folder to Unreal/CarlaUE4/Content/Maps/ wouldn't work in this case since we don't know which path the above script looks in for the new_map. I hope it is clear what I'm trying to say.

Opening the map in the editor does work however. We are just not sure how to open it using the packaged version using a script similar to the one above.

GustavoSilvera commented 1 year ago

Have you added your new map into the +MapsToCook configuration? This should allow you to cook your new maps and access them from the packaged game.