It is based on NVIDIA's Newton physical engine, but with my own fork so there might be some differences.
Firstly, git clone this repo with submodule.
git clone https://github.com/chunleili/RLMuscle
git submodule update --init --recursive
Install uv.
Then install the package with:
uv sync
Then run the example with:
uv run main.py
(Optional) To run different examples, you can hardcode change the "example_to_run" in main.py or set the environment variable "RUN" to the example name. For example, to run the muscle warp example in windows:
$env:RUN = "example_muscle_warp"
uv run main.py
Output (if any) will be saved in the "output" directory.
- physical engine
- Implement a minimal joint demo using newton
- USD IO with layering
- Add muscle coupling solver
- reinforcement learning
- Implement a simple RL task
You can run all the tests with:
uv run pytest -v
Or you can run a specific test file with:
uv run python tests/xxx.py
Use "--use-layered-usd" to enable the layered USD export. This is better than the newton's usd viewer because it just adding layers on top of the original usd file, which is the correct way to use usd. So it is incompatible with the "--viewer usd" and has to be used with usd as input.
You can also specify "--copy-usd" to copy the input usd file to the output directory, which is useful when you want to move and share the usd since the usd use relative path to reference the input usd file.
You can run the USD IO example in headless mode:
.\.venv\Scripts\python.exe examples\example_usd_io.py --viewer null --headless --num-frames 100 --use-layered-usd
It will automatically save the layered usd file after 100 frames.
USD and Houdini use Y up by default. But Newton uses Z up by default. See here for newton's convention. We will transfer the asset to Z up when loading it (turn off by switching off "y_up_to_z_up"). Be careful when importing other assets.
If you are simultaneously using Taichi and Warp, you have to first initialize Warp (wp.init()) then import Taichi, otherwise their LLVM will conflict with each other.