• Stars
    star
    134
  • Rank 270,967 (Top 6 %)
  • Language
    C#
  • License
    MIT License
  • Created almost 5 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Unity3D based multi-robot simulator can bring-up simulation environment by SDF(Simulation Description File) easily. And it supports to connect ROS2 through cloisim_ros.

CLOiSim : Multi-Robot Simulator

Multi-robot

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. Hence, CLOiSim.

This project consists of

  • SDF Parser for C#
  • SDF Robot Implementation for Unity -> Visual / Collision / Sensor / Physics for joints
  • SDF Plugins for Unity3D
  • 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

cloisim_multirobot video link

Features

Sensors

The current release includes the features only for marked items in the list below. Other sensor models are work in progress. Here are the list of items that is implemented(marked) or planned to be implemented.

  • Joint models
    • 2-Wheeled Motor driving
    • Joint control
  • Sensor models
    • LiDAR Sensor
      • 2D
      • 3D
    • Sonar sensor
    • IMU
    • Contact
    • Camera
      • Camera intrinsic parameter
      • Depth Camera
      • Multi-camera
      • RealSense (RGB + IR1 + IR2 + Depth)
    • GPS sensor
    • Sensor noise models
      • Gaussian
        • GPS, IMU
        • Lidar
        • Camera
      • Custom
  • Physics
    • Support all physics parameters in SDF specification
    • Support <Joint type="revolute2">
  • Worlds
    • Actors
      • interpolate_x in <animation>
    • Lights
      • supporting <specular>, <attenuation/linear>, <attenuation/contant>, <attenuation/quadratic>, <spot/falloff>
    • Spherical Coordinates

Plus, SDF file basically targeting and supporting version 1.6 and 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)'. <ambient> elements in <materal> and ambient properies in mesh files are not support in CLOiSim.

cloisim_lidar_ros video link

Sensor Plugins

It called 'CLOiSimPlugin'. And below plugins could be utilized through write an element on SDF.

Plugin name should be written in filename attribute and it's case sensitive.

For example,

<plugin name="actor_plugin" filename="libActorPlugin.so" />

more details in here).

Model Specific

  • LaserPlugin: help to publish 2D or 3D lidar data
  • CameraPlugin: help to publish 2D color image data or depth image data
  • MultiCameraPlugin: help to publish multiple color image data
  • RealSensePlugin: can handle ir1(left), ir2(right), depth, color
  • MicomPlugin: control micom(differential drive) input/output(sensor)
  • GpsPlugin: gps position in world
  • JointControlPlugin: can control joints and help to publish joints status.
  • ActorPlugin: add actor control functionality using AI(Unity) components
  • ImuPlugin: help to publish IMU sensor data
  • SonarPlugin: help to publish Sonar range data

World Specific

  • ElevatorSystemPlugin: control(lifting, cal) elevators
  • GroundTruthPlugin: retrieve all information(position, size, velocity) for objects
  • ActorControlPlugin: controls actor using AI(Unity) components(actor which loaded ActorPlugin)

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 it retrieves some of physics parameters from <ode> in sdf. 'SDFPlugins' help physics tricky handling for jointing <link> ojbects by <joint> element.

We've deceided to change a solver type of physics engine since new solver "TGS(Temporal Gauss Seidel)" is intorduced recently(PhysX 4.1).

So there is NO more constaints for rigidbodies by PGS(Projected Gauss Seidel) solver type since latest version(CLOiSim-1.11.0).

For the performance in terms of collision handling, designing collision geometry properly may important.

an aspect of rendering

if <name> element of <script> element in <material> element contains "tree" words, CLOiSim applies "URP/Nature/SpeedTree" Shader as a rendering material.

Getting Started

Minimum requirement

  • Processor: testing and looking for the minimum
  • Memory: testing and looking for the minimum
  • Graphics: testing and looking for the minimum

Tested environement (latest)

  • Unity Editor Version: '2021.3.27f1 (LTS)'.

  • Linux Machine

    • OS: Ubuntu 22.04.2 LTS
    • Processor: AMD® Ryzen 9 5950X 16-core processor
    • Memory: 64 GB
    • Graphics: NVIDIA Corporation [GeForce RTX 3090]
  • Windows Machine

    • OS: Windows 10 20H2
    • Processor: AMD® Ryzen 9 5900HS 8-core processor x 16
    • Memory: 32GB
    • Graphics: NVIDIA GeForce RTX3060 Laptop GPU

Release version

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

In terms of branch, 'main' is release(stable) version, and 'develop' is used for development(on-going).

If you want to build a project

Please visit here build guide.

Usage

Run 'CLOiSim'

Set environment path like below. You can find the sample resources here

Multiple path can be set by :(colon).

export CLOISIM_FILES_PATH="/home/Unity/cloisim/sample_resources/media"
export CLOISIM_MODEL_PATH="/home/Unity/cloisim/sample_resources/models:/home/Unity/cloisim/another_resources/models"
export CLOISIM_WORLD_PATH="/home/Unity/cloisim/sample_resources/worlds"

Run CLOiSim

./CLOiSim.x86_64 -world lg_seocho.world

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

  • ./run.sh cloisim.world

Run 'cloisim_ros' after running CLOiSim

  • You need to run this package in order to publish sensor data in ROS2.

  • Run bringup node in 'cloisim_ros' ros2 packages

  • Latest version of CLOiSim will support only humble version of ROS2

  • That's it. Have fun!!!

Debugging log

tail -f ~/.config/unity3d/lge-arlab/CLOiSim/Player.log

Control and external UI service

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

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

You can add markers like line, text, box, or sphere point and reset simulation by just sending a request data as a JSON format.

Read detail guide

CLOiSim + nav2

cloisim_nav2_ros2 video link

Future Plan

New features or functions shall be developed on demand.

  • Fully support to keep up with 'SDF specifiaction version 1.9'

  • Add new sensor models and enhance sensor performance

  • introduce programmable c++ plugin

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

  • Upgrade quality of graphical elements

  • If you have any troubles or issues, please don't hesitate to create a new issue on 'Issues'. https://github.com/lge-ros2/cloisim/issues

감사합니다. Thank you