FAIRIS-Lite is a project framework that allows you to implement navigational control logic directly on the open-source robotic simulation platform Webots. With this framework, you can create your own Webots controller without the need to set up a simulated environment or robot, as we provide all the materials required to get started.
To work with FAIRIS-Lite, ensure that your system meets the following requirements:
-
Important: It’s crucial to install Python 3.10+ from the Microsoft Store to avoid potential issues with PATH configurations and permissions.
-
Installation Instructions:
-
Open the Microsoft Store on your Windows PC.
-
In the search bar, type "Python 3.10".
-
Select Python 3.10 from the list of results.
-
Click Get or Install to download and install Python 3.10 on your machine.
-
Once installed, verify the installation by opening Command Prompt and typing:
python3 --version
- This should return
Python 3.10.x
if installed correctly.
-
-
Ensure you have Python 3.10+ installed. Most distributions can install it using the package manager:
sudo apt-get install python3.10
FAIRIS-Lite works in conjunction with Webots version R2023b. Ensure you install Webots correctly:
- Do not install Webots from the Snap packaging due to known compatibility issues. Instead, use the
.deb
package or tarball for installation. - Installation Instructions:
- Follow the detailed installation guide here.
- Download and install Webots R2023b from the official Cyberbotics website.
Ensure that you have Git installed to clone the FAIRIS-Lite repository:
-
Windows: Download and install Git from git-scm.com.
-
Linux: Install Git via your package manager:
sudo apt-get install git
-
macOS: Install Git via Homebrew:
brew install git
Follow these steps to set up FAIRIS-Lite on your local machine:
Clone this repository onto your device. There are numerous ways to achieve this, and you can decide which option is best for you. If you plan to use this repo for a course or an extended period, we recommend that you clone the repo and perform pulls when an update is pushed. A complete guide on how to clone GitHub repositories can be found here.
Clone command:
git clone https://github.com/biorobaw/FAIRIS-Lite.git
- MacOS: Press Command + Space Bar, type "Terminal" in Spotlight, and click to open the app.
- Linux: Press Ctrl + Alt + T to instantly launch a Terminal window.
- Windows: Press the Windows Key + R, type
cmd.exe
, and press Enter.
Change your directory to the root of the FAIRIS-Lite project:
cd path_to/FAIRIS-Lite
Run the provided script to create a Python virtual environment using Python 3.10+ and install all necessary dependencies.
python3 create_venv.py
This script will:
- Search for Python 3.10+ on your system and use it to create a virtual environment.
- Install all required libraries in the virtual environment.
- Add paths to the
fairis_tools
andfairis_lib
packages.
After creating the virtual environment, you need to activate it before installing the FAIRIS-Lite packages.
FAIRIS-LITE\ $ venv\Scripts\activate
FAIRIS-LITE$ source venv/bin/activate
You should now see your terminal prompt change to indicate that the virtual environment is active (e.g., (venv)
at the start of your command line).
pip install -e .
This command will install the fairis_tools
and fairis_lib
packages, making all classes and functions available for use in your Webots controllers.
rm -r fairis_lite.egg-info/
This command will remove the fairis_lite.egg-info directory that are automatically generated during the installation process.
You can configure Webots to use the correct Python environment in two ways: by running an automatic script or manually creating the necessary runtime.ini
files in each controller directory.
Simply run the provided script to automatically create and configure the runtime.ini
files in all controller directories:
python3 add_runtime_ini.py
This script will:
- Locate all controller directories under
WebotsSim/controllers/
. - Create a
runtime.ini
file in each directory. - Set the Python command to the correct virtual environment's Python executable.
- Note that you will need to run this everytime you create a new robot controller.
If you prefer, you can manually create and configure the runtime.ini
files. Follow these steps:
- Navigate to each controller directory under
WebotsSim/controllers/
. - Create a file named
runtime.ini
in each directory. - Add the following content to the
runtime.ini
file:
[python]
COMMAND = path_to_your_venv/bin/python3
Here’s an example structure showing where to place the runtime.ini
files:
FAIRIS-LITE/
├── WebotsSim/
│ ├── controllers/
│ │ ├── template/
│ │ │ ├── template.py
│ │ │ ├── runtime.ini # Manually created
│ │ ├── my_controller/
│ │ │ ├── my_controller.py
│ │ │ ├── runtime.ini # Manually created
│ └── ...other WebotsSim files...
├── fairis_tools/
│ ├── __init__.py
│ ├── my_robot.py
│ └── ...other modules students can use...
├── fairis_lib/
│ ├── __init__.py
│ ├── environment_loader.py
│ └── ...other foundational modules...
├── setup.py
└── README.md
FAIRIS-Lite supports PyCharm integration with Webots. Follow these steps to set it up:
- Open the FAIRIS-Lite directory as a project in PyCharm.
- Set the Python interpreter to the virtual environment created earlier.
- Ensure the project structure includes the
fairis_tools
andfairis_lib
directories.
For detailed instructions on configuring PyCharm with Webots, refer to this guide.
To ensure FAIRIS-Lite is set up correctly:
- Launch Webots and open the world file located at
FAIRIS-Lite/WebotsSim/worlds/StartingWorld.wbt
. - Verify that the Template controller is running, which should add walls and place the robot in a starting location.
- The robot should print sensor readings and move approximately 1.5 meters before stopping.
- Use the reset button in the Webots interface to see this process repeat.
If everything works as expected, you’re ready to start developing your robot controllers in Webots using Python.