Cloisim by lge-ros2 - 2


Unity3D based multi-robot simulator by SDF and supporting ROS2 connection

Unity 2019.4.10f1OtherUpdated 6 days agoCreated on March 6th, 2020
Go to source

CLOiSim : Multi-Robot Simulator


Happy to announce CLOiSim. It is a new multi-robot simulator that uses an SDF( file containing 3d world environemnts and robot descriptions.

The simulator is based on Unity 3D. It may look similar to Gazebo, where, unfortunately, we encountered performance problems while loading multiple robots equipped with multiple sensors.

This project consists of

  • SDF Parser for C#
  • SDF Robot Implementation for Unity -> Visual / Collision / Sensor / Physics for joints
  • SDF Plugins for Unity
  • UI modules -> Module for on-screen information
  • Network modules -> Module for transporting sensor data or control signal
  • Web service -> Module for controling simulation through a web interface


The current release includes the features only for a 2-wheeled mobile robot with 2D LiDAR sensor. Other sensor models are work in progress. Here is the full list of models that is implemented or planned to be implemented.

Plus, SDF works on the essential elements such as <model>, <link>, <visual>, <collision>, <joint>, etc. It does not support optional elmenets like <lights>, <audio>, <actor>, <state>.

Currently, geometry mesh type is supporting only ‘Wavefront(.obj) with material’ and ‘STL(.stl)’.

How it works

Refer to core codes in ‘Assets/Scripts’.

  • Load SDF file -> Parse SDF(simulation description) -> Implement and realize description

Shaders are also used to get depth buffer information in a few sensor model.

Default physics engine ‘Nvidia PhysX’ is used for physics. and retrieve physics parameters from <ode> in sdf. And ‘SDFPlugins’ help physics tricky handling for jointing <link> ojbects by <joint> element. Because there are quite big constraints in terms of ‘mass’ relationship between rigidbody in PhysX engine.

  • You could find details about these struggling issue with PhysX in unity forums. -> this thread
    • Mass ratio between two joined rigid bodies is limited to less than 1:10 in order to maintain joint stability
    • Motors are soft and cannot deliver enough power to drive multi-level articulated robotics
    • Wheels wobble around their joint axis under heavy load
    • Simulation step size (time interval) has to be reduced to too small to provide the needed accuracy which kills the performance

Inertia factors which retrieved from SDF are NOT USED for rigidbody in Unity. Because it cause unexpected behavior with physX engine.

Getting Started

Tested environement:

  • Linux: Ubuntu 18.04
  • Intel® Core™ i7-8700K, 32GB, GeForce RTX 2070
  • Current editor version is ‘2019.4.6f1 (LTS)’.

Release version

If you don’t want to build a project, just USE a release binary(Download linux version). And just refer to ‘Usage’

If you want to build a project

Please visit here build guide.


Run ‘CLOiSim’

Set environment path like below.

export CLOISIM_MODEL_PATH="/home/Unity/cloisim/sample-resources/models" export CLOISIM_WORLD_PATH="/home/Unity/cloisim/sample-resources/worlds"

  • ./CLOiSim.x86_64 -worldFile

or you can execute ‘./’ script in release binary version.

  • ./

After run ‘CLOiSim’

  • simdevice’ ros2 packages for transporting sensor data are required.

  • Run bringup node in ‘simdevice’ ros2 packages

  • And have fun!!!

Debugging log

  • $ tail -f ~/.config/unity3d/LG\ Electronics/CLOiSim/Player.log

Control service

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

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

Just send a request data as a JSON format.

Read detail guide

Future Plan

New features or functions shall be developed on demand.

  • Fully support to keep up with ‘SDF specifiaction version 1.7’

  • Add new sensor models and enhance sensor performance

  • Noise models for sensor model

  • Performance optimization for sensors (Use DOTS by unity?)

  • Upgrade quality of graphical elements

  • Change physics engine (havok or something else…) to find a stable one.

  • If you have any troubles or issues, please don’t hesitate to create a new issue on ‘Issues’.

감사합니다. Thank you.

Show all projects by lge-ros2