Skip to content

Commit

Permalink
CLOiSim-2.7.1
Browse files Browse the repository at this point in the history
[Minor Changes]
* UI: preserve previous transfom type when press esc key(clear target)
* UI: Close model list UI panel pressing esc key
* SDf.Importer: Modify log messages

[Bug fix]
* Main: Fix handling arguement in Main class
* SDF.Helper.Model: Add protecttion code in SDF.Helper.Model
* UI: Add protection code in ActorControl
  • Loading branch information
hyunseok-yang authored Jan 10, 2022
1 parent 3d63ec3 commit dd92447
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 31 deletions.
1 change: 1 addition & 0 deletions Assets/Scenes/MainScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -1780,6 +1780,7 @@ MonoBehaviour:
- ../lgrs_resource/assets/models/
- ../../lgrs_resource/assets/models/
- ../sample_resources/All
- ../cloi_resources
worldRootDirectories:
- ../sample_resources/worlds/
- ../lgrs_resource/worlds/
Expand Down
13 changes: 7 additions & 6 deletions Assets/Scripts/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,11 @@ void Start()
if (string.IsNullOrEmpty(newWorldFilename))
{
newWorldFilename = GetArgument("-worldFile");
if (!string.IsNullOrEmpty(newWorldFilename))
{
worldFileName = newWorldFilename;
}
}

if (!string.IsNullOrEmpty(newWorldFilename))
{
worldFileName = newWorldFilename;
}

if (!doNotLoad && !string.IsNullOrEmpty(worldFileName))
Expand Down Expand Up @@ -438,12 +439,12 @@ private IEnumerator ResetSimulation()
/// Eg: CLOiSim.x86_64 -worldFile lg_seocho.world
/// read the "-worldFile" command line argument
/// </summary>
private static string GetArgument(in string name)
private static string GetArgument(in string arg_name)
{
var args = Environment.GetCommandLineArgs();
for (var i = 0; i < args.Length; i++)
{
if (args[i] == name && args.Length > i + 1)
if (args[i].CompareTo(arg_name) == 0 && args.Length > i + 1)
{
return args[i + 1];
}
Expand Down
14 changes: 8 additions & 6 deletions Assets/Scripts/Tools/SDF/Helper/Model.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,14 @@ private void AddNavMeshObstalceForNonRobot()
if (parentObject != null && parentObject.CompareTag("Collision"))
{
var navMeshObstacle = parentObject.gameObject.AddComponent<UEAI.NavMeshObstacle>();
navMeshObstacle.carving = true;
navMeshObstacle.carveOnlyStationary = true;
navMeshObstacle.carvingMoveThreshold = CarvingMoveThreshold;
navMeshObstacle.carvingTimeToStationary = CarvingTimeToStationary;

navMeshObstacle.size = transform.rotation * colliders[i].bounds.size;
if (navMeshObstacle != null)
{
navMeshObstacle.carving = true;
navMeshObstacle.carveOnlyStationary = true;
navMeshObstacle.carvingMoveThreshold = CarvingMoveThreshold;
navMeshObstacle.carvingTimeToStationary = CarvingTimeToStationary;
navMeshObstacle.size = transform.rotation * colliders[i].bounds.size;
}
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions Assets/Scripts/Tools/SDF/Import/Import.Sensor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ protected override System.Object ImportSensor(in SDF.Sensor sensor, in System.Ob
switch (sensorType)
{
case "ray":
Debug.LogWarning("It is preferred to use 'lidar' since 'ray' will be deprecated.");
Debug.LogWarning("[SDF.Import] It is preferred to use 'lidar' since 'ray' will be deprecated.");
goto case "lidar";

case "lidar":
Debug.LogWarning("CPU based lidar or ray does not support. It will change to GPU based sensor.");
Debug.LogWarning("[SDF.Import] CPU based lidar or ray does not support. It will change to GPU based sensor.");
goto case "gpu_lidar";

case "gpu_ray":
Debug.LogWarning("It is preferred to use 'gpu_lidar' since 'gpu_ray' will be deprecated.");
Debug.LogWarning("[SDF.Import] It is preferred to use 'gpu_lidar' since 'gpu_ray' will be deprecated.");
goto case "gpu_lidar";

case "gpu_lidar":
Expand Down
15 changes: 9 additions & 6 deletions Assets/Scripts/UI/ActorControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,17 @@ void LateUpdate()
{
if (Input.GetMouseButton(1))
{
Main.Gizmos.GetSelectedTargets(out var list);

if (list.Count > 0)
if (Main.Gizmos != null)
{
var ray = Camera.main.ScreenPointToRay(Input.mousePosition);
if (Physics.Raycast(ray.origin, ray.direction, out m_HitInfo))
Main.Gizmos.GetSelectedTargets(out var list);

if (list.Count > 0)
{
ClickToMove(ref list);
var ray = Camera.main.ScreenPointToRay(Input.mousePosition);
if (Physics.Raycast(ray.origin, ray.direction, out m_HitInfo))
{
ClickToMove(ref list);
}
}
}
}
Expand Down
8 changes: 8 additions & 0 deletions Assets/Scripts/UI/AddModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,13 @@ void LateUpdate()
{
HandlingAddedObject();
}
else
{
// close ADd model list
if (Input.GetKey(KeyCode.Escape))
{
modelList.SetActive(false);
}
}
}
}
3 changes: 1 addition & 2 deletions Assets/Scripts/UI/RuntimeGizmo/TransformGizmo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ void Update()
// Clear Tagets when ESC
if (Input.GetKey(KeyCode.Escape))
{
transformType = TransformType.Move;
ClearTargets();
}
}
Expand Down Expand Up @@ -223,7 +222,7 @@ void SetSpaceAndType()
{
// avoid pressing left control
if (!Input.GetKey(KeyCode.LeftControl))
{
{
if (Input.GetKeyUp(SetMoveType))
{
transformType = TransformType.Move;
Expand Down
6 changes: 3 additions & 3 deletions ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ PlayerSettings:
targetDevice: 2
useOnDemandResources: 0
accelerometerFrequency: 60
companyName: lge-arlab
companyName: LGE.CTO.ARLab
productName: CLOiSim
defaultCursor: {fileID: 2800000, guid: 8c59cc8e2487aff97b53248ea15b74c0, type: 3}
cursorHotspot: {x: 3, y: 3}
Expand Down Expand Up @@ -134,7 +134,7 @@ PlayerSettings:
16:10: 1
16:9: 1
Others: 1
bundleVersion: 2.7.0
bundleVersion: 2.7.1
preloadedAssets: []
metroInputSource: 0
wsaTransparentSwapchain: 0
Expand All @@ -153,7 +153,7 @@ PlayerSettings:
androidSupportedAspectRatio: 1
androidMaxAspectRatio: 2.1
applicationIdentifier:
Standalone: com.lge-arlab.CLOiSim
Standalone: com.LGE.CTO.ARLab.CLOiSim
buildNumber:
Standalone: 0
iPhone: 0
Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Here are the list of items that is implemented(marked) or planned to be implemen
- [ ] supporting `<specular>`, `<attenuation/linear>`, `<attenuation/contant>`, `<attenuation/quadratic>`, `<spot/falloff>`
- [X] Spherical Coordinates

Plus, [SDF](http://sdformat.org/spec?ver=1.7) works on the essential elements such as `<model>`, `<link>`, `<visual>`, `<collision>`, `<joint>`, etc.
Plus, [SDF](http://sdformat.org/spec?ver=1.6) works on the essential elements such as `<model>`, `<link>`, `<visual>`, `<collision>`, `<joint>`, etc.
It does not support optional elmenets like `<wind>`, `<audio>`, `<state>`, `<atmosphere>`, `<magnetic_field>`, `<scene>`, `<road>`, `<population>`.

Currently, geometry mesh type is supporting only 'Wavefront(.obj) with material', 'Collada(.dae) including animation' and 'STL(.stl)'.
Expand Down Expand Up @@ -128,12 +128,12 @@ if `<name>` element of `<script>` element in `<material>` element contains "tree

### Tested environement

- Latest Unity Editor Version: *'2020.3.17f1 (LTS)'*.
- Latest Unity Editor Version: *'2020.3.25f1 (LTS)'*.

- Linux Machine
- OS: Ubuntu 20.04.2 LTS
- OS: Ubuntu 20.04.3 LTS
- Processor: AMD® Ryzen 9 3900x 12-core processor × 24
- Memory: 32GB
- Memory: 64 GB
- Graphics: NVIDIA Corporation [GeForce RTX 3090]

- Windows Machine
Expand Down Expand Up @@ -200,14 +200,16 @@ You can add markers like line, text, box, or sphere point and reset simulation b

Read [detail guide](https://github.com/lge-ros2/cloisim/wiki/Usage#control-service)

### CLOiSim + nav2

![cloisim_nav2_ros2](https://user-images.githubusercontent.com/21001946/107105530-37fbc100-686a-11eb-9ff8-f3cf45012d9b.gif)
[video link](https://user-images.githubusercontent.com/21001946/103973626-2f549400-51b3-11eb-8d1f-0945d40c700b.mp4)

## Future Plan

New features or functions shall be developed on demand.

- Fully support to keep up with 'SDF specifiaction version 1.8'
- Fully support to keep up with 'SDF specifiaction version 1.9'

- Add new sensor models and enhance sensor performance

Expand Down

0 comments on commit dd92447

Please sign in to comment.