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 9e4eec1aa..d1e13bd08 100644 --- a/Assets/AWSIM/Prefabs/Vehicles/Lexus RX450h 2015 Sample Sensor.prefab +++ b/Assets/AWSIM/Prefabs/Vehicles/Lexus RX450h 2015 Sample Sensor.prefab @@ -1,220 +1,5 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: ---- !u!1 &2122627082 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2122627087} - - component: {fileID: 2122627086} - - component: {fileID: 2122627085} - - component: {fileID: 2122627083} - - component: {fileID: 5709321372887088733} - - component: {fileID: 5944059108174647096} - - component: {fileID: 8532975497371975813} - - component: {fileID: 5116694460979264389} - m_Layer: 6 - m_Name: Main Camera - m_TagString: MainCamera - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &2122627087 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2122627082} - serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -0, y: 2.94, z: -5.21} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 5650763240072318842} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!20 &2122627086 -Camera: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2122627082} - m_Enabled: 1 - serializedVersion: 2 - m_ClearFlags: 1 - m_BackGroundColor: {r: 0, g: 0, b: 0, a: 1} - m_projectionMatrixMode: 1 - m_GateFitMode: 2 - m_FOVAxisMode: 0 - m_Iso: 200 - m_ShutterSpeed: 0.005 - m_Aperture: 16 - m_FocusDistance: 10 - m_FocalLength: 50 - m_BladeCount: 5 - m_Curvature: {x: 2, y: 11} - m_BarrelClipping: 0.25 - m_Anamorphism: 0 - m_SensorSize: {x: 36, y: 24} - m_LensShift: {x: 0, y: 0} - m_NormalizedViewPortRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - near clip plane: 0.3 - far clip plane: 1000 - field of view: 60 - orthographic: 0 - orthographic size: 5 - m_Depth: -1 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingPath: -1 - m_TargetTexture: {fileID: 0} - m_TargetDisplay: 0 - m_TargetEye: 3 - m_HDR: 1 - m_AllowMSAA: 1 - m_AllowDynamicResolution: 0 - m_ForceIntoRT: 0 - m_OcclusionCulling: 1 - m_StereoConvergence: 10 - m_StereoSeparation: 0.022 ---- !u!81 &2122627085 -AudioListener: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2122627082} - m_Enabled: 1 ---- !u!114 &2122627083 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2122627082} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 555e395f453a79e44b909d2fd10efc05, type: 3} - m_Name: - m_EditorClassIdentifier: - target: {fileID: 5650763240072318842} - Distance: 5.48 - Offset: 0 - Height: 2.82 - HeightMultiplier: 0.5 - RotateAroundModeToggle: 99 - RotateAroundSensitivity: 16 - HeightAdjustmentSensitivity: 1 - ZoomSensitivity: 200 - InvertHorzAxis: 0 - InvertVertAxis: 0 - InvertScrollWheel: 0 - MaxHeight: 10 - MinDistance: 1 - MaxDistance: 20 ---- !u!114 &5709321372887088733 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2122627082} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} - m_Name: - m_EditorClassIdentifier: - m_RenderShadows: 1 - m_RequiresDepthTextureOption: 0 - m_RequiresOpaqueTextureOption: 0 - m_CameraType: 0 - m_Cameras: [] - m_RendererIndex: -1 - m_VolumeLayerMask: - serializedVersion: 2 - m_Bits: 1 - m_VolumeTrigger: {fileID: 0} - m_VolumeFrameworkUpdateModeOption: 2 - m_RenderPostProcessing: 1 - m_Antialiasing: 0 - m_AntialiasingQuality: 2 - m_StopNaN: 0 - m_Dithering: 0 - m_ClearDepth: 1 - m_AllowXRRendering: 1 - m_AllowHDROutput: 1 - m_UseScreenCoordOverride: 0 - m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0} - m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0} - m_RequiresDepthTexture: 0 - m_RequiresColorTexture: 0 - m_Version: 2 - m_TaaSettings: - m_Quality: 3 - m_FrameInfluence: 0.1 - m_JitterScale: 1 - m_MipBias: 0 - m_VarianceClampScale: 0.9 - m_ContrastAdaptiveSharpening: 0 ---- !u!65 &5944059108174647096 -BoxCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2122627082} - m_Material: {fileID: 0} - m_IncludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_ExcludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_LayerOverridePriority: 0 - m_IsTrigger: 1 - m_ProvidesContacts: 0 - m_Enabled: 1 - serializedVersion: 3 - m_Size: {x: 0.5, y: 0.5, z: 0.5} - m_Center: {x: 0, y: 0, z: 0} ---- !u!114 &8532975497371975813 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2122627082} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 172515602e62fb746b5d573b38a5fe58, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IsGlobal: 0 - priority: 2 - blendDistance: 0 - weight: 0.7 - sharedProfile: {fileID: 11400000, guid: 5a38341ed3c2637fbbc507134841f2ae, type: 2} ---- !u!1542919678 &5116694460979264389 -StreamingController: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2122627082} - m_Enabled: 1 - m_StreamingMipmapBias: 1 --- !u!1 &473408091835705101 GameObject: m_ObjectHideFlags: 0 @@ -227,7 +12,7 @@ GameObject: - component: {fileID: 8518880599635421855} - component: {fileID: 5184536450966791566} m_Layer: 6 - m_Name: WheelBackRBreaks + m_Name: WheelBackRBrakes m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -299,6 +84,68 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &838235756887781521 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 518119724922739974} + m_Layer: 6 + m_Name: LWheelView + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &518119724922739974 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 838235756887781521} + serializedVersion: 2 + m_LocalRotation: {x: 0.09512418, y: 0.12209804, z: -0.0096093435, w: 0.98790246} + m_LocalPosition: {x: -1.293, y: 0.508, z: 2.024} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 5650763240072318842} + m_LocalEulerAnglesHint: {x: 10, y: 15, z: 0} +--- !u!1 &1067009496288677529 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7828524883346712315} + m_Layer: 6 + m_Name: TopView + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7828524883346712315 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1067009496288677529} + serializedVersion: 2 + m_LocalRotation: {x: 0.052334167, y: -0.008121934, z: 0.00042565202, w: 0.99859655} + m_LocalPosition: {x: 0, y: 1.7, z: 1.47} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 5650763240072318842} + m_LocalEulerAnglesHint: {x: 6, y: -0.932, z: 0} --- !u!1 &1335810017580505941 GameObject: m_ObjectHideFlags: 0 @@ -535,7 +382,7 @@ Transform: m_GameObject: {fileID: 2540743507290084091} serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -0.07, y: 0.936, z: 0.87} + m_LocalPosition: {x: 0.17, y: 1.026, z: 0.87} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] @@ -557,7 +404,7 @@ ReflectionProbe: m_Resolution: 256 m_UpdateFrequency: 0 m_BoxSize: {x: 25, y: 5, z: 25} - m_BoxOffset: {x: -0.2515869, y: 1.5, z: 0.48220825} + m_BoxOffset: {x: 0, y: 1.5, z: 0} m_NearClip: 0.5 m_FarClip: 10 m_ShadowDistance: 10 @@ -606,106 +453,6 @@ Transform: - {fileID: 5260087302461210498} m_Father: {fileID: 4843604171253800091} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &2963106999894261212 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2963106999894261213} - - component: {fileID: 2963106999894261215} - - component: {fileID: 2963106999894261214} - - component: {fileID: 6184538523070301091} - m_Layer: 6 - m_Name: RearLeftWheel - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &2963106999894261213 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2963106999894261212} - serializedVersion: 2 - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -0.9232308, y: 0.494, z: -1.4200822} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 2963107000851346598} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!146 &2963106999894261215 -WheelCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2963106999894261212} - serializedVersion: 2 - m_Center: {x: 0, y: 0, z: 0} - m_Radius: 0.368 - m_SuspensionSpring: - spring: 55000 - damper: 3500 - targetPosition: 0.5 - m_SuspensionDistance: 0.1 - m_ForceAppPointDistance: 0 - m_Mass: 1 - m_WheelDampingRate: 0.25 - m_ForwardFriction: - m_ExtremumSlip: 0 - m_ExtremumValue: 0 - m_AsymptoteSlip: 0 - m_AsymptoteValue: 0 - m_Stiffness: 0 - m_SidewaysFriction: - m_ExtremumSlip: 0 - m_ExtremumValue: 0 - m_AsymptoteSlip: 0 - m_AsymptoteValue: 0 - m_Stiffness: 0 - m_IncludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_ExcludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_LayerOverridePriority: 0 - m_Enabled: 1 - m_ProvidesContacts: 0 ---- !u!114 &2963106999894261214 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2963106999894261212} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: f3a3573a499012749afa3d9b0327ceeb, type: 3} - m_Name: - m_EditorClassIdentifier: - wheelCollider: {fileID: 2963106999894261215} - wheelVisualTransform: {fileID: 2963107000967671469} ---- !u!114 &6184538523070301091 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2963106999894261212} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: a60649e0cdbf2f14ba86692ea3564a00, type: 3} - m_Name: - m_EditorClassIdentifier: - wheelCollider: {fileID: 2963106999894261215} --- !u!1 &2963106999894658623 GameObject: m_ObjectHideFlags: 0 @@ -731,7 +478,7 @@ Transform: m_GameObject: {fileID: 2963106999894658623} serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0.8966711, y: 0.37483424, z: -1.4200822} + m_LocalPosition: {x: 0.9329091, y: 0.41799986, z: -1.4188654} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: @@ -764,7 +511,7 @@ Transform: m_GameObject: {fileID: 2963107000137126779} serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0.8966711, y: 0.3748342, z: 1.3677951} + m_LocalPosition: {x: 0.9329091, y: 0.41799983, z: 1.3690119} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: @@ -802,7 +549,7 @@ Transform: m_ConstrainProportionsScale: 0 m_Children: - {fileID: 4616592093506946199} - - {fileID: 2963107000851346598} + - {fileID: 4781663090331703132} m_Father: {fileID: 5650763240072318842} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &2963107000432534361 @@ -830,7 +577,7 @@ Transform: m_GameObject: {fileID: 2963107000432534361} serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -0.9232308, y: 0.3748342, z: 1.3677951} + m_LocalPosition: {x: -0.8869929, y: 0.41799983, z: 1.3690119} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: @@ -838,106 +585,6 @@ Transform: - {fileID: 2497811141526374608} m_Father: {fileID: 2963107001750233749} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &2963107000584003454 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2963107000584003455} - - component: {fileID: 2963107000584003441} - - component: {fileID: 2963107000584003440} - - component: {fileID: 6938426938036830228} - m_Layer: 6 - m_Name: FrontLeftWheel - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &2963107000584003455 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2963107000584003454} - serializedVersion: 2 - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -0.9232308, y: 0.49399996, z: 1.3677951} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 2963107000851346598} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!146 &2963107000584003441 -WheelCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2963107000584003454} - serializedVersion: 2 - m_Center: {x: 0, y: 0, z: 0} - m_Radius: 0.368 - m_SuspensionSpring: - spring: 55000 - damper: 3500 - targetPosition: 0.5 - m_SuspensionDistance: 0.1 - m_ForceAppPointDistance: 0 - m_Mass: 1 - m_WheelDampingRate: 0.25 - m_ForwardFriction: - m_ExtremumSlip: 0 - m_ExtremumValue: 0 - m_AsymptoteSlip: 0 - m_AsymptoteValue: 0 - m_Stiffness: 0 - m_SidewaysFriction: - m_ExtremumSlip: 0 - m_ExtremumValue: 0 - m_AsymptoteSlip: 0 - m_AsymptoteValue: 0 - m_Stiffness: 0 - m_IncludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_ExcludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_LayerOverridePriority: 0 - m_Enabled: 1 - m_ProvidesContacts: 0 ---- !u!114 &2963107000584003440 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2963107000584003454} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: f3a3573a499012749afa3d9b0327ceeb, type: 3} - m_Name: - m_EditorClassIdentifier: - wheelCollider: {fileID: 2963107000584003441} - wheelVisualTransform: {fileID: 2963107000432534362} ---- !u!114 &6938426938036830228 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2963107000584003454} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: a60649e0cdbf2f14ba86692ea3564a00, type: 3} - m_Name: - m_EditorClassIdentifier: - wheelCollider: {fileID: 2963107000584003441} --- !u!1 &2963107000684425356 GameObject: m_ObjectHideFlags: 0 @@ -1012,42 +659,7 @@ Transform: - {fileID: 6319571051795827989} - {fileID: 5887118019628061719} m_Father: {fileID: 2963107000684425357} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &2963107000851346597 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2963107000851346598} - m_Layer: 6 - m_Name: Wheels - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &2963107000851346598 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2963107000851346597} - serializedVersion: 2 - 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: 2963107000584003455} - - {fileID: 2963107001160131317} - - {fileID: 2963106999894261213} - - {fileID: 2963107001926338969} - m_Father: {fileID: 2963107000290125418} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: 0, y: -0.11, z: 0} --- !u!1 &2963107000967671468 GameObject: m_ObjectHideFlags: 0 @@ -1073,7 +685,7 @@ Transform: m_GameObject: {fileID: 2963107000967671468} serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -0.9232308, y: 0.37483424, z: -1.4200822} + m_LocalPosition: {x: -0.8869929, y: 0.41799986, z: -1.4188654} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: @@ -1081,106 +693,6 @@ Transform: - {fileID: 6190778692868263178} m_Father: {fileID: 2963107001750233749} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &2963107001160131316 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2963107001160131317} - - component: {fileID: 2963107001160131319} - - component: {fileID: 2963107001160131318} - - component: {fileID: 6059146595815256231} - m_Layer: 6 - m_Name: FrontRightWheel - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &2963107001160131317 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2963107001160131316} - serializedVersion: 2 - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0.8966711, y: 0.49399996, z: 1.3677951} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 2963107000851346598} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!146 &2963107001160131319 -WheelCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2963107001160131316} - serializedVersion: 2 - m_Center: {x: 0, y: 0, z: 0} - m_Radius: 0.368 - m_SuspensionSpring: - spring: 55000 - damper: 3500 - targetPosition: 0.5 - m_SuspensionDistance: 0.1 - m_ForceAppPointDistance: 0 - m_Mass: 1 - m_WheelDampingRate: 0.25 - m_ForwardFriction: - m_ExtremumSlip: 0 - m_ExtremumValue: 0 - m_AsymptoteSlip: 0 - m_AsymptoteValue: 0 - m_Stiffness: 0 - m_SidewaysFriction: - m_ExtremumSlip: 0 - m_ExtremumValue: 0 - m_AsymptoteSlip: 0 - m_AsymptoteValue: 0 - m_Stiffness: 0 - m_IncludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_ExcludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_LayerOverridePriority: 0 - m_Enabled: 1 - m_ProvidesContacts: 0 ---- !u!114 &2963107001160131318 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2963107001160131316} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: f3a3573a499012749afa3d9b0327ceeb, type: 3} - m_Name: - m_EditorClassIdentifier: - wheelCollider: {fileID: 2963107001160131319} - wheelVisualTransform: {fileID: 2963107000137126780} ---- !u!114 &6059146595815256231 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2963107001160131316} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: a60649e0cdbf2f14ba86692ea3564a00, type: 3} - m_Name: - m_EditorClassIdentifier: - wheelCollider: {fileID: 2963107001160131319} --- !u!1 &2963107001226707148 GameObject: m_ObjectHideFlags: 0 @@ -1247,106 +759,6 @@ Transform: - {fileID: 2963106999894658608} m_Father: {fileID: 2963107000684425357} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &2963107001926338968 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2963107001926338969} - - component: {fileID: 2963107001926338971} - - component: {fileID: 2963107001926338970} - - component: {fileID: 6977064608666563397} - m_Layer: 6 - m_Name: RearRightWheel - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &2963107001926338969 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2963107001926338968} - serializedVersion: 2 - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0.8966711, y: 0.494, z: -1.4200822} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 2963107000851346598} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!146 &2963107001926338971 -WheelCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2963107001926338968} - serializedVersion: 2 - m_Center: {x: 0, y: 0, z: 0} - m_Radius: 0.368 - m_SuspensionSpring: - spring: 55000 - damper: 3500 - targetPosition: 0.5 - m_SuspensionDistance: 0.1 - m_ForceAppPointDistance: 0 - m_Mass: 1 - m_WheelDampingRate: 0.25 - m_ForwardFriction: - m_ExtremumSlip: 0 - m_ExtremumValue: 0 - m_AsymptoteSlip: 0 - m_AsymptoteValue: 0 - m_Stiffness: 0 - m_SidewaysFriction: - m_ExtremumSlip: 0 - m_ExtremumValue: 0 - m_AsymptoteSlip: 0 - m_AsymptoteValue: 0 - m_Stiffness: 0 - m_IncludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_ExcludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_LayerOverridePriority: 0 - m_Enabled: 1 - m_ProvidesContacts: 0 ---- !u!114 &2963107001926338970 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2963107001926338968} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: f3a3573a499012749afa3d9b0327ceeb, type: 3} - m_Name: - m_EditorClassIdentifier: - wheelCollider: {fileID: 2963107001926338971} - wheelVisualTransform: {fileID: 2963106999894658608} ---- !u!114 &6977064608666563397 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2963107001926338968} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: a60649e0cdbf2f14ba86692ea3564a00, type: 3} - m_Name: - m_EditorClassIdentifier: - wheelCollider: {fileID: 2963107001926338971} --- !u!1 &3053446817831210607 GameObject: m_ObjectHideFlags: 0 @@ -1517,6 +929,65 @@ Transform: - {fileID: 5512666411487739948} m_Father: {fileID: 5650763240072318842} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &3204577569035564864 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1370489772639319545} + - component: {fileID: 718712847548543310} + m_Layer: 6 + m_Name: FR_Col + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1370489772639319545 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3204577569035564864} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.9329091, y: 0.41799983, z: 1.3690119} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4781663090331703132} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &718712847548543310 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3204577569035564864} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1445780741, guid: b8873f7cd5fec6f49a4b37228b9b23ac, type: 3} + m_Name: + m_EditorClassIdentifier: + mass: 15 + radius: 0.365 + center: {x: 0.01, y: 0, z: 0} + suspensionDistance: 0.15 + suspensionAnchor: 0.4 + springRate: 55000 + damperRate: 3000 + suspensionTransform: {fileID: 0} + caliperTransform: {fileID: 0} + wheelTransform: {fileID: 2963107000137126780} + groundPenetration: 0.02 + disableSuspensionMovement: 0 + hideWheelOnDisable: 1 + localSteeringAxis: 1 + localSpinAxis: 0 --- !u!1 &3498665163385352096 GameObject: m_ObjectHideFlags: 0 @@ -1566,6 +1037,65 @@ MonoBehaviour: - {fileID: 5653496621862650956} publishHz: 10 renderInQueue: 1 +--- !u!1 &3774390953481019643 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 948417558862970379} + - component: {fileID: 1206439736759447704} + m_Layer: 6 + m_Name: RR_Col + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &948417558862970379 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3774390953481019643} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.9329091, y: 0.41799986, z: -1.4188654} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4781663090331703132} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1206439736759447704 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3774390953481019643} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1445780741, guid: b8873f7cd5fec6f49a4b37228b9b23ac, type: 3} + m_Name: + m_EditorClassIdentifier: + mass: 15 + radius: 0.365 + center: {x: 0.01, y: 0, z: 0} + suspensionDistance: 0.15 + suspensionAnchor: 0.5 + springRate: 55000 + damperRate: 3000 + suspensionTransform: {fileID: 0} + caliperTransform: {fileID: 0} + wheelTransform: {fileID: 2963106999894658608} + groundPenetration: 0.02 + disableSuspensionMovement: 0 + hideWheelOnDisable: 1 + localSteeringAxis: 1 + localSpinAxis: 0 --- !u!1 &4646002869503629639 GameObject: m_ObjectHideFlags: 0 @@ -1610,11 +1140,15 @@ GameObject: m_Component: - component: {fileID: 5650763240072318842} - component: {fileID: 4981081891045692865} - - component: {fileID: 4981081891045692866} - - component: {fileID: 4981081891045692867} - - component: {fileID: 4981081891045692868} - - component: {fileID: 515532636256791959} - - component: {fileID: 8242141845828784011} + - component: {fileID: 609743776972327103} + - component: {fileID: 3608516095911096369} + - component: {fileID: 447310682229587963} + - component: {fileID: 2034560788105417487} + - component: {fileID: 8627087200372202738} + - component: {fileID: 1469440915397572680} + - component: {fileID: 8380214914162268112} + - component: {fileID: 1782664888259975789} + - component: {fileID: 3543118715908269206} m_Layer: 6 m_Name: Lexus RX450h 2015 Sample Sensor m_TagString: Ego @@ -1640,8 +1174,11 @@ Transform: - {fileID: 2963107000290125418} - {fileID: 2540743507290084090} - {fileID: 635807138616992815} - - {fileID: 2122627087} - {fileID: 1409833042415025234} + - {fileID: 5055317025945945549} + - {fileID: 5271924586409072639} + - {fileID: 7828524883346712315} + - {fileID: 518119724922739974} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!54 &4981081891045692865 @@ -1652,10 +1189,10 @@ Rigidbody: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 4981081891045692864} serializedVersion: 4 - m_Mass: 1800 + m_Mass: 2100 m_Drag: 0 m_AngularDrag: 0 - m_CenterOfMass: {x: 0, y: 0, z: 0} + m_CenterOfMass: {x: 0, y: 0.395, z: 1.185} m_InertiaTensor: {x: 1, y: 1, z: 1} m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1} m_IncludeLayers: @@ -1664,14 +1201,14 @@ Rigidbody: m_ExcludeLayers: serializedVersion: 2 m_Bits: 0 - m_ImplicitCom: 1 + m_ImplicitCom: 0 m_ImplicitTensor: 1 m_UseGravity: 1 m_IsKinematic: 0 m_Interpolate: 1 m_Constraints: 0 m_CollisionDetection: 2 ---- !u!114 &4981081891045692866 +--- !u!114 &609743776972327103 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -1680,31 +1217,320 @@ MonoBehaviour: m_GameObject: {fileID: 4981081891045692864} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 80ebb0e40b62ca443ba1d8ccf61fcbda, type: 3} + m_Script: {fileID: -1898320663, guid: b8873f7cd5fec6f49a4b37228b9b23ac, type: 3} m_Name: m_EditorClassIdentifier: - centerOfMassTransform: {fileID: 2963107001226707149} - useInertia: 0 - inertia: {x: 0, y: 0, z: 0} - sleepVelocityThreshold: 0.02 - sleepTimeThreshold: 0 - SkiddingCancelRate: 0.606 - frontAxle: - leftWheel: {fileID: 2963107000584003440} - rightWheel: {fileID: 2963107001160131318} - rearAxle: - leftWheel: {fileID: 2963106999894261214} - rightWheel: {fileID: 2963107001926338970} - MaxSteerAngleInput: 35 - MaxAccelerationInput: 10 - AutomaticShiftInput: 0 - AccelerationInput: 0 - SteerAngleInput: 0 - PositionInput: {x: 0, y: 0, z: 0} - RotationInput: {x: 0, y: 0, z: 0, w: 0} - WillUpdatePosition: 0 - SignalInput: 0 ---- !u!114 &4981081891045692867 + integrationSteps: 8 + integrationUseRK4: 0 + centerOfMass: {fileID: 2963107001226707149} + tireSideDeflection: 0 + tireSideDeflectionRate: 10 + tireAdherentImpulseRatio: 0.5 + wheelSleepVelocity: 0.2 + advancedSuspensionDamper: 1 + suspensionDamperLimitFactor: 2 + contactAngleAffectsTireForce: 1 + dontAdjustSuspensionForcePoint: 0 + disableSteerAngleFix: 0 + disableWheelReferenceFrameFix: 0 + scaleFactor: 1 + vehicleSleepCriteria: 0 + showContactGizmos: 1 + disableContactProcessing: 0 + inertia: + mode: 3 + inertiaColliders: [] + chassisDimensions: {x: 1.5, y: 0.3, z: 4} + inertiaBias: 1 + inertiaTensor: {x: 2000, y: 2200, z: 700} + inertiaTensorRotation: {x: 0, y: 0, z: 0} + inertiaRow0: {x: 2000, y: 0, z: 0} + inertiaRow1: {x: 0, y: 2200, z: 0} + inertiaRow2: {x: 0, y: 0, z: 400} + steeringAids: + priority: 1 + helpMode: 0 + helpRatio: 1 + helpGravity: 0.4 + limitMode: 0 + limitRatio: 1 + limitProportionality: 1 + limitCustomSlip: 2 + speedControl: + cruiseControl: 0 + cruiseSpeed: 27.777779 + minSpeedForCC: 4.166667 + speedLimiter: 0 + speedLimit: 13.888889 + limitReverseSpeed: 0 + throttleSlope: 1 + axles: + - leftWheel: {fileID: 5429697449238222761} + rightWheel: {fileID: 718712847548543310} + brakeCircuit: 1 + steeringMode: 1 + steeringRatio: 1 + - leftWheel: {fileID: 5439201788990043268} + rightWheel: {fileID: 1206439736759447704} + brakeCircuit: 2 + steeringMode: 0 + steeringRatio: 1 + driveline: + drivenAxles: 1 + firstDrivenAxle: 0 + secondDrivenAxle: 0 + thirdDrivenAxle: 2 + fourthDrivenAxle: 3 + twoDrivenAxlesConfig: 1 + threeDrivenAxlesConfig: 1 + fourDrivenAxlesConfig: 3 + efficiency: 1 + differential: + type: 3 + gearRatio: 4.2 + preload: 0 + powerStiffness: 0.2 + coastStiffness: 0.2 + clutchPreload: 50 + clutchPackFriction: 0.2 + powerAngle: 45 + coastAngle: 80 + torquePreload: 0 + powerRatio: 5 + coastRatio: 5 + centerDifferential: + type: 0 + gearRatio: 1 + preload: 0 + powerStiffness: 0.2 + coastStiffness: 0.2 + clutchPreload: 50 + clutchPackFriction: 0.4 + powerAngle: 45 + coastAngle: 80 + torquePreload: 0 + powerRatio: 5 + coastRatio: 5 + interAxleDifferential: + type: 1 + gearRatio: 1 + preload: 0 + powerStiffness: 0.2 + coastStiffness: 0.2 + clutchPreload: 50 + clutchPackFriction: 0.4 + powerAngle: 45 + coastAngle: 80 + torquePreload: 0 + powerRatio: 5 + coastRatio: 5 + torqueSplitter: + preload: 0 + stiffness: 0.5 + steering: + maxSteerAngle: 40 + toeAngle: 0 + ackerman: 1 + ackermanReference: {fileID: 5055317025945945549} + ratioReference: {fileID: 0} + brakes: + maxBrakeTorque: 2800 + brakeBias: 0.68 + handbrakeTorque: 1500 + handbrakeAxle: 0 + combinedRetarderBrake: 0 + fullBrakeThreshold: 0.8 + tireFriction: + model: 3 + settings: + adherentFriction: 0.8 + peak: {x: 2, y: 1.2} + limit: {x: 12, y: 0.95} + a: 0.6 + b: 0 + c: 0 + d: 0.1 + A: 0.95 + B: 0.8 + C: 1.5 + D: 1.1 + E: -2 + adherent: {x: 0.5, y: -1} + frictionMultiplier: 1 + maxAdherentSpeed: 6.388889 + engine: + idleRpm: 1000 + peakRpm: 7700 + maxRpm: 8000 + idleRpmTorque: 105 + peakRpmTorque: 140 + idleRpmCurveBias: 0.855 + peakRpmCurveBias: 0.5 + inertia: 0.15 + frictionTorque: 20 + rotationalFriction: 0.14 + viscousFriction: 0.0167 + torqueCap: 0 + torqueCapLimit: 290.4 + rpmLimiter: 1 + rpmLimiterMode: 0 + rpmLimiterMax: 6000 + rpmLimiterCutoffTime: 0.075 + idleControl: 1 + maxIdleThrottle: 0.8 + activeIdleRange: 0.25 + activeIdleBias: 0.25 + canStall: 0 + stallBias: 0.8 + stalledFrictionTorque: 25 + starterMotorBias: 0.8 + maxFuelPerRev: 0.16 + fuelDensity: 0.745 + fuelConsumptionCorrection: 3.6 + clutch: + type: 3 + maxTorqueTransfer: 280 + unlockRpm: 0 + lockRpm: 2500 + lockRatioBias: 0.1 + gearbox: + type: 1 + forwardGearRatios: + - 3.76 + - 2.269 + - 1.645 + - 1.187 + - 1 + - 0.843 + reverseGearRatios: + - -3.564 + auto2ndGearMinSpeed: 10 + parkRequiresStopAndBrakes: 0 + allowParkInManual: 0 + manualShiftTime: 0.15 + autoShift: 1 + autoShiftNeutralRpm: 1200 + autoShiftFirstGearRpm: 3000 + autoShiftDownRevs: 3400 + autoShiftUpRevs: 6500 + autoShiftThrottleSens: 0 + autoShiftThrottleSensMin: 0.6 + autoShiftFullThrottleDownRevs: 3000 + autoShiftFullThrottleUpRevs: 4500 + autoShiftUpInterval: 0.6 + autoShiftDownInterval: 0.2 + automaticTransitionTime: 0.5 + automaticShiftInterval: 1 + automaticGearDownRevs: 2000 + automaticGearUpRevs: 5000 + automaticThrottleSens: 0 + automaticThrottleSensMin: 0.6 + automaticFullThrottleGearDownRevs: 3000 + automaticFullThrottleGearUpRevs: 4500 + automaticGearUpRequiresThrottle: 1 + automaticShiftReverseGears: 0 + automaticInitialGearForward: 1 + automaticInitialGearReverse: -1 + antiLock: + enabled: 1 + mode: 0 + trigger: 0 + minSlipOffset: 0.3 + maxSlipOffset: 1.5 + minSlip: 0.5 + maxSlip: 5 + minPressureRatio: 0.25 + valvePositions: 2 + tractionControl: + enabled: 1 + mode: 2 + ratio: 1 + customSlip: 2.1 + stabilityControl: + enabled: 1 + minSpeed: 6 + understeerMinRate: 0.7352941 + understeerMaxRate: 1.7352941 + understeerMinSpeed: 6 + oversteerMinAngle: 6 + oversteerMaxAngle: 14 + oversteerMinSpeed: 10 + antiSpin: + enabled: 1 + maxSpeed: 5.555556 + minRotationDiffRpm: 100 + maxRotationDiffRpm: 400 + maxBrakeTorque: 1000 + engineReactionFactor: 1 + parkModeReactionFactor: 0.95 + maxSubsystemsEnergy: 100000 + "\u202A\u206C\u202D\u206D\u200B\u206E\u202B\u202B\u202D\u206D\u206B\u200E\u206B\u202C\u206B\u202C\u202B\u206F\u202C\u200F\u202B\u202C\u202C\u200B\u206C\u206E\u202A\u202B\u200B\u200B\u200F\u200D\u206F\u202C\u200C\u206F\u202D\u206E\u206D\u206A\u202E": 1 +--- !u!114 &3608516095911096369 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4981081891045692864} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 541707468, guid: b8873f7cd5fec6f49a4b37228b9b23ac, type: 3} + m_Name: + m_EditorClassIdentifier: + throttleAndBrakeMode: 0 + brakeOnThrottleBackwards: 0 + applyClutchOnHandbrake: 1 + unlockDrivelineOnHandbrake: 1 + progressiveSteerMode: 0 + movementRate: 0.25 + autoCenterRate: 0.01 + ignitionKey: 107 + steerAxis: Horizontal + throttleAndBrakeAxis: Vertical + handbrakeAxis: Jump + clutchAxis: Fire1 + gearShiftButton: Fire2 + gearModeSelectButton: Fire3 + keyboardNumbersSelectGears: 0 + neutralGear: 110 + reverseGear: 114 + disableSteerInput: 0 + disableThrottleInput: 0 + disableBrakeInput: 0 + disableClutchInput: 0 + externalThrottle: 0 + reverse: 0 + externalBrake: 0 + externalHandbrake: 0 + externalSteer: 0 + externalClutch: 0 + externalIgnition: 1 + lockBrakesOnEnable: 0 +--- !u!114 &447310682229587963 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4981081891045692864} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -1603333029, guid: b8873f7cd5fec6f49a4b37228b9b23ac, type: 3} + m_Name: + m_EditorClassIdentifier: + lookAtPoint: {fileID: 2963107001226707149} + attachToPoint: {fileID: 518119724922739974} + driverCameraIsInterior: 0 + viewDistance: 6.5 + viewHeight: 2 + viewDamping: 3 + viewMinDistance: 3 + viewMinAngle: 0 + targetRadius: 5 + useCustomCameras: 0 + currentCustomCamera: 0 + customCameras: [] +--- !u!114 &2034560788105417487 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -1713,13 +1539,69 @@ MonoBehaviour: m_GameObject: {fileID: 4981081891045692864} m_Enabled: 0 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 1a266bb6c1315a6418ca5f241f8e20e0, type: 3} + m_Script: {fileID: -153239313, guid: b8873f7cd5fec6f49a4b37228b9b23ac, type: 3} + m_Name: + m_EditorClassIdentifier: + showTelemetry: 1 + showSuspensionAs: 0 + loadUnits: 0 + tireData: 0 + enableHotKey: 1 + hotKey: 98 + screenPosition: {x: 8, y: 8} + font: {fileID: 12800000, guid: 68e91a955efe04085922337eb01d7626, type: 3} + showCenterOfMass: 1 + gizmosAtPhysicPositions: 0 + showWheelGizmos: 1 + showLocalFrame: 1 + showContactPoints: 1 + showTireSlip: 1 + showTireForces: 1 + showSurfaceForces: 0 + useLogScale: 1 +--- !u!114 &8627087200372202738 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4981081891045692864} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -897142050, guid: b8873f7cd5fec6f49a4b37228b9b23ac, type: 3} m_Name: m_EditorClassIdentifier: - vehicle: {fileID: 4981081891045692866} - maxAcceleration: 1.5 - maxSteerAngle: 35 ---- !u!114 &4981081891045692868 + steeringWheel: {fileID: 0} + degreesOfRotation: 600 + localRotationAxis: 2 + brakeLightsOn: + - {fileID: 0} + - {fileID: 0} + brakeLightsOff: [] + reverseLightsOn: + - {fileID: 0} + reverseLightsOff: [] + headLightsOn: + - {fileID: 0} + - {fileID: 0} + headLightsOff: [] + headLightsEnabled: 0 + headLightsToggleKey: 108 + rpmGauge: {fileID: 0} + rpmMax: 7000 + rpmMinAngle: 0 + rpmMaxAngle: -270 + speedGauge: {fileID: 0} + speedMaxKph: 220 + speedMinAngle: 0 + speedMaxAngle: -270 + dashboardOn: [] + dashboardOff: [] + stalledLightsOn: {fileID: 0} + stalledLightsOff: {fileID: 0} + handbrakeLightsOn: {fileID: 0} + handbrakeLightsOff: {fileID: 0} +--- !u!114 &1469440915397572680 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -1728,32 +1610,19 @@ MonoBehaviour: m_GameObject: {fileID: 4981081891045692864} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: f007404cf74b1ec4e9b45aae2bf9d900, type: 3} + m_Script: {fileID: 11500000, guid: 0dbceea492288af5a9a663c606ad86a8, type: 3} m_Name: m_EditorClassIdentifier: - vehicle: {fileID: 4981081891045692866} - brakeLights: - - meshRenderer: {fileID: 8794606528374986436} - materialIndex: 0 - lightingColor: {r: 1, g: 0, b: 0, a: 1} - emissionIntensity: 10 - leftTurnSignalLights: - - meshRenderer: {fileID: 4161163181542201040} - materialIndex: 0 - lightingColor: {r: 1, g: 1, b: 0, a: 1} - emissionIntensity: 10 - rightTurnSignalLights: - - meshRenderer: {fileID: 8262602167162004868} - materialIndex: 0 - lightingColor: {r: 1, g: 1, b: 0, a: 1} - emissionIntensity: 10 - turnSignalTimerIntervalSec: 0.5 - reverseLights: - - meshRenderer: {fileID: 2064283678226759879} - materialIndex: 0 - lightingColor: {r: 1, g: 1, b: 1, a: 1} - emissionIntensity: 10 ---- !u!114 &515532636256791959 + _frontWheels: + - {fileID: 5429697449238222761} + - {fileID: 718712847548543310} + _simulateSteering: 0 + _steerWheelInput: 45 + _emergencyBrakePercent: 100 + _updatePositionOffsetY: 1.33 + _updatePositionRayOriginY: 1000 + _doPedalCalibration: 0 +--- !u!114 &8380214914162268112 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -1762,27 +1631,69 @@ MonoBehaviour: m_GameObject: {fileID: 4981081891045692864} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: bf5efb70a440286439770e3549221730, type: 3} + m_Script: {fileID: 11500000, guid: 7ca678817e2c893b797f2e68f1cd5d67, type: 3} m_Name: m_EditorClassIdentifier: + _adapter: {fileID: 1469440915397572680} + controlModeTopic: /vehicle/status/control_mode turnIndicatorsCommandTopic: /control/command/turn_indicators_cmd hazardLightsCommandTopic: /control/command/hazard_lights_cmd - ackermannControlCommandTopic: /control/command/control_cmd + controlCommandTopic: /control/command/control_cmd gearCommandTopic: /control/command/gear_cmd vehicleEmergencyStampedTopic: /control/command/emergency_cmd positionTopic: /initialpose + actuationCommandTopic: /control/command/actuation_cmd qosSettings: ReliabilityPolicy: 1 DurabilityPolicy: 1 HistoryPolicy: 1 Depth: 1 - vehicle: {fileID: 4981081891045692866} - positionQosInput: + positionQosSettings: + ReliabilityPolicy: 1 + DurabilityPolicy: 2 + HistoryPolicy: 1 + Depth: 1 + _actuationQosSettings: ReliabilityPolicy: 1 DurabilityPolicy: 2 HistoryPolicy: 1 Depth: 1 ---- !u!114 &8242141845828784011 +--- !u!114 &1782664888259975789 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4981081891045692864} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e59ef37f82b1643d0a1d62edf54a2c1b, type: 3} + m_Name: + m_EditorClassIdentifier: + _adapter: {fileID: 1469440915397572680} + _vpVehicle: {fileID: 609743776972327103} + brakeLights: + - meshRenderer: {fileID: 8794606528374986436} + materialIndex: 0 + lightingColor: {r: 1.4980392, g: 0, b: 0, a: 0} + emissionIntensity: 0 + leftTurnSignalLights: + - meshRenderer: {fileID: 4161163181542201040} + materialIndex: 0 + lightingColor: {r: 5.9921575, g: 1.7623993, b: 0, a: 0} + emissionIntensity: 0 + rightTurnSignalLights: + - meshRenderer: {fileID: 8262602167162004868} + materialIndex: 0 + lightingColor: {r: 8, g: 2.3529413, b: 0, a: 0} + emissionIntensity: 0 + _turnSignalTimerIntervalSec: 0.5 + _reverseLights: + - meshRenderer: {fileID: 2064283678226759879} + materialIndex: 0 + lightingColor: {r: 1.4980391, g: 1.4980391, b: 1.4980391, a: 0} + emissionIntensity: 0 +--- !u!114 &3543118715908269206 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -2007,6 +1918,37 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &5820302155297621449 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5055317025945945549} + m_Layer: 6 + m_Name: Ackerman + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5055317025945945549 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5820302155297621449} + serializedVersion: 2 + m_LocalRotation: {x: 0.008726558, y: 0, z: 0, w: 0.999962} + m_LocalPosition: {x: 0, y: 0, z: -0.018} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 5650763240072318842} + m_LocalEulerAnglesHint: {x: 1, y: 0, z: 0} --- !u!1 &5882984195825941695 GameObject: m_ObjectHideFlags: 0 @@ -2019,7 +1961,7 @@ GameObject: - component: {fileID: 7137444068976389817} - component: {fileID: 8599611685803511614} m_Layer: 6 - m_Name: WheelFrontLBreaks + m_Name: WheelFrontLBrakes m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -2091,6 +2033,65 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &5889245242532048299 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3963035686871509477} + - component: {fileID: 5439201788990043268} + m_Layer: 6 + m_Name: RL_Col + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3963035686871509477 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5889245242532048299} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0.8869929, y: 0.41799986, z: -1.4188654} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4781663090331703132} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5439201788990043268 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5889245242532048299} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1445780741, guid: b8873f7cd5fec6f49a4b37228b9b23ac, type: 3} + m_Name: + m_EditorClassIdentifier: + mass: 15 + radius: 0.365 + center: {x: -0.05, y: 0, z: 0} + suspensionDistance: 0.15 + suspensionAnchor: 0.5 + springRate: 55000 + damperRate: 3000 + suspensionTransform: {fileID: 0} + caliperTransform: {fileID: 0} + wheelTransform: {fileID: 2963107000967671469} + groundPenetration: 0.02 + disableSuspensionMovement: 0 + hideWheelOnDisable: 1 + localSteeringAxis: 1 + localSpinAxis: 0 --- !u!1 &6171037601245593386 GameObject: m_ObjectHideFlags: 0 @@ -2342,6 +2343,59 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &6520392831073867478 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8745532041232132092} + - component: {fileID: 8325512660630331110} + m_Layer: 6 + m_Name: Aero + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8745532041232132092 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6520392831073867478} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.754, z: 0.2} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 5271924586409072639} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &8325512660630331110 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6520392831073867478} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1257740466, guid: b8873f7cd5fec6f49a4b37228b9b23ac, type: 3} + m_Name: + m_EditorClassIdentifier: + dragModel: 0 + dragCoefficientQuadratic: 0.33 + dragCoefficientCubic: 0.3 + dragMixedRefSpeed: 25 + dragMixedRefForce: 4000 + dragMixedShapeTerm: 0.2 + dragMixedLinearTerm: 0.1 + downforceCoefficient: 1 + showDebugLabel: 0 --- !u!1 &6554901054073138485 GameObject: m_ObjectHideFlags: 0 @@ -2386,7 +2440,7 @@ GameObject: - component: {fileID: 1364964082971548906} - component: {fileID: 3172526087419228044} m_Layer: 6 - m_Name: WheelFrontRBreaks + m_Name: WheelFrontRBrakes m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -2470,7 +2524,7 @@ GameObject: - component: {fileID: 4281955748508215573} - component: {fileID: 3817426283622898669} m_Layer: 6 - m_Name: WheelBackLBreaks + m_Name: WheelBackLBrakes m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -2748,7 +2802,7 @@ Transform: m_GameObject: {fileID: 7304948738224020340} serializedVersion: 2 m_LocalRotation: {x: 0.82533914, y: 2.894371e-17, z: 2.8943695e-17, w: 0.56463736} - m_LocalPosition: {x: -0.50177336, y: 1.0825666, z: -1.0134895} + m_LocalPosition: {x: -0.4869, y: 1.0825666, z: 0.4108} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] @@ -3001,6 +3055,65 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &8142014580109698536 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5670635155968876956} + - component: {fileID: 5429697449238222761} + m_Layer: 6 + m_Name: FL_Col + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5670635155968876956 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8142014580109698536} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0.887, y: 0.418, z: 1.369} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4781663090331703132} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5429697449238222761 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8142014580109698536} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1445780741, guid: b8873f7cd5fec6f49a4b37228b9b23ac, type: 3} + m_Name: + m_EditorClassIdentifier: + mass: 15 + radius: 0.365 + center: {x: -0.05, y: 0, z: 0} + suspensionDistance: 0.15 + suspensionAnchor: 0.4 + springRate: 55000 + damperRate: 3000 + suspensionTransform: {fileID: 0} + caliperTransform: {fileID: 0} + wheelTransform: {fileID: 2963107000432534362} + groundPenetration: 0.02 + disableSuspensionMovement: 0 + hideWheelOnDisable: 1 + localSteeringAxis: 1 + localSpinAxis: 0 --- !u!1 &8211390332096081473 GameObject: m_ObjectHideFlags: 0 @@ -3251,6 +3364,99 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &8694826825807246079 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5271924586409072639} + - component: {fileID: 1611083234106224468} + - component: {fileID: 7226978134186799435} + - component: {fileID: 7824200548975616440} + m_Layer: 6 + m_Name: Dynamics + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5271924586409072639 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8694826825807246079} + serializedVersion: 2 + m_LocalRotation: {x: 0.008726558, y: 0, z: 0, w: 0.999962} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 8745532041232132092} + m_Father: {fileID: 5650763240072318842} + m_LocalEulerAnglesHint: {x: 1, y: 0, z: 0} +--- !u!114 &1611083234106224468 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8694826825807246079} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -1799796719, guid: b8873f7cd5fec6f49a4b37228b9b23ac, type: 3} + m_Name: + m_EditorClassIdentifier: + dynamicModel: 0 + dynamicCoefficient: 0.04 + staticCoefficient: 0.004 + staticSpeedThreshold: 2 + axleFrictionFactors: [] + showDebugLabel: 0 + coefficient: -1 + version: 1 +--- !u!114 &7226978134186799435 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8694826825807246079} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -674611101, guid: b8873f7cd5fec6f49a4b37228b9b23ac, type: 3} + m_Name: + m_EditorClassIdentifier: + axle: 0 + mode: 0 + stiffness: 0.7 + springRate: 20000 + antiRollRate: 20000 + rigidity: 0.5 + emitTelemetry: 0 +--- !u!114 &7824200548975616440 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8694826825807246079} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -674611101, guid: b8873f7cd5fec6f49a4b37228b9b23ac, type: 3} + m_Name: + m_EditorClassIdentifier: + axle: 1 + mode: 0 + stiffness: 0.3 + springRate: 20000 + antiRollRate: 20000 + rigidity: 0.5 + emitTelemetry: 0 --- !u!1 &8742333904353133501 GameObject: m_ObjectHideFlags: 0 @@ -3335,6 +3541,41 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &8885795722780476556 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4781663090331703132} + m_Layer: 6 + m_Name: WheelsVPP + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4781663090331703132 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8885795722780476556} + serializedVersion: 2 + 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: 5670635155968876956} + - {fileID: 1370489772639319545} + - {fileID: 3963035686871509477} + - {fileID: 948417558862970379} + m_Father: {fileID: 2963107000290125418} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &8904802372398452593 GameObject: m_ObjectHideFlags: 0 @@ -3554,20 +3795,52 @@ PrefabInstance: propertyPath: m_Name value: VehicleStatusSensor objectReference: {fileID: 0} - - target: {fileID: 3932027664973163071, guid: 72652f08acec776488e01c42ef2e9ab1, type: 3} - propertyPath: vehicle - value: - objectReference: {fileID: 4981081891045692866} - m_RemovedComponents: [] + m_RemovedComponents: + - {fileID: 3932027664973163071, guid: 72652f08acec776488e01c42ef2e9ab1, type: 3} m_RemovedGameObjects: [] m_AddedGameObjects: [] - m_AddedComponents: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 3443857259492923294, guid: 72652f08acec776488e01c42ef2e9ab1, type: 3} + insertIndex: -1 + addedObject: {fileID: 6426191544371659831} m_SourcePrefab: {fileID: 100100000, guid: 72652f08acec776488e01c42ef2e9ab1, type: 3} --- !u!4 &1028604030829351293 stripped Transform: m_CorrespondingSourceObject: {fileID: 213128046543285247, guid: 72652f08acec776488e01c42ef2e9ab1, type: 3} m_PrefabInstance: {fileID: 915210659027548802} m_PrefabAsset: {fileID: 0} +--- !u!1 &2555919029177232668 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 3443857259492923294, guid: 72652f08acec776488e01c42ef2e9ab1, type: 3} + m_PrefabInstance: {fileID: 915210659027548802} + m_PrefabAsset: {fileID: 0} +--- !u!114 &6426191544371659831 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2555919029177232668} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a8d1cd8ae6a65d2f3bd79183dfecd210, type: 3} + m_Name: + m_EditorClassIdentifier: + _adapter: {fileID: 1469440915397572680} + _controlModeReportTopic: /vehicle/status/control_mode + _gearReportTopic: /vehicle/status/gear_status + _steeringReportTopic: /vehicle/status/steering_status + _turnIndicatorsReportTopic: /vehicle/status/turn_indicators_status + _hazardLightsReportTopic: /vehicle/status/hazard_lights_status + _velocityReportTopic: /vehicle/status/velocity_status + _ActuationStatusTopic: /vehicle/status/actuation_status + _frameId: base_link + _publishHz: 30 + _qosSettings: + ReliabilityPolicy: 1 + DurabilityPolicy: 2 + HistoryPolicy: 1 + Depth: 1 --- !u!1001 &2465439770172797818 PrefabInstance: m_ObjectHideFlags: 0 diff --git a/Assets/AWSIM/Scenes/Composition/AWSIMSimulation.unity b/Assets/AWSIM/Scenes/Composition/AWSIMSimulation.unity index 09c624c3a..8b3b862eb 100644 --- a/Assets/AWSIM/Scenes/Composition/AWSIMSimulation.unity +++ b/Assets/AWSIM/Scenes/Composition/AWSIMSimulation.unity @@ -643,8 +643,6 @@ MonoBehaviour: m_EditorClassIdentifier: _cardTopBarButton: {fileID: 1260265816} _barChevronRect: {fileID: 1997208415} - _chevronExpandedDegrees: 90 - _chevronCollapsedDegrees: 0 _isCardOpen: 1 ElementHeight: 30 ElementSpacing: 5 @@ -791,6 +789,7 @@ Transform: - {fileID: 1232284682541564030} - {fileID: 1232284682054556268} - {fileID: 1955430582} + - {fileID: 1150880498} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &131919678 @@ -3784,8 +3783,6 @@ MonoBehaviour: m_EditorClassIdentifier: _cardTopBarButton: {fileID: 830995974} _barChevronRect: {fileID: 933050327} - _chevronExpandedDegrees: 90 - _chevronCollapsedDegrees: 0 _isCardOpen: 1 ElementHeight: 30 ElementSpacing: 5 @@ -4653,8 +4650,8 @@ MonoBehaviour: m_TargetGraphic: {fileID: 1668138103} m_HandleRect: {fileID: 1668138102} m_Direction: 2 - m_Value: 1 - m_Size: 0.75574714 + m_Value: 0 + m_Size: 1 m_NumberOfSteps: 0 m_OnValueChanged: m_PersistentCalls: @@ -5516,8 +5513,6 @@ MonoBehaviour: m_EditorClassIdentifier: _cardTopBarButton: {fileID: 1046157539} _barChevronRect: {fileID: 412352509} - _chevronExpandedDegrees: 90 - _chevronCollapsedDegrees: 0 _isCardOpen: 1 ElementHeight: 30 ElementSpacing: 5 @@ -5769,6 +5764,221 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 985529871} m_CullTransparentMesh: 1 +--- !u!1 &1028782402 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1028782403} + - component: {fileID: 1028782410} + - component: {fileID: 1028782409} + - component: {fileID: 1028782408} + - component: {fileID: 1028782407} + - component: {fileID: 1028782406} + - component: {fileID: 1028782405} + - component: {fileID: 1028782404} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1028782403 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1028782402} + serializedVersion: 2 + 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: 1150880498} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1542919678 &1028782404 +StreamingController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1028782402} + m_Enabled: 1 + m_StreamingMipmapBias: 1 +--- !u!114 &1028782405 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1028782402} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 172515602e62fb746b5d573b38a5fe58, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IsGlobal: 0 + priority: 2 + blendDistance: 0 + weight: 0.7 + sharedProfile: {fileID: 11400000, guid: 5a38341ed3c2637fbbc507134841f2ae, type: 2} +--- !u!65 &1028782406 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1028782402} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 1 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 0.5, y: 0.5, z: 0.5} + m_Center: {x: 0, y: 0, z: 0} +--- !u!114 &1028782407 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1028782402} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RenderShadows: 1 + m_RequiresDepthTextureOption: 0 + m_RequiresOpaqueTextureOption: 0 + m_CameraType: 0 + m_Cameras: [] + m_RendererIndex: -1 + m_VolumeLayerMask: + serializedVersion: 2 + m_Bits: 1 + m_VolumeTrigger: {fileID: 0} + m_VolumeFrameworkUpdateModeOption: 2 + m_RenderPostProcessing: 1 + m_Antialiasing: 0 + m_AntialiasingQuality: 2 + m_StopNaN: 0 + m_Dithering: 0 + m_ClearDepth: 1 + m_AllowXRRendering: 1 + m_AllowHDROutput: 1 + m_UseScreenCoordOverride: 0 + m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0} + m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0} + m_RequiresDepthTexture: 0 + m_RequiresColorTexture: 0 + m_Version: 2 + m_TaaSettings: + m_Quality: 3 + m_FrameInfluence: 0.1 + m_JitterScale: 1 + m_MipBias: 0 + m_VarianceClampScale: 0.9 + m_ContrastAdaptiveSharpening: 0 +--- !u!114 &1028782408 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1028782402} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 555e395f453a79e44b909d2fd10efc05, type: 3} + m_Name: + m_EditorClassIdentifier: + target: {fileID: 0} + Distance: 5.48 + Offset: 0 + Height: 2.82 + HeightMultiplier: 0.5 + RotateAroundModeToggle: 99 + RotateAroundSensitivity: 16 + HeightAdjustmentSensitivity: 1 + ZoomSensitivity: 200 + InvertHorzAxis: 0 + InvertVertAxis: 0 + InvertScrollWheel: 0 + MaxHeight: 10 + MinDistance: 1 + MaxDistance: 20 +--- !u!81 &1028782409 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1028782402} + m_Enabled: 1 +--- !u!20 &1028782410 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1028782402} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0, g: 0, b: 0, a: 1} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.01 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 --- !u!1 &1037837058 GameObject: m_ObjectHideFlags: 0 @@ -6436,6 +6646,156 @@ MonoBehaviour: m_BoolArgument: 0 m_CallState: 2 m_IsOn: 1 +--- !u!1 &1150880497 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1150880498} + - component: {fileID: 1150880499} + m_Layer: 0 + m_Name: Camera Controller + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1150880498 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1150880497} + serializedVersion: 2 + m_LocalRotation: {x: 0.22057624, y: -0.27639782, z: 0.06533767, w: 0.93310314} + m_LocalPosition: {x: 231.1, y: 5.9, z: -288.9} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1028782403} + m_Father: {fileID: 120471358} + m_LocalEulerAnglesHint: {x: 26.6, y: -33, z: 0} +--- !u!114 &1150880499 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1150880497} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1403093141, guid: b8873f7cd5fec6f49a4b37228b9b23ac, type: 3} + m_Name: + m_EditorClassIdentifier: + mode: 1 + target: {fileID: 0} + changeCameraKey: 99 + customCameraIndex: 0 + timeMode: 1 + driverCameraFov: 75 + driver: + hotKey: 282 + attachTarget: {fileID: 0} + enableRotation: 0 + resetRotationOnEnable: 0 + requireKeyPressedToRotate: 0 + keyToRequire: 324 + lookAtTarget: {fileID: 0} + horizontal: + angle: 0 + mode: 1 + targetOffset: 0 + damped: 1 + damping: 4 + clamped: 1 + minAngle: -90 + maxAngle: 90 + vertical: + angle: 0 + mode: 1 + targetOffset: 0 + damped: 1 + damping: 4 + clamped: 1 + minAngle: -60 + maxAngle: 60 + horizontalAxis: Mouse X + verticalAxis: Mouse Y + horizontalSensitivity: 4 + verticalSensitivity: 4 + smoothFollow: + hotKey: 283 + distance: 10 + height: 3.5 + heightMultiplier: 1 + heightDamping: 4.25 + rotationDamping: 3 + followVelocity: 1 + velocityDamping: 5 + orbit: + hotKey: 284 + distance: 14 + minVerticalAngle: 1.8 + maxVerticalAngle: 70 + horizontalSpeed: 5 + verticalSpeed: 2.5 + orbitDamping: 4 + minDistance: 3.8 + maxDistance: 50 + distanceSpeed: 10 + distanceDamping: 4 + requireKeyPressed: 0 + requiredKey: 324 + horizontalAxis: Mouse X + verticalAxis: Mouse Y + distanceAxis: Mouse ScrollWheel + lookAt: + hotKey: 285 + damping: 8 + adjustFov: 1 + minFov: 1 + maxFov: 60 + fovSpeed: 20 + fovDamping: 4 + autoFov: 1 + targetRadius: 5 + targetRadiusSpeed: 5 + adjustNearPlane: 0 + nearPlaneAtMinFov: 1.5 + fovAxis: Mouse ScrollWheel + enableMovement: 0 + movementSpeed: 10 + movementDamping: 5 + forwardAxis: Forwards + sidewaysAxis: Sideways + upwardsAxis: Upwards + free: + hotKey: 0 + minVerticalAngle: -60 + maxVerticalAngle: 60 + horizontalSpeed: 4 + verticalSpeed: 2 + damping: 4 + adjustFov: 1 + minFov: 10 + maxFov: 60 + fovSpeed: 20 + fovDamping: 4 + adjustNearPlane: 0 + nearPlaneAtMinFov: 1.5 + horizontalAxis: Mouse X + verticalAxis: Mouse Y + fovAxis: Mouse ScrollWheel + enableMovement: 0 + movementSpeed: 2 + movementDamping: 5 + forwardAxis: Forwards + sidewaysAxis: Sideways + upwardsAxis: Upwards --- !u!1 &1199477678 GameObject: m_ObjectHideFlags: 0 @@ -8744,8 +9104,6 @@ MonoBehaviour: m_EditorClassIdentifier: _cardTopBarButton: {fileID: 1558295553} _barChevronRect: {fileID: 1538985887} - _chevronExpandedDegrees: 90 - _chevronCollapsedDegrees: 0 _isCardOpen: 1 ElementHeight: 30 ElementSpacing: 5 diff --git a/Assets/AWSIM/Scenes/Main/AutowareSimulation.unity b/Assets/AWSIM/Scenes/Main/AutowareSimulation.unity index 250dc4e37..888085da2 100644 --- a/Assets/AWSIM/Scenes/Main/AutowareSimulation.unity +++ b/Assets/AWSIM/Scenes/Main/AutowareSimulation.unity @@ -232,7 +232,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 9027057600357292013, guid: 58d73df60b244d146bdf5f5896f78355, type: 3} propertyPath: m_IsActive - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 9027057600502630240, guid: 58d73df60b244d146bdf5f5896f78355, type: 3} propertyPath: m_IsActive @@ -1239,8 +1239,6 @@ MonoBehaviour: m_EditorClassIdentifier: _cardTopBarButton: {fileID: 1875037353} _barChevronRect: {fileID: 1795778249} - _chevronExpandedDegrees: 90 - _chevronCollapsedDegrees: 0 _isCardOpen: 1 ElementHeight: 30 ElementSpacing: 5 @@ -1381,7 +1379,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 5650763240072318842, guid: 164645b2d105b6b4ab4e3d2e7c65dab2, type: 3} propertyPath: m_LocalPosition.y - value: -1.246 + value: 372.49 objectReference: {fileID: 0} - target: {fileID: 5650763240072318842, guid: 164645b2d105b6b4ab4e3d2e7c65dab2, type: 3} propertyPath: m_LocalPosition.z @@ -1658,8 +1656,8 @@ MonoBehaviour: m_TargetGraphic: {fileID: 1743169424} m_HandleRect: {fileID: 1743169422} m_Direction: 2 - m_Value: 1.0000012 - m_Size: 0.9126437 + m_Value: 1 + m_Size: 1 m_NumberOfSteps: 0 m_OnValueChanged: m_PersistentCalls: @@ -2622,6 +2620,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: + - {fileID: 8504170772392074351} - {fileID: 26523764} - {fileID: 1416174297} m_Father: {fileID: 0} @@ -3286,6 +3285,221 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 770863574} m_CullTransparentMesh: 1 +--- !u!1 &778136819 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 778136820} + - component: {fileID: 778136827} + - component: {fileID: 778136826} + - component: {fileID: 778136825} + - component: {fileID: 778136824} + - component: {fileID: 778136823} + - component: {fileID: 778136822} + - component: {fileID: 778136821} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &778136820 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 778136819} + serializedVersion: 2 + 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: 8504170772392074351} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1542919678 &778136821 +StreamingController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 778136819} + m_Enabled: 1 + m_StreamingMipmapBias: 1 +--- !u!114 &778136822 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 778136819} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 172515602e62fb746b5d573b38a5fe58, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IsGlobal: 0 + priority: 2 + blendDistance: 0 + weight: 0.7 + sharedProfile: {fileID: 11400000, guid: 5a38341ed3c2637fbbc507134841f2ae, type: 2} +--- !u!65 &778136823 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 778136819} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 1 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 0.5, y: 0.5, z: 0.5} + m_Center: {x: 0, y: 0, z: 0} +--- !u!114 &778136824 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 778136819} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RenderShadows: 1 + m_RequiresDepthTextureOption: 0 + m_RequiresOpaqueTextureOption: 0 + m_CameraType: 0 + m_Cameras: [] + m_RendererIndex: -1 + m_VolumeLayerMask: + serializedVersion: 2 + m_Bits: 1 + m_VolumeTrigger: {fileID: 0} + m_VolumeFrameworkUpdateModeOption: 2 + m_RenderPostProcessing: 1 + m_Antialiasing: 0 + m_AntialiasingQuality: 2 + m_StopNaN: 0 + m_Dithering: 0 + m_ClearDepth: 1 + m_AllowXRRendering: 1 + m_AllowHDROutput: 1 + m_UseScreenCoordOverride: 0 + m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0} + m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0} + m_RequiresDepthTexture: 0 + m_RequiresColorTexture: 0 + m_Version: 2 + m_TaaSettings: + m_Quality: 3 + m_FrameInfluence: 0.1 + m_JitterScale: 1 + m_MipBias: 0 + m_VarianceClampScale: 0.9 + m_ContrastAdaptiveSharpening: 0 +--- !u!114 &778136825 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 778136819} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 555e395f453a79e44b909d2fd10efc05, type: 3} + m_Name: + m_EditorClassIdentifier: + target: {fileID: 0} + Distance: 5.48 + Offset: 0 + Height: 2.82 + HeightMultiplier: 0.5 + RotateAroundModeToggle: 99 + RotateAroundSensitivity: 16 + HeightAdjustmentSensitivity: 1 + ZoomSensitivity: 200 + InvertHorzAxis: 0 + InvertVertAxis: 0 + InvertScrollWheel: 0 + MaxHeight: 10 + MinDistance: 1 + MaxDistance: 20 +--- !u!81 &778136826 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 778136819} + m_Enabled: 1 +--- !u!20 &778136827 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 778136819} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0, g: 0, b: 0, a: 1} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.01 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 --- !u!1 &785762361 GameObject: m_ObjectHideFlags: 0 @@ -5408,8 +5622,6 @@ MonoBehaviour: m_EditorClassIdentifier: _cardTopBarButton: {fileID: 788042817} _barChevronRect: {fileID: 572910616} - _chevronExpandedDegrees: 90 - _chevronCollapsedDegrees: 0 _isCardOpen: 1 ElementHeight: 30 ElementSpacing: 5 @@ -6303,7 +6515,7 @@ Transform: m_GameObject: {fileID: 1416174296} serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: 0, y: -373.803, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: @@ -6479,8 +6691,6 @@ MonoBehaviour: m_EditorClassIdentifier: _cardTopBarButton: {fileID: 1021800943} _barChevronRect: {fileID: 1757667091} - _chevronExpandedDegrees: 90 - _chevronCollapsedDegrees: 0 _isCardOpen: 1 ElementHeight: 30 ElementSpacing: 5 @@ -7598,8 +7808,6 @@ MonoBehaviour: m_EditorClassIdentifier: _cardTopBarButton: {fileID: 594280525} _barChevronRect: {fileID: 1826199771} - _chevronExpandedDegrees: 90 - _chevronCollapsedDegrees: 0 _isCardOpen: 1 ElementHeight: 30 ElementSpacing: 5 @@ -11201,6 +11409,156 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 7258987998192245412} m_CullTransparentMesh: 1 +--- !u!114 &8504170772382184531 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8504170772392379957} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1403093141, guid: b8873f7cd5fec6f49a4b37228b9b23ac, type: 3} + m_Name: + m_EditorClassIdentifier: + mode: 1 + target: {fileID: 1222839950} + changeCameraKey: 99 + customCameraIndex: 0 + timeMode: 1 + driverCameraFov: 75 + driver: + hotKey: 282 + attachTarget: {fileID: 0} + enableRotation: 0 + resetRotationOnEnable: 0 + requireKeyPressedToRotate: 0 + keyToRequire: 324 + lookAtTarget: {fileID: 0} + horizontal: + angle: 0 + mode: 1 + targetOffset: 0 + damped: 1 + damping: 4 + clamped: 1 + minAngle: -90 + maxAngle: 90 + vertical: + angle: 0 + mode: 1 + targetOffset: 0 + damped: 1 + damping: 4 + clamped: 1 + minAngle: -60 + maxAngle: 60 + horizontalAxis: Mouse X + verticalAxis: Mouse Y + horizontalSensitivity: 4 + verticalSensitivity: 4 + smoothFollow: + hotKey: 283 + distance: 10 + height: 3.5 + heightMultiplier: 1 + heightDamping: 4.25 + rotationDamping: 3 + followVelocity: 1 + velocityDamping: 5 + orbit: + hotKey: 284 + distance: 14 + minVerticalAngle: 1.8 + maxVerticalAngle: 70 + horizontalSpeed: 5 + verticalSpeed: 2.5 + orbitDamping: 4 + minDistance: 3.8 + maxDistance: 50 + distanceSpeed: 10 + distanceDamping: 4 + requireKeyPressed: 0 + requiredKey: 324 + horizontalAxis: Mouse X + verticalAxis: Mouse Y + distanceAxis: Mouse ScrollWheel + lookAt: + hotKey: 285 + damping: 8 + adjustFov: 1 + minFov: 1 + maxFov: 60 + fovSpeed: 20 + fovDamping: 4 + autoFov: 1 + targetRadius: 5 + targetRadiusSpeed: 5 + adjustNearPlane: 0 + nearPlaneAtMinFov: 1.5 + fovAxis: Mouse ScrollWheel + enableMovement: 0 + movementSpeed: 10 + movementDamping: 5 + forwardAxis: Forwards + sidewaysAxis: Sideways + upwardsAxis: Upwards + free: + hotKey: 0 + minVerticalAngle: -60 + maxVerticalAngle: 60 + horizontalSpeed: 4 + verticalSpeed: 2 + damping: 4 + adjustFov: 1 + minFov: 10 + maxFov: 60 + fovSpeed: 20 + fovDamping: 4 + adjustNearPlane: 0 + nearPlaneAtMinFov: 1.5 + horizontalAxis: Mouse X + verticalAxis: Mouse Y + fovAxis: Mouse ScrollWheel + enableMovement: 0 + movementSpeed: 2 + movementDamping: 5 + forwardAxis: Forwards + sidewaysAxis: Sideways + upwardsAxis: Upwards +--- !u!4 &8504170772392074351 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8504170772392379957} + serializedVersion: 2 + m_LocalRotation: {x: 0.22057624, y: -0.27639782, z: 0.06533767, w: 0.93310314} + m_LocalPosition: {x: 231.1, y: 5.9, z: -288.9} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 778136820} + m_Father: {fileID: 543989980} + m_LocalEulerAnglesHint: {x: 26.6, y: -33, z: 0} +--- !u!1 &8504170772392379957 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8504170772392074351} + - component: {fileID: 8504170772382184531} + m_Layer: 0 + m_Name: Camera Controller + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!114 &9030775819749627845 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/AWSIM/Scripts/UI/Toggle/UIKeyboardControlToggle.cs b/Assets/AWSIM/Scripts/UI/Toggle/UIKeyboardControlToggle.cs index 1fe17c34b..746bae646 100644 --- a/Assets/AWSIM/Scripts/UI/Toggle/UIKeyboardControlToggle.cs +++ b/Assets/AWSIM/Scripts/UI/Toggle/UIKeyboardControlToggle.cs @@ -1,3 +1,5 @@ +using AWSIM.Scripts.Vehicles.VPP_Integration; +using AWSIM.Scripts.Vehicles.VPP_Integration.Enums; using UnityEngine; namespace AWSIM.Scripts.UI.Toggle @@ -5,15 +7,15 @@ namespace AWSIM.Scripts.UI.Toggle public class UIKeyboardControlToggle : MonoBehaviour { private GameObject _egoVehicle; - private VehicleKeyboardInput _vehicleKeyboardInput; + private AutowareVPPAdapter _adapter; private void Start() { - _egoVehicle = GameObject.FindGameObjectWithTag("Ego"); - _vehicleKeyboardInput = _egoVehicle.GetComponent(); + _egoVehicle = GameObject.FindWithTag("Ego"); + _adapter = _egoVehicle.GetComponent(); - // Set the toggle to the current state of the keyboard control - GetComponent().isOn = _vehicleKeyboardInput.enabled; + // Set the toggle to the current state of the keyboard control mode + GetComponent().isOn = _adapter.ControlModeInput != VPPControlMode.Autonomous; } public void Activate() @@ -25,7 +27,9 @@ public void Activate() // Toggle the keyboard control public void OnClick(bool isOn) { - _vehicleKeyboardInput.enabled = isOn; + _adapter.ControlModeInput = _adapter.ControlModeInput == VPPControlMode.Autonomous + ? VPPControlMode.Manual + : VPPControlMode.Autonomous; } } } diff --git a/Assets/AWSIM/Scripts/UI/UICard.cs b/Assets/AWSIM/Scripts/UI/UICard.cs index cadf35b03..c7e89a408 100644 --- a/Assets/AWSIM/Scripts/UI/UICard.cs +++ b/Assets/AWSIM/Scripts/UI/UICard.cs @@ -8,8 +8,6 @@ public class UICard : MonoBehaviour { [SerializeField] private Button _cardTopBarButton; [SerializeField] private RectTransform _barChevronRect; - [SerializeField] private float _chevronExpandedDegrees = 90f; - [SerializeField] private float _chevronCollapsedDegrees = 0f; [SerializeField] private bool _isCardOpen; [SerializeField] public float ElementHeight = 30f; diff --git a/Assets/AWSIM/Materials/New Material.mat.meta~refs/remotes/origin.meta b/Assets/AWSIM/Scripts/Vehicles/VPP Integration.meta similarity index 77% rename from Assets/AWSIM/Materials/New Material.mat.meta~refs/remotes/origin.meta rename to Assets/AWSIM/Scripts/Vehicles/VPP Integration.meta index 61c537557..9210bd146 100644 --- a/Assets/AWSIM/Materials/New Material.mat.meta~refs/remotes/origin.meta +++ b/Assets/AWSIM/Scripts/Vehicles/VPP Integration.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 2b9db00854f341fd9ac861e54236e1a3 +guid: e37e91ad67047f8d7a4e19d89bccaf00 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/AWSIM/Scripts/Vehicles/VPP Integration/AutowareVPPAdapter.cs b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/AutowareVPPAdapter.cs new file mode 100644 index 000000000..ad93823af --- /dev/null +++ b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/AutowareVPPAdapter.cs @@ -0,0 +1,343 @@ +using System; +using System.Collections.Generic; +using AWSIM.Scripts.Vehicles.VPP_Integration.Enums; +using AWSIM.Scripts.Vehicles.VPP_Integration.IVehicleControlModes; +using UnityEngine; +using VehiclePhysics; + +namespace AWSIM.Scripts.Vehicles.VPP_Integration +{ + public class AutowareVPPAdapter : MonoBehaviour + { + /// + /// This script applies the VPP vehicle inputs. + /// Vehicle inputs are updated from the `Ros2ToVPPInput.cs`. + /// Results from this script are sent to the `VPPtoRos2Publisher.cs`. + /// + + // Initial Position inputs from Rviz + [NonSerialized] public bool WillUpdatePositionInput; + + [NonSerialized] public Vector3 PositionInput; + [NonSerialized] public Quaternion RotationInput; + + /// Control inputs from Autoware + [NonSerialized] public float SteerAngleInput; + + private float _steerAngleInput => SteerAngleInput; + + public bool IsDefinedSteeringTireRotationRateInput { get; set; } + public float SteeringTireRotationRateInput { get; set; } + + // Gear input from Autoware + [NonSerialized] public Gearbox.AutomaticGear AutomaticShiftInput; + private Gearbox.AutomaticGear _automaticShiftInput => AutomaticShiftInput; + + // Signal input from Autoware + [NonSerialized] public VPPSignal VehicleSignalInput; + private VPPSignal _vehicleSignalInput => VehicleSignalInput; + + // Emergency input from Autoware + public bool IsEmergencyInput { get; set; } + + // Control mode input from Autoware + public VPPControlMode ControlModeInput { get; set; } + + // Actuation commands from Autoware + public double SteerInput { get; set; } + [NonSerialized] public double BrakeInput; + private double _brakeInput => BrakeInput; + [NonSerialized] public double ThrottleInput; + private double _throttleInput => ThrottleInput; + + // Outputs from Unity/VPP + public VPPControlMode VpControlModeReport { get; private set; } + public int VpGearReport { get; private set; } + public Vector3 VpVelocityReport { get; private set; } + public Vector3 VpAngularVelocityReport { get; private set; } + public float VpSteeringReport { get; private set; } + public VPPSignal VpTurnIndicatorReport { get; private set; } + public VPPSignal VpHazardLightsReport { get; private set; } + public double VpThrottleStatusReport { get; private set; } + public double VpBrakeStatusReport { get; private set; } + public double VpSteerStatusReport { get; private set; } + + // VPP components + private VPVehicleController _vehicleController; + private VPStandardInput _standardInput; + private VPCameraController _cameraController; + + [SerializeField] private VPWheelCollider[] _frontWheels; + + private Rigidbody _rigidbody; + + [Tooltip("Whether set wheel angle directly from Autoware or simulate with additive steering wheel input")] + [SerializeField] + private bool _simulateSteering; + + [Tooltip("Change applied to steering wheel per fixed update in degrees")] + [Range(0f, 100f)] + [SerializeField] + private float _steerWheelInput = 5f; + + private int _vppSteerFromLastFrame; + + [Tooltip("Brake pedal percent on emergency brake. This value is mapped to [0, 10000] to match VPP input")] + [Range(0f, 100f)] + [SerializeField] + private float _emergencyBrakePercent = 100f; + + public float CurrentSpeed { get; private set; } + public float CurrentJerk { get; private set; } + // private float _previousAcceleration; + + // Control mode variables + private Dictionary _controlModes; + private IVehicleControlMode _currentMode; + + // RViz2 Update position variables + [Header("RViz2 Update Position")] + [SerializeField] + private float _updatePositionOffsetY = 1.33f; + + [SerializeField] private float _updatePositionRayOriginY = 1000f; + + [Header("Calibration Mode")] + [Tooltip( + "Enable pedal calibration mode. Use Numpad(+,-,0) keys to set constant throttle/brake values for ease of calibration")] + [SerializeField] + private bool _doPedalCalibration; + + private int _brakeAmount; + private int _throttleAmount; + + // Constants used for conversion between VPP and Autoware + private const float VppToAutowareMultiplier = 0.0001f; + private const int AutowareToVppMultiplier = 10000; + + private void Awake() + { + //TODO: Implement the control mode switch from simulator (mozzz) + // Initialize the control mode as Autonomous + ControlModeInput = VPPControlMode.Autonomous; + } + + private void Start() + { + // get components + _vehicleController = GetComponent(); + _standardInput = GetComponent(); + _rigidbody = GetComponent(); + + // set camera target to this vehicle + _cameraController = FindObjectOfType(); + _cameraController.target = transform; + + InitializeControlModes(); + + // Set initial vehicle gear to Park to prevent movement + _vehicleController.data.bus[Channel.Input][InputData.AutomaticGear] = (int)Gearbox.AutomaticGear.P; + + // reset vpp stuff for multi-scene loading (no idea why, but it works) + _vehicleController.enabled = false; + _vehicleController.enabled = true; + } + + // private void Update() + // { + // // TODO: Implement the control mode switch from simulator (mozzz) + // UserSwitchControlMode(); + // } + + private void FixedUpdate() + { + // Update the ego position depending on RViz Input. + if (WillUpdatePositionInput) + { + UpdateEgoPosition(); + WillUpdatePositionInput = false; + } + + if (_doPedalCalibration) + { + PedalCalibrationMode(); + } + else + { + // If keyboard enabled stop Autoware control. + // if (_standardInput.enabled) return; + + // Control the vehicle based on the control mode + ControlVehicle(ControlModeInput); + } + + // Update the publisher values for VPPToRos2Publisher.cs + ReportVehicleState(); + } + + private void InitializeControlModes() + { + _controlModes = new Dictionary + { + { VPPControlMode.NoCommand, new ControlMode.NoCommand() }, + { VPPControlMode.Autonomous, new ControlMode.Autonomous() }, + { VPPControlMode.AutonomousSteerOnly, new ControlMode.AutonomousSteerOnly() }, + { VPPControlMode.AutonomousVelocityOnly, new ControlMode.AutonomousVelocityOnly() }, + { VPPControlMode.Manual, new ControlMode.Manual() }, + { VPPControlMode.Disengaged, new ControlMode.Disengaged() }, + { VPPControlMode.NotReady, new ControlMode.NotReady() } + }; + } + + private void ControlVehicle(VPPControlMode controlMode) + { + if (_controlModes.TryGetValue(controlMode, out _currentMode)) + { + _currentMode.ExecuteControlMode(this); + } + else + { + Debug.LogWarning("Control mode is not recognized."); + } + } + + public void HandleHazardLights() + { + // TODO: this is implemented in Ros2ToVPPInput.cs, move it here (mozzz) + } + + public void HandleTurnSignal() + { + // TODO: this is implemented in Ros2ToVPPInput.cs, move it here (mozzz) + } + + public void HandleSteer() + { + if (_simulateSteering) + { + SimulateSteeringWheelInput(); + } + else + { + SetWheelSteerAngleDirectly(_steerAngleInput); + } + } + + private void SetWheelSteerAngleDirectly(float angle) + { + foreach (var wheel in _frontWheels) + { + wheel.steerAngle = angle; + } + } + + // temp method to simulate steering wheel input with delay, also inaccurate (mozzz) + private void SimulateSteeringWheelInput() + { + if (SteerAngleInput == 0) return; + + int steerAdjustment = SteerAngleInput > _vehicleController.wheelState[0].steerAngle + ? (int)_steerWheelInput + : -(int)_steerWheelInput; + + _vehicleController.data.bus[Channel.Input][InputData.Steer] = _vppSteerFromLastFrame + steerAdjustment; + _vppSteerFromLastFrame = _vehicleController.data.bus[Channel.Input][InputData.Steer]; + } + + public void HandleGear() + { + _vehicleController.data.bus[Channel.Input][InputData.AutomaticGear] = (int)_automaticShiftInput; + } + + public void HandleAcceleration() + { + // Store current values + CurrentSpeed = _vehicleController.speed; + + SetThrottle((int)(_throttleInput * AutowareToVppMultiplier)); + SetBrake((int)(_brakeInput * AutowareToVppMultiplier)); + } + + /// + /// Range:[0-10000] + /// + private void SetThrottle(int amount) + { + _vehicleController.data.bus[Channel.Input][InputData.Throttle] = amount; + } + + /// + /// Range:[0-10000] + /// + private void SetBrake(int amount) + { + _vehicleController.data.bus[Channel.Input][InputData.Brake] = amount; + } + + // TODO: report jerk state (mozzz) + private void ReportVehicleState() + { + VpControlModeReport = ControlModeInput; + VpHazardLightsReport = _vehicleSignalInput; + VpTurnIndicatorReport = _vehicleSignalInput; + VpSteeringReport = _frontWheels[0].steerAngle; + VpGearReport = _vehicleController.data.bus[Channel.Vehicle][VehicleData.GearboxMode]; + VpVelocityReport = + transform.InverseTransformDirection(_rigidbody.velocity.normalized * _vehicleController.speed); + VpAngularVelocityReport = transform.InverseTransformDirection(_rigidbody.angularVelocity); + VpThrottleStatusReport = + _vehicleController.data.bus[Channel.Input][InputData.Throttle] * VppToAutowareMultiplier; + VpBrakeStatusReport = _vehicleController.data.bus[Channel.Input][InputData.Brake] * VppToAutowareMultiplier; + VpSteerStatusReport = _vehicleController.data.bus[Channel.Input][InputData.Steer] * VppToAutowareMultiplier; + } + + private void UpdateEgoPosition() + { + // Method to update the position based on PositionInput + Vector3 rayOrigin = new Vector3(PositionInput.x, _updatePositionRayOriginY, PositionInput.z); + Vector3 rayDirection = Vector3.down; + + if (Physics.Raycast(rayOrigin, rayDirection, out RaycastHit hit, Mathf.Infinity)) + { + PositionInput = new Vector3(PositionInput.x, hit.point.y + _updatePositionOffsetY, PositionInput.z); + transform.SetPositionAndRotation(PositionInput, RotationInput); + } + else + { + Debug.LogWarning( + "No mesh or collider detected on target location. Please ensure that the target location is on a mesh or collider."); + } + } + + // TODO: Method to switch control mode based on user input (mozzz) + private void UserSwitchControlMode() + { + } + + // TODO: Add UI and documentation for this method (mozzz) + /// + /// Used to enable Numpad(+,-,0) keys to set constant throttle/brake values for ease of calibration. %10 increments + /// + private void PedalCalibrationMode() + { + _vehicleController.data.bus[Channel.Input][InputData.Throttle] = _throttleAmount; + _vehicleController.data.bus[Channel.Input][InputData.Brake] = _brakeAmount; + + if (Input.GetKeyDown(KeyCode.KeypadPlus)) + { + _throttleAmount += 1000; + } + + if (Input.GetKeyDown(KeyCode.KeypadMinus)) + { + _brakeAmount += 1000; + } + + if (Input.GetKeyDown(KeyCode.Keypad0)) + { + _throttleAmount = 0; + _brakeAmount = 0; + } + } + } +} diff --git a/Assets/AWSIM/Scripts/Vehicles/VPP Integration/AutowareVPPAdapter.cs.meta b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/AutowareVPPAdapter.cs.meta new file mode 100644 index 000000000..58b745320 --- /dev/null +++ b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/AutowareVPPAdapter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0dbceea492288af5a9a663c606ad86a8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AWSIM/Scripts/Vehicles/VPP Integration/Enums.meta b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/Enums.meta new file mode 100644 index 000000000..73bf9adb4 --- /dev/null +++ b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/Enums.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6dc2874f7c16a0a9aae83c59f25c4970 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AWSIM/Scripts/Vehicles/VPP Integration/Enums/VPPControlMode.cs b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/Enums/VPPControlMode.cs new file mode 100644 index 000000000..7178573a8 --- /dev/null +++ b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/Enums/VPPControlMode.cs @@ -0,0 +1,13 @@ +namespace AWSIM.Scripts.Vehicles.VPP_Integration.Enums +{ + public enum VPPControlMode + { + NoCommand, + Autonomous, + AutonomousSteerOnly, + AutonomousVelocityOnly, + Manual, + Disengaged, + NotReady + } +} diff --git a/Assets/AWSIM/Scripts/Vehicles/VPP Integration/Enums/VPPControlMode.cs.meta b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/Enums/VPPControlMode.cs.meta new file mode 100644 index 000000000..86508601b --- /dev/null +++ b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/Enums/VPPControlMode.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d47a068cafd2d6f48bc48c942e6a5932 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AWSIM/Scripts/Vehicles/VPP Integration/Enums/VPPSignal.cs b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/Enums/VPPSignal.cs new file mode 100644 index 000000000..406172388 --- /dev/null +++ b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/Enums/VPPSignal.cs @@ -0,0 +1,10 @@ +namespace AWSIM.Scripts.Vehicles.VPP_Integration.Enums +{ + public enum VPPSignal + { + None, + Left, + Right, + Hazard + } +} diff --git a/Assets/AWSIM/Scripts/Vehicles/VPP Integration/Enums/VPPSignal.cs.meta b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/Enums/VPPSignal.cs.meta new file mode 100644 index 000000000..8e8d68980 --- /dev/null +++ b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/Enums/VPPSignal.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 614dd771ecfaeb9e9a5a3c9bef2a35a7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AWSIM/Scripts/Vehicles/VPP Integration/IVehicleControlModes.meta b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/IVehicleControlModes.meta new file mode 100644 index 000000000..e0cd4cf7c --- /dev/null +++ b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/IVehicleControlModes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7974fb23e5c127bf48d6b427f536753d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AWSIM/Scripts/Vehicles/VPP Integration/IVehicleControlModes/ControlMode.cs b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/IVehicleControlModes/ControlMode.cs new file mode 100644 index 000000000..e194cd3c0 --- /dev/null +++ b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/IVehicleControlModes/ControlMode.cs @@ -0,0 +1,74 @@ +using UnityEngine; + +namespace AWSIM.Scripts.Vehicles.VPP_Integration.IVehicleControlModes +{ + // Vehicle control mode classes + public abstract class ControlMode + { + public class NoCommand : IVehicleControlMode + { + public void ExecuteControlMode(AutowareVPPAdapter adapter) + { + // Debug.Log("Control mode: No command"); + } + } + + public class Autonomous : IVehicleControlMode + { + public void ExecuteControlMode(AutowareVPPAdapter adapter) + { + adapter.HandleHazardLights(); + adapter.HandleTurnSignal(); + adapter.HandleAcceleration(); + adapter.HandleGear(); + adapter.HandleSteer(); + } + } + + public class AutonomousSteerOnly : IVehicleControlMode + { + public void ExecuteControlMode(AutowareVPPAdapter adapter) + { + adapter.HandleHazardLights(); + adapter.HandleTurnSignal(); + adapter.HandleGear(); + adapter.HandleSteer(); + } + } + + public class AutonomousVelocityOnly : IVehicleControlMode + { + public void ExecuteControlMode(AutowareVPPAdapter adapter) + { + adapter.HandleHazardLights(); + adapter.HandleTurnSignal(); + adapter.HandleAcceleration(); + adapter.HandleGear(); + } + } + + public class Manual : IVehicleControlMode + { + public void ExecuteControlMode(AutowareVPPAdapter adapter) + { + // Debug.Log("Control mode: Manual"); + } + } + + public class Disengaged : IVehicleControlMode + { + public void ExecuteControlMode(AutowareVPPAdapter adapter) + { + // Debug.Log("Control mode: Disengaged"); + } + } + + public class NotReady : IVehicleControlMode + { + public void ExecuteControlMode(AutowareVPPAdapter adapter) + { + // Debug.Log("Control mode: Not ready"); + } + } + } +} diff --git a/Assets/AWSIM/Scripts/Vehicles/VPP Integration/IVehicleControlModes/ControlMode.cs.meta b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/IVehicleControlModes/ControlMode.cs.meta new file mode 100644 index 000000000..8ce909e6e --- /dev/null +++ b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/IVehicleControlModes/ControlMode.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 99f769d911d27540280b4252a42b189d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AWSIM/Scripts/Vehicles/VPP Integration/IVehicleControlModes/IVehicleControlMode.cs b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/IVehicleControlModes/IVehicleControlMode.cs new file mode 100644 index 000000000..2fd722d76 --- /dev/null +++ b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/IVehicleControlModes/IVehicleControlMode.cs @@ -0,0 +1,8 @@ +namespace AWSIM.Scripts.Vehicles.VPP_Integration.IVehicleControlModes +{ + // Vehicle control mode interface + public interface IVehicleControlMode + { + void ExecuteControlMode(AutowareVPPAdapter adapter); + } +} diff --git a/Assets/AWSIM/Scripts/Vehicles/VPP Integration/IVehicleControlModes/IVehicleControlMode.cs.meta b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/IVehicleControlModes/IVehicleControlMode.cs.meta new file mode 100644 index 000000000..041e8c045 --- /dev/null +++ b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/IVehicleControlModes/IVehicleControlMode.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 693249ce49af164eb84c9d7e5478ffe9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AWSIM/Scripts/Vehicles/VPP Integration/Ros2ToVPPInput.cs b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/Ros2ToVPPInput.cs new file mode 100644 index 000000000..992a6c654 --- /dev/null +++ b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/Ros2ToVPPInput.cs @@ -0,0 +1,173 @@ +using AWSIM.Scripts.Vehicles.VPP_Integration.Enums; +using ROS2; +using UnityEngine; + +namespace AWSIM.Scripts.Vehicles.VPP_Integration +{ + [RequireComponent(typeof(AutowareVPPAdapter))] + public class Ros2ToVPPInput : MonoBehaviour + { + [Header("AutowareVPPAdapter")] + [SerializeField] + private AutowareVPPAdapter _adapter; + + [Header("Ros2 fields")] + [SerializeField] + private string controlModeTopic = "/vehicle/status/control_mode"; + + [SerializeField] private string turnIndicatorsCommandTopic = "/control/command/turn_indicators_cmd"; + [SerializeField] private string hazardLightsCommandTopic = "/control/command/hazard_lights_cmd"; + [SerializeField] private string controlCommandTopic = "/control/command/control_cmd"; + [SerializeField] private string gearCommandTopic = "/control/command/gear_cmd"; + [SerializeField] private string vehicleEmergencyStampedTopic = "/control/command/emergency_cmd"; + [SerializeField] private string positionTopic = "/initialpose"; + [SerializeField] private string actuationCommandTopic = "/control/command/actuation_cmd"; + + [SerializeField] private QoSSettings qosSettings = new(); + [SerializeField] private QoSSettings positionQosSettings; + [SerializeField] private QoSSettings _actuationQosSettings; + + // subscribers + private ISubscription _controlModeSubscriber; + private ISubscription _turnIndicatorsCommandSubscriber; + private ISubscription _hazardLightsCommandSubscriber; + private ISubscription _controlCommandSubscriber; + private ISubscription _gearCommandSubscriber; + private ISubscription _vehicleEmergencyStampedSubscriber; + private ISubscription _positionSubscriber; + private ISubscription _actuationCommandSubscriber; + + private VPPSignal _turnIndicatorsCommand = VPPSignal.None; + private VPPSignal _hazardLightsCommand = VPPSignal.None; + private VPPSignal _input = VPPSignal.None; + + private void Reset() + { + if (_adapter == null) + _adapter = GetComponent(); + + // initialize default QoS params. + qosSettings.ReliabilityPolicy = ReliabilityPolicy.QOS_POLICY_RELIABILITY_RELIABLE; + qosSettings.DurabilityPolicy = DurabilityPolicy.QOS_POLICY_DURABILITY_TRANSIENT_LOCAL; + qosSettings.HistoryPolicy = HistoryPolicy.QOS_POLICY_HISTORY_KEEP_LAST; + qosSettings.Depth = 1; + } + + // TODO: handle this input in VPPVehicleSignalHandler.cs (mozzz) + /// + /// Processes the TurnSignal to be applied to the vehicle from the latest turnIndicatorsSignal and hazardLightsSignal values. + /// Priority : HAZARD > LEFT/RIGHT > NONE + /// + private void UpdateVehicleTurnSignal() + { + // HAZARD > LEFT, RIGHT > NONE + if (_hazardLightsCommand == VPPSignal.Hazard) + _input = _hazardLightsCommand; + else if (_turnIndicatorsCommand is VPPSignal.Left or VPPSignal.Right) + _input = _turnIndicatorsCommand; + else + _input = VPPSignal.None; + + // input + if (!Equals(_adapter.VehicleSignalInput, _input)) + _adapter.VehicleSignalInput = _input; + } + + private void Start() + { + var qos = qosSettings.GetQoSProfile(); + var positionQoS = positionQosSettings.GetQoSProfile(); + var actuationQoSSettings = _actuationQosSettings.GetQoSProfile(); + + _controlModeSubscriber = + SimulatorROS2Node.CreateSubscription( + controlModeTopic, + msg => { _adapter.ControlModeInput = Ros2ToVPPUtilities.Ros2ToVPPControlMode(msg); }, qos); + + _turnIndicatorsCommandSubscriber = + SimulatorROS2Node.CreateSubscription( + turnIndicatorsCommandTopic, + msg => + { + _turnIndicatorsCommand = Ros2ToVPPUtilities.Ros2ToVPPTurnSignal(msg); + UpdateVehicleTurnSignal(); + }, qos); + + _hazardLightsCommandSubscriber = + SimulatorROS2Node.CreateSubscription( + hazardLightsCommandTopic, + msg => + { + _hazardLightsCommand = Ros2ToVPPUtilities.Ros2ToVPPHazard(msg); + UpdateVehicleTurnSignal(); + }, qos); + + _controlCommandSubscriber = SimulatorROS2Node.CreateSubscription( + controlCommandTopic, msg => + { + // longitudinal + // _adapter.VelocityInput = msg.Longitudinal.Velocity; + // _adapter.IsAccelerationDefinedInput = msg.Longitudinal.Is_defined_acceleration; + // _adapter.AccelerationInput = msg.Longitudinal.Acceleration; + // _adapter.IsJerkDefinedInput = msg.Longitudinal.Is_defined_jerk; + // _adapter.JerkInput = msg.Longitudinal.Jerk; + + // lateral + _adapter.SteerAngleInput = -msg.Lateral.Steering_tire_angle * Mathf.Rad2Deg; + // _adapter.IsDefinedSteeringTireRotationRateInput = + // msg.Lateral.Is_defined_steering_tire_rotation_rate; + // _adapter.SteeringTireRotationRateInput = msg.Lateral.Steering_tire_rotation_rate; + }, qos); + + _gearCommandSubscriber = SimulatorROS2Node.CreateSubscription( + gearCommandTopic, msg => { _adapter.AutomaticShiftInput = Ros2ToVPPUtilities.Ros2ToVPPShift(msg); }, + qos); + + _vehicleEmergencyStampedSubscriber = + SimulatorROS2Node.CreateSubscription( + vehicleEmergencyStampedTopic, msg => { _adapter.IsEmergencyInput = msg.Emergency; }); + + _positionSubscriber = SimulatorROS2Node.CreateSubscription( + positionTopic, msg => + { + var positionVector = new Vector3((float)msg.Pose.Pose.Position.X, + (float)msg.Pose.Pose.Position.Y, + (float)msg.Pose.Pose.Position.Z); + + var rotationVector = new Quaternion((float)msg.Pose.Pose.Orientation.X, + (float)msg.Pose.Pose.Orientation.Y, + (float)msg.Pose.Pose.Orientation.Z, + (float)msg.Pose.Pose.Orientation.W); + + _adapter.PositionInput = + ROS2Utility.RosToUnityPosition(positionVector - Environment.Instance.MgrsOffsetPosition); + _adapter.RotationInput = ROS2Utility.RosToUnityRotation(rotationVector); + _adapter.WillUpdatePositionInput = true; + }, positionQoS); + + _actuationCommandSubscriber = SimulatorROS2Node.CreateSubscription( + actuationCommandTopic, msg => + { + _adapter.ThrottleInput = msg.Actuation.Accel_cmd; + _adapter.BrakeInput = msg.Actuation.Brake_cmd; + // _adapter.SteerInput = msg.Steer_cmd; + }, actuationQoSSettings); + } + + private void OnDestroy() + { + SimulatorROS2Node.RemoveSubscription( + _controlModeSubscriber); + SimulatorROS2Node.RemoveSubscription( + _turnIndicatorsCommandSubscriber); + SimulatorROS2Node.RemoveSubscription( + _hazardLightsCommandSubscriber); + SimulatorROS2Node.RemoveSubscription(_controlCommandSubscriber); + SimulatorROS2Node.RemoveSubscription(_gearCommandSubscriber); + SimulatorROS2Node.RemoveSubscription( + _vehicleEmergencyStampedSubscriber); + SimulatorROS2Node.RemoveSubscription(_positionSubscriber); + SimulatorROS2Node.RemoveSubscription(_actuationCommandSubscriber); + } + } +} diff --git a/Assets/AWSIM/Scripts/Vehicles/VPP Integration/Ros2ToVPPInput.cs.meta b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/Ros2ToVPPInput.cs.meta new file mode 100644 index 000000000..72e1375d9 --- /dev/null +++ b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/Ros2ToVPPInput.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7ca678817e2c893b797f2e68f1cd5d67 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AWSIM/Scripts/Vehicles/VPP Integration/Ros2ToVPPUtilities.cs b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/Ros2ToVPPUtilities.cs new file mode 100644 index 000000000..6243760e0 --- /dev/null +++ b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/Ros2ToVPPUtilities.cs @@ -0,0 +1,112 @@ +using AWSIM.Scripts.Vehicles.VPP_Integration.Enums; +using VehiclePhysics; + +namespace AWSIM.Scripts.Vehicles.VPP_Integration +{ + public static class Ros2ToVPPUtilities + { + public static Gearbox.AutomaticGear Ros2ToVPPShift(autoware_vehicle_msgs.msg.GearCommand gearCommand) + { + return gearCommand.Command switch + { + autoware_vehicle_msgs.msg.GearReport.NONE or autoware_vehicle_msgs.msg.GearReport.PARK => Gearbox + .AutomaticGear.P, + autoware_vehicle_msgs.msg.GearReport.REVERSE => Gearbox.AutomaticGear.R, + autoware_vehicle_msgs.msg.GearReport.NEUTRAL => Gearbox.AutomaticGear.N, + autoware_vehicle_msgs.msg.GearReport.DRIVE or autoware_vehicle_msgs.msg.GearReport.LOW => Gearbox + .AutomaticGear.D, + _ => Gearbox.AutomaticGear.P + }; + } + + public static byte VPPToRos2Shift(int shift) + { + return shift switch + { + 1 => autoware_vehicle_msgs.msg.GearReport.PARK, + 2 => autoware_vehicle_msgs.msg.GearReport.REVERSE, + 3 => autoware_vehicle_msgs.msg.GearReport.NEUTRAL, + 4 or 5 or 6 or 7 or 8 => autoware_vehicle_msgs.msg.GearReport.DRIVE, + _ => autoware_vehicle_msgs.msg.GearReport.PARK + }; + } + + // Turn Signal conversion + public static VPPSignal Ros2ToVPPTurnSignal( + autoware_vehicle_msgs.msg.TurnIndicatorsCommand turnIndicatorsCommand) + { + return turnIndicatorsCommand.Command switch + { + autoware_vehicle_msgs.msg.TurnIndicatorsCommand.DISABLE => VPPSignal.None, + autoware_vehicle_msgs.msg.TurnIndicatorsCommand.ENABLE_LEFT => VPPSignal.Left, + autoware_vehicle_msgs.msg.TurnIndicatorsCommand.ENABLE_RIGHT => VPPSignal.Right, + _ => VPPSignal.None + }; + } + + public static byte VPPToRos2TurnSignal(VPPSignal turnSignal) + { + return turnSignal switch + { + VPPSignal.None => autoware_vehicle_msgs.msg.TurnIndicatorsReport.DISABLE, + VPPSignal.Left => autoware_vehicle_msgs.msg.TurnIndicatorsReport.ENABLE_LEFT, + VPPSignal.Right => autoware_vehicle_msgs.msg.TurnIndicatorsReport.ENABLE_RIGHT, + _ => autoware_vehicle_msgs.msg.TurnIndicatorsReport.DISABLE + }; + } + + // Hazard Lights conversion + public static VPPSignal Ros2ToVPPHazard( + autoware_vehicle_msgs.msg.HazardLightsCommand hazardLightsCommand) + { + return hazardLightsCommand.Command switch + { + autoware_vehicle_msgs.msg.HazardLightsCommand.ENABLE => VPPSignal.Hazard, + autoware_vehicle_msgs.msg.HazardLightsCommand.DISABLE => VPPSignal.None, + _ => VPPSignal.None + }; + } + + public static byte VPPToRos2Hazard(VPPSignal turnSignal) + { + return turnSignal switch + { + VPPSignal.Hazard => autoware_vehicle_msgs.msg.HazardLightsReport.ENABLE, + VPPSignal.None => autoware_vehicle_msgs.msg.HazardLightsReport.DISABLE, + _ => autoware_vehicle_msgs.msg.HazardLightsReport.DISABLE + }; + } + + // Control Mode conversion + public static VPPControlMode Ros2ToVPPControlMode( + autoware_vehicle_msgs.msg.ControlModeReport controlMode) + { + return controlMode.Mode switch + { + autoware_vehicle_msgs.msg.ControlModeReport.NO_COMMAND => VPPControlMode.NoCommand, + autoware_vehicle_msgs.msg.ControlModeReport.AUTONOMOUS => VPPControlMode.Autonomous, + autoware_vehicle_msgs.msg.ControlModeReport.AUTONOMOUS_STEER_ONLY => VPPControlMode.AutonomousSteerOnly, + autoware_vehicle_msgs.msg.ControlModeReport.AUTONOMOUS_VELOCITY_ONLY => VPPControlMode.AutonomousVelocityOnly, + autoware_vehicle_msgs.msg.ControlModeReport.MANUAL => VPPControlMode.Manual, + autoware_vehicle_msgs.msg.ControlModeReport.DISENGAGED => VPPControlMode.Disengaged, + autoware_vehicle_msgs.msg.ControlModeReport.NOT_READY => VPPControlMode.NotReady, + _ => VPPControlMode.NoCommand + }; + } + + public static byte VPPToRos2ControlMode(VPPControlMode controlMode) + { + return controlMode switch + { + VPPControlMode.NoCommand => autoware_vehicle_msgs.msg.ControlModeReport.NO_COMMAND, + VPPControlMode.Autonomous => autoware_vehicle_msgs.msg.ControlModeReport.AUTONOMOUS, + VPPControlMode.AutonomousSteerOnly => autoware_vehicle_msgs.msg.ControlModeReport.AUTONOMOUS_STEER_ONLY, + VPPControlMode.AutonomousVelocityOnly => autoware_vehicle_msgs.msg.ControlModeReport.AUTONOMOUS_VELOCITY_ONLY, + VPPControlMode.Manual => autoware_vehicle_msgs.msg.ControlModeReport.MANUAL, + VPPControlMode.Disengaged => autoware_vehicle_msgs.msg.ControlModeReport.DISENGAGED, + VPPControlMode.NotReady => autoware_vehicle_msgs.msg.ControlModeReport.NOT_READY, + _ => autoware_vehicle_msgs.msg.ControlModeReport.NO_COMMAND + }; + } + } +} diff --git a/Assets/AWSIM/Scripts/Vehicles/VPP Integration/Ros2ToVPPUtilities.cs.meta b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/Ros2ToVPPUtilities.cs.meta new file mode 100644 index 000000000..189746047 --- /dev/null +++ b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/Ros2ToVPPUtilities.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b5f31c4d6a2818575b84455f21ce5f4a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AWSIM/Scripts/Vehicles/VPP Integration/VPPToRos2Publisher.cs b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/VPPToRos2Publisher.cs new file mode 100644 index 000000000..3a26e8f42 --- /dev/null +++ b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/VPPToRos2Publisher.cs @@ -0,0 +1,186 @@ +using System.Collections; +using ROS2; +using UnityEngine; + +namespace AWSIM.Scripts.Vehicles.VPP_Integration +{ + public class VPPToRos2Publisher : MonoBehaviour + { + [Header("AutowareVPPAdapter")] + [SerializeField] + private AutowareVPPAdapter _adapter; + + [Header("Ros2 fields")] + [SerializeField] + private string _controlModeReportTopic = "/vehicle/status/control_mode"; + + [SerializeField] private string _gearReportTopic = "/vehicle/status/gear_status"; + [SerializeField] private string _steeringReportTopic = "/vehicle/status/steering_status"; + [SerializeField] private string _turnIndicatorsReportTopic = "/vehicle/status/turn_indicators_status"; + [SerializeField] private string _hazardLightsReportTopic = "/vehicle/status/hazard_lights_status"; + [SerializeField] private string _velocityReportTopic = "/vehicle/status/velocity_status"; + [SerializeField] private string _ActuationStatusTopic = "/vehicle/status/actuation_status"; + [SerializeField] private string _frameId = "base_link"; + + [Range(1, 60)][SerializeField] private int _publishHz = 30; + [SerializeField] private QoSSettings _qosSettings; + + // messages + private autoware_vehicle_msgs.msg.ControlModeReport _controlModeReportMsg; + private autoware_vehicle_msgs.msg.GearReport _gearReportMsg; + private autoware_vehicle_msgs.msg.SteeringReport _steeringReportMsg; + private autoware_vehicle_msgs.msg.TurnIndicatorsReport _turnIndicatorsReportMsg; + private autoware_vehicle_msgs.msg.HazardLightsReport _hazardLightsReportMsg; + private autoware_vehicle_msgs.msg.VelocityReport _velocityReportMsg; + private tier4_vehicle_msgs.msg.ActuationStatusStamped _actuationStatusReport; + + // publisher + private IPublisher _controlModeReportPublisher; + private IPublisher _gearReportPublisher; + private IPublisher _steeringReportPublisher; + private IPublisher _turnIndicatorsReportPublisher; + private IPublisher _hazardLightsReportPublisher; + private IPublisher _velocityReportPublisher; + private IPublisher _actuationStatusPublisher; + + private bool _isInitialized; + + private void Start() + { + InitializePublishers(); + InitializeMessages(); + _isInitialized = true; + if (_isInitialized) + { + StartCoroutine(PublishRoutine()); + } + } + + private IEnumerator PublishRoutine() + { + var interval = 1.0f / _publishHz; + interval -= 0.00001f; // Allow for accuracy errors. + while (true) + { + UpdateMessages(); + PublishMessages(); + yield return new WaitForSeconds(interval); + } + } + + private void InitializePublishers() + { + var qos = _qosSettings.GetQoSProfile(); + _controlModeReportPublisher = + SimulatorROS2Node.CreatePublisher(_controlModeReportTopic, + qos); + _gearReportPublisher = + SimulatorROS2Node.CreatePublisher(_gearReportTopic, qos); + _steeringReportPublisher = + SimulatorROS2Node.CreatePublisher(_steeringReportTopic, qos); + _turnIndicatorsReportPublisher = + SimulatorROS2Node.CreatePublisher( + _turnIndicatorsReportTopic, qos); + _hazardLightsReportPublisher = + SimulatorROS2Node.CreatePublisher( + _hazardLightsReportTopic, qos); + _velocityReportPublisher = + SimulatorROS2Node.CreatePublisher(_velocityReportTopic, qos); + _actuationStatusPublisher = + SimulatorROS2Node.CreatePublisher(_ActuationStatusTopic, + qos); + } + + private void InitializeMessages() + { + _controlModeReportMsg = new autoware_vehicle_msgs.msg.ControlModeReport(); + _gearReportMsg = new autoware_vehicle_msgs.msg.GearReport(); + _steeringReportMsg = new autoware_vehicle_msgs.msg.SteeringReport(); + _turnIndicatorsReportMsg = new autoware_vehicle_msgs.msg.TurnIndicatorsReport(); + _hazardLightsReportMsg = new autoware_vehicle_msgs.msg.HazardLightsReport(); + _velocityReportMsg = new autoware_vehicle_msgs.msg.VelocityReport + { + Header = new std_msgs.msg.Header + { + Frame_id = _frameId, + } + }; + _actuationStatusReport = new tier4_vehicle_msgs.msg.ActuationStatusStamped + { + Header = new std_msgs.msg.Header() + { + Frame_id = _frameId, + } + }; + } + + private void UpdateMessages() + { + // ControlModeReport + _controlModeReportMsg.Mode = Ros2ToVPPUtilities.VPPToRos2ControlMode(_adapter.VpControlModeReport); + + // GearReport + _gearReportMsg.Report = Ros2ToVPPUtilities.VPPToRos2Shift(_adapter.VpGearReport); + + // SteeringReport + _steeringReportMsg.Steering_tire_angle = -1 * _adapter.VpSteeringReport * Mathf.Deg2Rad; + + // TurnIndicatorsReport + _turnIndicatorsReportMsg.Report = Ros2ToVPPUtilities.VPPToRos2TurnSignal(_adapter.VehicleSignalInput); + + // HazardLightsReport + _hazardLightsReportMsg.Report = Ros2ToVPPUtilities.VPPToRos2Hazard(_adapter.VehicleSignalInput); + + // VelocityReport + var rosLinearVelocity = ROS2Utility.UnityToRosPosition(_adapter.VpVelocityReport); + var rosAngularVelocity = ROS2Utility.UnityToRosPosition(_adapter.VpAngularVelocityReport); + _velocityReportMsg.Longitudinal_velocity = rosLinearVelocity.x; + _velocityReportMsg.Lateral_velocity = rosLinearVelocity.y; + _velocityReportMsg.Heading_rate = rosAngularVelocity.z; + + // ActuationStatusReport + _actuationStatusReport.Status.Accel_status = _adapter.VpThrottleStatusReport; + _actuationStatusReport.Status.Brake_status = _adapter.VpBrakeStatusReport; + _actuationStatusReport.Status.Steer_status = _adapter.VpSteerStatusReport; + + // Update timestamps + var time = SimulatorROS2Node.GetCurrentRosTime(); + _controlModeReportMsg.Stamp = time; + _gearReportMsg.Stamp = time; + _steeringReportMsg.Stamp = time; + _turnIndicatorsReportMsg.Stamp = time; + _hazardLightsReportMsg.Stamp = time; + + MessageWithHeader velocityReportMsgHeader = _velocityReportMsg; + SimulatorROS2Node.UpdateROSTimestamp(ref velocityReportMsgHeader); + MessageWithHeader actuationStatusReportHeader = _actuationStatusReport; + SimulatorROS2Node.UpdateROSTimestamp(ref actuationStatusReportHeader); + } + + private void PublishMessages() + { + _controlModeReportPublisher.Publish(_controlModeReportMsg); + _gearReportPublisher.Publish(_gearReportMsg); + _steeringReportPublisher.Publish(_steeringReportMsg); + _turnIndicatorsReportPublisher.Publish(_turnIndicatorsReportMsg); + _hazardLightsReportPublisher.Publish(_hazardLightsReportMsg); + _velocityReportPublisher.Publish(_velocityReportMsg); + _actuationStatusPublisher.Publish(_actuationStatusReport); + } + + private void OnDestroy() + { + StopCoroutine(PublishRoutine()); + + SimulatorROS2Node.RemovePublisher(_controlModeReportPublisher); + SimulatorROS2Node.RemovePublisher(_gearReportPublisher); + SimulatorROS2Node.RemovePublisher(_steeringReportPublisher); + SimulatorROS2Node.RemovePublisher( + _turnIndicatorsReportPublisher); + SimulatorROS2Node.RemovePublisher( + _hazardLightsReportPublisher); + SimulatorROS2Node.RemovePublisher(_velocityReportPublisher); + SimulatorROS2Node.RemovePublisher(_actuationStatusPublisher); + } + } +} diff --git a/Assets/AWSIM/Scripts/Vehicles/VPP Integration/VPPToRos2Publisher.cs.meta b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/VPPToRos2Publisher.cs.meta new file mode 100644 index 000000000..eff5d0854 --- /dev/null +++ b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/VPPToRos2Publisher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a8d1cd8ae6a65d2f3bd79183dfecd210 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AWSIM/Scripts/Vehicles/VPP Integration/VPPVehicleSignalHandler.cs b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/VPPVehicleSignalHandler.cs new file mode 100644 index 000000000..a49ecc077 --- /dev/null +++ b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/VPPVehicleSignalHandler.cs @@ -0,0 +1,151 @@ +using AWSIM.Scripts.Vehicles.VPP_Integration.Enums; +using UnityEngine; +using UnityEngine.Serialization; +using VehiclePhysics; + +namespace AWSIM.Scripts.Vehicles.VPP_Integration +{ + // Handle the signals for the VPP vehicle + + [RequireComponent(typeof(AutowareVPPAdapter))] + [RequireComponent(typeof(VPVehicleController))] + public class VPPVehicleSignalHandler : MonoBehaviour + { + [SerializeField] private AutowareVPPAdapter _adapter; + [SerializeField] private VPVehicleController _vpVehicle; + + [Header("BrakeLight")] + [SerializeField] + private VehicleVisualEffect.EmissionMaterial[] brakeLights; + + [Header("TurnSignal")] + [SerializeField] + private VehicleVisualEffect.EmissionMaterial[] leftTurnSignalLights; + + [SerializeField] private VehicleVisualEffect.EmissionMaterial[] rightTurnSignalLights; + [SerializeField] private float _turnSignalTimerIntervalSec = 0.5f; + private float _turnSignalTimer; + private bool _turnSignalOn; + + [Header("ReverseLight")] + [SerializeField] + private VehicleVisualEffect.EmissionMaterial[] _reverseLights; + + private void Reset() + { + if (_adapter == null) + _adapter = GetComponent(); + if (_vpVehicle == null) + _vpVehicle = GetComponent(); + } + + private void Start() + { + foreach (var e in brakeLights) e.Initialize(); + foreach (var e in leftTurnSignalLights) e.Initialize(); + foreach (var e in rightTurnSignalLights) e.Initialize(); + foreach (var e in _reverseLights) e.Initialize(); + } + + private void Update() + { + // User input for turn signal. + if (Input.GetKey(KeyCode.Alpha1)) + _adapter.VehicleSignalInput = VPPSignal.Left; + else if (Input.GetKey(KeyCode.Alpha2)) + _adapter.VehicleSignalInput = VPPSignal.Right; + else if (Input.GetKey(KeyCode.Alpha3)) + _adapter.VehicleSignalInput = VPPSignal.Hazard; + else if (Input.GetKey(KeyCode.Alpha4)) + _adapter.VehicleSignalInput = VPPSignal.None; + + // brake light. + var isBrakeLight = IsBrakeLight(); + ApplyLights(brakeLights, isBrakeLight); + + // reverse light. + var isReverseLight = IsReverseLight(); + ApplyLights(_reverseLights, isReverseLight); + + // User input for brake & reverse light. + if (Input.GetKey(KeyCode.S) || Input.GetKey(KeyCode.Space)) + { + ApplyLights(brakeLights, true); + } + + if (_vpVehicle.data.bus[Channel.Vehicle][VehicleData.GearboxMode] == (int)Gearbox.AutomaticGear.R) + { + ApplyLights(brakeLights, true); + ApplyLights(_reverseLights, true); + } + + // turn signal light. + if (IsTurnSignalOn() == false) + { + _turnSignalTimer = 0; + _turnSignalOn = false; + ApplyLights(leftTurnSignalLights, false); + ApplyLights(rightTurnSignalLights, false); + return; + } + + _turnSignalTimer -= Time.deltaTime; + if (_turnSignalTimer < 0f) + { + _turnSignalTimer = _turnSignalTimerIntervalSec; + _turnSignalOn = !_turnSignalOn; + } + + var isTurnLeftLight = IsTurnLeftLight(); + ApplyLights(leftTurnSignalLights, isTurnLeftLight); + + var isTurnRightLight = IsTurnRightLight(); + ApplyLights(rightTurnSignalLights, isTurnRightLight); + } + + private bool IsBrakeLight() + { + return (_adapter.AutomaticShiftInput == Gearbox.AutomaticGear.D && _adapter.CurrentSpeed < 0) + || (_adapter.AutomaticShiftInput == Gearbox.AutomaticGear.R && _adapter.CurrentSpeed < 0); + } + + private bool IsReverseLight() + { + return _adapter.AutomaticShiftInput == Gearbox.AutomaticGear.R; + } + + private bool IsTurnSignalOn() + { + return _adapter.VehicleSignalInput is + VPPSignal.Left or VPPSignal.Right or VPPSignal.Hazard; + } + + private bool IsTurnLeftLight() + { + return _adapter.VehicleSignalInput is + VPPSignal.Left or VPPSignal.Hazard && _turnSignalOn; + } + + private bool IsTurnRightLight() + { + return _adapter.VehicleSignalInput is + VPPSignal.Right or VPPSignal.Hazard && _turnSignalOn; + } + + private static void ApplyLights(VehicleVisualEffect.EmissionMaterial[] emissionMaterials, bool isOn) + { + foreach (var e in emissionMaterials) + { + e.Set(isOn); + } + } + + private void OnDestroy() + { + foreach (var e in brakeLights) e.Destroy(); + foreach (var e in leftTurnSignalLights) e.Destroy(); + foreach (var e in rightTurnSignalLights) e.Destroy(); + foreach (var e in _reverseLights) e.Destroy(); + } + } +} diff --git a/Assets/AWSIM/Scripts/Vehicles/VPP Integration/VPPVehicleSignalHandler.cs.meta b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/VPPVehicleSignalHandler.cs.meta new file mode 100644 index 000000000..d3111f4c3 --- /dev/null +++ b/Assets/AWSIM/Scripts/Vehicles/VPP Integration/VPPVehicleSignalHandler.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e59ef37f82b1643d0a1d62edf54a2c1b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AWSIM/Scripts/Vehicles/VehicleVisualEffect.cs b/Assets/AWSIM/Scripts/Vehicles/VehicleVisualEffect.cs index 6f760b16a..28922edb5 100644 --- a/Assets/AWSIM/Scripts/Vehicles/VehicleVisualEffect.cs +++ b/Assets/AWSIM/Scripts/Vehicles/VehicleVisualEffect.cs @@ -11,30 +11,32 @@ namespace AWSIM /// //TODO: Implement proper lighting system for vehicle. - [RequireComponent(typeof(Vehicle))] public class VehicleVisualEffect : MonoBehaviour { [Serializable] public class EmissionMaterial { - [SerializeField] MeshRenderer meshRenderer; - [SerializeField] int materialIndex; - [SerializeField] Color lightingColor; - [SerializeField] float emissionIntensity; + [SerializeField] private MeshRenderer meshRenderer; + [SerializeField] private int materialIndex; + + [ColorUsage(false, true)] + [SerializeField] + private Color lightingColor; - Material material = null; - private Color defaultEmissionColor; + [SerializeField] private float emissionIntensity; - const string EmissionColor = "_EmissionColor"; + private Material _material; + private Color _defaultEmissionColor; + private const string EmissionColor = "_EmissionColor"; public void Initialize() { - if (material == null) + if (_material == null) { - material = meshRenderer.materials[materialIndex]; - material.EnableKeyword("_EMISSION"); - defaultEmissionColor = Color.black; + _material = meshRenderer.materials[materialIndex]; + _material.EnableKeyword("_EMISSION"); + _defaultEmissionColor = Color.black; } } @@ -42,35 +44,40 @@ public void Set(bool isLightOn) { if (isLightOn) { - material.SetColor(EmissionColor, lightingColor * emissionIntensity); + // _material.SetColor(EmissionColor, lightingColor * emissionIntensity); + _material.SetColor(EmissionColor, lightingColor); } else { - material.SetColor(EmissionColor, defaultEmissionColor); + _material.SetColor(EmissionColor, _defaultEmissionColor); } } public void Destroy() { - if (material != null) - UnityEngine.Object.Destroy(material); + if (_material != null) + UnityEngine.Object.Destroy(_material); } } [SerializeField] Vehicle vehicle; [Header("BrakeLight")] - [SerializeField] EmissionMaterial[] brakeLights; + [SerializeField] + EmissionMaterial[] brakeLights; [Header("TurnSignal")] - [SerializeField] EmissionMaterial[] leftTurnSignalLights; + [SerializeField] + EmissionMaterial[] leftTurnSignalLights; + [SerializeField] EmissionMaterial[] rightTurnSignalLights; [SerializeField] float turnSignalTimerIntervalSec = 0.5f; float turnSignalTimer = 0; bool turnSignalOn = false; [Header("ReverseLight")] - [SerializeField] EmissionMaterial[] reverseLights; + [SerializeField] + EmissionMaterial[] reverseLights; void Reset() { @@ -131,7 +138,7 @@ void Update() bool IsBrakeLight() { return (vehicle.AutomaticShiftInput == Vehicle.Shift.DRIVE && vehicle.AccelerationInput < 0) - || (vehicle.AutomaticShiftInput == Vehicle.Shift.REVERSE && vehicle.AccelerationInput < 0); + || (vehicle.AutomaticShiftInput == Vehicle.Shift.REVERSE && vehicle.AccelerationInput < 0); } bool IsReverseLight() @@ -142,22 +149,22 @@ bool IsReverseLight() bool IsTurnSignalOn() { return ((vehicle.SignalInput == Vehicle.TurnSignal.LEFT) - || ((vehicle.SignalInput == Vehicle.TurnSignal.RIGHT) - || (vehicle.SignalInput == Vehicle.TurnSignal.HAZARD))); + || ((vehicle.SignalInput == Vehicle.TurnSignal.RIGHT) + || (vehicle.SignalInput == Vehicle.TurnSignal.HAZARD))); } bool IsTurnLeftLight() { return ((vehicle.SignalInput == Vehicle.TurnSignal.LEFT) - || (vehicle.SignalInput == Vehicle.TurnSignal.HAZARD)) - && turnSignalOn; + || (vehicle.SignalInput == Vehicle.TurnSignal.HAZARD)) + && turnSignalOn; } bool IsTurnRightLight() { return ((vehicle.SignalInput == Vehicle.TurnSignal.RIGHT) - || (vehicle.SignalInput == Vehicle.TurnSignal.HAZARD)) - && turnSignalOn; + || (vehicle.SignalInput == Vehicle.TurnSignal.HAZARD)) + && turnSignalOn; } void ApplyLights(EmissionMaterial[] emissionMaterials, bool isOn) diff --git a/Assets/Vehicle Physics Pro.meta b/Assets/Vehicle Physics Pro.meta new file mode 100644 index 000000000..181a9490f --- /dev/null +++ b/Assets/Vehicle Physics Pro.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a27b0d41643df94e49b0e8cd16f73f49 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Vehicle Physics Pro/.gitignore b/Assets/Vehicle Physics Pro/.gitignore new file mode 100644 index 000000000..8b6c78f0d --- /dev/null +++ b/Assets/Vehicle Physics Pro/.gitignore @@ -0,0 +1,7 @@ +# Ignore everything except directories +* +!*/ + +# But not these files... +!.gitignore +!/Editor/csc.rsp* diff --git a/Assets/Vehicle Physics Pro/Editor/csc.rsp b/Assets/Vehicle Physics Pro/Editor/csc.rsp new file mode 100644 index 000000000..da6a88339 --- /dev/null +++ b/Assets/Vehicle Physics Pro/Editor/csc.rsp @@ -0,0 +1 @@ +-warn:0 diff --git a/Assets/Vehicle Physics Pro/Editor/csc.rsp.meta b/Assets/Vehicle Physics Pro/Editor/csc.rsp.meta new file mode 100644 index 000000000..b0eec1ae4 --- /dev/null +++ b/Assets/Vehicle Physics Pro/Editor/csc.rsp.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 996489e29286dd5e694b0e8f8a1c4aaf +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/ProjectSettings/DynamicsManager.asset b/ProjectSettings/DynamicsManager.asset index 1be85f283..ad5b315ee 100644 --- a/ProjectSettings/DynamicsManager.asset +++ b/ProjectSettings/DynamicsManager.asset @@ -9,7 +9,7 @@ PhysicsManager: m_BounceThreshold: 2 m_DefaultMaxDepenetrationVelocity: 10 m_SleepThreshold: 0.005 - m_DefaultContactOffset: 0.01 + m_DefaultContactOffset: 0.02 m_DefaultSolverIterations: 6 m_DefaultSolverVelocityIterations: 1 m_QueriesHitBackfaces: 0 @@ -17,15 +17,15 @@ PhysicsManager: m_EnableAdaptiveForce: 0 m_ClothInterCollisionDistance: 0 m_ClothInterCollisionStiffness: 0 - m_ContactsGeneration: 1 - m_LayerCollisionMatrix: ffefffffffefffffffefffffffffffffffefffffffefffffbfefffffffffffffffffffffffffffffffffffffffefffff88e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + m_ContactsGeneration: 0 + m_LayerCollisionMatrix: fffffdfffffffdfffffffdfffffffffffffffdffffffffffbffffffffffffffffffffffffffffffffffffdffffffffffffffffffffffffffffffffffffffffffffffffffe8fbfdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff m_SimulationMode: 0 - m_AutoSyncTransforms: 0 - m_ReuseCollisionCallbacks: 1 + m_AutoSyncTransforms: 1 + m_ReuseCollisionCallbacks: 0 m_InvokeCollisionCallbacks: 1 m_ClothInterCollisionSettingsToggle: 0 m_ClothGravity: {x: 0, y: -9.81, z: 0} - m_ContactPairsMode: 0 + m_ContactPairsMode: 3 m_BroadphaseType: 0 m_WorldBounds: m_Center: {x: 0, y: 0, z: 0} diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 90a406a9e..2bfea1bb4 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -141,7 +141,7 @@ PlayerSettings: loadStoreDebugModeEnabled: 0 visionOSBundleVersion: 1.0 tvOSBundleVersion: 1.0 - bundleVersion: 1.3.1 + bundleVersion: 1.4.0 preloadedAssets: [] metroInputSource: 0 wsaTransparentSwapchain: 0 diff --git a/ProjectSettings/QualitySettings.asset b/ProjectSettings/QualitySettings.asset index 3d5d6879f..7f271d5ca 100644 --- a/ProjectSettings/QualitySettings.asset +++ b/ProjectSettings/QualitySettings.asset @@ -4,7 +4,7 @@ QualitySettings: m_ObjectHideFlags: 0 serializedVersion: 5 - m_CurrentQuality: 1 + m_CurrentQuality: 3 m_QualitySettings: - serializedVersion: 3 name: Low @@ -88,7 +88,7 @@ QualitySettings: streamingMipmapsRenderersPerFrame: 256 streamingMipmapsMaxLevelReduction: 4 streamingMipmapsMaxFileIORequests: 512 - particleRaycastBudget: 2048 + particleRaycastBudget: 1024 asyncUploadTimeSlice: 2 asyncUploadBufferSize: 16 asyncUploadPersistentBuffer: 1 @@ -137,7 +137,7 @@ QualitySettings: streamingMipmapsRenderersPerFrame: 512 streamingMipmapsMaxLevelReduction: 6 streamingMipmapsMaxFileIORequests: 512 - particleRaycastBudget: 4096 + particleRaycastBudget: 1024 asyncUploadTimeSlice: 2 asyncUploadBufferSize: 16 asyncUploadPersistentBuffer: 1 @@ -186,7 +186,7 @@ QualitySettings: streamingMipmapsRenderersPerFrame: 512 streamingMipmapsMaxLevelReduction: 7 streamingMipmapsMaxFileIORequests: 1024 - particleRaycastBudget: 4096 + particleRaycastBudget: 1024 asyncUploadTimeSlice: 2 asyncUploadBufferSize: 16 asyncUploadPersistentBuffer: 1 diff --git a/docs/Components/Vehicle/EgoVehicle/index.md b/docs/Components/Vehicle/EgoVehicle/index.md index da4d6c2c7..1ca7e1b77 100644 --- a/docs/Components/Vehicle/EgoVehicle/index.md +++ b/docs/Components/Vehicle/EgoVehicle/index.md @@ -7,7 +7,7 @@ The default prefab `EgoVehicle` was developed using a *Lexus RX450h 2015* vehicl ![vehicle](vehicle.png) !!! tip "Own EgoVehicle prefab" - If you would like to develop your own `EgoVehicle` prefab, we encourage you to read this [tutorial](../../../Components/Vehicle/AddNewVehicle/AddAVehicle/). + If you would like to develop your own `EgoVehicle` prefab, we encourage you to read this [tutorial](../../../Components/Vehicle/AddNewVehicle/AddAVehicle/). ### Supported features diff --git a/docs/Components/Vehicle/VPPIntegration/index.md b/docs/Components/Vehicle/VPPIntegration/index.md new file mode 100644 index 000000000..f215a1d03 --- /dev/null +++ b/docs/Components/Vehicle/VPPIntegration/index.md @@ -0,0 +1,146 @@ +# VPP Integration with the Ego Vehicle + +VPP is a package that provides realistic vehicle simulation. Here you can find a guide on how to integrate VPP with the +Ego Vehicle. + +!!! tip "Example Vehicle" + It is recommended to take a look at the default Lexus vehicle prefab as example to see how the components are set up. + +## Initial setup + +To be able to use VPP with the ego vehicle, please attach these components to the vehicle prefab: +From the VPP package: + +Added to prefab root: + +- `Vehicle Controller` +- `Standard Input` +- `Camera Target` (Optional, you can use your own implementation) +- `Telemetry Window` (Optional, used to display telemetry data) +- `Visual Effects` (Optional, used to visualize the steering wheel) + +!!! warning "Wheel Colliders" + VPP uses its own implementation of the `Wheel Colliders`! For the wheel colliders, please add the `Wheel Colliders` + provided by the VPP package. They share the same name with the default Unity components. + +After adding those scripts continue with adding the following components to the vehicle prefab: + +Added to prefab root: + +- `AutowareVPPAdapter.cs`: Used for applying the control inputs to the vehicle. +- `Ros2ToVPPInput.cs`: Used for receiving the control inputs from the Autoware. +- `VPPVehicleSignalHandler.cs`: Used for handling the signals from the vehicle. +- `BirdEyeView.cs`: Used for providing top-down ortho view. + +To be able to report the vehicle state to the Autoware, you'll need this script in the URDF. +_This script is added in the `VehicleStatusSensor` prefab by default._ + +Added to URDF: + +- `VPPToRos2Publisher.cs`: Used for publishing the vehicle state to the Autoware. + +## Setting up the components + +After doing the initial setup, we will need to configure the components for your vehicle. + +Set up the `Vehicle Controller` and the `Wheel Colliders` with the correct values for your vehicle. Using values from +the real vehicles will result in a more realistic simulation. + +You can refer to [VPP documentation](https://vehiclephysics.com/components/component-guide/) for more detailed +information about the VPP components. + +As for the other components we've added to the vehicle, we have to give their necessary references. + +!!! warning "Camera Controller" + If you've added the `Camera Target` component, you'll need a separate gameObject with a `Camera Controller`. Don't + forget to assign vehicle Transform reference in this component. This is used by default in the `AutowareSimulation` + scene. + +### AutowareVPPAdapter.cs + +| Variable | Description | +|--------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `Front Wheels` | Used for handling the steering input. Assign the front wheel colliders of the vehicle. | +| `Simulate Steering` | Simulate the steering instead of assigning wheel angles directly. | +| `Steer Wheel Input` | Change applied to steering wheel when simulating steering. Applied every in fixed update as an input to the VPP steering. _(0-100)_ | +| `Emergency Brake Percent` | The amount of brake pedal percent applied when the emergency is triggered. _(0-100)_ | +| `Update Position Offset Y` | The height offset value for the vehicle position when initializing position of the vehicle from the Rviz. _(In meters)_ | +| `Update Position Ray Origin Y` | The height of the raycast origin for the vehicle position when initializing position of the vehicle from the Rviz. _(In meters)_ | +| `Do Pedal Calibration` | Mode for vehicle pedal calibration. If enabled the vehicle pedals can be set to certain percentages with Numpad(-,+,0) keys. Uses %10 increments by default. | + +### Ros2ToVPPInput.cs + +| Variable | Description | +|-----------|---------------------------------------------------------------------------------------------------------| +| `Adapter` | Reference to the `AutowareVPPAdapter` script. _(Drag the object that has the corresponding component.)_ | +| `Topics` | Topics used in the Ros2 communication. You can change the topics according to your case. | + +- `QoS Settings`: Quality of Service settings for the Ros2 communication. Currently, it is as follows: + +| Variable | Value | +|----------------------|-----------------| +| `Reliability Policy` | Reliable | +| `Durability Policy` | Transient Local | +| `History Policy` | Keep Last | +| `Depth` | 1 | + +- `Position QoS Setttings`: QoS settings for the position topic: + +| Variable | Value | +|----------------------|-----------| +| `Reliability Policy` | Reliable | +| `Durability Policy` | Volatile | +| `History Policy` | Keep Last | +| `Depth` | 1 | + +- `Actuation QoS Setttings`: QoS settings for the actuation topic: + +| Variable | Value | +|----------------------|-----------| +| `Reliability Policy` | Reliable | +| `Durability Policy` | Volatile | +| `History Policy` | Keep Last | +| `Depth` | 1 | + +### VehicleSignalHandler.cs + +| Variable | Description | +|--------------|---------------------------------------------------------------------------------------------------------| +| `Adapter` | Reference to the `AutowareVPPAdapter` script. _(Drag the object that has the corresponding component.)_ | +| `Vp Vehicle` | Reference to the `Vehicle Controller` script. _(Drag the object that has the corresponding component.)_ | + +Rest of the signal related settings are same as `VehicleVisualEffect.cs`. These two scripts are basically same. + +### VPPToRos2Publisher.cs + +Same as `VehicleStatusSensor.cs` but the `Adapter` reference is the `AutowareVPPAdapter` script. + +## Setting up the child objects + +For the VPP to work correctly, you need to set up the child objects of the vehicle prefab. + +### Setting up the reference for Ackermann Steering: + +1. Create an empty game object named `"Ackermann"` and set as the direct child of the prefab. Then assign reference in + the `Vehicle Controller`. +2. Move position of the created game object to the middle of the rear axle and set its height to the bottom of the rear + wheels. Make sure the rotations are `(0,0,0)` + +Assign the reference in the `Vehicle Controller`. For details, you can refer to the VPP. + +VPP Reference: [Ackermann](https://vehiclephysics.com/blocks/steering/) + +### Setting up the reference for Dynamics: + +1. Create an empty game object named `"Dynamics"` and set as the direct child of the prefab. Add the following + components to this object: + - `Rolling Friction` + - `Anti-roll Bar` (x2) + +2. Create an empty game object named `"Aero"` and set as the child of the "Dynamics". Add the following + components to this object: + - `Aerodynamic Surface` + +Assign the references in the `Vehicle Controller`. For configuring these components, you can refer to the VPP documentation. + +VPP Reference: [Dynamics](https://vehiclephysics.com/components/vehicle-dynamics/) diff --git a/docs/DeveloperGuide/EditorSetup/VPPCommunityEdition/index.md b/docs/DeveloperGuide/EditorSetup/VPPCommunityEdition/index.md new file mode 100644 index 000000000..75c6e31d0 --- /dev/null +++ b/docs/DeveloperGuide/EditorSetup/VPPCommunityEdition/index.md @@ -0,0 +1,28 @@ +# Vehicle Physics Pro Community Edition + +## Add VPP-CE from Asset Store + +- Go to Unity Asset Store and add VPP-CE to personal assets. + +[Vehicle Physics Pro Asset Store link](https://assetstore.unity.com/packages/tools/physics/vehicle-physics-pro-community-edition-153556) + +## Add VPP-CE to the Unity Editor + +1. Open up the Unity Editor. +2. Go to the `Window` menu and select `Package Manager`. +3. Make sure the `My Assets` tab is selected from the top left of the Package Manager window. +4. Find & select the VPP-CE from the list and click `Download` or `Import` from the bottom left of the Package Manager + window. +5. There will be a popup window showing contents of the package. + - Select `Sdk` folder to import. Rest of the content is optional. + - Click `Import` to add VPP-CE to the project. + +## Useful links: + +Unity Package manager: + +- [Manual](https://docs.unity3d.com/Manual/upm-ui.html) + +VPP Website: + +- [Vehicle Physics](https://vehiclephysics.com/) diff --git a/docs/GettingStarted/QuickStartDemo/index.md b/docs/GettingStarted/QuickStartDemo/index.md index 1b6de1239..8fe0c5274 100644 --- a/docs/GettingStarted/QuickStartDemo/index.md +++ b/docs/GettingStarted/QuickStartDemo/index.md @@ -206,15 +206,20 @@ rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO ``` colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ``` -8. Launch Autoware. +8. Provide pedal maps to Autoware. + Copy default Lexus pedal maps to the following location: + Pedal Maps: [Google Drive Link](https://drive.google.com/drive/folders/1S0fcNHzkiF3F03hWqonQW8SYKPb2zQo-?usp=drive_link) + Location: `.../autoware/install/autoware_raw_vehicle_cmd_converter/share/autoware_raw_vehicle_cmd_converter/data/default/` + +9. Launch Autoware. ``` source install/setup.bash -ros2 launch autoware_launch e2e_simulator.launch.xml vehicle_model:=sample_vehicle sensor_model:=awsim_labs_sensor_kit map_path:= +ros2 launch autoware_launch e2e_simulator.launch.xml vehicle_model:=awsim_labs_vehicle sensor_model:=awsim_labs_sensor_kit map_path:= launch_vehicle_interface:=true # Use the absolute path for the map folder, don't use the ~ operator. # Example: -ros2 launch autoware_launch e2e_simulator.launch.xml vehicle_model:=sample_vehicle sensor_model:=awsim_labs_sensor_kit map_path:=/home/your_username/autoware_map/nishishinjuku_autoware_map +ros2 launch autoware_launch e2e_simulator.launch.xml vehicle_model:=awsim_labs_vehicle sensor_model:=awsim_labs_sensor_kit map_path:=/home/your_username/autoware_map/nishishinjuku_autoware_map launch_vehicle_interface:=true ``` ![](Image_2.png) diff --git a/docs/GettingStarted/SetupUnityProject/index.md b/docs/GettingStarted/SetupUnityProject/index.md index 483c679ef..42ede304b 100644 --- a/docs/GettingStarted/SetupUnityProject/index.md +++ b/docs/GettingStarted/SetupUnityProject/index.md @@ -142,6 +142,10 @@ To properly run and use AWSIM project in Unity it is required to download map pa The Externals directory is added to the `.gitignore` because the map has a large file size and should not be directly uploaded to the repository. +## Import Vehicle Physics Pro Community Edition Asset + +Import Vehicle Physics Pro CE by following these instructions: [VPP CE Setup](../../DeveloperGuide/EditorSetup/VPPCommunityEdition/index.md) + ## Import Graphy Asset Import Graphy by following these instructions: [Graphy Asset Setup](../../DeveloperGuide/EditorSetup/Graphy/index.md) diff --git a/mkdocs.yml b/mkdocs.yml index 9abeacc34..d9a4b36b3 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -134,6 +134,7 @@ nav: - Add Visual Elements: Components/Vehicle/AddNewVehicle/AddVisualElements/index.md - Customize Slip: Components/Vehicle/CustomizeSlip/index.md - FollowCamera: Components/Vehicle/FollowCamera/index.md + - VPP Integration: Components/Vehicle/VPPIntegration/index.md - Sensors: - LiDAR Sensor: - LiDAR Sensor: Components/Sensors/LiDARSensor/LiDARSensor/index.md @@ -180,6 +181,7 @@ nav: - VSCode Configuration: DeveloperGuide/EditorSetup/VSCode/index.md - Rider Configuration: DeveloperGuide/EditorSetup/JetBrainsRider/index.md - Graphy Asset Setup: DeveloperGuide/EditorSetup/Graphy/index.md + - Vehicle Physics Pro CE Setup: DeveloperGuide/EditorSetup/VPPCommunityEdition/index.md - Trouble shooting: DeveloperGuide/TroubleShooting/index.md - Documentation: DeveloperGuide/Documentation/index.md - License : DeveloperGuide/License/index.md