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 (
.deb
for Linux,.msi
for Windows, or.dmg
for MacOS) or as a compressed archive (.zip
). - It is important to note that portable formats (
.AppImage
for Linux,.exe
for Windows,.app
for 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
bin
subdirectory, 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
.msi
installer isC:\Users\YOUR_USERNAME\AppData\Local\Programs\emio-labs
- A typical example on Linux when you used the
.deb
installer 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
bin
subdirectory, 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
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