SOFA Robotics Without Emio Labs
This guide provides instructions for using SOFA Robotics independently of the Emio Labs application.
- To use SOFA Robotics independently of Emio Labs, you first need to download the appropriate Emio Labs package for your operating system. This package may come as an installer (
.debfor Linux,.msifor Windows, or.dmgfor MacOS) or as a compressed archive (.zip). - It is important to note that portable formats (
.AppImagefor Linux,.exefor Windows,.appfor MacOS), which run from a temporary directory, are not supported. - Ensure you extract or install the package to a permanent location on your system before proceeding.
Locate the SOFA Robotics Directory and Executable
To find the paths to the SOFA Robotics directory and executable, follow the instructions below depending on your chosen package format:
- Installer
- Compressed Archive
- Locate the directory where you installed the Emio Labs application. We will refer to this directory as
PATH_TO_EMIO_LABS. - Within this directory, you will find the SOFA Robotics directory at
PATH_TO_EMIO_LABS/resources/sofa. - Inside this directory, you will find the
binsubdirectory, which contains the executable file required to run the software. This executable is essential for launching SOFA Robotics independently.
- A typical path example when you installed Emio Labs on Windows using the
.msiinstaller isC:\Users\YOUR_USERNAME\AppData\Local\Programs\emio-labs - A typical example on Linux when you used the
.debinstaller is/opt/emio-labs
- Extract the compressed archive to your chosen location (referred to as
PATH_TO_EMIO_LABS). - Within this directory, you will find the SOFA Robotics directory at
PATH_TO_EMIO_LABS/resources/sofa. - Inside this directory, you will find the
binsubdirectory, which contains the executable file required to run the software. This executable is essential for launching SOFA Robotics independently.
Setup the Environment Variables
In the previous section, you located the path to the SOFA Robotics directory.
We will refer to this path as PATH_TO_SOFA_ROBOTICS_DIR throughout this guide.
To run the software, you need to configure your environment by adding specific paths to your PATH and PYTHONPATH, along with other required environment variables.
The steps below will help you set up these variables temporarily. Note that these changes will only last for the duration of your terminal session. To avoid repeating these steps every time you run SOFA, consider creating a script to automate the process. However, we recommend against setting these variables permanently to maintain a clean environment.
Open a terminal and run the commands for your operating system as outlined below.
- Linux
- Windows
- MacOS
export SOFA_ROOT=PATH_TO_SOFA_ROBOTICS_DIR
export PATH=$PATH:$SOFA_ROOT/bin
export PYTHONHOME=$SOFA_ROOT/bin/python
export PYTHONPATH=$SOFA_ROOT/bin/python/lib/python3.10/site-packages
export PYTHONPATH=$PYTHONPATH:$SOFA_ROOT/plugins/SofaPython3/lib/python3/site-packages
Using Powershell:
$env:SOFA_ROOT=PATH_TO_SOFA_ROBOTICS_DIR
$env:PATH+=";$env:SOFA_ROOT\bin"
$env:PYTHONHOME="$env:SOFA_ROOT\bin\python"
$env:PYTHONPATH="$env:SOFA_ROOT\bin\python\Lib\site-packages"
$env:PYTHONPATH+=";$env:SOFA_ROOT\plugins\SofaPython3\lib\python3\site-packages"
Using Command Prompt:
set SOFA_ROOT=PATH_TO_SOFA_ROBOTICS_DIR
set PATH=$PATH:$SOFA_ROOT\bin
set PYTHONHOME=$SOFA_ROOT\bin\python
set PYTHONPATH=$SOFA_ROOT\bin\python\Lib\site-packages
set PYTHONPATH=$PYTHONPATH:$SOFA_ROOT\plugins\SofaPython3\lib\python3\site-packages
export SOFA_ROOT=PATH_TO_SOFA_ROBOTICS_DIR
export PATH=$PATH:$SOFA_ROOT/bin
export PYTHONPATH=$PYTHONPATH:$SOFA_ROOT/plugins/SofaPython3/lib/python3/site-packages
Launch the Software
In the same terminal, try the following command:
- Linux
- Windows
- MacOS
runSofa -l SofaPython3,SofaImGui
runSofa.exe -l SofaPython3,SofaImGui
runSofa -l SofaPython3,SofaImGui
This should run the SOFA Robotics with a default simulation (press the play button).
To run your own simulation:
- Linux
- Windows
- MacOS
runSofa -l SofaPython3,SofaImGui your_scene.py
runSofa.exe -l SofaPython3,SofaImGui your_scene.py
runSofa -l SofaPython3,SofaImGui your_scene.py
Using Emio Assets
If you want to use the Emio assets (e.g. scenes, parts, meshes, etc. ), you need to add the Emio Labs assets folder to the PYTHONPATH.
You have two options:
- use the assets from the
path/to/home/emio-labs/VERSION/assetsfolder that is created at the first launch of Emio Labs - use directly the assets from the Emio Labs installation folder (i.e.
PATH_TO_EMIO_LABS/resources/assets)
If you use the assets in the PATH_TO_EMIO_LABS folder, changes made there cannot be reverted except by downloading and copying the content of Emio.CoreAssets back in the PATH_TO_EMIO_LABS/resources/assets folder.
To set the PYTHONPATH variable, use the corresponding command:
- Linux
- Windows
- MacOS
export PYTHONPATH=$PYTHONPATH:PATH_TO_EMIO_LABS/resources/assets
or
export PYTHONPATH=$PYTHONPATH:path/to/home/emio-labs/VERSION/assets
Using Powershell:
$env:PYTHONPATH+=";PATH_TO_EMIO_LABS\resources\assets
or
$env:PYTHONPATH+=";path\to\home\emio-labs\VERSION\assets
Using Command Prompt:
set PYTHONPATH=$PYTHONPATH:$PATH_TO_EMIO_LABS\resources\assets
or
set PYTHONPATH=$PYTHONPATH:path\to\home\emio-labs\VERSION\assets
export PYTHONPATH=$PYTHONPATH:PATH_TO_EMIO_LABS/resources/assets
or
export PYTHONPATH=$PYTHONPATH:path/to/home/emio-labs/VERSION/assets