From 45ac96b92291f1399da28f2efbb4d4bbb695b4b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alptu=C4=9F=20C=C4=B1r=C4=B1t?= Date: Fri, 20 Sep 2024 20:49:50 +0300 Subject: [PATCH] update prefab MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alptuğ Cırıt --- .../AWSIM/Prefabs/UI/Vehicle Dashboard.prefab | 439 ++++++++++++++++-- .../Lexus RX450h 2015 Sample Sensor.prefab | 2 +- Assets/AWSIM/Scripts/UI/VehicleDashboard.cs | 207 ++++++++- .../VPP Integration/AutowareVPPAdapter.cs | 2 - 4 files changed, 589 insertions(+), 61 deletions(-) diff --git a/Assets/AWSIM/Prefabs/UI/Vehicle Dashboard.prefab b/Assets/AWSIM/Prefabs/UI/Vehicle Dashboard.prefab index 12eb4bdad..ae95ca300 100644 --- a/Assets/AWSIM/Prefabs/UI/Vehicle Dashboard.prefab +++ b/Assets/AWSIM/Prefabs/UI/Vehicle Dashboard.prefab @@ -29,17 +29,17 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: - - {fileID: 8953770003924022276} - - {fileID: 490485276830483272} - - {fileID: 1540594835373909981} - {fileID: 8816851931006714352} + - {fileID: 1540594835373909981} + - {fileID: 490485276830483272} + - {fileID: 8953770003924022276} m_Father: {fileID: 1975691864731210933} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} + m_AnchorMin: {x: 0.5, y: 0} + m_AnchorMax: {x: 0.5, y: 0} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} + m_SizeDelta: {x: 125, y: 20} + m_Pivot: {x: 0.5, y: 0} --- !u!114 &6328704028126527298 MonoBehaviour: m_ObjectHideFlags: 0 @@ -53,10 +53,10 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Padding: - m_Left: 33 + m_Left: 30 m_Right: 5 - m_Top: 31 - m_Bottom: 2 + m_Top: 0 + m_Bottom: 0 m_ChildAlignment: 4 m_Spacing: 0 m_ChildForceExpandWidth: 0 @@ -78,7 +78,7 @@ GameObject: - component: {fileID: 6957649927627338177} - component: {fileID: 427228891876868511} m_Layer: 5 - m_Name: ECS + m_Name: ESC m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -124,7 +124,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Color: {r: 0.64705884, g: 0.64705884, b: 0.64705884, a: 1} m_RaycastTarget: 0 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 0 @@ -139,12 +139,91 @@ MonoBehaviour: m_MinSize: 1 m_MaxSize: 44 m_Alignment: 4 - m_AlignByGeometry: 0 + m_AlignByGeometry: 1 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: ESC +--- !u!1 &1382662531356061165 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 248550546147974100} + - component: {fileID: 3558497207769863839} + - component: {fileID: 5189531802717415106} + m_Layer: 5 + m_Name: Mode + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &248550546147974100 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1382662531356061165} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 7328560227402072427} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: -5} + m_SizeDelta: {x: 0, y: -16} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &3558497207769863839 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1382662531356061165} + m_CullTransparentMesh: 1 +--- !u!114 &5189531802717415106 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1382662531356061165} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 12800000, guid: bb5f0ae255e1c3b0bbcf3430971e7be1, type: 3} + m_FontSize: 8 + m_FontStyle: 1 + m_BestFit: 0 + m_MinSize: 1 + m_MaxSize: 44 + m_Alignment: 4 + m_AlignByGeometry: 1 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 m_LineSpacing: 1 - m_Text: ECS + m_Text: Mode --- !u!1 &2296141498424693830 GameObject: m_ObjectHideFlags: 0 @@ -157,7 +236,7 @@ GameObject: - component: {fileID: 8100106727771301704} - component: {fileID: 981123869688330889} m_Layer: 5 - m_Name: Speed + m_Name: Value m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -180,7 +259,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 15, y: -17.5} - m_SizeDelta: {x: 40, y: 35} + m_SizeDelta: {x: 40, y: 30} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &8100106727771301704 CanvasRenderer: @@ -213,7 +292,7 @@ MonoBehaviour: m_FontData: m_Font: {fileID: 12800000, guid: bb5f0ae255e1c3b0bbcf3430971e7be1, type: 3} m_FontSize: 20 - m_FontStyle: 0 + m_FontStyle: 1 m_BestFit: 0 m_MinSize: 1 m_MaxSize: 44 @@ -282,7 +361,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Color: {r: 0.64705884, g: 0.64705884, b: 0.64705884, a: 1} m_RaycastTarget: 0 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 0 @@ -297,7 +376,7 @@ MonoBehaviour: m_MinSize: 1 m_MaxSize: 44 m_Alignment: 4 - m_AlignByGeometry: 0 + m_AlignByGeometry: 1 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -394,7 +473,7 @@ GameObject: - component: {fileID: 5427430749818939450} - component: {fileID: 181175624740186984} m_Layer: 5 - m_Name: Gear + m_Name: Gear Value m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -412,12 +491,12 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 1975691864731210933} + m_Father: {fileID: 1684617300302939515} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: -42.5, y: 0} - m_SizeDelta: {x: -85, y: 0} + m_AnchoredPosition: {x: 0, y: 6} + m_SizeDelta: {x: 0, y: -12} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &5427430749818939450 CanvasRenderer: @@ -450,7 +529,7 @@ MonoBehaviour: m_FontData: m_Font: {fileID: 12800000, guid: bb5f0ae255e1c3b0bbcf3430971e7be1, type: 3} m_FontSize: 26 - m_FontStyle: 0 + m_FontStyle: 1 m_BestFit: 0 m_MinSize: 1 m_MaxSize: 44 @@ -519,7 +598,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Color: {r: 0.64705884, g: 0.64705884, b: 0.64705884, a: 1} m_RaycastTarget: 0 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 0 @@ -534,12 +613,91 @@ MonoBehaviour: m_MinSize: 1 m_MaxSize: 44 m_Alignment: 4 - m_AlignByGeometry: 0 + m_AlignByGeometry: 1 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 m_LineSpacing: 1 m_Text: ASR +--- !u!1 &4377549815302536109 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 350656860517170802} + - component: {fileID: 3792765140210199718} + - component: {fileID: 4090842716936413378} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &350656860517170802 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4377549815302536109} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 7328560227402072427} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 5} + m_SizeDelta: {x: 0, y: -10} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &3792765140210199718 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4377549815302536109} + m_CullTransparentMesh: 1 +--- !u!114 &4090842716936413378 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4377549815302536109} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 12800000, guid: bb5f0ae255e1c3b0bbcf3430971e7be1, type: 3} + m_FontSize: 6 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 1 + m_MaxSize: 44 + m_Alignment: 4 + m_AlignByGeometry: 1 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Control Mode --- !u!1 &4430727111052778003 GameObject: m_ObjectHideFlags: 0 @@ -571,8 +729,9 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: + - {fileID: 7328560227402072427} - {fileID: 1093617847597781306} - - {fileID: 6836526048785689382} + - {fileID: 1684617300302939515} - {fileID: 2344393150607476788} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -631,6 +790,174 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 1c6b35ceba677e70283562903989f306, type: 3} m_Name: m_EditorClassIdentifier: + _speedText: {fileID: 981123869688330889} + _transmissionModeText: {fileID: 4348451483883432348} + _gearText: {fileID: 181175624740186984} + _absText: {fileID: 2143041281713999414} + _tcsText: {fileID: 8693070001430859869} + _escText: {fileID: 427228891876868511} + _asrText: {fileID: 8307860672775780730} + _controlModeText: {fileID: 5189531802717415106} + _systemActiveColor: {r: 0, g: 1, b: 0, a: 1} + _systemInactiveColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + _conrtolModeAutonomousColor: {r: 0, g: 1, b: 1, a: 1} + _controlModeManualColor: {r: 1, g: 1, b: 0, a: 1} +--- !u!1 &4740354333584197100 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1517554950134157378} + - component: {fileID: 6402101578772791781} + - component: {fileID: 4348451483883432348} + m_Layer: 5 + m_Name: Mode + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1517554950134157378 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4740354333584197100} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1684617300302939515} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0} + m_AnchorMax: {x: 0.5, y: 0} + m_AnchoredPosition: {x: 0, y: 4.5} + m_SizeDelta: {x: 40, y: 10} + m_Pivot: {x: 0.5, y: 0} +--- !u!222 &6402101578772791781 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4740354333584197100} + m_CullTransparentMesh: 1 +--- !u!114 &4348451483883432348 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4740354333584197100} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 12800000, guid: bb5f0ae255e1c3b0bbcf3430971e7be1, type: 3} + m_FontSize: 6 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 1 + m_MaxSize: 44 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Gear +--- !u!1 &5123724238643821434 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7328560227402072427} + - component: {fileID: 7666466119684443085} + - component: {fileID: 7883500199592372257} + m_Layer: 5 + m_Name: Control Mode + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &7328560227402072427 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5123724238643821434} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 350656860517170802} + - {fileID: 248550546147974100} + m_Father: {fileID: 1975691864731210933} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 1} + m_AnchorMax: {x: 0.5, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 100, y: 25} + m_Pivot: {x: 0.5, y: 1} +--- !u!222 &7666466119684443085 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5123724238643821434} + m_CullTransparentMesh: 1 +--- !u!114 &7883500199592372257 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5123724238643821434} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.29411766, g: 0.29411766, b: 0.29411766, a: 1} + m_RaycastTarget: 0 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 --- !u!1 &6442091590382499696 GameObject: m_ObjectHideFlags: 0 @@ -640,7 +967,6 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 1093617847597781306} - - component: {fileID: 3521337050448564287} m_Layer: 5 m_Name: Speed m_TagString: Untagged @@ -664,19 +990,11 @@ RectTransform: - {fileID: 2579497655131387953} m_Father: {fileID: 1975691864731210933} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 15, y: 0} - m_SizeDelta: {x: -40, y: 35} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 0} + m_AnchoredPosition: {x: 15, y: 45} + m_SizeDelta: {x: -40, y: 30} m_Pivot: {x: 0.5, y: 1} ---- !u!222 &3521337050448564287 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 6442091590382499696} - m_CullTransparentMesh: 1 --- !u!1 &8524583037465567722 GameObject: m_ObjectHideFlags: 0 @@ -735,7 +1053,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Color: {r: 0.64705884, g: 0.64705884, b: 0.64705884, a: 1} m_RaycastTarget: 0 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 0 @@ -750,9 +1068,46 @@ MonoBehaviour: m_MinSize: 1 m_MaxSize: 44 m_Alignment: 4 - m_AlignByGeometry: 0 + m_AlignByGeometry: 1 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 m_LineSpacing: 1 m_Text: TCS +--- !u!1 &9045880049876511431 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1684617300302939515} + m_Layer: 5 + m_Name: Transmission + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1684617300302939515 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9045880049876511431} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 6836526048785689382} + - {fileID: 1517554950134157378} + m_Father: {fileID: 1975691864731210933} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 0, y: 0.5} + m_AnchoredPosition: {x: 20, y: -12.5} + m_SizeDelta: {x: 40, y: 45} + m_Pivot: {x: 0.5, y: 0.5} diff --git a/Assets/AWSIM/Prefabs/Vehicles/Lexus RX450h 2015 Sample Sensor.prefab b/Assets/AWSIM/Prefabs/Vehicles/Lexus RX450h 2015 Sample Sensor.prefab index ce3047067..e198bad43 100644 --- a/Assets/AWSIM/Prefabs/Vehicles/Lexus RX450h 2015 Sample Sensor.prefab +++ b/Assets/AWSIM/Prefabs/Vehicles/Lexus RX450h 2015 Sample Sensor.prefab @@ -1477,7 +1477,7 @@ MonoBehaviour: m_Script: {fileID: 541707468, guid: b8873f7cd5fec6f49a4b37228b9b23ac, type: 3} m_Name: m_EditorClassIdentifier: - throttleAndBrakeMode: 0 + throttleAndBrakeMode: 1 brakeOnThrottleBackwards: 0 applyClutchOnHandbrake: 1 unlockDrivelineOnHandbrake: 1 diff --git a/Assets/AWSIM/Scripts/UI/VehicleDashboard.cs b/Assets/AWSIM/Scripts/UI/VehicleDashboard.cs index 076c1e3bc..aad4d90b0 100644 --- a/Assets/AWSIM/Scripts/UI/VehicleDashboard.cs +++ b/Assets/AWSIM/Scripts/UI/VehicleDashboard.cs @@ -1,3 +1,5 @@ +using AWSIM.Scripts.Vehicles.VPP_Integration; +using AWSIM.Scripts.Vehicles.VPP_Integration.Enums; using UnityEngine; using UnityEngine.UI; using VehiclePhysics; @@ -7,28 +9,201 @@ namespace AWSIM.Scripts.UI public class VehicleDashboard : MonoBehaviour { private VPVehicleController _vehicleController; - private Text _speedText; - private Text _gearText; - private Text _absText; - private Text _tcsText; - private Text _espText; - private Text _asrText; + private AutowareVPPAdapter _adapter; + + [SerializeField] private Text _speedText; + [SerializeField] private Text _transmissionModeText; + [SerializeField] private Text _gearText; + [SerializeField] private Text _absText; + [SerializeField] private Text _tcsText; + [SerializeField] private Text _escText; + [SerializeField] private Text _asrText; + [SerializeField] private Text _controlModeText; + + [SerializeField] private Color _systemActiveColor = Color.green; + [SerializeField] private Color _systemInactiveColor = Color.gray; + + [SerializeField] private Color _conrtolModeAutonomousColor = Color.cyan; + [SerializeField] private Color _controlModeManualColor = Color.yellow; + + private const float MsToKmH = 3.6f; private void Start() { _vehicleController = FindObjectOfType(); - _speedText = transform.Find("Speed").GetComponent(); - _gearText = transform.Find("Gear").GetComponent(); - _absText = transform.Find("ABS").GetComponent(); - _tcsText = transform.Find("TCS").GetComponent(); - _espText = transform.Find("ESP").GetComponent(); - _asrText = transform.Find("ASR").GetComponent(); + _adapter = FindObjectOfType(); + } + + private void FixedUpdate() + { + UpdateDashboard(); + } + + private void UpdateDashboard() + { + _speedText.text = UpdateSpeed(_vehicleController); + _transmissionModeText.text = UpdateTransmissionMode(_vehicleController); + _gearText.text = UpdateGear(_vehicleController); + UpdateAbsState(_vehicleController, _absText); + UpdateAsrState(_vehicleController, _asrText); + UpdateEscState(_vehicleController, _escText); + UpdateTcsState(_vehicleController, _tcsText); + UpdateControlMode(_adapter, _controlModeText); + } + + private void UpdateControlMode(AutowareVPPAdapter adapter, Text text) + { + if (adapter == null) + { + text.text = "N/A"; + text.color = _systemInactiveColor; + } + else + { + switch (adapter.ControlModeInput) + { + case VPPControlMode.Autonomous: + text.text = "Autonomous"; + text.color = _conrtolModeAutonomousColor; + break; + case VPPControlMode.Manual: + text.text = "Manual"; + text.color = _controlModeManualColor; + break; + case VPPControlMode.NoCommand: + text.text = "NoCommand"; + text.color = _systemInactiveColor; + break; + case VPPControlMode.AutonomousSteerOnly: + text.text = "AutonomousSteerOnly"; + text.color = _systemInactiveColor; + break; + case VPPControlMode.AutonomousVelocityOnly: + text.text = "AutonomousVelocityOnly"; + text.color = _systemInactiveColor; + break; + case VPPControlMode.Disengaged: + text.text = "Disengaged"; + text.color = _systemInactiveColor; + break; + case VPPControlMode.NotReady: + text.text = "Not Ready"; + text.color = _systemInactiveColor; + break; + default: + text.text = "N/A"; + text.color = _systemInactiveColor; + break; + } + } + } + + private static string UpdateSpeed(VPVehicleController vehicle) + { + if (vehicle == null) + { + return "N/A"; + } + + var speedVal = (int)(vehicle.speed * MsToKmH); + // Always return positive + if (speedVal < 0) + { + speedVal = -speedVal; + } + + string speed = speedVal.ToString("F0"); + return speed; + } + + private string UpdateTransmissionMode(VPVehicleController vehicle) + { + if (vehicle == null) + { + return "N/A"; + } + + int modeVal = _vehicleController.data.bus[Channel.Vehicle][VehicleData.GearboxMode]; + + return modeVal switch + { + 0 => "Manual", + 1 => "Park", + 2 => "Reverse", + 3 => "Neutral", + 4 => "Auto", + 5 => "Auto 1", + 6 => "Auto 2", + 7 => "Auto 3", + 8 => "Auto 4", + 9 => "Auto 5", + _ => "N/A" + }; + } + + private string UpdateGear(VPVehicleController vehicle) + { + if (vehicle == null) + { + return "N/A"; + } + + int gearVal = _vehicleController.data.bus[Channel.Vehicle][VehicleData.GearboxGear]; + + return gearVal switch + { + < 0 => "R", + 0 => "N", + > 0 => gearVal.ToString() + }; + } + + private void UpdateAbsState(VPVehicleController vehicle, Text text) + { + if (vehicle.data.bus[Channel.Vehicle][VehicleData.AbsEngaged] != 0) + { + text.color = _systemActiveColor; + } + else + { + text.color = _systemInactiveColor; + } + } + + private void UpdateAsrState(VPVehicleController vehicle, Text text) + { + if (vehicle.data.bus[Channel.Vehicle][VehicleData.AsrEngaged] != 0) + { + text.color = _systemActiveColor; + } + else + { + text.color = _systemInactiveColor; + } + } + + private void UpdateEscState(VPVehicleController vehicle, Text text) + { + if (vehicle.data.bus[Channel.Vehicle][VehicleData.EscEngaged] != 0) + { + text.color = _systemActiveColor; + } + else + { + text.color = _systemInactiveColor; + } } - private void Update() + private void UpdateTcsState(VPVehicleController vehicle, Text text) { - _speedText.text = _vehicleController.speed.ToString("F0"); - // _gearText.text = _vehicleController.data.bus[][VehicleData.GearboxGear].ToString(); + if (vehicle.data.bus[Channel.Vehicle][VehicleData.TcsEngaged] != 0) + { + text.color = _systemActiveColor; + } + else + { + text.color = _systemInactiveColor; + } } } -} \ No newline at end of file +} diff --git a/Assets/AWSIM/Scripts/Vehicles/VPP Integration/AutowareVPPAdapter.cs b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/AutowareVPPAdapter.cs index b53722c84..cb1bafce7 100644 --- a/Assets/AWSIM/Scripts/Vehicles/VPP Integration/AutowareVPPAdapter.cs +++ b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/AutowareVPPAdapter.cs @@ -97,7 +97,6 @@ public class AutowareVPPAdapter : MonoBehaviour // VPP components private VPVehicleController _vehicleController; - private VPStandardInput _standardInput; private VPCameraController _cameraController; [SerializeField] private VPWheelCollider[] _frontWheels; @@ -159,7 +158,6 @@ private void Start() { // get components _vehicleController = GetComponent(); - _standardInput = GetComponent(); _rigidbody = GetComponent(); // set camera target to this vehicle