diff --git a/Assets/AddOns/RosSharp/Scripts/RosBridgeClient/RosCommuncation/TwistArrayStampedPublisher.cs b/Assets/AddOns/RosSharp/Scripts/RosBridgeClient/RosCommuncation/TwistArrayStampedPublisher.cs index 3292e70636da5f93e7d4da6da58db0889513b706..0bfbce5d8aadb1205d3b7f8e0bb126db51ba5c4c 100644 --- a/Assets/AddOns/RosSharp/Scripts/RosBridgeClient/RosCommuncation/TwistArrayStampedPublisher.cs +++ b/Assets/AddOns/RosSharp/Scripts/RosBridgeClient/RosCommuncation/TwistArrayStampedPublisher.cs @@ -5,9 +5,11 @@ namespace RosSharp.RosBridgeClient { public class TwistArrayStampedPublisher : Publisher<Messages.crowdbotsim.TwistArrayStamped> { + [System.NonSerialized] public Rigidbody[] agent; private Messages.crowdbotsim.TwistArrayStamped message; + [System.NonSerialized] public bool started = false; private bool initialized = false; diff --git a/Assets/AddOns/RosSharp/Scripts/RosBridgeClient/RosCommuncation/TwistArrayStampedSubscriber.cs b/Assets/AddOns/RosSharp/Scripts/RosBridgeClient/RosCommuncation/TwistArrayStampedSubscriber.cs index 313024eaef65be59d2be2758c3fb09789192e7f8..4b14aa274234574882d14495d4f7de445c8ab3a2 100644 --- a/Assets/AddOns/RosSharp/Scripts/RosBridgeClient/RosCommuncation/TwistArrayStampedSubscriber.cs +++ b/Assets/AddOns/RosSharp/Scripts/RosBridgeClient/RosCommuncation/TwistArrayStampedSubscriber.cs @@ -5,10 +5,13 @@ namespace RosSharp.RosBridgeClient { public class TwistArrayStampedSubscriber : Subscriber<Messages.crowdbotsim.TwistArrayStamped> { + [System.NonSerialized] public UnityTwist[] ut; + [System.NonSerialized] public Rigidbody[] agent; private bool isMessageReceived; + [System.NonSerialized] public bool started = false; diff --git a/Assets/Demo/DutraDemo/DutraDemo.unity b/Assets/Demo/DutraDemo/DutraDemo.unity index 90d1f1677d4db3975449a500e87725e1b3a4a999..cb301819812331f54b852a50ccb4d45eb2c2101e 100644 --- a/Assets/Demo/DutraDemo/DutraDemo.unity +++ b/Assets/Demo/DutraDemo/DutraDemo.unity @@ -180,7 +180,7 @@ GameObject: - component: {fileID: 333326180} - component: {fileID: 333326179} m_Layer: 0 - m_Name: CrowdBotSimMainManager + m_Name: "DutraMainManager\x13" m_TagString: GameManager m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -195,10 +195,10 @@ MonoBehaviour: m_GameObject: {fileID: 333326178} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 1c2641949379e48af81b2ccc1c022197, type: 3} + m_Script: {fileID: 11500000, guid: d898cf07e683fae63914f2e2a83b1ecc, type: 3} m_Name: m_EditorClassIdentifier: - configPath: config.xml + configPath: ./config.xml --- !u!4 &333326180 Transform: m_ObjectHideFlags: 0 @@ -226,6 +226,11 @@ PrefabInstance: propertyPath: m_Name value: Corridor objectReference: {fileID: 0} + - target: {fileID: 2693360514360754476, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} - target: {fileID: 3519069451263302153, guid: 0c74edb6e532568f5bb6062b3e40039e, type: 3} propertyPath: m_LocalPosition.x @@ -281,21 +286,101 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 3519069451263302153, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_LocalScale.z + value: 1 + objectReference: {fileID: 0} - target: {fileID: 3519069451635480193, guid: 0c74edb6e532568f5bb6062b3e40039e, type: 3} propertyPath: m_LocalScale.y value: 0.1 objectReference: {fileID: 0} + - target: {fileID: 3519069451635480193, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3519069451635480193, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_LocalPosition.z + value: -6 + objectReference: {fileID: 0} + - target: {fileID: 3519069451635480193, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_LocalScale.x + value: 79.084526 + objectReference: {fileID: 0} + - target: {fileID: 3519069451635480193, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_LocalPosition.y + value: 1.5 + objectReference: {fileID: 0} + - target: {fileID: 3519069451635480193, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_LocalScale.z + value: 3 + objectReference: {fileID: 0} - target: {fileID: 7829086639550337831, guid: 0c74edb6e532568f5bb6062b3e40039e, type: 3} propertyPath: m_LocalScale.y value: 0.1 objectReference: {fileID: 0} + - target: {fileID: 7829086639550337831, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_LocalPosition.x + value: -4.26 + objectReference: {fileID: 0} + - target: {fileID: 7829086639550337831, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_LocalPosition.y + value: 1.5 + objectReference: {fileID: 0} + - target: {fileID: 7829086639550337831, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_LocalPosition.z + value: 6 + objectReference: {fileID: 0} + - target: {fileID: 7829086639550337831, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_LocalScale.x + value: 88.85756 + objectReference: {fileID: 0} + - target: {fileID: 7829086639550337831, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_LocalScale.z + value: 3 + objectReference: {fileID: 0} - target: {fileID: 1149414704119754357, guid: 0c74edb6e532568f5bb6062b3e40039e, type: 3} propertyPath: m_LocalScale.y value: 0.1 objectReference: {fileID: 0} + - target: {fileID: 1149414704119754357, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_LocalPosition.x + value: 33.89 + objectReference: {fileID: 0} + - target: {fileID: 1149414704119754357, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_LocalPosition.z + value: 2.61 + objectReference: {fileID: 0} + - target: {fileID: 1149414704119754357, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_LocalPosition.y + value: 1.5 + objectReference: {fileID: 0} + - target: {fileID: 1149414704119754357, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_LocalScale.x + value: 41.71908 + objectReference: {fileID: 0} + - target: {fileID: 1149414704119754357, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_LocalScale.z + value: 3 + objectReference: {fileID: 0} - target: {fileID: 3519069450086967720, guid: 0c74edb6e532568f5bb6062b3e40039e, type: 3} propertyPath: m_LocalPosition.z @@ -361,6 +446,31 @@ PrefabInstance: propertyPath: m_LocalScale.y value: 0.1 objectReference: {fileID: 0} + - target: {fileID: 1340034456684694574, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_LocalPosition.x + value: -49.49 + objectReference: {fileID: 0} + - target: {fileID: 1340034456684694574, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_LocalPosition.z + value: 3.94 + objectReference: {fileID: 0} + - target: {fileID: 1340034456684694574, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_LocalPosition.y + value: 1.5 + objectReference: {fileID: 0} + - target: {fileID: 1340034456684694574, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_LocalScale.x + value: 30.211597 + objectReference: {fileID: 0} + - target: {fileID: 1340034456684694574, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_LocalScale.z + value: 3 + objectReference: {fileID: 0} - target: {fileID: 5082900336303182058, guid: 0c74edb6e532568f5bb6062b3e40039e, type: 3} propertyPath: ROS @@ -376,7 +486,103 @@ PrefabInstance: propertyPath: crowdSize value: 20 objectReference: {fileID: 0} - m_RemovedComponents: [] + - target: {fileID: 3519069449937733496, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_LocalScale.x + value: 100 + objectReference: {fileID: 0} + - target: {fileID: 3519069449937733496, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_LocalScale.z + value: 100 + objectReference: {fileID: 0} + - target: {fileID: 3519069450223440061, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_LocalScale.x + value: 100 + objectReference: {fileID: 0} + - target: {fileID: 3519069450223440061, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_LocalScale.z + value: 100 + objectReference: {fileID: 0} + - target: {fileID: 4178035562082628774, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_LocalScale.z + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4178035562082628774, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4178035562082628774, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3519069449654954733, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3519069449656028581, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3519069449658778569, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3519069449875110391, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3519069450086967723, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3519069450163685515, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3519069450226428875, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3519069450338284010, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3519069450608638583, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3519069450903366887, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3519069451158702164, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3519069451307356435, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: + - {fileID: 5082900336303182058, guid: 0c74edb6e532568f5bb6062b3e40039e, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 0c74edb6e532568f5bb6062b3e40039e, type: 3} --- !u!1 &411394057 stripped GameObject: @@ -384,18 +590,6 @@ GameObject: type: 3} m_PrefabInstance: {fileID: 411394056} m_PrefabAsset: {fileID: 0} ---- !u!1 &411394058 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 5480424619420761514, guid: 0c74edb6e532568f5bb6062b3e40039e, - type: 3} - m_PrefabInstance: {fileID: 411394056} - m_PrefabAsset: {fileID: 0} ---- !u!1 &411394059 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1025742803531751589, guid: 0c74edb6e532568f5bb6062b3e40039e, - type: 3} - m_PrefabInstance: {fileID: 411394056} - m_PrefabAsset: {fileID: 0} --- !u!1 &411394060 stripped GameObject: m_CorrespondingSourceObject: {fileID: 3570376132769222368, guid: 0c74edb6e532568f5bb6062b3e40039e, @@ -408,58 +602,52 @@ GameObject: type: 3} m_PrefabInstance: {fileID: 411394056} m_PrefabAsset: {fileID: 0} ---- !u!65 &411394062 +--- !u!65 &411394064 BoxCollider: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 411394058} + m_GameObject: {fileID: 411394060} m_Material: {fileID: 0} m_IsTrigger: 0 m_Enabled: 1 serializedVersion: 2 - m_Size: {x: 1, y: 1.0000091, z: 1.0000001} + m_Size: {x: 0.99999994, y: 1.0000001, z: 1.0000002} m_Center: {x: 0, y: 0, z: 0} ---- !u!65 &411394063 +--- !u!65 &411394065 BoxCollider: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 411394059} + m_GameObject: {fileID: 411394061} m_Material: {fileID: 0} m_IsTrigger: 0 m_Enabled: 1 serializedVersion: 2 - m_Size: {x: 1, y: 1.0000052, z: 1.0000001} - m_Center: {x: -0.00000011920929, y: 0, z: 0} ---- !u!65 &411394064 -BoxCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} + m_Size: {x: 1, y: 1.0000001, z: 1.0000002} + m_Center: {x: 0, y: 0.0000076293945, z: -0.000000029802322} +--- !u!1 &411394066 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 3519069451263302152, guid: 0c74edb6e532568f5bb6062b3e40039e, + type: 3} + m_PrefabInstance: {fileID: 411394056} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 411394060} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Size: {x: 1, y: 1.0000002, z: 1.0000002} - m_Center: {x: 0, y: 0, z: -0.000000059604645} ---- !u!65 &411394065 -BoxCollider: +--- !u!114 &411394067 +MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 411394061} - m_Material: {fileID: 0} - m_IsTrigger: 0 + m_GameObject: {fileID: 411394066} m_Enabled: 1 - serializedVersion: 2 - m_Size: {x: 1, y: 1.0000002, z: 1.0000002} - m_Center: {x: 0, y: 0, z: -0.000000029802322} + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3944ff65718da4282bfaacbc24ce200f, type: 3} + m_Name: + m_EditorClassIdentifier: + obstaclesContainer: {fileID: 411394057} + ROS: {fileID: 700489740} --- !u!1001 &423529953 PrefabInstance: m_ObjectHideFlags: 0 @@ -475,6 +663,10 @@ PrefabInstance: propertyPath: m_TagString value: Robot objectReference: {fileID: 0} + - target: {fileID: 1041508668541268, guid: d34743bfef1e6764c85d7d139c4159b6, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} - target: {fileID: 4498409229885204, guid: d34743bfef1e6764c85d7d139c4159b6, type: 3} propertyPath: m_LocalPosition.x value: 0 @@ -562,10 +754,6 @@ PrefabInstance: propertyPath: m_Name value: RocketBoxModels objectReference: {fileID: 0} - - target: {fileID: 1818040870363006, guid: b551cf9162fd66c4daea1ff87626c62f, type: 3} - propertyPath: m_IsActive - value: 1 - objectReference: {fileID: 0} - target: {fileID: 4225141319257862, guid: b551cf9162fd66c4daea1ff87626c62f, type: 3} propertyPath: m_LocalPosition.x value: 10 @@ -610,1088 +798,8 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 136850474469139040, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 136549360383595758, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 136457254605625726, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 136362920202938468, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 136491142894082350, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 136219943422380512, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 136362805755308014, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 136273109283283738, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 136883950391203908, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 136503474596576138, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 136684686775179994, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 136349648576162518, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 136990901596407214, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 136885331417474834, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 136174560303255300, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 136469413574784942, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 136174693962466530, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 136791200481369156, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 136892152104151722, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 136900992236663120, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 136963733565304558, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 136997854741310444, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 136730038752027948, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 136367991300175832, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 136702491733891486, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 136364198193132526, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 136108740845954822, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 136581981191307608, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 136578327754567072, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 136374857735053820, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 136460496921123686, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 136669584300459864, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 136202598892146330, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 136396170660787522, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 136821232449355056, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 136723411364665960, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 136665035894137406, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 136670964795316734, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 136935520323421244, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 136089248489762518, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - propertyPath: m_Enabled - value: 1 - objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: b551cf9162fd66c4daea1ff87626c62f, type: 3} ---- !u!1 &575128694 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1624125802027590, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!1 &575128695 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1098395968507350, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!1 &575128696 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1263181921716004, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!1 &575128697 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1039905481778110, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!1 &575128698 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1209184067565308, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!1 &575128699 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1634634570121122, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!1 &575128700 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1863965905291488, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!1 &575128701 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1688730005983284, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!1 &575128702 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1244791077844680, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!1 &575128703 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1070432246410832, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!1 &575128704 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1271861255027486, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!1 &575128705 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1362909071634930, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!1 &575128706 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1485223627786204, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!1 &575128707 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1204324703358138, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!1 &575128708 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1012608592017586, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!1 &575128709 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1989084183353640, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!1 &575128710 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1332009624717630, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!1 &575128711 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1359373163516598, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!1 &575128712 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1309972224850090, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!1 &575128713 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1481838267804468, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!1 &575128714 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1465216304362036, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!1 &575128715 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1915626869427326, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!1 &575128716 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1242353851597212, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!1 &575128717 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1659671047010558, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!1 &575128718 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1164534542131662, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!1 &575128719 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1866881860823106, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!1 &575128720 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1084865382127952, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!1 &575128721 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1359938796675984, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!1 &575128722 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1538182897587764, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!1 &575128723 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1760770779918214, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!1 &575128724 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1546202786931222, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!1 &575128725 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1894353329899508, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!1 &575128726 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1248658155122266, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!1 &575128727 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1924445971555290, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!1 &575128728 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1214916211868072, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!1 &575128729 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1858988955870538, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!1 &575128730 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1035491308095818, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!1 &575128731 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1757057979535932, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!1 &575128732 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1990037596701042, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!1 &575128733 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1400565448454622, guid: b551cf9162fd66c4daea1ff87626c62f, - type: 3} - m_PrefabInstance: {fileID: 575128693} - m_PrefabAsset: {fileID: 0} ---- !u!54 &575128734 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128694} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 ---- !u!54 &575128735 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128695} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 ---- !u!54 &575128736 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128696} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 ---- !u!54 &575128737 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128697} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 ---- !u!54 &575128738 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128698} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 ---- !u!54 &575128739 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128699} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 ---- !u!54 &575128740 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128700} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 ---- !u!54 &575128741 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128701} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 ---- !u!54 &575128742 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128702} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 ---- !u!54 &575128743 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128703} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 ---- !u!54 &575128744 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128704} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 ---- !u!54 &575128745 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128705} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 ---- !u!54 &575128746 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128706} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 ---- !u!54 &575128747 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128707} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 ---- !u!54 &575128748 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128708} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 ---- !u!54 &575128749 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128709} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 ---- !u!54 &575128750 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128710} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 ---- !u!54 &575128751 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128711} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 ---- !u!54 &575128752 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128712} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 ---- !u!54 &575128753 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128713} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 ---- !u!54 &575128754 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128714} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 ---- !u!54 &575128755 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128715} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 ---- !u!54 &575128756 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128716} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 ---- !u!54 &575128757 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128717} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 ---- !u!54 &575128758 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128718} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 ---- !u!54 &575128759 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128719} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 ---- !u!54 &575128760 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128720} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 ---- !u!54 &575128761 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128721} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 ---- !u!54 &575128762 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128722} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 ---- !u!54 &575128763 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128723} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 ---- !u!54 &575128764 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128724} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 ---- !u!54 &575128765 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128725} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 ---- !u!54 &575128766 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128726} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 ---- !u!54 &575128767 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128727} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 ---- !u!54 &575128768 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128728} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 ---- !u!54 &575128769 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128729} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 ---- !u!54 &575128770 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128730} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 ---- !u!54 &575128771 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128731} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 ---- !u!54 &575128772 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128732} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 ---- !u!54 &575128773 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 575128733} - serializedVersion: 2 - m_Mass: 1 - m_Drag: Infinity - m_AngularDrag: 100 - m_UseGravity: 0 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 84 - m_CollisionDetection: 0 --- !u!1 &700489740 GameObject: m_ObjectHideFlags: 0 @@ -1724,14 +832,12 @@ MonoBehaviour: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 700489740} - m_Enabled: 1 + m_Enabled: 0 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 37c5582562095417b92c86f347336847, type: 3} m_Name: m_EditorClassIdentifier: Topic: - agent: [] - started: 0 --- !u!114 &700489742 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1760,8 +866,6 @@ MonoBehaviour: m_EditorClassIdentifier: Topic: /crowd/vel TimeStep: 0 - agent: [] - started: 0 --- !u!114 &700489744 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/Demo/GroupExperiment/GroupExperiment.unity b/Assets/Demo/GroupExperiment/GroupExperiment.unity index d4f61a6e72216d9afd4e1e2cfb6587c1b84d161f..4d18d422a9d7fe8a0cf26ec32f8594e04a20637d 100644 --- a/Assets/Demo/GroupExperiment/GroupExperiment.unity +++ b/Assets/Demo/GroupExperiment/GroupExperiment.unity @@ -329,7 +329,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c8e7046e9f110da4a81262f9658c8514, type: 3} m_Name: m_EditorClassIdentifier: - Name: Vertical + Name: Vertical2 --- !u!114 &1204470961 MonoBehaviour: m_ObjectHideFlags: 0 @@ -342,7 +342,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c8e7046e9f110da4a81262f9658c8514, type: 3} m_Name: m_EditorClassIdentifier: - Name: Horizontal + Name: Horizontal2 --- !u!114 &1204470962 MonoBehaviour: m_ObjectHideFlags: 0 @@ -433,8 +433,6 @@ MonoBehaviour: m_EditorClassIdentifier: Topic: /crowd/vel TimeStep: 0 - agent: [] - started: 0 --- !u!114 &1204470968 MonoBehaviour: m_ObjectHideFlags: 0 @@ -462,8 +460,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: Topic: /crowd/pos - agent: [] - started: 0 --- !u!1001 &1616151443 PrefabInstance: m_ObjectHideFlags: 0 diff --git a/Assets/Examples/CrowdBot.meta b/Assets/Examples/CrowdBot.meta new file mode 100644 index 0000000000000000000000000000000000000000..889056e765ac7b97d13a572fa2fa6ab44a6db3e9 --- /dev/null +++ b/Assets/Examples/CrowdBot.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ba141974dd5040cafbd2adba06988335 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Examples/CrowdBot/1D_flow_pepper_player.meta b/Assets/Examples/CrowdBot/1D_flow_pepper_player.meta new file mode 100644 index 0000000000000000000000000000000000000000..46193ffd4235724aa59884fd937a86af584dc63d --- /dev/null +++ b/Assets/Examples/CrowdBot/1D_flow_pepper_player.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 29a02333a4442b7c1bbf2d1ad1cb55d2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MainAssets/Script/Agents/ControlSim/CrowdBot.meta b/Assets/MainAssets/Script/Agents/ControlSim/CrowdBot.meta new file mode 100644 index 0000000000000000000000000000000000000000..743a44b32a1880fed930987641febc8231d276ea --- /dev/null +++ b/Assets/MainAssets/Script/Agents/ControlSim/CrowdBot.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 21aff979fe044a125b298e3fac15b62a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MainAssets/Script/Agents/ControlSim/CrowdBot/CrowdBotControlSim.cs b/Assets/MainAssets/Script/Agents/ControlSim/CrowdBot/CrowdBotControlSim.cs new file mode 100644 index 0000000000000000000000000000000000000000..d13876049f877745002949553ba1abeab70762ea --- /dev/null +++ b/Assets/MainAssets/Script/Agents/ControlSim/CrowdBot/CrowdBotControlSim.cs @@ -0,0 +1,71 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class CrowdBotControlSim : ControlSim +{ + int ConfigId; + CrowdBot.Simulator sim; + + public CrowdBotControlSim(int id) + { + ConfigId = id; + sim = new CrowdBot.Simulator(); + } + + public void addAgent(Vector3 position, TrialControlSim infos) + { + CrowdBotControlSimConfig ConfigInfos = (CrowdBotControlSimConfig)infos; + sim.addAgent(position, ConfigInfos.neighborDist, ConfigInfos.maxNeighbors, ConfigInfos.timeHorizon, ConfigInfos.timeHorizonObst, ConfigInfos.radius, ConfigInfos.maxSpeed, new Vector3(0,0,0)); + } + + public void addNonResponsiveAgent(Vector3 position, float radius) + { + sim.addAgent(position, 0, 0, 0, 0, radius, 5, new Vector3(0,0,0)); + } + + public void addObstacles(Obstacles obst) + { + foreach (ObstCylinder pillar in obst.Pillars) + { + sim.addAgent(pillar.position, 0, 0, 0, 0, pillar.radius, 5, new Vector3(0,0,0)); + } + + foreach (ObstWall wall in obst.Walls) + { + sim.addWall(wall); + } + } + + public void clear() + { + sim.Clear(); + } + + public void doStep(float deltaTime) + { + sim.setTimeStep(deltaTime); + sim.doStep(); + } + + public Vector3 getAgentPosition(int id) + { + return sim.getAgentPosition(id); + } + + public Vector3 getAgentSpeed(int id) + { + return sim.getAgentVelocity(id); + } + + public int getConfigId() + { + return ConfigId; + } + + public void updateAgentState(int id, Vector3 position, Vector3 goal) + { + sim.setAgentPosition(id, position); + sim.setAgentPrefVelocity(id, goal); + } +} diff --git a/Assets/MainAssets/Script/Agents/ControlSim/CrowdBot/CrowdBotControlSim.cs.meta b/Assets/MainAssets/Script/Agents/ControlSim/CrowdBot/CrowdBotControlSim.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..0c0c973be8952f10d8b1c874bf3bd26eeb568840 --- /dev/null +++ b/Assets/MainAssets/Script/Agents/ControlSim/CrowdBot/CrowdBotControlSim.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ff06c4ac162ece9c39eb42e7c9559368 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MainAssets/Script/Agents/ControlSim/CrowdBot/CrowdBotControlSimConfig.cs b/Assets/MainAssets/Script/Agents/ControlSim/CrowdBot/CrowdBotControlSimConfig.cs new file mode 100644 index 0000000000000000000000000000000000000000..db6defc633754c1fd1122e02ae9131ca29e0ab8f --- /dev/null +++ b/Assets/MainAssets/Script/Agents/ControlSim/CrowdBot/CrowdBotControlSimConfig.cs @@ -0,0 +1,46 @@ +using System.Collections; +using System.Collections.Generic; +using System.Xml.Serialization; +using UnityEngine; + +public class CrowdBotControlSimConfig : TrialControlSim +{ + [XmlAttribute("SimulationID")] + public int id; + [XmlAttribute] + public float neighborDist; + [XmlAttribute] + public int maxNeighbors; + [XmlAttribute] + public float timeHorizon; + [XmlAttribute] + public float timeHorizonObst; + [XmlAttribute] + public float radius; + [XmlAttribute] + public float maxSpeed; + + public int getConfigId() + { + return id; + } + + public ControlSim createControlSim(int id) + { + + return new CrowdBotControlSim(id); + } + + public CrowdBotControlSimConfig() + { + id = 0; + neighborDist = 5; + maxNeighbors = 3; + timeHorizon = 5; + timeHorizon = 2; + radius = 0.33f; + maxSpeed = 2; + + } + +} diff --git a/Assets/MainAssets/Script/Agents/ControlSim/CrowdBot/CrowdBotControlSimConfig.cs.meta b/Assets/MainAssets/Script/Agents/ControlSim/CrowdBot/CrowdBotControlSimConfig.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..94a22015503e5feb5e254e10b1634efa86925174 --- /dev/null +++ b/Assets/MainAssets/Script/Agents/ControlSim/CrowdBot/CrowdBotControlSimConfig.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 61a72843b2d47791bad5c05dfe1c6894 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MainAssets/Script/Agents/ControlSim/CrowdBot/Lib.meta b/Assets/MainAssets/Script/Agents/ControlSim/CrowdBot/Lib.meta new file mode 100644 index 0000000000000000000000000000000000000000..0b3e2dd17ab826b8cdab770a0f170161f0bb5235 --- /dev/null +++ b/Assets/MainAssets/Script/Agents/ControlSim/CrowdBot/Lib.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 30053fe63e65e4dc4aba81a71f49ee50 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MainAssets/Script/Agents/ControlSim/CrowdBot/Lib/CrowdBotCrowdSimulator.cs b/Assets/MainAssets/Script/Agents/ControlSim/CrowdBot/Lib/CrowdBotCrowdSimulator.cs new file mode 100644 index 0000000000000000000000000000000000000000..87df475355361e901790cbfcf8b89d7d701b4591 --- /dev/null +++ b/Assets/MainAssets/Script/Agents/ControlSim/CrowdBot/Lib/CrowdBotCrowdSimulator.cs @@ -0,0 +1,288 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace CrowdBot +{ + public class Simulator + { + List<Agent> agents_; + List<ObstWall> walls_; + + float timeStep_ = 0.01f; + + private float sigDca_ = 0.3f; + private float sigTtca_ = 0.3f; + float sigDist_ = 0.1f; + private float coefficient_ = 8.0f; + private float coefficientSpeed_ = 0.05f; + private float coefficientDist_ = 0.001f; + private float alpha = 0.15f; + + private float eps = 0.001f; + + public Simulator() + { + agents_ = new List<Agent>(); + walls_ = new List<ObstWall>(); + } + + public int addAgent(Vector3 position, float neighborDist, int maxNeighbors, float timeHorizon, float timeHorizonObst, float radius, float maxSpeed, Vector3 velocity) + { + Agent agent = new Agent(); + agent.id_ = agents_.Count; + agent.maxNeighbors_ = maxNeighbors; + agent.maxSpeed_ = maxSpeed; + agent.neighborDist_ = neighborDist; + agent.setPosition(position); + agent.radius_ = radius; + agent.timeHorizon_ = timeHorizon; + agent.timeHorizonObst_ = timeHorizonObst; + agent.setVelocity(velocity); + agents_.Add(agent); + + return agent.id_; + } + + public void Clear() + { + agents_.Clear(); + } + + public void setTimeStep(float deltaTime) + { + timeStep_ = deltaTime; + } + + public void doStep() + { + Vector3[] new_vels = new Vector3[agents_.Count]; + //Do the magic here + foreach(Agent a in agents_) + { + Vector3 Gradient = new Vector3(); + Vector3 Vnorm = a.getVelocity().normalized; + + Matrix2x2 R = new Matrix2x2(new Vector3(Vnorm.z, -Vnorm.x), Vnorm); + + float TotalCost = 0; + float GradTh = 0; + float GradS = 0; + Vector3 GradDist = Vector3.zero; + Vector3 GradWalls = Vector3.zero; + + //find the neighbors + List<int> neighbors_id = FindNeighbors(a.id_); + + int NumAgentsVisible = 0; + + // for each agent of the neighbourhood + foreach(int n_id in neighbors_id) + { + // Compute relative velocity and relative position + Vector3 relPos = getAgentPosition(n_id) - a.getPosition(); + float radius_diff = agents_[n_id].radius_ + a.radius_; + + relPos = relPos.magnitude > radius_diff ? relPos - relPos.normalized * radius_diff : relPos.normalized * eps; + + Vector3 relVelocity = getAgentVelocity(n_id) - a.getVelocity(); + + GradDist += coefficientDist_ * relPos / (2*sigDist_*sigDist_) * Mathf.Exp(-0.5f*(relPos.magnitude/sigDist_)*(relPos.magnitude/sigDist_)) * a.getVelocity().sqrMagnitude; + + //Only see agents in front of the direction of motion + if (Vector3.Dot(relPos, a.getVelocity()) < 0) { + continue; + } + + float ttca = 0; + float dca = 0; + Vector3 vdca = new Vector3(0,0,0); + + // there is adaptation only if relative velocity is not zero + if (relVelocity.sqrMagnitude > eps) + { + // computing ttc and dca + ttca = -Vector3.Dot(relPos, relVelocity) / relVelocity.sqrMagnitude; + vdca = (relPos + ttca * relVelocity); + dca = vdca.magnitude; + if (ttca < 0) continue; + + // saving the total cost + float cost = Cost(ttca,dca); + + // cost = cost * (coefficient_ / relPos.sqrMagnitude); //simulate num of pixels of an agent in screen + cost = cost * (coefficient_ / relPos.magnitude); //simulate num of pixels of an agent in screen + TotalCost += cost; + + // computing gradients of the cost regarding the speed and velocity of the main agent + Vector3 velRot = new Vector3(a.getVelocity().z,0,-a.getVelocity().x); + float gradTtcaAngle = -Vector3.Dot(relPos + 2*ttca*relVelocity,velRot) / (Vector3.Dot(relVelocity,relVelocity)); + float gradTtcaSpeed = Vector3.Dot(relPos + 2*ttca*relVelocity,a.getVelocity().normalized) / (Vector3.Dot(relVelocity,relVelocity)); + + float gradDcaAngle, gradDcaSpeed; + if(Mathf.Abs(dca) > eps){ + gradDcaAngle = Vector3.Dot(vdca, gradTtcaAngle*relVelocity + ttca*velRot) / dca; + gradDcaSpeed = Vector3.Dot(vdca, gradTtcaSpeed*relVelocity - ttca * (a.getVelocity().normalized))/ dca; + } + else { + gradDcaAngle = 0; + gradDcaSpeed = 0; + } + + float gradCSpeed = -cost * ( gradTtcaSpeed * (ttca/(sigTtca_*sigTtca_)) + gradDcaSpeed * (dca/(sigDca_*sigDca_))); + float gradCAngle = -cost * ( gradTtcaAngle * (ttca/(sigTtca_*sigTtca_)) + gradDcaAngle * (dca/(sigDca_*sigDca_))); + + gradCSpeed += 0.5f*UnityEngine.Random.Range(-1.0f,1.0f); + gradCAngle += 1.0f*UnityEngine.Random.Range(-1.0f,1.0f); + gradCSpeed *= coefficientSpeed_; + gradCAngle *= coefficient_; + + GradTh += gradCAngle; + GradS += gradCSpeed; + + ++NumAgentsVisible; + } + // else{ + // GradS = coefficientSpeed_*UnityEngine.Random.Range(-1.0f,1.0f); + // GradTh = coefficient_*UnityEngine.Random.Range(-1.0f,1.0f); + // } + } + foreach(ObstWall wall in walls_) + { + //TODO: better + + //find the longest part + Vector3 L1 = wall.B - wall.A; + Vector3 L2 = wall.D - wall.A; + + Vector3 AB = (L1.magnitude > L2.magnitude) ? L1 : L2; + Vector3 AP = a.getPosition() - wall.A; + Vector3 AM = Vector3.Dot(AP,AB)*AB.normalized; + Vector3 PM = AP - AM; + + // 1000 factor to boost it + GradWalls = PM.normalized * Mathf.Exp(-0.5f*(PM.sqrMagnitude))*1000.0f; + } + if(Mathf.Abs(GradS) > a.getVelocity().magnitude || a.getVelocity().magnitude < eps) GradS = 0; + // GradTh *= coefficient_; + // GradS *= coefficient_; + // GradS = Mathf.Clamp(GradS,-0.5f,0.5f); + // GradS = 0; + // GradTh = Mathf.Clamp(GradTh, -0.5f, 0.5f); + + // Gradient = -1 * R.product(new Vector3(Mathf.Sin(GradTh), 0, 1 - Mathf.Cos(GradTh))*a.getVelocity().magnitude + new Vector3(0,0,GradS)); + // Gradient = a.getVelocity().normalized - Quaternion.AngleAxis(GradTh, Vector3.up) * a.getVelocity().normalized * (1 + GradS); + // Gradient = -(a.getVelocity().normalized - Quaternion.AngleAxis(GradTh, Vector3.up) * a.getVelocity().normalized); + // Gradient = -(a.getVelocity().normalized - Quaternion.AngleAxis(GradTh, Vector3.up) * a.getVelocity().normalized*(1+GradS)) - GradDist - GradWalls; + Gradient = -(a.getVelocity().normalized - Quaternion.AngleAxis(GradTh, Vector3.up) * a.getVelocity().normalized); + Gradient -= a.getVelocity()*GradS; + Gradient -= GradDist; + if (NumAgentsVisible > 0) { + Gradient = Gradient / (float)NumAgentsVisible; + TotalCost = TotalCost / (float)NumAgentsVisible; + } + + + Vector3 new_delta_vel = new Vector3(); + + //TODO Debug this + + // float CostAngle = -0.5f*Vector3.Angle(a.pref_velocity_, a.velocity_)*Mathf.Exp(-0.5f*( Mathf.Pow(Vector3.Angle(a.pref_velocity_, a.velocity_),2))); + // float CostSpeed = -0.5f*(a.velocity_.magnitude - a.pref_velocity_.magnitude)*Mathf.Exp(-0.5f*( Mathf.Pow(a.velocity_.magnitude - a.pref_velocity_.magnitude,2))); + + // Vector3 CostMov = new Vector3(CostAngle, 0, CostSpeed); + + // if(a.velocity_.magnitude > 0){ + // // new_vel = Quaternion.AngleAxis(CostMov.x, Vector3.up) * (a.velocity_.normalized * (a.velocity_.magnitude + CostMov.z)); + // new_vel = Quaternion.LookRotation(a.pref_velocity_, Vector3.up) * (a.velocity_.normalized * (a.velocity_.magnitude + CostMov.z)); + // } + // else{ + // new_vel = Quaternion.LookRotation(a.pref_velocity_, Vector3.up) * (a.pref_velocity_.normalized * CostMov.z); + // } + + //new_delta_vel = (a.pref_velocity_ - a.velocity_) + Gradient; + new_delta_vel = alpha * (a.pref_velocity_ - a.getVelocity()) + (1-alpha) * Gradient; + // if(new_delta_vel.magnitude >= 0.8f) + // { + // new_delta_vel = new_delta_vel.normalized * 0.8f; + // } + new_vels[a.id_] = a.getVelocity() + new_delta_vel; + if(new_vels[a.id_].magnitude > 2.0f){ + new_vels[a.id_] = new_vels[a.id_].normalized*2.0f; + } + // a.setVelocity(new_vels[a.id_]); + // a.setPosition(a.getPosition() + a.getVelocity() * timeStep_); + // Debug.DrawLine(a.getPosition(), a.getPosition() + Gradient*10.0f); + } + + foreach(Agent a in agents_) + { + a.setVelocity(new_vels[a.id_]); + a.setPosition(a.getPosition() + a.getVelocity() * timeStep_); + } + } + + private struct Matrix2x2 { + float a11_; + float a12_; + float a21_; + float a22_; + public Matrix2x2(Vector3 v1, Vector3 v2) { + a11_ = v1.x; + a21_ = v1.z; + a12_ = v2.x; + a22_ = v2.z; + } + public Vector3 product(Vector3 v) + { + return new Vector3(a11_*v.x + a12_*v.z, 0, a21_*v.x + a22_*v.z); + } + } + + float Cost(float ttca, float dca){ + return Mathf.Exp(-0.5f*( (ttca/sigTtca_)*(ttca/sigTtca_) + (dca/sigDca_)*(dca/sigDca_) ) ); + } + + public Vector3 getAgentPosition(int id) + { + return agents_[id].getPosition(); + } + public Vector3 getAgentVelocity(int id) + { + return agents_[id].getVelocity(); + } + public void setAgentPosition(int id, Vector3 position) + { + agents_[id].setPosition(position); + + } + public void setAgentPrefVelocity(int id, Vector3 goal) + { + agents_[id].pref_velocity_ = goal; + } + + private List<int> FindNeighbors(int a_id) + { + //TODO: KDTREE + List<int> n = new List<int>(); + if(agents_[a_id].maxNeighbors_ == 0) return n; + for(int i = 0; i < agents_.Count; i++) + { + if(n.Count >= agents_[a_id].maxNeighbors_) + return n; + if(i == a_id) + continue; + if(Vector3.Distance(getAgentPosition(a_id), getAgentPosition(i)) < agents_[a_id].neighborDist_) + { + n.Add(i); + } + } + return n; + } + + public void addWall(ObstWall wall) + { + walls_.Add(wall); + } + } +} diff --git a/Assets/MainAssets/Script/Agents/ControlSim/CrowdBot/Lib/CrowdBotCrowdSimulator.cs.meta b/Assets/MainAssets/Script/Agents/ControlSim/CrowdBot/Lib/CrowdBotCrowdSimulator.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..72bbeaa85dabc2c1f53880ddd7020923d299d387 --- /dev/null +++ b/Assets/MainAssets/Script/Agents/ControlSim/CrowdBot/Lib/CrowdBotCrowdSimulator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 70fa961f7860f2e4da3c7d1faf88fe08 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MainAssets/Script/Agents/ControlSim/CrowdBot/Lib/agent.cs b/Assets/MainAssets/Script/Agents/ControlSim/CrowdBot/Lib/agent.cs new file mode 100644 index 0000000000000000000000000000000000000000..9b8120b0e74a02fe688b8d16d2128f9d0f23b227 --- /dev/null +++ b/Assets/MainAssets/Script/Agents/ControlSim/CrowdBot/Lib/agent.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace CrowdBot +{ + public class Agent + { + public int id_; + public int maxNeighbors_; + public float maxSpeed_; + public float neighborDist_; + private Vector3 position_; + public float radius_; + public float timeHorizon_; + public float timeHorizonObst_; + private Vector3 velocity_; + public Vector3 pref_velocity_; + + public Agent() + { + id_ = -1; + maxNeighbors_ = 10; + maxSpeed_ = 2.0f; + neighborDist_ = 10.0f; + position_ = Vector3.zero; + radius_ = 0.3f; + timeHorizon_ = 10.0f; + timeHorizonObst_ = 10.0f; + velocity_ = Vector3.zero; + pref_velocity_ = Vector3.zero; + } + + public void setVelocity(Vector3 v) + { + velocity_ = Vector3.Lerp(getVelocity(),new Vector3(v.x,0,v.z),0.5f); + } + public void setPosition(Vector3 v) + { + position_ = new Vector3(v.x,0,v.z); + } + + public Vector3 getPosition(){ return new Vector3(position_.x, 0, position_.z); } + public Vector3 getVelocity() + { + Vector3 vel = new Vector3(velocity_.x, 0, velocity_.z); + return vel; + } + } +} \ No newline at end of file diff --git a/Assets/MainAssets/Script/Agents/ControlSim/CrowdBot/Lib/agent.cs.meta b/Assets/MainAssets/Script/Agents/ControlSim/CrowdBot/Lib/agent.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..4f212ca223736c4302e2c99a9bab7db5ac00cf43 --- /dev/null +++ b/Assets/MainAssets/Script/Agents/ControlSim/CrowdBot/Lib/agent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 043014237e87ec31d9fa6d2412127833 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MainAssets/Script/Agents/ControlSim/Simulations.cs b/Assets/MainAssets/Script/Agents/ControlSim/Simulations.cs index 785cfe6255aba3cc4fb86c7857cfd1f61d09076f..4e4468e69376e6bf148e22496eb802bb74f51737 100644 --- a/Assets/MainAssets/Script/Agents/ControlSim/Simulations.cs +++ b/Assets/MainAssets/Script/Agents/ControlSim/Simulations.cs @@ -39,12 +39,10 @@ public class SimManager { // Create simulators agentToSim.Add(getInternalId(LoaderConfig.playerInfo.getControlSimInfo())); - //tmp.Add(LoaderConfig.playerInfo.getControlSimInfo()); foreach (TrialAgent a in LoaderConfig.agentsInfo) { agentToSim.Add(getInternalId(a.getControlSimInfo())); - //tmp.Add(a.getControlSimInfo()); } // Fill simulators with agents and Obstacles diff --git a/Assets/MainAssets/Script/Managers/CrowdBotSimMainManager.cs b/Assets/MainAssets/Script/Managers/CrowdBotSimMainManager.cs index 3edddf265b0498c1331c53f373488811d0d54a0c..80b39ffab6c0efcc4fe924bac82cd353cd74959c 100644 --- a/Assets/MainAssets/Script/Managers/CrowdBotSimMainManager.cs +++ b/Assets/MainAssets/Script/Managers/CrowdBotSimMainManager.cs @@ -69,7 +69,7 @@ public class CrowdBotSimMainManager : MainManager { ToolsTime.newLevel(); // Initialize the trial manager - currentTrialManager = sceneGameObject.GetComponent<CrowdBotSimTrial>(); + currentTrialManager = sceneGameObject.GetComponent<TrialManager>(); if (currentTrialManager == null) { ToolsDebug.logFatalError("Trials " + LoaderConfig.xpCurrentTrial.ToString() + " does not have a manager"); diff --git a/Assets/MainAssets/Script/Managers/CrowdBotSimMainManager.cs.meta b/Assets/MainAssets/Script/Managers/CrowdBotSimMainManager.cs.meta index 821b97bba106d8a562344c9e8210e322996a14d7..4502365edf4a0e48724e0a3c553bc42b64f99996 100644 --- a/Assets/MainAssets/Script/Managers/CrowdBotSimMainManager.cs.meta +++ b/Assets/MainAssets/Script/Managers/CrowdBotSimMainManager.cs.meta @@ -4,7 +4,7 @@ MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] - executionOrder: 0 + executionOrder: -1 icon: {instanceID: 0} userData: assetBundleName: diff --git a/Assets/MainAssets/Script/Managers/DutraMainManager.cs b/Assets/MainAssets/Script/Managers/DutraMainManager.cs new file mode 100644 index 0000000000000000000000000000000000000000..f3c2b96a5b44ebe1c32f7018ec47906e2f200a69 --- /dev/null +++ b/Assets/MainAssets/Script/Managers/DutraMainManager.cs @@ -0,0 +1,197 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; + +/// <summary> +/// The main manager controlling the Experiment flow +/// </summary> +public class DutraMainManager : MainManager { + + [System.NonSerialized] + public GameObject[] robotsModels; + + // Use this for initialization + public override void Start () { + + + if (!initializeConstants()) + { + ToolsDebug.logFatalError("Error on GUIManager constants initialisation"); + Application.Quit(); + } + + isEndXP = false; + startTrial(); + startTransition(); + } + + /// <summary> + /// Load and setup current trial + /// </summary> + public override void startTrial() + { + // Load trial file + if (!LoaderConfig.LoadXP()) + { + ToolsDebug.log("End of the trials", 2); + isEndXP = true; + //Application.Quit(); + return; + } + + // Load the trial scene and unload the others + string sceneMeshName = LoaderConfig.sceneName; + foreach (GameObject currentGameObject in sceneObjectsModels) + { + /*Make every scene disapered exept the one given by the scenarioLoader*/ + if (currentGameObject.name == sceneMeshName) + { + currentGameObject.SetActive(true); + + if (currentGameObject.GetComponent<TrialManager>() == null) + { + ToolsDebug.logFatalError("The trial need a Manager"); + return; + } + + + sceneGameObject = currentGameObject; + sceneGameObject.transform.position = LoaderConfig.scenePosition; + sceneGameObject.transform.rotation = Quaternion.Euler(LoaderConfig.sceneRotation); + break; + } + } + + if (sceneGameObject == null) + ToolsDebug.logFatalError("Scene not found (" + sceneMeshName + ")"); + + // Reset trial time + ToolsTime.newLevel(); + + // Initialize the trial manager + currentTrialManager = sceneGameObject.GetComponent<TrialManager>(); + if (currentTrialManager == null) + { + ToolsDebug.logFatalError("Trials " + LoaderConfig.xpCurrentTrial.ToString() + " does not have a manager"); + Application.Quit(); + } + currentTrialManager.initializeTrial(playerModels, agentModels); + + trialStarted = false; + } + + /// <summary> + /// Method used to initialize scene constants + /// </summary> + /// <returns>True if constant are well initialized, otherwise False</returns> + protected override bool initializeConstants() + { + playerModels =GameObject.FindGameObjectsWithTag("Player"); + foreach (GameObject p in playerModels) + { + p.SetActive(false); + } + sceneObjectsModels = GameObject.FindGameObjectsWithTag("Stage"); + foreach (GameObject scene in sceneObjectsModels) + { + scene.SetActive(false); + } + + agentModels = GameObject.FindGameObjectsWithTag("AgentModels"); + foreach (GameObject go in agentModels) + { + go.SetActive(false); + } + + robotsModels = GameObject.FindGameObjectsWithTag("Robot"); + foreach (GameObject go in robotsModels) + { + go.SetActive(false); + } + + PluginManager[] plugins = gameObject.GetComponentsInChildren<PluginManager>(); + foreach (PluginManager plugin in plugins) + { + plugin.LoadPlugin(); + } + + return true; + } + + // Update is called once per frame + void Update () { + ToolsTime.updateTime(); + + if (currentTrialManager == null) + return; + + if (currentTrialManager.hasEnded()) + endTrial(); + else + currentTrialManager.doStep(); + } + + // Handle key/button input in LateUpdate + protected override void LateUpdate() + { + if ((currentTrialManager==null || currentTrialManager.isReady()) && (ToolsInput.GetKeyDown(KeyCode.Space) || ToolsInput.GetButtonDown(ButtonCode.Fire1))) + { + if (!trialStarted) + { + trialStarted = true; + currentTrialManager.startTrial(); + } + + if (isEndXP) + Application.Quit(); + else + ToolsTime.tooglePause(); + } + + if (ToolsInput.GetKeyDown(KeyCode.N)) + { + endTrial(); + } + + if (ToolsInput.GetKeyDown(KeyCode.P)) + { + endTrial(-1); + } + + if (ToolsInput.GetKeyDown(KeyCode.R)) + { + endTrial(0); + } + + if (ToolsInput.GetKeyDown(KeyCode.Escape)) + { + Application.Quit(); + } + } + + /// <summary> + /// End the current trial change it + /// </summary> + void endTrial(int trialSwitch=1) + { + currentTrialManager.clear(); + sceneGameObject.gameObject.SetActive(false); + sceneGameObject = null; + currentTrialManager = null; + LoaderConfig.ChangeTrial(trialSwitch); + startTrial(); + } + + /// <summary> + /// Update and load transition screen + /// </summary> + public override void startTransition() + { + if (isEndXP) + { + player.gameObject.SetActive(true); + return; + } + } +} diff --git a/Assets/MainAssets/Script/Managers/DutraMainManager.cs.meta b/Assets/MainAssets/Script/Managers/DutraMainManager.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..2a8cc266c4ccf7711c177a0a8e37680828039406 --- /dev/null +++ b/Assets/MainAssets/Script/Managers/DutraMainManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d898cf07e683fae63914f2e2a83b1ecc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: -2 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MainAssets/Script/Managers/DutraTrial.cs b/Assets/MainAssets/Script/Managers/DutraTrial.cs new file mode 100644 index 0000000000000000000000000000000000000000..69db887d4956d8a7e56bcbb0eda4566e4bd1844b --- /dev/null +++ b/Assets/MainAssets/Script/Managers/DutraTrial.cs @@ -0,0 +1,357 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +/// <summary> +/// Regular trial manager with moving agents/player +/// </summary> +public class DutraTrial : MonoBehaviour, TrialManager { + + protected Player player; + protected List<Agent> agentsList; + protected List<GameObject> robotsList; + protected Recorder rec; + protected SimManager sims; + protected ToolsCamRecord camRecord; + public GameObject obstaclesContainer; + public GameObject ROS; + private RosSharp.RosBridgeClient.TwistArrayStampedPublisher crowdPublisher; + private GameObject[] robotsModels; + + + /// <summary> + /// Reset trial + /// </summary> + public virtual void clear() + { + /* Cleaning old virtual humans */ + foreach (Agent currentAgent in agentsList) + { + //GameObject.DestroyImmediate(currentAgent.gameObject); // Dangerous function but mandatory since the GraphicPlayer can't wait the end of the current frame to store the activehumans (Start function) at the beginning of a level, so using Destroy instead will make it store old virtualhumans from the previous level that will be clean at the end of the frame. + GameObject.Destroy(currentAgent.gameObject); + } + agentsList.Clear(); + + sims.clear(); + player.clear(); + //player.gameObject.SetActive(false); + Destroy(player); + if (camRecord != null) + { + Destroy(camRecord); + camRecord = null; + } + if (rec != null) + rec.clear(); + + } + + + private void lookForObst(Transform container, ref Obstacles obst) + { + foreach (Transform item in container.transform) + { + if (item.tag == "Wall") + obst.addWall(item.gameObject); + else if (item.tag == "Pillar") + obst.addPillar(item.gameObject); + else + lookForObst(item, ref obst); + } + } + + /// <summary> + /// Initialize trial + /// </summary> + /// <param name="p">The player</param> + /// <param name="agentModels">All the available agent models</param> + /// <returns>True if the trial has been correctly intialized</returns> + public virtual bool initializeTrial(GameObject[] playersModel, GameObject[] agentModels) + { + robotsModels = GameObject.FindGameObjectsWithTag("Robot"); + foreach (GameObject go in robotsModels) + { + go.SetActive(false); + } + + // Compute obstacles list + Obstacles obst = new Obstacles(); + if (obstaclesContainer != null) + lookForObst(obstaclesContainer.transform, ref obst); + + // Setup simulations for collision avoidance + if (agentsList == null) + agentsList = new List<Agent>(); + if (sims==null) + sims = new SimManager(); + sims.initSimulations(obst); + + // Setup the player + foreach (GameObject p in playersModel) + { + + if (p.name == LoaderConfig.playerInfo.mesh) + { + player = LoaderConfig.playerInfo.createPlayerComponnent(p, 0); + p.SetActive(true); + } else + { + p.SetActive(false); + } + } + + // Create each agents from the trial.xml file + uint i = 0; + foreach (TrialAgent a in LoaderConfig.agentsInfo) + { + ++i; + GameObject currentAgentGameObject = null; + + foreach (GameObject currentAgentInModel in agentModels) + { + + if (currentAgentInModel.name == a.mesh) + { + currentAgentGameObject = (GameObject)GameObject.Instantiate(currentAgentInModel); + currentAgentGameObject.name = i.ToString() + " - " + currentAgentGameObject.name; + currentAgentGameObject.GetComponent<Collider>().enabled = true; + currentAgentGameObject.AddComponent<Rigidbody>(); + // Rigidbody rb = currentAgentGameObject.GetComponent<Rigidbody>(); + // rb.mass = 1; + // rb.drag = Mathf.Infinity; + // rb.angularDrag = 100; + // rb.useGravity = false; + // rb.constraints = RigidbodyConstraints.FreezePositionY | RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationZ; + + break; + } + } + + if (currentAgentGameObject == null) + { + ToolsDebug.logFatalError("Error, unknown mesh " + a.mesh); + Application.Quit(); + } + currentAgentGameObject.SetActive(true); + Agent currentAgent = a.createAgentComponnent(currentAgentGameObject, i + 1); + currentAgentGameObject.tag = "VirtualHumanActive"; + agentsList.Add(currentAgent); + } + + // Setup ROS + ROS = GameObject.FindGameObjectWithTag("Ros"); + // crowdpublisher = ros.getcomponent<rossharp.rosbridgeclient.twistarraystampedpublisher>(); + // crowdPublisher.agent = new Rigidbody[i]; + + if (robotsList == null) + robotsList = new List<GameObject>(); + + DutraMainManager gameManager = GameObject.FindGameObjectWithTag("GameManager").GetComponent<DutraMainManager>(); + + foreach(GameObject r in gameManager.robotsModels){ + // for agents to take the robot into account for collision avoidance + r.tag = "VirtualHumanActive"; + robotsList.Add(r); + r.SetActive(true); + } + + // Set the list of agent to watch in the recorder + rec=gameObject.GetComponent<Recorder>(); + if (rec!=null) + rec.initRecorder(player, agentsList); + + TrialScreenRecorder screenRecorderInfos = LoaderConfig.screenRecorder; + if (screenRecorderInfos!=null) + { + camRecord=Camera.main.gameObject.AddComponent<ToolsCamRecord>(); + camRecord.record = screenRecorderInfos.record; + camRecord.timeToStart = screenRecorderInfos.timeToStart; + camRecord.timeToStop = screenRecorderInfos.timeToStop; + camRecord.framerate = screenRecorderInfos.framerate; + camRecord.saveDir = screenRecorderInfos.saveDir; + } + + return true; + } + + /// <summary> + /// Check the ending conditions of the trials + /// </summary> + /// <returns>True if the trial is over</returns> + public virtual bool hasEnded() + { + bool isEnd = false; + foreach (TrialEnding condition in LoaderConfig.sceneEndings) + { + float currentValue=0; + switch (condition.parameter) + { + case TrialParam.time: + currentValue = ToolsTime.TrialTime; + break; + case TrialParam.x: + currentValue = -player.transform.position.x; + break; + case TrialParam.y: + currentValue = player.transform.position.z; + break; + } + + switch (condition.test) + { + case TrialTest.greater: + isEnd = isEnd || currentValue > condition.value; + break; + case TrialTest.less: + isEnd = isEnd || currentValue < condition.value; + break; + } + } + + return isEnd; + } + + /// <summary> + /// Perform a step of the trial + /// </summary> + public virtual void doStep() + { + if (ToolsTime.DeltaTime == 0) + return; + + List<Vector3> currPos = new List<Vector3>(); + + // Do regular step + currPos.Add(player.Position); + player.doStep(); + + foreach (Agent a in agentsList) + { + currPos.Add(a.Position); + a.doStep(); + } + + sims.doStep(ToolsTime.DeltaTime, currPos, player, agentsList); + } + + ///// <summary> + ///// Method used to initialize the VirtualHumans + ///// </summary> + ///// <returns>True if the VirtualHumans are well initialized, otherwise False</returns> + //private bool initializeAgents() + //{ + + // if (agentsList == null) + // { + // agentsList = new List<Agent>(); + // } + // else + // { + // /* Cleaning old virtual humans */ + // foreach (Agent currentAgent in agentsList) + // { + // GameObject.DestroyImmediate(currentAgent.gameObject); // Dangerous function but mandatory since the GraphicPlayer can't wait the end of the current frame to store the activehumans (Start function) at the beginning of a level, so using Destroy instead will make it store old virtualhumans from the previous level that will be clean at the end of the frame. + // } + // agentsList.Clear(); + // } + + + // int i = 0; + // foreach (TrialAgent a in LoaderConfig.agentsInfo) + // { + // ++i; + // GameObject currentAgentGameObject = null; + + // foreach (GameObject currentAgentInModel in agentModels) + // { + + // if (currentAgentInModel.name == a.mesh) + // { + // currentAgentGameObject = (GameObject)GameObject.Instantiate(currentAgentInModel); + // currentAgentGameObject.name = i.ToString() + " - " + currentAgentGameObject.name; + // break; + // } + // } + + // if (currentAgentGameObject == null) + // { + // ToolsDebug.logFatalError("Error, unknown mesh " + a.mesh); + // Application.Quit(); + // } + // Agent currentAgent = currentAgentGameObject.GetComponent<Agent>(); + // currentAgent.initAgent(a); + // currentAgent.gameObject.SetActive(true); + // currentAgent.gameObject.tag = "VirtualHumanActive"; + + // } + + + + + // // virtualHumanListForSimulationWatcher.Add(currentVirtualHumanGameObject); + // // VirtualHuman.GameObject = currentVirtualHumanGameObject; + // // VirtualHuman.GraphicObject = VirtualHuman.GameObject.GetComponent<GraphicVirtualHuman>(); + // // VirtualHuman.Behavior = controlLawGenerator.setControlModule(VirtualHuman.BehaviorXelement, currentVirtualHumanGameObject); + + // // VirtualHuman.GameObject.SetActive(true); + // // VirtualHuman.GraphicObject.SetPositionAndRotation(VirtualHuman.PositionAndRotation); + // // VirtualHuman.GraphicObject.AnimationOffset = VirtualHuman.AnimationOffset; + // // VirtualHuman.GraphicObject.idleAnimationIndex = VirtualHuman.IdleAnimationIdex; + // // VirtualHuman.GraphicObject.IdColor = TableColor[i - 1]; + // // InvertColorDict[TableColor[i - 1]] = i - 1; + // // VirtualHuman.GameObject.tag = "VirtualHumanActive"; + + + + // // /* Set RVO and other responsive systems */ + // // if (VirtualHuman.Behavior.getBehaviorType() == BehaviorType.responsive) + // // { + // // _isRVOUsed = true; + // // RVOManager.addAgent(currentVirtualHumanGameObject); + // // } + // // else if (VirtualHuman.Behavior.getBehaviorType() == BehaviorType.unresponsive) + // // { + // // RVOManager.addBlindAgent(currentVirtualHumanGameObject); + // // } + // //} + + // //if (currentXPManager != null) + // // virtualHumanListForSimulationWatcher.AddRange(currentXPManager.getRecordedObjects()); + + // //this.GetComponent<simulationWatcher>().VirtualHumans = virtualHumanListForSimulationWatcher; + // //this.GetComponent<simulationWatcher>().InvertColorDict = InvertColorDict; + // //this.GetComponent<simulationWatcher>().InitDictGaze(); + + // return true; + //} + + // Use this for initialization + void Start () { + if (agentsList==null) + agentsList = new List<Agent>(); + } + + // Update is called once per frame + void Update () + { + + } + + public Player getPlayer() + { + return player; + + } + + public virtual bool isReady() + { + return true; + } + public virtual void startTrial() + { + + + } + + +} diff --git a/Assets/MainAssets/Script/Managers/DutraTrial.cs.meta b/Assets/MainAssets/Script/Managers/DutraTrial.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..50a8e007c9e872cb44e93165a0b86fb7fcde198e --- /dev/null +++ b/Assets/MainAssets/Script/Managers/DutraTrial.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3944ff65718da4282bfaacbc24ce200f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scenario/DutraDemo/FileOrder0.csv b/Scenario/DutraDemo/FileOrder0.csv new file mode 100644 index 0000000000000000000000000000000000000000..c9872ef1a49cd5845d8f34dbc08e9bc2311e873d --- /dev/null +++ b/Scenario/DutraDemo/FileOrder0.csv @@ -0,0 +1 @@ +/Scenario/DutraDemo/trial.xml \ No newline at end of file diff --git a/Scenario/DutraDemo/trial.xml b/Scenario/DutraDemo/trial.xml new file mode 100644 index 0000000000000000000000000000000000000000..29a2454ac1d12879a596cbb3e02f639d8ae3179c --- /dev/null +++ b/Scenario/DutraDemo/trial.xml @@ -0,0 +1,296 @@ +<?xml version="1.0" encoding="utf-8"?> +<Trial xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <scene meshName="Corridor"> + <Position x="0" y="0" z="0" /> + <Rotation x="0" y="0" z="0" /> + <endingConditions> + <condition parameter="time" test="less" value="0" /> + </endingConditions> + </scene> + + <player> + <TrialRegularPlayer mesh="RegPlayer" radius="0.33"> + <Position x="-20" y="0" z="0" /> + <Rotation x="0" y="0" z="90" /> + <controlLaw> + <LawControllerSpeedAngle speedCurrent="0" speedDefault="0" speedVariation="1.5" angularSpeed="30" accelerationMax="0.8" timeBeforeControl="0" /> + </controlLaw> + </TrialRegularPlayer> + </player> + + <agents> + <agent> + <TrialRegularAgent mesh="m001" radius="0.33" visualVariation="0" animationOffset="0" heightOffset="0"> + <Position x="5" y="1" z="0" /> + <Rotation x="0" y="0" z="90" /> + <controlLaw> + <LawWaypoints speedCurrent="1.629349" speedDefault="1.4" accelerationMax="0.8" isLooping="true"> + <Waypoints> + <Waypoint x="16" y="-2" z="0" /> + <Waypoint x="-14" y="-2" z="0" /> + </Waypoints> + </LawWaypoints> + </controlLaw> + <controlSim> + <CrowdBotControlSimConfig SimulationID="0" neighborDist="10" maxNeighbors="20" timeHorizon="10" timeHorizonObst="10" radius="0.33" maxSpeed="2" /> + </controlSim> + </TrialRegularAgent> + </agent> + <agent> + <TrialRegularAgent mesh="m002" radius="0.33" visualVariation="0" animationOffset="0" heightOffset="0"> + <Position x="4" y="3" z="0" /> + <Rotation x="0" y="0" z="90" /> + <controlLaw> + <LawWaypoints speedCurrent="1.629349" speedDefault="1.5" accelerationMax="0.8" isLooping="true"> + <Waypoints> + <Waypoint x="-15" y="-1" z="0" /> + <Waypoint x="17" y="1" z="0" /> + </Waypoints> + </LawWaypoints> + </controlLaw> + <controlSim> + <CrowdBotControlSimConfig SimulationID="0" neighborDist="10" maxNeighbors="20" timeHorizon="10" timeHorizonObst="10" radius="0.33" maxSpeed="2" /> + </controlSim> + </TrialRegularAgent> + </agent> + <agent> + <TrialRegularAgent mesh="m003" radius="0.33" visualVariation="0" animationOffset="0" heightOffset="0"> + <Position x="3" y="0" z="0" /> + <Rotation x="0" y="0" z="90" /> + <controlLaw> + <LawWaypoints speedCurrent="1.629349" speedDefault="1.6" accelerationMax="0.8" isLooping="true"> + <Waypoints> + <Waypoint x="15" y="-2" z="0" /> + <Waypoint x="-11" y="2" z="0" /> + </Waypoints> + </LawWaypoints> + </controlLaw> + <controlSim> + <CrowdBotControlSimConfig SimulationID="0" neighborDist="10" maxNeighbors="20" timeHorizon="10" timeHorizonObst="10" radius="0.33" maxSpeed="2" /> + </controlSim> + </TrialRegularAgent> + </agent> + <agent> + <TrialRegularAgent mesh="f004" radius="0.33" visualVariation="0" animationOffset="0" heightOffset="0"> + <Position x="-6" y="-2" z="0" /> + <Rotation x="0" y="0" z="90" /> + <controlLaw> + <LawWaypoints speedCurrent="1.629349" speedDefault="1.65" accelerationMax="0.8" isLooping="true"> + <Waypoints> + <Waypoint x="-14" y="0" z="0" /> + <Waypoint x="15" y="-2" z="0" /> + </Waypoints> + </LawWaypoints> + </controlLaw> + <controlSim> + <CrowdBotControlSimConfig SimulationID="0" neighborDist="10" maxNeighbors="20" timeHorizon="10" timeHorizonObst="10" radius="0.33" maxSpeed="2" /> + </controlSim> + </TrialRegularAgent> + </agent> + <agent> + <TrialRegularAgent mesh="f005" radius="0.33" visualVariation="0" animationOffset="0" heightOffset="0"> + <Position x="6" y="-5" z="0" /> + <Rotation x="0" y="0" z="90" /> + <controlLaw> + <LawWaypoints speedCurrent="1.629349" speedDefault="1.69" accelerationMax="0.8" isLooping="true"> + <Waypoints> + <Waypoint x="15" y="0" z="0" /> + <Waypoint x="-12" y="1" z="0" /> + </Waypoints> + </LawWaypoints> + </controlLaw> + <controlSim> + <CrowdBotControlSimConfig SimulationID="0" neighborDist="10" maxNeighbors="20" timeHorizon="10" timeHorizonObst="10" radius="0.33" maxSpeed="2" /> + </controlSim> + </TrialRegularAgent> + </agent> + <agent> + <TrialRegularAgent mesh="f006" radius="0.33" visualVariation="0" animationOffset="0" heightOffset="0"> + <Position x="-7" y="2" z="0" /> + <Rotation x="0" y="0" z="90" /> + <controlLaw> + <LawWaypoints speedCurrent="1.629349" speedDefault="1.629349" accelerationMax="0.8" isLooping="true"> + <Waypoints> + <Waypoint x="-14" y="-2" z="0" /> + <Waypoint x="15" y="0" z="0" /> + </Waypoints> + </LawWaypoints> + </controlLaw> + <controlSim> + <CrowdBotControlSimConfig SimulationID="0" neighborDist="10" maxNeighbors="20" timeHorizon="10" timeHorizonObst="10" radius="0.33" maxSpeed="2" /> + </controlSim> + </TrialRegularAgent> + </agent> + <agent> + <TrialRegularAgent mesh="f007" radius="0.33" visualVariation="0" animationOffset="0" heightOffset="0"> + <Position x="7" y="0" z="0" /> + <Rotation x="0" y="0" z="90" /> + <controlLaw> + <LawWaypoints speedCurrent="1.629349" speedDefault="1.2" accelerationMax="0.8" isLooping="true"> + <Waypoints> + <Waypoint x="15" y="0" z="0" /> + <Waypoint x="-12" y="0" z="0" /> + </Waypoints> + </LawWaypoints> + </controlLaw> + <controlSim> + <CrowdBotControlSimConfig SimulationID="0" neighborDist="10" maxNeighbors="20" timeHorizon="10" timeHorizonObst="10" radius="0.33" maxSpeed="2" /> + </controlSim> + </TrialRegularAgent> + </agent> + <agent> + <TrialRegularAgent mesh="m001" radius="0.33" visualVariation="0" animationOffset="0" heightOffset="0"> + <Position x="5" y="-1" z="0" /> + <Rotation x="0" y="0" z="90" /> + <controlLaw> + <LawWaypoints speedCurrent="1.629349" speedDefault="1.1" accelerationMax="0.8" isLooping="true"> + <Waypoints> + <Waypoint x="-13" y="-2" z="0" /> + <Waypoint x="15" y="-2" z="0" /> + </Waypoints> + </LawWaypoints> + </controlLaw> + <controlSim> + <CrowdBotControlSimConfig SimulationID="0" neighborDist="10" maxNeighbors="20" timeHorizon="10" timeHorizonObst="10" radius="0.33" maxSpeed="2" /> + </controlSim> + </TrialRegularAgent> + </agent> + <agent> + <TrialRegularAgent mesh="m005" radius="0.33" visualVariation="0" animationOffset="0" heightOffset="0"> + <Position x="1" y="-2" z="0" /> + <Rotation x="0" y="0" z="90" /> + <controlLaw> + <LawWaypoints speedCurrent="1.629349" speedDefault="1.7" accelerationMax="0.8" isLooping="true"> + <Waypoints> + <Waypoint x="-15" y="1" z="0" /> + <Waypoint x="17" y="3" z="0" /> + </Waypoints> + </LawWaypoints> + </controlLaw> + <controlSim> + <CrowdBotControlSimConfig SimulationID="0" neighborDist="10" maxNeighbors="20" timeHorizon="10" timeHorizonObst="10" radius="0.33" maxSpeed="2" /> + </controlSim> + </TrialRegularAgent> + </agent> + <agent> + <TrialRegularAgent mesh="m006" radius="0.33" visualVariation="0" animationOffset="0" heightOffset="0"> + <Position x="-1" y="5" z="0" /> + <Rotation x="0" y="0" z="90" /> + <controlLaw> + <LawWaypoints speedCurrent="1.629349" speedDefault="1.629349" accelerationMax="0.8" isLooping="true"> + <Waypoints> + <Waypoint x="15" y="0" z="0" /> + <Waypoint x="-13" y="0" z="0" /> + </Waypoints> + </LawWaypoints> + </controlLaw> + <controlSim> + <CrowdBotControlSimConfig SimulationID="0" neighborDist="10" maxNeighbors="20" timeHorizon="10" timeHorizonObst="10" radius="0.33" maxSpeed="2" /> + </controlSim> + </TrialRegularAgent> + </agent> + <agent> + <TrialRegularAgent mesh="m007" radius="0.33" visualVariation="0" animationOffset="0" heightOffset="0"> + <Position x="-2" y="-1" z="0" /> + <Rotation x="0" y="0" z="90" /> + <controlLaw> + <LawWaypoints speedCurrent="1.629349" speedDefault="1.62" accelerationMax="0.8" isLooping="true"> + <Waypoints> + <Waypoint x="-14" y="2" z="0" /> + <Waypoint x="15" y="1" z="0" /> + </Waypoints> + </LawWaypoints> + </controlLaw> + <controlSim> + <CrowdBotControlSimConfig SimulationID="0" neighborDist="10" maxNeighbors="20" timeHorizon="10" timeHorizonObst="10" radius="0.33" maxSpeed="2" /> + </controlSim> + </TrialRegularAgent> + </agent> + <agent> + <TrialRegularAgent mesh="f001" radius="0.33" visualVariation="0" animationOffset="0" heightOffset="0"> + <Position x="-3" y="1" z="0" /> + <Rotation x="0" y="0" z="90" /> + <controlLaw> + <LawWaypoints speedCurrent="1.629349" speedDefault="1.3" accelerationMax="0.8" isLooping="true"> + <Waypoints> + <Waypoint x="17" y="1" z="0" /> + <Waypoint x="-12" y="-2" z="0" /> + </Waypoints> + </LawWaypoints> + </controlLaw> + <controlSim> + <CrowdBotControlSimConfig SimulationID="0" neighborDist="10" maxNeighbors="20" timeHorizon="10" timeHorizonObst="10" radius="0.33" maxSpeed="2" /> + </controlSim> + </TrialRegularAgent> + </agent> + <agent> + <TrialRegularAgent mesh="f002" radius="0.33" visualVariation="0" animationOffset="0" heightOffset="0"> + <Position x="-4" y="0" z="0" /> + <Rotation x="0" y="0" z="90" /> + <controlLaw> + <LawWaypoints speedCurrent="1.629349" speedDefault="1.0" accelerationMax="0.8" isLooping="true"> + <Waypoints> + <Waypoint x="-14" y="2" z="0" /> + <Waypoint x="16" y="1" z="0" /> + </Waypoints> + </LawWaypoints> + </controlLaw> + <controlSim> + <CrowdBotControlSimConfig SimulationID="0" neighborDist="10" maxNeighbors="20" timeHorizon="10" timeHorizonObst="10" radius="0.33" maxSpeed="2" /> + </controlSim> + </TrialRegularAgent> + </agent> + <agent> + <TrialRegularAgent mesh="f003" radius="0.33" visualVariation="0" animationOffset="0" heightOffset="0"> + <Position x="-5" y="-1" z="0" /> + <Rotation x="0" y="0" z="90" /> + <controlLaw> + <LawWaypoints speedCurrent="1.629349" speedDefault="1.7" accelerationMax="0.8" isLooping="true"> + <Waypoints> + <Waypoint x="17" y="0" z="0" /> + <Waypoint x="-13" y="1" z="0" /> + </Waypoints> + </LawWaypoints> + </controlLaw> + <controlSim> + <CrowdBotControlSimConfig SimulationID="0" neighborDist="10" maxNeighbors="20" timeHorizon="10" timeHorizonObst="10" radius="0.33" maxSpeed="2" /> + </controlSim> + </TrialRegularAgent> + </agent> + + <!-- <agent> + <TrialRegularAgent mesh="m005" radius="0.33" visualVariation="0" animationOffset="0" heightOffset="0"> + <Position x="-4.5" y="0" z="0" /> + <Rotation x="0" y="0" z="90" /> + <controlLaw> + <LawWaypoints speedCurrent="1.629349" speedDefault="1.62" accelerationMax="0.8" isLooping="true"> + <Waypoints> + <Waypoint x="5" y="0" z="0" /> + <Waypoint x="-5" y="0" z="0" /> + </Waypoints> + </LawWaypoints> + </controlLaw> + <controlSim> + <CrowdBotControlSimConfig SimulationID="0" neighborDist="10" maxNeighbors="20" timeHorizon="10" timeHorizonObst="10" radius="0.33" maxSpeed="2" /> + </controlSim> + </TrialRegularAgent> + </agent> + <agent> + <TrialRegularAgent mesh="m006" radius="0.33" visualVariation="0" animationOffset="0" heightOffset="0"> + <Position x="0" y="-5" z="0" /> + <Rotation x="0" y="0" z="90" /> + <controlLaw> + <LawWaypoints speedCurrent="1.629349" speedDefault="1.6" accelerationMax="0.8" isLooping="true"> + <Waypoints> + <Waypoint x="0" y="-5" z="0" /> + <Waypoint x="0" y="5" z="0" /> + </Waypoints> + </LawWaypoints> + </controlLaw> + <controlSim> + <CrowdBotControlSimConfig SimulationID="0" neighborDist="10" maxNeighbors="20" timeHorizon="10" timeHorizonObst="10" radius="0.33" maxSpeed="2" /> + </controlSim> + </TrialRegularAgent> + </agent> --> + </agents> +</Trial> \ No newline at end of file diff --git a/config.xml b/config.xml index 0ed299b7b1b6745a4cb2e6c8a43c09d56fb7fac8..555816867f6c91a8df87d4be0e93cca40b775bbf 100644 --- a/config.xml +++ b/config.xml @@ -2,7 +2,7 @@ <Config xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <experience currentUser="0" startingTrial="0"> - <sourceFileExperiment>./Scenario/GroupExperiment/FileOrder{USER}.csv</sourceFileExperiment> + <sourceFileExperiment>./Scenario/DutraDemo/FileOrder{USER}.csv</sourceFileExperiment> <userHeight>1.7</userHeight> </experience>