autowarefoundation / AWSIM-Labs

Open source simulator for self-driving vehicles
https://autowarefoundation.github.io/AWSIM-Labs/
Other
15 stars 13 forks source link

Changing sensor kit from the binary #113

Open mozhoku opened 4 months ago

mozhoku commented 4 months ago

Currently the sensor kit is coupled with the vehicle that it is used with. If you were to add a new sensor to the kit you would have to open up the Unity editor and update the vehicle prefab...

We can import the sensor configuration directly to our simulation. When we want to change something in the sensor kit, we just update the sensor kit file that is used by the simulator.

mozhoku commented 1 month ago

Here is my planned diagram for this PR. I will be updating this as I progress.

---
config:
title: Simulator Launch Process
---
flowchart LR
 subgraph LoadVehicleBundle
    direction LR
        vhclA[/"Add new bundle"/]
        vhclB{"Select Vehicle Bundle"}
        vhclA --> vhclB
  end
 subgraph LoadURDF["LoadURDF"]
    direction LR
        urdfA[/"Add new URDF"/]
        urdfB{"Select URDF File"}
        urdfA --> urdfB
  end
 subgraph EgoSetup["EgoSetup"]
        LoadVehicleBundle
        LoadURDF
        egoA["Prepare Ego Prefab"]
        vhclB --> egoA
        urdfB --> egoA
  end
 subgraph LoadEnvironmentBundle
     direction LR
        EnvA[/"Add new bundle"/]
        EnvB{"Select Environment Bundle"}
        EnvA --> EnvB
  end
  subgraph AddNewSpawnPoint
    direction LR
        newSpwnA{Coordinate System?}
        newSpwnB(MGRS)
        newSpwnC(UnityXYZ)
        newSpwnD(Lat-Long)
        newSpwnE[/Enter Coords/]
        newSpwnF[Add to the User Spawn Points]
        newSpwnA --> newSpwnB & newSpwnC & newSpwnD --> newSpwnE --> newSpwnF
  end
  subgraph EnvironmentSetup
    direction LR
        LoadEnvironmentBundle
        AddNewSpawnPoint
        LoadEnvA{Spawn Position?}
        LoadEnvB(Built-in Spawn Points)
        LoadEnvC(User Set Spawn Points)
        LoadEnvD["Prepare Environment Prefab"]
        EnvB --> LoadEnvA --> LoadEnvB & LoadEnvC & newSpwnA
        newSpwnF --> LoadEnvC
        LoadEnvB & LoadEnvC --> LoadEnvD
  end
  subgraph Graphics
    direction LR
        grphcsA[/"Graphic Settings"/]
        grphcsB(Load from last session)
        grphcsB --> grphcsA
  end
  subgraph SimParameters
        simParamsA[/"Sim Parameters"/]
  end
  subgraph Configuration
    direction LR
        EgoSetup
        EnvironmentSetup
        SimParameters
        confA(Create Simulation Configuration)
        confB[/ Name the configuration/]
        LoadEnvD & egoA & simParamsA --> confA
        confA --> confB
  end
  subgraph SimulationConfiguration
    direction LR
        Configuration
        SimConfA["Save Config"]
        SimConfB["Load Config"]
        SimConfA --> SimConfB
        confB --> SimConfA
  end
    SimLaunchA["Simulator Launch"]
    SimLaunchB("Simulator Setup Scene")

    StartSim["Start Simulation"]

    SimLaunchA --> SimLaunchB
    SimLaunchB --> LoadVehicleBundle & LoadURDF & LoadEnvironmentBundle & SimConfB 
    SimLaunchB --> simParamsA
    SimLaunchB --> grphcsA

    SimConfB --> StartSim
    grphcsA --> StartSim