|
bitsim
Model, simulate, estimate and control robots in C++
|
bitrl is built on bitsim, so bitsim comes first. Ubuntu 24.04 is the reference platform: the CI builds bitrl there, with the scripts in bitrl's ci/ directory that this page mentions.
| Dependency | Needed for |
|---|---|
| A C++20 compiler, such as g++ 11, and CMake 3.20 or newer | everything |
| bitsim 5, and what it needs: Boost, Eigen, spdlog | everything; see Installing bitsim |
| libtorch, built with the C++11 ABI | everything; the deep reinforcement learning |
| TBB, sudo apt-get install libtbb-dev | everything |
| GoogleTest | ENABLE_TESTS |
| The bitrl-rest-api server | running the Gymnasium environments, not building |
HTTPRequest and nlohmann/json come with bitsim. bitsim installs as the CMake package bitsim; ci/install_bitsim.sh <prefix> builds and installs it, and ci/install_libtorch.sh <prefix> downloads libtorch, the way the CI does.
Tell CMake where bitsim and libtorch are:
Give --parallel a number. The files that include libtorch take a lot of memory to compile, and an unlimited build runs out of memory on a 16 GB machine. If bitsim was built with Chrono, and Chrono is not in a system prefix, add its prefix to CMAKE_PREFIX_PATH too.
| Option | Default | Description |
|---|---|---|
| ENABLE_EXAMPLES | ON | Build the examples, see Examples |
| ENABLE_TESTS | OFF | Build the tests |
| USE_CUDA | OFF | Use CUDA; libtorch must be built with CUDA too |
| BITRL_LOG | ON | Library logging |
| BITRL_WERROR | OFF | Treat warnings as errors |
With the tests:
installs lib/libbitrllib.so, the headers in include/bitrl/ and the CMake package in lib/cmake/bitrl/. Another project then uses bitrl with
and -DCMAKE_PREFIX_PATH with the prefixes of bitrl, bitsim and libtorch. The package finds bitsim, libtorch and TBB itself. ci/check_install.sh checks that an installed bitrl works this way.
Gymnasium's environments run on the bitrl-rest-api server, which bitrl reaches at http://0.0.0.0:8001/api by default. Start it before you run the examples that use them; its README says how to install and run it.
bitrl logs with bitsim's logger, which writes with spdlog to standard error. bitrl's messages go to the logger named bitrl:
The SPDLOG_LEVEL environment variable sets the levels without changing the code: SPDLOG_LEVEL=bitrl=warn ./ppo_cartpole. The logging section of Installing bitsim has the details.
This site is built with Doxygen from its own repository; Building the documentation says how.