From 1636e8e765a71b4dceac87be601434857e3672dc Mon Sep 17 00:00:00 2001 From: Hyunseok Yang Date: Fri, 24 Apr 2020 19:32:04 +0900 Subject: [PATCH 01/10] Apply .gitignore --- .gitignore | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.gitignore b/.gitignore index eb89864a..74662987 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,14 @@ */[Ll]ogs/ */[Mm]emoryCaptures/ +[Ll]ibrary/ +[Tt]emp/ +[Oo]bj/ +[Bb]uild/ +[Bb]uilds/ +[Ll]ogs/ +[Mm]emoryCaptures/ + # Never ignore Asset meta data !*/[Aa]ssets/**/*.meta @@ -22,6 +30,9 @@ # TextMesh Pro files */[Aa]ssets/TextMesh*Pro/ */[Aa]ssets/TextMesh*Pro.meta +[Aa]ssets/TextMesh*Pro/ +[Aa]ssets/TextMesh*Pro.meta + # Autogenerated Jetbrains Rider plugin */[Aa]ssets/Plugins/Editor/JetBrains* From 38dbe0764b66000e908313229d974f460ab9fdce Mon Sep 17 00:00:00 2001 From: Hyunseok Yang Date: Fri, 24 Apr 2020 19:57:26 +0900 Subject: [PATCH 02/10] Change default resource path with UNITY_EDITOR mode --- Assets/Scripts/ModelLoader.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/ModelLoader.cs b/Assets/Scripts/ModelLoader.cs index 38a763ca..69657b47 100644 --- a/Assets/Scripts/ModelLoader.cs +++ b/Assets/Scripts/ModelLoader.cs @@ -71,9 +71,9 @@ private void ResetTransform() void Awake() { #if UNITY_EDITOR - filesRootDirectory = "../../../SimulatorInstance/gazebo/gazebo/build/Installed/Release/share/gazebo-9/"; - modelRootDirectories.Add("../../../lgrs_resource/assets/models/"); - worldRootDirectories.Add("../../../lgrs_resource/worlds"); + filesRootDirectory = "/usr/share/gazebo-9/"; + modelRootDirectories.Add("../../sample-resources/models/"); + worldRootDirectories.Add("../../sample-resources/worlds/"); #else var separator = new char[] {':'}; filesRootDirectory = Environment.GetEnvironmentVariable("CLOISIM_FILES_PATH"); From 64ecc47e961bf4e76a413f7d35e8952feecfa680 Mon Sep 17 00:00:00 2001 From: Hyunseok Yang Date: Fri, 24 Apr 2020 20:58:55 +0900 Subject: [PATCH 03/10] Modify UI font size in robot model list - Scene file --- Assets/Scenes/MainScene.unity | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/Assets/Scenes/MainScene.unity b/Assets/Scenes/MainScene.unity index 0c41f171..78cd37ba 100644 --- a/Assets/Scenes/MainScene.unity +++ b/Assets/Scenes/MainScene.unity @@ -860,7 +860,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 0.5} m_AnchorMax: {x: 1, y: 0.5} m_AnchoredPosition: {x: -7.5, y: -0.5} - m_SizeDelta: {x: -35, y: 15} + m_SizeDelta: {x: 200, y: 50} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &387521880 MonoBehaviour: @@ -877,6 +877,7 @@ MonoBehaviour: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 + m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -915,14 +916,14 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 1 - m_textAlignment: 513 + m_textAlignment: 514 m_characterSpacing: 0 m_wordSpacing: 0 m_lineSpacing: 0 m_lineSpacingMax: 0 m_paragraphSpacing: 0 m_charWidthMaxAdj: 0 - m_enableWordWrapping: 0 + m_enableWordWrapping: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 1 m_firstOverflowCharacterIndex: -1 @@ -1376,12 +1377,13 @@ MonoBehaviour: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 + m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] m_text: Option A m_isRightToLeft: 0 - m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontAsset: {fileID: 0} m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} m_fontSharedMaterials: [] m_fontMaterial: {fileID: 0} @@ -1531,6 +1533,7 @@ MonoBehaviour: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 + m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -1940,6 +1943,7 @@ MonoBehaviour: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 + m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -2377,6 +2381,7 @@ MonoBehaviour: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 + m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -3671,6 +3676,7 @@ MonoBehaviour: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 + m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -3807,6 +3813,7 @@ MonoBehaviour: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 + m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -5537,6 +5544,7 @@ MonoBehaviour: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 + m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -5643,6 +5651,7 @@ MonoBehaviour: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 + m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -5922,6 +5931,7 @@ MonoBehaviour: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 + m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -6782,6 +6792,7 @@ MonoBehaviour: m_Material: {fileID: 0} m_Color: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} m_RaycastTarget: 1 + m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -6855,6 +6866,7 @@ MonoBehaviour: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 + m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] From 8ada7263268d0bd28317af4cab9ac05f002878f6 Mon Sep 17 00:00:00 2001 From: Hyunseok Yang Date: Fri, 24 Apr 2020 22:18:46 +0900 Subject: [PATCH 04/10] Modify elevator task handling - change check sequence when 'call elevator' is triggered --- .../CustomPlugins/ElevatorSystem.Elevator.cs | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Assets/Scripts/CustomPlugins/ElevatorSystem.Elevator.cs b/Assets/Scripts/CustomPlugins/ElevatorSystem.Elevator.cs index 3248b81b..5c829796 100644 --- a/Assets/Scripts/CustomPlugins/ElevatorSystem.Elevator.cs +++ b/Assets/Scripts/CustomPlugins/ElevatorSystem.Elevator.cs @@ -138,16 +138,6 @@ private bool GetCalledElevator(in string currentFloor, in string targetFloor, ou { elevatorIndex = NON_ELEVATOR_INDEX; - // Try to find in task queue - foreach (var task in elevatorTaskQueue) - { - if (task.toFloor.Equals(currentFloor) && task.state.Equals(ElevatorTaskState.PROCESSING)) - { - elevatorIndex = task.elevatorIndex; - return true; - } - } - var currentFloorHeight = GetFloorHeight(currentFloor); // If not, try to find in stopped elevator foreach (var elevatorItem in elevatorList) @@ -156,6 +146,18 @@ private bool GetCalledElevator(in string currentFloor, in string targetFloor, ou if (elevator.State.Equals(ElevatorState.STOP) && elevator.IsArrived(currentFloorHeight)) { elevatorIndex = elevatorItem.Key; + Debug.Log("Already elevator is stopped " + elevatorIndex); + return true; + } + } + + // Try to find in task queue + foreach (var task in elevatorTaskQueue) + { + if (task.toFloor.Equals(currentFloor) && task.state.Equals(ElevatorTaskState.PROCESSING)) + { + elevatorIndex = task.elevatorIndex; + Debug.Log("Calling elevator " + elevatorIndex); return true; } } From 7a9357887dc1fdee39619a3dfc7032b11329b9d1 Mon Sep 17 00:00:00 2001 From: Hyunseok Date: Mon, 27 Apr 2020 16:40:35 +0900 Subject: [PATCH 05/10] Update README.md --- README.md | 135 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 131 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f501f03d..3d23ddac 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,138 @@ # CLOiSim : Multi-Robot Simulator +Happy to announce CLOiSim. It is a new multi-robot simulator to bring-up SDF(www.sdformat.org) file which contains 3d world environemnt and multi-robot descriptions. -SDF Parser for C# +It may looks similar to Gazebo simulator, but we had a problems to load multi-robot which equipped multi-sensors in Gazebo. +So that is why we initiated to utilize a 'Unity 3D'. +I believe 'Unity' can provide a powerful resource handling and can see many possiblity in industrial area by Unity. -SDF Implementation for Unity +So, this project consist of +- [SDF](http://sdformat.org/spec?ver=1.7) Parser for C# +- [SDF](http://sdformat.org/spec?ver=1.7) Implementation for Unity -> **Visual / Collision / Sensor / Physics for joints** +- [SDF](http://sdformat.org/spec?ver=1.7) Plugins for Unity +- UI modules -> On screen information +- Network modules -> transporting sensor data or control data +- Web service -> control and manipulate simulation -SDF Plugins for Unity +## Features +Unfortunately, all sensor models are not fully developed yet. +Because first target for simulation was 2-wheeled mobile robot with 2D lidar sensor. -'simdevice' ros2 packages for sensor are required. \ No newline at end of file +Here are sensor models that already implemented or ongoing. +- [X] 2D Lidar Sensor +- [X] 2-Wheeled Motor +- [X] Sonar sensor +- [X] IMU +- [ ] Camera +- [ ] Multi Camera +- [ ] Depth Camera +- [ ] 3D Lidar Sensor +- [ ] Sensor noise model + +Plus, [SDF](http://sdformat.org/spec?ver=1.7) implementation only works on essenstial elements like ``, ``, ``, ``, ``, etc. +For example, kind of optional elmenets ``, `