lgsvl / simulator

A ROS/ROS2 Multi-robot Simulator for Autonomous Vehicles
Other
2.27k stars 778 forks source link

How to Add a New Ego Vehicle #1547

Closed DestinyFrank closed 3 years ago

DestinyFrank commented 3 years ago

I am having problems

creating a new ego vehicle in the SVL Simulator. I have been following this tutorial ( https://www.svlsimulator.com/docs/simulation-content/add-new-ego-vehicle/). After completing the steps for preparing the asset in Maya. The main issue I am having is launching the svl simulator from the unity editor. When that wasn't working I tried to continue with setting up the vehicle in Unity. However, I keep getting error messages when I try to Build the simulator in unity. I have also tried to upload the vehicle as a unity asset bundle directly into the website, but it does not match the requested type. Any help would be greatly appreciated. Thank you. s

heeen commented 3 years ago

What operating system/platform are you developing on? Is it 32bit or 64 bit?

DestinyFrank commented 3 years ago

My operating system is 64 bit.

On Tue, Jul 6, 2021 at 5:04 AM Florian Hänel @.***> wrote:

What operating system/platform are you developing on? Is it 32bit or 64 bit?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lgsvl/simulator/issues/1547#issuecomment-874590828, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUSG6MGEKXXUT6YOXD3HVILTWLBI3ANCNFSM473AR3WQ .

heeen commented 3 years ago

Windows or Linux?

DestinyFrank commented 3 years ago

My computer is Windows.

On Tue, Jul 6, 2021 at 10:53 AM Florian Hänel @.***> wrote:

Windows or Linux?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lgsvl/simulator/issues/1547#issuecomment-874831400, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUSG6MFNJSOQUVKUPIE5TP3TWMKHJANCNFSM473AR3WQ .

EricBoiseLGSVL commented 3 years ago

@DestinyFrank hello and awesome you are creating a new vehicle for svl simulator. It is a complex process and I hope I can help.

A few things before building a vehicle:

Let me know how it goes to run the simulator first and then post the errors you are having building. Errors are in the player.log for the binary and in the console window for the Editor.

A few things to check before trying to build again: 1) be sure Linux mono build support is installed in your windows Unity installation. 2) be sure you have the right version installed. 2019.4.18f1 is the version for 2021.1.1 release. 3) be sure you are placing all assets in Assets/External/Vehicles/YourVehicle. 4) vehicle prefab needs to be named YourVehicle.

Try again, post errors and take a screen shot of the vehicle in the Unity Editor with a view of the Hierarchy Panel and a screen shot of the bundle opened with a zip program (the bundle is just a zip and you can open it to see what files are missing).

DestinyFrank commented 3 years ago

@EricBoiseLGSVL Thank you for your help. I was able to build the vehicle in Unity and upload it to the simulator website. I am getting an error that the versions are mismatched. I checked the other vehicles in the library and it seems that the rest are for simulator 3 while ours in simulator 5. Is there a way to change the version or do I need to change building it in Unity. SVL_Simulator_Robot SVL_Simulator_Robot_1

EricBoiseLGSVL commented 3 years ago

Glad to help. We have been updating webui all day today. Try to clear cookies, sign out and sign back in. See if the assets have been updated.

DestinyFrank commented 3 years ago

Hi, @EricBoiseLGSVL I am trying to get the vehicle to show when I run the simulation. I changed the configuration and I am trying to select a bridge to see if that helps. I tried using the ROS bridge because it is the same as the other vehicle I used. However, when I try to select an autopilot it says that it is not compatible with the selected vehicle's bridge. I tried another bridge-type but it says the same thing. Is there a different bridge I need to use or an update? SVL_Capture_5 SVL_Capture_6 SVL_Capture_7

EricBoiseLGSVL commented 3 years ago

Yes we have removed bridges from the source code and posted to github. I recommend creating a new vehicle and use the new bridge in webui. Sorry for the confusion.

DestinyFrank commented 3 years ago

Okay, thank you for letting me know. I am still a little confused about where is the WebUI is? Is there a setting when you upload the AssetBundle to the website or is that in Unity? After trying again I think I fixed the issue with the ROS bridge. I was able to select Autoware.AI v1.12 for the Autopilot and it was able to run the simulation. I am still not able to see our vehicle in the simulation view. SVL_Capture_8 SVL_Capture_9

EricBoiseLGSVL commented 3 years ago

hmm it is loaded. What is the scale? Can you post the bundle here?

DestinyFrank commented 3 years ago

My original scale was 1 I tried I changed it to 2 to see if that would help. The vehicle is still not showing when I run the simulation it does show in the Vehicles Library. SVL_Capture_10

EricBoiseLGSVL commented 3 years ago

Can you run the simulation in the Editor so we can look to see what Unity is spawning? The camera is centered at the spawn point so it seems the issue is the vehicle itself. Please run loader, then the simulation and then open AgentManager under SimulationManager to select the vehicle. Then you can press F to snap to the agent. Let's get a screen shot of the vehicle in the hierarchy panel. Keep the scale at 1,1,1 but we also need to check your mesh import settings. Select the mesh of the vehicle in the Project Panel and then look at the inspector. It has details on the scale the vehicle is imported at.

DestinyFrank commented 3 years ago

I am not able to run the simulation from the Unity editor. When I have tried to run the simulation in unity I have gotten errors. I am also having a hard time finding the settings you are talking about in Unity I apologize.

SVL_Capture_10 SVL_Capture_11 SVL_Capture_12 SVL_Capture_13

DestinyFrank commented 3 years ago

Here is the asset bundle of the vehicle I am using. vehicle_Robot_Medium_ALL_2.zip

EricBoiseLGSVL commented 3 years ago

First off, don't run editor simulation with developer settings. Run the LoaderScene. Then look at the game object that spawns for your vehicle in the Hierarchy Panel while a simulation is running. We need to see what Unity is spawning as an agent. That way you can see if the pivot is off or the mesh is missing.

The meshes look ok but we need to see how you placed the pivot point of the mesh and holder object. Does your pivots look like these? image image

Are the pivots at the bottom of the model, not at the bottom of the chassis?

EricBoiseLGSVL commented 3 years ago

The issue with your build is that webui is not able to get a version from your locally built binary of simulator. We are working on a fix and should push very soon.

DestinyFrank commented 3 years ago

I apologize it been a while since I've used Unity what do you mean by Run the LoaderScene? Here are images where the pivots on the vehicle is this correct? SVL_Capture_15 SVL_Capture_16

EricBoiseLGSVL commented 3 years ago

The pivot in local space is not right I think. Look again at the images I posted and the underline in red. Notice the gizmo is at the bottom of the vehicle, not in the middle. Vehicles are placed at the spawn point at this position in world space. So in simulator, the vehicle is placed mid way in the road collision mesh, and falls through. If you look in the editor when the simulator starts, I bet the vehicle is falling below the map. (Check local space is toggled on in the top left, you cut it out of the image you posted and you can see in mine)

Loaderscene is the scene in the editor you start with play mode to test. It loads the main menu and you can run simulations just like a binary. Look for it in Assets/Scenes.

Doc here video at 0:19 for origin point.

DestinyFrank commented 3 years ago

I changed it to Pivot and local and it seems to be at the right spot below the vehicle. I was able to do the find Loaderscene but when I pressed play it said that it was disconnected and that it does not match the linked version 2021.2. Since I changed to the gizmo setting should I try to build the vehicle again and uploaded it to the website again?

SVL_Capture_17 SVL_Capture_18 SVL_Capture_19 SVL_Capture_20

EricBoiseLGSVL commented 3 years ago

Since the cluster is linked to the binary that is 2021.2 and the editor is technically Development you need to unlink the cluster and link with the editor. Then 2021.2 and the editor will both work. You can also add a data_path to the binary so it uses a different simid and cache folder.

DestinyFrank commented 3 years ago

I deleted that original cluster and connected it to the one in the Loaderscene but it's now saying that is not compatible with the simulation cluster version. SVL_Capture_21 SVL_Capture_22 SVL_Capture_23 SVL_Capture_24

EricBoiseLGSVL commented 3 years ago

You need to replace the old maps/bridge with the new compatible ones in the simulation

DestinyFrank commented 3 years ago

Which bridges and maps are compatible with the simulation? When I am looking at the other maps it's saying that none of them are. Also, we wanted to find a map that was a city area is there another one like the San Francisco one? SVL_Capture_25

EricBoiseLGSVL commented 3 years ago

what webui url are you using? Hit ctrl F5 or delete cookies for the url because you should see updated assets

DestinyFrank commented 3 years ago

I am unsure about WebUI I did not have the option in the simulator tab in unity which is where the tutorial said it would be. Also, I deleted the cookies from the URL and it is still saying it is invalid. SVL_Capture_27

SVL_Capture_26

thisisdavidfrank commented 3 years ago

@DestinyFrank, WebUI is just a term we use for the the user interface on your browser. Please go to the browser where you are seeing this incompatibility errors, and try a hard-refresh (can be done by using Ctrl + F5). This should clear your local browser cache's stale data and reload it with the compatible versions.

EricBoiseLGSVL commented 3 years ago

Why are you on Unity Editor 2020.3.12f1? This is not right. You need to be on 2020.3.3f1 per our documentation. I'm guessing you are on wise.svlsimulator then but you can check in the bottom left in loader scene after hitting play mode. You may need to reclone everything because you are using a version of unity that is not supported

heeen commented 3 years ago

It looks like on wise.svlsimulator.com San Francisco is not marked as compatible with Development & dev.

EricBoiseLGSVL commented 3 years ago

Darn looks like this needs fixed in the back-end. @eagafonovlge

eagafonovlge commented 3 years ago

@DestinyFrank What is the exact version of the simulator your build is based on?

Looks like it is not 2021.2 and it's not 2021.1 either, but something in between. Could you please pick 2021.2 version as the base version for your changes?

DestinyFrank commented 3 years ago

I have tried to download different versions of Unity and the simulator files but I am still really confused. @EricBoiseLGSVL would it be possible to set up a meeting or is there a person I can contact? I have been working on this project for a couple of weeks and I am not sure how to move forward.

EricBoiseLGSVL commented 3 years ago

Once this runs without errors, we can try to find out why you cannot add a new vehicle. Because you are using the wrong Unity version, there is no point in screen sharing. Let's get a clean slate first.

DestinyFrank commented 3 years ago

@EricBoiseLGSVL I followed those steps and was able to load the simulator into Unity. After doing that, I tried to create a simulation, but it would not like me to select a map, but I could choose a vehicle. It's not giving me any error messages telling me why it's not connecting.
SVL_Capture_28 SVL_Capture_29 SVL_Capture_30

EricBoiseLGSVL commented 3 years ago

@DestinyFrank It seems you don't have the assets that supports development. Any idea @eagafonovlge or @thisisdavidfrank ?

EricBoiseLGSVL commented 3 years ago

It looks like those are added but not compatible with the development version. Those may be the old ones though. @DestinyFrank please try to remove all maps in your library in webui maps and then ctrl f5 and then add borregas from the public ones.

DestinyFrank commented 3 years ago

@EricBoiseLGSVL The map says that is it not compatible with the simulation cluster version. Also, I was wondering if you had a chance to try on your end to upload the vehicle with the files I sent? SVL_Capture_32 SVL_Capture_33

EricBoiseLGSVL commented 3 years ago

It seems the the map is not the latest. I'll ping @eagafonovlge and @thisisdavidfrank on this. You are on wise.svlsimulator.com and release 2021.2 right?

DestinyFrank commented 3 years ago

Okay thank you and yes I am on both of those. @EricBoiseLGSVL

eagafonovlge commented 3 years ago

@DestinyFrank Please, unlink the simulator and link it again. It would refresh asset bundle format mapping for your Development simulator version, so 2021.2 release assets would be marked as compatible.

DestinyFrank commented 3 years ago

Thank you! It is now able to run the simulation in the unity editor. @eagafonovlge @EricBoiseLGSVL

SVL_Capture_35

eagafonovlge commented 3 years ago

You are welcome!

DestinyFrank commented 3 years ago

@EricBoiseLGSVL @eagafonovlge Thank you for your help. I looked back at the tutorial to upload a new ego vehicle and it is now able to be seen in the simulation. The only issue I having now is that when I press play the car and the screen seems to freeze. Is there a configuration I need to add or something I missed when creating the assets bundle? SVL_Capture_39 SVL_Capture_41 SVL_Capture_40 SVL_Capture_38

EricBoiseLGSVL commented 3 years ago

When you press play in the UI at the bottom left the simulator freezes? Do you have errors in the console panel?

DestinyFrank commented 3 years ago

Yes, once I click the play button it freezes. I can move the camera around and click the icons until I press the play button and I am not getting any error messages.

EricBoiseLGSVL commented 3 years ago

Are you running the simulator in editor from the LoaderScene? How are you running the simulator? It seems you have the play/pause state inverted.

DestinyFrank commented 3 years ago

@EricBoiseLGSVL I am running the simulation in the LoaderScene. I am clicking run simulation on the website and then pressing play in the game view.

EricBoiseLGSVL commented 3 years ago

Did you change any code for state? The issue I see is that your simulation is paused but the button state is inverted. So when you press play the simulation actually pauses. Do you have any errors in the console panel? If you have an error then the initialization will fail. Please screen shot the console panel or share your editor log? Another thing to check is what testcase template are you running from the webui? What type of simulation are you running in the editor?

DestinyFrank commented 3 years ago

@EricBoiseLGSVL I think that the issue is with the pause button. Once I pressed play I went and pressed the pause button for the game editor and it worked. I can use the arrow keys the move it now and all the wheels are moving in the right way. Thank you so much for your help.

EricBoiseLGSVL commented 3 years ago

Odd, you may have a editor setting that pauses on errors. See here. Glad to help and that you resolved the issue.