Skip to content

Commit

Permalink
Merge pull request #1 from lge-ros2/develop
Browse files Browse the repository at this point in the history
Merge 'develop' branch into 'master'
  • Loading branch information
hyunseok-yang authored Apr 27, 2020
2 parents b0417e0 + e580877 commit 11309f3
Show file tree
Hide file tree
Showing 7 changed files with 259 additions and 22 deletions.
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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*
Expand Down Expand Up @@ -58,6 +69,8 @@
*.pdb.meta
*.mdb.meta

README.md.meta

# Unity3D generated file on crash reports
sysinfo.txt

Expand Down
20 changes: 16 additions & 4 deletions Assets/Scenes/MainScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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: []
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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: []
Expand Down Expand Up @@ -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: []
Expand Down Expand Up @@ -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: []
Expand Down Expand Up @@ -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: []
Expand Down Expand Up @@ -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: []
Expand Down Expand Up @@ -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: []
Expand Down Expand Up @@ -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: []
Expand Down Expand Up @@ -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: []
Expand Down Expand Up @@ -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: []
Expand Down Expand Up @@ -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: []
Expand Down
22 changes: 12 additions & 10 deletions Assets/Scripts/CustomPlugins/ElevatorSystem.Elevator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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;
}
}
Expand Down
34 changes: 34 additions & 0 deletions Assets/Scripts/CustomPlugins/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# CustomPlugins

These plugin scripts are for sensor connection.

Each class name is important to load plugin in SDF.

For example, if it describes a name with 'RobotControl' in `<plugin>` attributesm, SDF Parser will start to find a plugin named 'RobotControl' in Unity project.

Unlink gazebo, 'filename' attribute shall not be used anywhere on current project.

```
<model>
...
...
<plugin name='RobotControl' filename=''>
<PID>
<kp>3.0</kp>
<ki>0.2</ki>
<kd>0.0</kd>
</PID>
<wheel>
<base>449</base>
<radius>95.5</radius>
<location type="left">LeftWheel</location>
<location type="right">RightWheel</location>
<friction>
<motor>0.06</motor>
<brake>13.0</brake>
</friction>
</wheel>
<update_rate>20</update_rate>
</plugin>
</model>
```
6 changes: 3 additions & 3 deletions Assets/Scripts/ModelLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ PlayerSettings:
16:10: 1
16:9: 1
Others: 1
bundleVersion: 1.2.2
bundleVersion: 1.0.1
preloadedAssets: []
metroInputSource: 0
wsaTransparentSwapchain: 0
Expand Down
Loading

0 comments on commit 11309f3

Please sign in to comment.