Merge branch 'master' of http://172.16.1.12/huangjiayu/H_SafeExperienceDrivingSystem
# Conflicts: # U3D_DrivingSystem/Assets/Scenes/main_.unity
This commit is contained in:
commit
758e298b58
|
|
@ -1963,7 +1963,7 @@ ConfigurableJoint:
|
||||||
m_Anchor: {x: 0, y: -0.5, z: 0}
|
m_Anchor: {x: 0, y: -0.5, z: 0}
|
||||||
m_Axis: {x: 1, y: 0, z: 0}
|
m_Axis: {x: 1, y: 0, z: 0}
|
||||||
m_AutoConfigureConnectedAnchor: 1
|
m_AutoConfigureConnectedAnchor: 1
|
||||||
m_ConnectedAnchor: {x: -0.39498428, y: 0.70000005, z: -0.044983614}
|
m_ConnectedAnchor: {x: -0.394989, y: 0.70000005, z: -0.04498291}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_SecondaryAxis: {x: 0, y: 1, z: 0}
|
m_SecondaryAxis: {x: 0, y: 1, z: 0}
|
||||||
m_XMotion: 0
|
m_XMotion: 0
|
||||||
|
|
@ -2695,6 +2695,8 @@ GameObject:
|
||||||
- component: {fileID: 11454394}
|
- component: {fileID: 11454394}
|
||||||
- component: {fileID: 11462602}
|
- component: {fileID: 11462602}
|
||||||
- component: {fileID: 11410574}
|
- component: {fileID: 11410574}
|
||||||
|
- component: {fileID: 1276762318}
|
||||||
|
- component: {fileID: 1276762327}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Sport Coupe Drift
|
m_Name: Sport Coupe Drift
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
|
|
@ -2723,6 +2725,7 @@ Transform:
|
||||||
- {fileID: 2793264845307687955}
|
- {fileID: 2793264845307687955}
|
||||||
- {fileID: 2286986072208732639}
|
- {fileID: 2286986072208732639}
|
||||||
- {fileID: 5723886156076664925}
|
- {fileID: 5723886156076664925}
|
||||||
|
- {fileID: 1911478032}
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_RootOrder: 0
|
m_RootOrder: 0
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
|
@ -2787,7 +2790,7 @@ MonoBehaviour:
|
||||||
centerOfMassPosition: 0.567
|
centerOfMassPosition: 0.567
|
||||||
centerOfMassHeightOffset: 0
|
centerOfMassHeightOffset: 0
|
||||||
centerOfMassTransform: {fileID: 0}
|
centerOfMassTransform: {fileID: 0}
|
||||||
maxSpeedForward: 60
|
maxSpeedForward: 20
|
||||||
maxSpeedReverse: 16
|
maxSpeedReverse: 16
|
||||||
tireFriction: 1
|
tireFriction: 1
|
||||||
rollingResistance: 0.05
|
rollingResistance: 0.05
|
||||||
|
|
@ -2964,7 +2967,7 @@ MonoBehaviour:
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 198400}
|
m_GameObject: {fileID: 198400}
|
||||||
m_Enabled: 1
|
m_Enabled: 0
|
||||||
m_EditorHideFlags: 0
|
m_EditorHideFlags: 0
|
||||||
m_Script: {fileID: 11500000, guid: ca79ba03ebacd504783b096c3667cfbd, type: 3}
|
m_Script: {fileID: 11500000, guid: ca79ba03ebacd504783b096c3667cfbd, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
|
|
@ -3065,6 +3068,45 @@ MonoBehaviour:
|
||||||
brakesMaterialIndex: 0
|
brakesMaterialIndex: 0
|
||||||
brakesOnMaterial: {fileID: 2100000, guid: cf2165b8c0c410449aa0bc0d325c65eb, type: 2}
|
brakesOnMaterial: {fileID: 2100000, guid: cf2165b8c0c410449aa0bc0d325c65eb, type: 2}
|
||||||
brakesOffMaterial: {fileID: 2100000, guid: 9251e20ab7ba62c4ebf2437bc9eb9de6, type: 2}
|
brakesOffMaterial: {fileID: 2100000, guid: 9251e20ab7ba62c4ebf2437bc9eb9de6, type: 2}
|
||||||
|
--- !u!114 &1276762318
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 198400}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: b4decbca4aaf413abd074ba71736660a, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
currentGear: 1
|
||||||
|
gearSpeeds:
|
||||||
|
- 0
|
||||||
|
- 5
|
||||||
|
- 40
|
||||||
|
- 60
|
||||||
|
xx: 0
|
||||||
|
carInfoManager: {fileID: 0}
|
||||||
|
thirdPerson: {fileID: 0}
|
||||||
|
firstPerson: {fileID: 3190887408370009811}
|
||||||
|
shache:
|
||||||
|
- {fileID: 9404289244154715}
|
||||||
|
- {fileID: 1911478031}
|
||||||
|
--- !u!114 &1276762327
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 198400}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 5be1af227faf7b740b2a9b062718d7d9, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
puncture: {fileID: 9404289244154715}
|
||||||
|
UIl: {fileID: 0}
|
||||||
--- !u!1 &199004
|
--- !u!1 &199004
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -3297,6 +3339,102 @@ BoxCollider:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_Size: {x: 1, y: 1, z: 1}
|
m_Size: {x: 1, y: 1, z: 1}
|
||||||
m_Center: {x: 0, y: 0, z: 0}
|
m_Center: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!1 &1911478031
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 1911478032}
|
||||||
|
- component: {fileID: 1911478035}
|
||||||
|
- component: {fileID: 1911478034}
|
||||||
|
- component: {fileID: 1911478033}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: "\u7206\u80CE (1)"
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 0
|
||||||
|
--- !u!4 &1911478032
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1911478031}
|
||||||
|
m_LocalRotation: {x: -0.26746163, y: -0.055704076, z: 0.043036826, w: 0.9609938}
|
||||||
|
m_LocalPosition: {x: -0.804, y: 0.114, z: -0.743}
|
||||||
|
m_LocalScale: {x: 0.4536, y: 0.072123155, z: 0.36368668}
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 448752}
|
||||||
|
m_RootOrder: 10
|
||||||
|
m_LocalEulerAnglesHint: {x: -30.615, y: -8.694, z: 7.512}
|
||||||
|
--- !u!33 &1911478035
|
||||||
|
MeshFilter:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1911478031}
|
||||||
|
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
|
||||||
|
--- !u!23 &1911478034
|
||||||
|
MeshRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1911478031}
|
||||||
|
m_Enabled: 0
|
||||||
|
m_CastShadows: 1
|
||||||
|
m_ReceiveShadows: 1
|
||||||
|
m_DynamicOccludee: 1
|
||||||
|
m_StaticShadowCaster: 0
|
||||||
|
m_MotionVectors: 1
|
||||||
|
m_LightProbeUsage: 1
|
||||||
|
m_ReflectionProbeUsage: 1
|
||||||
|
m_RayTracingMode: 2
|
||||||
|
m_RayTraceProcedural: 0
|
||||||
|
m_RenderingLayerMask: 1
|
||||||
|
m_RendererPriority: 0
|
||||||
|
m_Materials:
|
||||||
|
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_StaticBatchInfo:
|
||||||
|
firstSubMesh: 0
|
||||||
|
subMeshCount: 0
|
||||||
|
m_StaticBatchRoot: {fileID: 0}
|
||||||
|
m_ProbeAnchor: {fileID: 0}
|
||||||
|
m_LightProbeVolumeOverride: {fileID: 0}
|
||||||
|
m_ScaleInLightmap: 1
|
||||||
|
m_ReceiveGI: 1
|
||||||
|
m_PreserveUVs: 0
|
||||||
|
m_IgnoreNormalsForChartDetection: 0
|
||||||
|
m_ImportantGI: 0
|
||||||
|
m_StitchLightmapSeams: 1
|
||||||
|
m_SelectedEditorRenderState: 3
|
||||||
|
m_MinimumChartSize: 4
|
||||||
|
m_AutoUVMaxDistance: 0.5
|
||||||
|
m_AutoUVMaxAngle: 89
|
||||||
|
m_LightmapParameters: {fileID: 0}
|
||||||
|
m_SortingLayerID: 0
|
||||||
|
m_SortingLayer: 0
|
||||||
|
m_SortingOrder: 0
|
||||||
|
m_AdditionalVertexStreams: {fileID: 0}
|
||||||
|
--- !u!65 &1911478033
|
||||||
|
BoxCollider:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1911478031}
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_IsTrigger: 0
|
||||||
|
m_Enabled: 1
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Size: {x: 1, y: 1, z: 1}
|
||||||
|
m_Center: {x: 0, y: 0, z: 0}
|
||||||
--- !u!1 &9404289244154715
|
--- !u!1 &9404289244154715
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -3315,7 +3453,7 @@ GameObject:
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
m_IsActive: 1
|
m_IsActive: 0
|
||||||
--- !u!4 &2793264845307687955
|
--- !u!4 &2793264845307687955
|
||||||
Transform:
|
Transform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -3324,7 +3462,7 @@ Transform:
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 9404289244154715}
|
m_GameObject: {fileID: 9404289244154715}
|
||||||
m_LocalRotation: {x: -0.26746163, y: -0.055704076, z: 0.043036826, w: 0.9609938}
|
m_LocalRotation: {x: -0.26746163, y: -0.055704076, z: 0.043036826, w: 0.9609938}
|
||||||
m_LocalPosition: {x: 0.693, y: 0.058, z: -0.81}
|
m_LocalPosition: {x: 0.693, y: 0.122, z: -0.744}
|
||||||
m_LocalScale: {x: 0.4536, y: 0.072123155, z: 0.36368668}
|
m_LocalScale: {x: 0.4536, y: 0.072123155, z: 0.36368668}
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 448752}
|
m_Father: {fileID: 448752}
|
||||||
|
|
@ -3345,7 +3483,7 @@ MeshRenderer:
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 9404289244154715}
|
m_GameObject: {fileID: 9404289244154715}
|
||||||
m_Enabled: 1
|
m_Enabled: 0
|
||||||
m_CastShadows: 1
|
m_CastShadows: 1
|
||||||
m_ReceiveShadows: 1
|
m_ReceiveShadows: 1
|
||||||
m_DynamicOccludee: 1
|
m_DynamicOccludee: 1
|
||||||
|
|
@ -3418,13 +3556,13 @@ Transform:
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 3190887408370009811}
|
m_GameObject: {fileID: 3190887408370009811}
|
||||||
m_LocalRotation: {x: -0.28546208, y: 0.00861602, z: -0.0025655522, w: -0.95834786}
|
m_LocalRotation: {x: 0.037859958, y: 0.015582657, z: -0.0005904539, w: 0.99916136}
|
||||||
m_LocalPosition: {x: 0.11001393, y: 4.044464, z: -5.319769}
|
m_LocalPosition: {x: -0.34838867, y: 1.23, z: 0.027679443}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 448752}
|
m_Father: {fileID: 448752}
|
||||||
m_RootOrder: 6
|
m_RootOrder: 6
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 4.34, y: 1.787, z: 0}
|
||||||
--- !u!20 &1592101705092406238
|
--- !u!20 &1592101705092406238
|
||||||
Camera:
|
Camera:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -32,14 +32,18 @@ namespace Script
|
||||||
private int NewValue = -1;
|
private int NewValue = -1;
|
||||||
|
|
||||||
|
|
||||||
public GameObject thirdPerson;//第三人称
|
public GameObject thirdPerson; //第三人称
|
||||||
public GameObject firstPerson;//第一人称
|
public GameObject firstPerson; //第一人称
|
||||||
|
|
||||||
|
|
||||||
|
public GameObject[] shache;
|
||||||
|
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
vehicleController = GetComponent<VehicleController>();
|
vehicleController = GetComponent<VehicleController>();
|
||||||
vehicleStandardInput = GetComponent<VehicleStandardInput>();
|
vehicleStandardInput = GetComponent<VehicleStandardInput>();
|
||||||
|
|
||||||
StartModbus();
|
StartModbus();
|
||||||
ModBusQueue();
|
ModBusQueue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -50,7 +54,7 @@ namespace Script
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
await client.SendModbusRequest();
|
await client.SendModbusRequest();
|
||||||
|
|
||||||
await Task.Delay(TimeSpan.FromSeconds(.1));
|
await Task.Delay(TimeSpan.FromSeconds(.1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -70,9 +74,6 @@ namespace Script
|
||||||
carData = client.modbusQueue.Dequeue();
|
carData = client.modbusQueue.Dequeue();
|
||||||
|
|
||||||
Debug.Log(vehicleController.steerInput);
|
Debug.Log(vehicleController.steerInput);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//方向盘
|
//方向盘
|
||||||
|
|
@ -128,7 +129,7 @@ namespace Script
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//转向灯 00是未开转向灯,1是左转向灯,2是右转向灯
|
//转向灯 00是未开转向灯,1是左转向灯,2是右转向灯
|
||||||
//当钥匙转为通电才能启动转向灯 0熄火,1通电,2启动
|
//当钥匙转为通电才能启动转向灯 0熄火,1通电,2启动
|
||||||
if (carData.IgnitionSwitch == 1)
|
if (carData.IgnitionSwitch == 1)
|
||||||
{
|
{
|
||||||
|
|
@ -145,21 +146,38 @@ namespace Script
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//上1,右2,下3,左4
|
//上1,右2,下3,左4
|
||||||
if (NewValue != carData.ButtonData)
|
if (NewValue != carData.ButtonData)
|
||||||
{
|
{
|
||||||
NewValue = carData.ButtonData;
|
NewValue = carData.ButtonData;
|
||||||
CarMenuButton(NewValue);
|
CarMenuButton(NewValue);
|
||||||
}
|
}
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
if (carData.BrakePedalPosition > 40)
|
||||||
|
{
|
||||||
|
if (shache[0].activeInHierarchy)
|
||||||
|
continue;
|
||||||
|
for (int i = 0; i < shache.Length; i++)
|
||||||
|
{
|
||||||
|
shache[i].SetActive(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
continue;
|
if (!shache[0].activeInHierarchy)
|
||||||
|
continue;
|
||||||
|
for (int i = 0; i < shache.Length; i++)
|
||||||
|
{
|
||||||
|
shache[i].SetActive(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await Task.Delay(TimeSpan.FromSeconds(.1));
|
await Task.Delay(TimeSpan.FromSeconds(.1));
|
||||||
|
|
@ -181,8 +199,6 @@ namespace Script
|
||||||
thirdPerson.SetActive(true);
|
thirdPerson.SetActive(true);
|
||||||
firstPerson.SetActive(false);
|
firstPerson.SetActive(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -157,15 +157,15 @@ namespace ModbusManager
|
||||||
carStatusData.IgnitionSwitch = dataValue;
|
carStatusData.IgnitionSwitch = dataValue;
|
||||||
break;
|
break;
|
||||||
case 1://左打方向盘为负数,右打方向盘为正数,打方向盘打死一圈半,数值1500。
|
case 1://左打方向盘为负数,右打方向盘为正数,打方向盘打死一圈半,数值1500。
|
||||||
Debug.Log($"方向盘数据: {(short)dataValue}");
|
// Debug.Log($"方向盘数据: {(short)dataValue}");
|
||||||
carStatusData.SteeringWheelAngle = (short)dataValue;
|
carStatusData.SteeringWheelAngle = (short)dataValue;
|
||||||
break;
|
break;
|
||||||
case 2://01为喇叭按下
|
case 2://01为喇叭按下
|
||||||
//Debug.Log($"方向盘上喇叭状态: {dataValue}");
|
// Debug.Log($"方向盘上喇叭状态: {dataValue}");
|
||||||
carStatusData.HornStatus = dataValue;
|
carStatusData.HornStatus = dataValue;
|
||||||
break;
|
break;
|
||||||
case 3://0-100,踩到底为100
|
case 3://0-100,踩到底为100
|
||||||
//Debug.Log($"刹车踏板数据: {dataValue}");
|
Debug.Log($"刹车踏板数据: {dataValue}");
|
||||||
carStatusData.BrakePedalPosition = dataValue;
|
carStatusData.BrakePedalPosition = dataValue;
|
||||||
break;
|
break;
|
||||||
case 4://0-100,踩到底为100
|
case 4://0-100,踩到底为100
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue