RaiSimUnity is a visualizer for RaiSim based on Unity. It gets the simulation data from raisim server application via TCP/IP.
The project was tested on Ubuntu 18.04 LST.
The following Unity plugins are already included in the project.
The following Unity packages are imported by Unity Package Manager automatically: see Packages/manifest.json
-
minizip
sudo apt install minizip
-
vulkan. check https://linuxconfig.org/install-and-test-vulkan-on-linux
The followings are optional dependencies
- ffmpeg for video recording
- You can install ffmpeg by
$ sudo apt install ffmpeg
- You can install ffmpeg by
For beginners, we recommend downloading a compiled app image from the release tab. This is stand-alone application thus you don't have to mind about dependencies or compiling. (only ffmpeg is required for recording a screen capture video.)
- Add the following line in your RaiSim simulation code: see Example code
/// launch raisim server raisim::RaisimServer server(&world); server.launchServer(); while(1) { raisim::MSLEEP(2); server.integrateWorldThreadSafe(); } server.killServer();
- Run your RaiSim simulation.
- Run RaiSimUnity application.
- Add your resource directory that contains your mesh, material etc.
- Tap Connect button after specify TCP address and port.
- You can change background by Background dropdown menu in run time.
The following sections introduces how to develop RaiSimUnity on Linux (Ubuntu 18.04 LTS). For more details, see Installation wiki and Developing wiki.
- Clone this repository with git and git-lfs: we use git-lfs for large files such as materials, meshes, texture images etc.
$ git clone https://github.com/eastskykang/RaiSimUnity.git
- Once you cloned source code, get lfs files by
You should see texture JPEG files properly from
$ git lfs pull origin
Assets/Resources/texture/cc0/
. - Open the project by Unity Editor >= 2019.2.9
- You can get Unity Editor for Linux from Unity Hub for Linux
- Once you open the project, UnityMeshImporter - com.donghok.meshimporter is imported automatically.
- Write or edit Unity project with Unity Editor and your code editor
- We strongly recommend to use JetBrain's Rider IDE and Unity Rider Editor package >= 1.1.2 for programming or debugging. See this for more details.
See a contribution guideline.
RaiSimUnity has default materials created from CC0 textures and Free PBR Materials textures. Default materials are included as Resources. You can use default materials as follows:
Material material = Resources.Load<Material>(yourMaterialName);
yourGameObject.GetComponentInChildren<Renderer>().material = material;
The name of default materials are:
Ground1
: default material for height mapTiles1
: default material for planePlastic1
: red plasticPlastic2
: green plasticPlastic3
: blue plasticMetal1
If you want to create your own material, see Wiki doc.
Note that material defined in Collada format (.dae) can be automatically imported without pre-created Unity material.
- Is RaiSimUnity a stand-alone simulator?
- No, RaiSimUnity is a TCP client of RaiSim.
- Is RaiSimUnity open-sourced?
- Yes. However note that RaiSim is not open-sourced project.
- Can RaiSim and RaiSimUnity be run on different machines?
- Yes. You can run RaiSim application on your "Server" machine and connect RaiSimUnity to the server by specifying IP address.
- Does RaiSimUnity support Mac or Windows?
- Although we only release Linux builds, you can easily build RaiSimUnity for Mac or Windows.
- However RaiSim does not support Mac or Windows. This means if you want to use RaiSimUnity on Mac or Windows, you need to run your RaiSim application on Linux "Server" machine (or docker container) and connect it with RaiSimUnity.