Skip to content

Getting started

Hyunseok edited this page Apr 27, 2024 · 8 revisions

Prerequisite

Check environment

Make sure if graphic driver is installed in your machine.

Install prerequisite libraries

sudo apt-get install libgl1 libvulkan1 libc6-dev libxcursor1 libminizip-dev libgdiplus

Troubleshooting for Unity Editor on Ubuntu 22.04/21.04

When you got this message in editor's console.
No usable version of libssl was found
Aborted (core dumped)

Install these.

wget -q http://security.ubuntu.com/ubuntu/pool/main/o/openssl1.0/libssl1.0.0_1.0.2n-1ubuntu5.10_amd64.deb
sudo dpkg -i libssl1.0.0_1.0.2n-1ubuntu5.10_amd64.deb 
When you got this message in editor's console.
DllNotFoundException: libdl.so assembly:<unknown assembly> type:<unknown type> member:(null)

Do this.

sudo apt install --reinstall libc6
sudo ln -s /usr/lib/x86_64-linux-gnu/libdl.so.2 /usr/lib/x86_64-linux-gnu/libdl.so
When you got this error message in unity debugging log

debugging log

tail -f ~/.config/unity3d/LGE.CTO.AdvancedRoboticsLab/CLOiSim/Player.log

error message

Failed to load image: The type initializer for 'System.Drawing.GDIPlus' threw an exception.
Fallback handler could not load library /home/nav/cloisim/CLOiSim-linux-4.3.0/CLOiSim_Data/MonoBleedingEdge/x86_64/libgdiplus.so.0
Fallback handler could not load library /home/nav/cloisim/CLOiSim-linux-4.3.0/CLOiSim_Data/MonoBleedingEdge/x86_64/libgdiplus.so.0.so

Please check if below library is installed in advance.

sudo apt install libgdiplus

Run CLOiSim

Editor Mode

TBD

Binary Mode

world file should be located in 'CLOISIM_WORLD_PATH' path

Set environment path like below

$ export CLOISIM_FILES_PATH="/home/Unity/cloisim/sample_resources/media"
$ export CLOISIM_MODEL_PATH="/home/Unity/cloisim/sample_resources/models"
$ export CLOISIM_WORLD_PATH="/home/Unity/cloisim/sample_resources/worlds"
Option A
$ ./CLOiSim.x86_64 -world cloisim.world
Option B

you can execute './run.sh' script in release binary version.

$ ./run.sh cloisim.world

After run CLOiSim

  • 'cloisim_ros' ros2 packages for transporting sensor data are required.

  • Run bringup node in 'cloisim_ros' ros2 packages

  • And have fun!!!

Hot keys

Here are hot keys for simulation manipulation.

General

Ctrl + R : Reset simulation Ctrl + Shift + R : simulation Full reset like restart

Object spawning

Choose one of model on the top of screen.[Box], [Cylinder], [Sphere]

Pressing 'Left-Ctrl' Key,

  • Spawning:
    • (+) Click the left mouse button on the pointer
  • Remove:
    • (+) Click the right mouse button on the object already spawned

Object Control

After select object you want,

  • T : Translation
    • (+) Shift : Snapping
  • R : Rotation
    • (+) Shift : Snapping
  • Y : Translation + Rotation
    • (+) Shift : Snapping
  • X : Change manipulation space

Camera Following mode

Choose one object from the list on the bottom right corner.

if you want cancel the following mode, choose '--unfollowing--' menu from the list.

Camera control

Camera control is quite intuitive like a FPS game.

  • W/S/A/D

    • W or Mouse Scroll Up: Move Forward
    • S or Mouse Scroll Down: Move Backward
    • A: Move Left(sidestep left)
    • D: Move Right(sidestep right)
      • (+) Space: moving only on current plane(X,Z axis)
  • Q/Z

    • Q: Move upward
    • Z: Move downward
  • Mouse pointer with pressing "center button" on the mouse

    • Moves screen view-port

Simulation control service (external)

CLOiSim supports web-based simulation control service through websocket as an external interface.

default service port is 8080, but you can change service port setting environment variable

export CLOISIM_SERVICE_PORT=8080

websocket service path: ws://127.0.0.1:8080/{service-name}

Just send a request data as a JSON format.

Supporting Service Name

  • control => url: ws://127.0.0.1:8080/control

    • Reset simulation
      • {"command": "reset"}
    • Get device list
      • {"command": "device_list"}
      • options:
        • filter: {"command": "device_list", "filter": "CLOi"}
        • indenting JSON format: {"command": "device_list", "indent": false}
        • example: {"command": "device_list", "filter": "CLOi", "indent": false}
    • Get topic list
      • {"command": "topic_list"}
        • filter: {"command": "topic_list", "filter": "CLOi"}
        • indenting JSON format: {"command": "topic_list", "indent": false}
        • example: {"command": "topic_list", "filter": "CLOi", "indent": false}
  • markers => url: ws://127.0.0.1:8080/markers

    • Markers are consist of group, id, type, color.

      • id must be unique in group.
      • Check supporting color type in below
        • Red, Green, Blue, Gray, Orange, Lime, Pink, Purple, Navy, Aqua, Cyan, Magenta, Yellow, Black
      • There are four types of 'type'. Must describe type properties for each type.
        • line
          • "line":{"size":0.03, "point":{"x":1.1, "y":1.1, "z":3.3}, "endpoint":{"x":1.1, "y":1.1, "z":10.0}}}
        • text
          • "text":{"size": 5, "align": "center", "following": null, "text": "Hello!!!!\nCLOiSim!!", "point": {"x": 1.0, "y": 1.0, "z": 4.0}}
        • sphere
          • "sphere":{"size":0.1, "point":{"x": 1.1, "y": 2.2, "z": 4.1}}
        • box
          • "box":{"size": 0.2, "point":{"x": 2.1, "y": 3.2, "z": 4.1}}
    • Examples

      • Adding markers command format
        • {"command":"add", "markers":[{"group":"sample","id":4,"type":"type what you want","color":"red", Describe 'type properties' here}]}
      • Add markers (line type)
        • {"command":"add", "markers":[{"group":"sample","id":4,"type":"line","color":"red", "line":{"size":0.03, "point":{"x":1.1, "y":1.1, "z":3.3}, "endpoint":{"x":1.1, "y":1.1, "z":10.0}}},]}
      • Modify markers
        • {"command":"modify", "markers":[{"group":"sample", "id":4, "type":"line", "color":"blue", "line":{"size":0.05, "point":{"x":1.1, "y":1.1, "z":3.3}, "endpoint":{"x":1.1,"y":1.1,"z":5.0}}},]}
      • Remove markers
        • {"command": "remove", "markers":[{"group":"sample","id":5,"type":"line"},]}
      • Get markers list
        • {"command": "list"}
        • {"command": "list", "filter":{"group": "sample"}}
    • 'Following object feature' in 'Text' marker

      • Enable following function
        • Input target object name in simulation on "following" field.
        • "text":{"size": 5, "align": "center", "following": "CLOI_Porter_Robot", "text": "Hello, CLOiSim!!", "point": {"x": 1.0, "y": 3.0, "z": 4.0}}
      • Disable following function
        • "text":{"size": 5, "align": "center", "following": "", "text": "Hello, CLOiSim", "point": {"x": 1.0, "y": 3.0, "z": 4.0}}
        • "text":{"size": 5, "align": "center", "following": null, "text": "Hello, CLOiSim", "point": {"x": 1.0, "y": 3.0, "z": 4.0}}

Examples

markers
> {"command":"add","markers":[{"group":"sample","id":4,"type":"text","color":"red","text":{"size":5,"align":"center","following":"cloi1","text":"Hello!!!!\nCLOiSim!!","point":{"x":1.0,"y":1.0,"z":4.0}}}]}
< {
  "command": "add",
  "result": "ok",
  "lines": null,
  "texts": null,
  "boxes": null,
  "spheres": null
}
control
cloi2_ws$ wsdump.py ws://127.0.0.1:8080/control

> {"command": "reset"}
< {
  "command": "reset",
  "result": "ok"
}

> {"command": "device_list", filter:"cloi1", indent:true}
< {
  "command": "device_list",
  "result": {
    "cloi1": {
      "MULTICAMERA": {
        "multi_camera": {
          "Info": 49154,
          "Data": 49155
        }
      },
      "CAMERA": {
        "camera": {
          "Info": 49156,
          "Data": 49157
        }
      },
      "DEPTHCAMERA": {
        "depthcamera": {
          "Info": 49158,
          "Data": 49159
        }
      },
      "REALSENSE": {
        "realsense": {
          "Info": 49160,
          "colorInfo": 49168,
          "colorData": 49169,
          "ir1Info": 49170,
          "ir1Data": 49171,
          "ir2Info": 49172,
          "ir2Data": 49173,
          "depthInfo": 49174,
          "depthData": 49175
        }
      },
      "LASER": {
        "lidar": {
          "Info": 49161,
          "Data": 49162
        }
      },
      "GPS": {
        "gps": {
          "Info": 49163,
          "Data": 49164
        }
      }
    }
  }

> {"command":"topic_list"}
< {
  "command":"topic_list",
  "result":{"WorldUnityRosClock":49152,"SeochoTowerElevatorSystemControl":49153,"cloi1multi_cameraInfo":49154,"cloi1multi_cameraData":49155,"cloi1cameraInfo":49156,"cloi1cameraData":49157,"cloi1depthcameraInfo":49158,"cloi1depthcameraData":49159,"cloi1realsenseInfo":49160,"cloi1lidarInfo":49161,"cloi1lidarData":49162,"cloi1gpsInfo":49163,"cloi1gpsData":49164,"cloi1RobotControlInfo":49165,"cloi1RobotControlTx":49166,"cloi1RobotControlRx":49167,"cloi1realsensecolorInfo":49168,"cloi1realsensecolorData":49169,"cloi1realsenseir1Info":49170,"cloi1realsenseir1Data":49171,"cloi1realsenseir2Info":49172,"cloi1realsenseir2Data":49173,"cloi1realsensedepthInfo":49174,"cloi1realsensedepthData":49175}}

Build guide is only for developer.

Clone this wiki locally