Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
288 changes: 288 additions & 0 deletions Assets/Awsim/Scenes/AutowareSimulationDemo.unity
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of instantiating game objects at runtime, it's better to place them in the scene beforehand and toggle their active state during scene initialization.

Original file line number Diff line number Diff line change
Expand Up @@ -13514,6 +13514,47 @@ Transform:
m_Children: []
m_Father: {fileID: 1730261892}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!21 &583704491
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Sprites/Default
m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AlphaTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- PixelSnap: 0
- _EnableExternalAlpha: 0
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _Flip: {r: 1, g: 1, b: 1, a: 1}
- _RendererColor: {r: 1, g: 1, b: 1, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1
--- !u!1 &585038400
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -40400,6 +40441,7 @@ MonoBehaviour:
_nodeName: AWSIM
_timeSourceType: 0
_followCamera: {fileID: 1399028710}
_vrCamera: {fileID: 2146090865}
_commandLineConfigParam: --json_path
_useJsonConfig: 0
_jsonPath: /home/takatokimakino/main/github/tier4/AWSIM/Assets/Awsim/Scenes/AutowareSimulationDemo/sample-config.json
Expand Down Expand Up @@ -41932,6 +41974,171 @@ Transform:
m_Children: []
m_Father: {fileID: 1730261892}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!43 &1811615945
Mesh:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
serializedVersion: 11
m_SubMeshes:
- serializedVersion: 2
firstByte: 0
indexCount: 24
topology: 0
baseVertex: 0
firstVertex: 0
vertexCount: 8
localAABB:
m_Center: {x: 0, y: 0.01, z: 0}
m_Extent: {x: 1.65, y: 0, z: 1.275}
m_Shapes:
vertices: []
shapes: []
channels: []
fullWeights: []
m_BindPose: []
m_BoneNameHashes:
m_RootBoneNameHash: 0
m_BonesAABB: []
m_VariableBoneCountWeights:
m_Data:
m_MeshCompression: 0
m_IsReadable: 1
m_KeepVertices: 1
m_KeepIndices: 1
m_IndexFormat: 0
m_IndexBuffer: 000004000100010004000500010005000200020005000600020006000300030006000700030007000000000007000400
m_VertexData:
serializedVersion: 3
m_VertexCount: 8
m_Channels:
- stream: 0
offset: 0
format: 0
dimension: 3
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 12
format: 0
dimension: 4
- stream: 0
offset: 28
format: 0
dimension: 2
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
m_DataSize: 288
_typelessdata: 0000c03f0ad7233c000090bf000000000000803f0000803f0000803f00000000000000000000c0bf0ad7233c000090bf000000000000803f0000803f0000803f0000803f000000000000c0bf0ad7233c0000903f000000000000803f0000803f0000803f00000000000000000000c03f0ad7233c0000903f000000000000803f0000803f0000803f0000803f000000003333d33f0ad7233c3333a3bf000000000000803f0000803f00000000000000000000803f3333d3bf0ad7233c3333a3bf000000000000803f0000803f000000000000803f0000803f3333d3bf0ad7233c3333a33f000000000000803f0000803f00000000000000000000803f3333d33f0ad7233c3333a33f000000000000803f0000803f000000000000803f0000803f
m_CompressedMesh:
m_Vertices:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_UV:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_Normals:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_Tangents:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_Weights:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_NormalSigns:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_TangentSigns:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_FloatColors:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_BoneIndices:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_Triangles:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_UVInfo: 0
m_LocalAABB:
m_Center: {x: 0, y: 0.01, z: 0}
m_Extent: {x: 1.65, y: 0, z: 1.275}
m_MeshUsageFlags: 0
m_CookingOptions: 30
m_BakedConvexCollisionMesh:
m_BakedTriangleCollisionMesh:
'm_MeshMetrics[0]': 1
'm_MeshMetrics[1]': 1
m_MeshOptimizationFlags: 1
m_StreamData:
serializedVersion: 2
offset: 0
size: 0
path:
--- !u!1 &1813248978
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -49675,6 +49882,85 @@ Transform:
m_Children: []
m_Father: {fileID: 1730261892}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &2146090863
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 5884929512889163408}
m_Modifications:
- target: {fileID: 146900, guid: 4d293c8e162f3874b982baadd71153d2, type: 3}
propertyPath: m_Name
value: '[CameraRig]'
objectReference: {fileID: 0}
- target: {fileID: 146900, guid: 4d293c8e162f3874b982baadd71153d2, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 3}
propertyPath: m_LocalPosition.x
value: -0.473
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 3}
propertyPath: m_LocalPosition.y
value: 0.21
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 3}
propertyPath: m_LocalPosition.z
value: 1.245
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2348914, guid: 4d293c8e162f3874b982baadd71153d2, type: 3}
propertyPath: 'm_Materials.Array.data[0]'
value:
objectReference: {fileID: 583704491}
- target: {fileID: 3380982, guid: 4d293c8e162f3874b982baadd71153d2, type: 3}
propertyPath: m_Mesh
value:
objectReference: {fileID: 1811615945}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 4d293c8e162f3874b982baadd71153d2, type: 3}
--- !u!4 &2146090864 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 3}
m_PrefabInstance: {fileID: 2146090863}
m_PrefabAsset: {fileID: 0}
--- !u!1 &2146090865 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 146900, guid: 4d293c8e162f3874b982baadd71153d2, type: 3}
m_PrefabInstance: {fileID: 2146090863}
m_PrefabAsset: {fileID: 0}
--- !u!33 &451055342981107
MeshFilter:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -205822,6 +206108,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 2146090864}
- {fileID: 6311478900788237898}
- {fileID: 7351119152888337096}
- {fileID: 6078822893280346227}
Expand Down Expand Up @@ -292944,6 +293231,7 @@ MonoBehaviour:
_rightTurnSignalKey: 50
_hazardSignalKey: 51
_noneSignalKey: 52
_switchAutonomousKey: 99
_readonlyVehicleComponent: {fileID: 8966377323996319312}
--- !u!1 &8425860949032774722
GameObject:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

using System;
using UnityEngine;
using UnityEngine.XR.Management;
using Awsim.Common;
using Awsim.UI;
using Awsim.Usecase;
Expand All @@ -34,6 +35,7 @@ public class JsonConfiguration
public int MaxVehicleCount;
public string LogitechG29DevicePath;
public EgoPose EgoPose;
public bool UseVR;
}

[Serializable]
Expand Down Expand Up @@ -71,6 +73,7 @@ public class EgoPose
[SerializeField] string _nodeName = "AWSIM";
[SerializeField] TimeSourceType _timeSourceType;
[SerializeField] FollowCamera _followCamera;
[SerializeField] GameObject _vrCamera;
#pragma warning disable CS0414 // Remove unused private members warning disabled. Warns when built for not UNITY_EDITOR
[SerializeField] string _commandLineConfigParam = "--json_path";
#pragma warning restore CS0414
Expand Down Expand Up @@ -114,6 +117,14 @@ void Start()
var rotation = Quaternion.Euler(jsonConfig.EgoPose.EulerAngles);
_egoVehicle.Initialize(jsonConfig.LogitechG29DevicePath, position, rotation);

if (jsonConfig.UseVR)
{
var xrSettings = XRGeneralSettings.Instance;
xrSettings.Manager.InitializeLoaderSync();
xrSettings.Manager.StartSubsystems();
_vrCamera.gameObject.SetActive(true);
_followCamera.gameObject.SetActive(false);
}
}
else
_egoVehicle.Initialize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"RandomTrafficSeed": 33,
"MaxVehicleCount": 10,
"LogitechG29DevicePath": "/dev/input/event21",
"UseVR": false,
"EgoPose": {
"Position": {
"x": 81381.7265625,
Expand Down
9 changes: 9 additions & 0 deletions Assets/SteamVR.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Assets/SteamVR/Editor.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading