Novometis is a fork of a fork of a fork of... you know what? Just check the commit history.
Novometis is based on facebook's polymetis, which is unfortunately no longer being maintained. It is primarily intended for robot setups involving a real-time computer without a GPU (the server) and a GPU computer used for policy inference (the client). Regarding robot hardware, we focus on the Franka Emika Robot, although the source code for other robots has not been removed.
The original goal of Polymetis was to provide a unified interface for writing robot controllers that can be used in both simulation and on real hardware. In practice, such an interface is almost impossible to create. Not only do modern simulators (e.g. IsaacSim, ManiSkill) have differing paradigms for robot control (or may not support custom controllers), but even defining a common API for all robot hardware can be too restrictive.
Despite these shortcomings, Polymetis is a powerful framework for controlling robot hardware, and the source code remains a valuable resource. One of the main advantages of Polymetis is the ability to write robot controllers in Python instead of C++, which are then jit compiled to overcome the performance limitations of Python for real-time execution. As a result, these controllers don't even need to be predefined on the server, and a client can inject (almost) arbitrary code to be executed in the control loop at 1kHz!
- Install the system build requirements (requires sudo rights).
sudo apt install build-essential cmake libssl-dev- Clone the repository.
git clone git@github.com:ALRhub/novometis.git
cd novometis- Set up a conda/mamba environment for compilation. This environment contains some minimal libraries that should likely not affect any of your machine learning code.
mamba env create -n polymetis -f polymetis/environment_client.yml
mamba activate polymetisIf you already have an existing conda environment activated, run the following instead:
mamba env update -f polymetis/environment_client.yml- Install your desired version of pytorch. You should probably install via pip, as this is currently the preferred method.
# e.g. substitute with any version of pytorch you like
pip3 install torch --index-url https://download.pytorch.org/whl/test/cu128- Compile and install polymetis.
cmake -S polymetis -B polymetis/build -DCMAKE_BUILD_TYPE=Release
cmake --build polymetis/build -j --target install- Install python runtime dependencies and the polymetis package itself.
pip install -r polymetis/requirements.txt
pip install -e ./polymetis-
Create a cpu environment with dependencies.
-
Build libfranka to communicate with the robot.
-
Build & install polymetis
# clone & create env
git clone git@github.com:intuitive-robots/irl_polymetis.git
cd monometis/
mamba env create -f polymetis/environment_cpu.yml
conda activate robo
# compile stuff
./scripts/build_libfranka.sh
mkdir -p ./polymetis/build
cd ./polymetis/build
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_FRANKA=ON
make -j
cd ../..
# inside the project root
pip install -e ./polymetisTo launch the robot or gripper server:
# start robot server
./scripts/start_robot.sh 101
# start gripper server
./scripts/start_gripper.sh 201You need to specify the robots id. It is the same as the last part if the robots ip address (10.10.10.101).
Additional arguments for the commands can be seen in the table below.
| Argument | Description |
|---|---|
| -h, --help | Display a help message. |
| -i, --pc-ip [IP] | Change the ip address, where the server is running. Default is localhost. |
| -p, --port [PORT] | Change the port of the server. Default is 50051. |
| -c, --conda [CONDA_ENV] | Change the conda environment, where polymetis is installed. Default is poly. |
| -r, --readonly | Starts the server in readonly mode. For usage with the robots white mode. Only for the robot server. |
Write PyTorch controllers for robots, test them in simulation, and seamlessly transfer to real-time hardware.
Polymetis powers robotics research at Facebook AI Research. If you want to write your robot policies in PyTorch for simulation and immediately transfer them to high-frequency (1kHz) policies on real-time hardware (e.g. Franka Panda), read on!
- Unified simulation & hardware interface: Write all your robot controllers just once -- immediately transfer them to real-time hardware. You can even train neural network policies using reinforcement learning in simulation and transfer them to hardware, with just a single configuration toggle.
- Write your own robot controllers: Use the building blocks in our TorchControl library to write complex robot controllers, including operational space control. Take advantage of our wrapping of the Pinocchio dynamics library for your robot dynamics.
- Drop-in replacement for PyRobot: If you're already using PyRobot, you can use the exact same interface, but immediately gain access to arbitrary, custom high-frequency robot controllers.
To get started, you only need one line:
conda install -c pytorch -c fair-robotics -c aihabitat -c conda-forge polymetis
You can immediately start running the example scripts in both simulation and hardware. See installation and usage documentation for details.
All documentation on the website. Includes:
- Guides on setting up your Franka Panda hardware for real-time control
- How to quickly get started in PyBullet simulation
- Writing developing your own custom controllers in PyTorch
- Full autogenerated documentation
To run benchmarking, first configure the script to point to your hardware instance, then run
asv run --python=python --set-commit-hash $(git rev-parse HEAD)To update the dashboard, run:
asv publishCommit the result under .asv/results and docs/; it will show up under the benchmarking page in the documentation.
If you use Polymetis in your research, please use the following BibTeX entry.
@misc{Polymetis2021,
author = {Lin, Yixin and Wang, Austin S. and Sutanto, Giovanni and Rai, Akshara and Meier, Franziska},
title = {Polymetis},
howpublished = {\url{https://facebookresearch.github.io/fairo/polymetis/}},
year = {2021}
}
Note: Giovanni Sutanto contributed to the repository during his research internship at Facebook Artificial Intelligence Research (FAIR) in Fall 2019.
See the CONTRIBUTING file for how to help out. Make an issue for bugs and feature requests, or contribute a new robot controller by making a pull request!
Polymetis is MIT licensed, as found in the LICENSE file.