Skip to content

Commit 5133830

Browse files
chore: release v0.0.1
0 parents  commit 5133830

105 files changed

Lines changed: 8789 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
* text=auto
2+
*.sh text eol=lf
3+
*.stl filter=lfs diff=lfs merge=lfs -text
4+
*.obj filter=lfs diff=lfs merge=lfs -text
5+
*.pickle filter=lfs diff=lfs merge=lfs -text
6+
*.png filter=lfs diff=lfs merge=lfs -text
7+
*.mp4 filter=lfs diff=lfs merge=lfs -text
8+
*.jpg filter=lfs diff=lfs merge=lfs -text

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
__pycache__
2+
runs
3+
.pdm-python
4+
logs
5+
.idea
6+
.claude
7+
.venv
8+
node_modules
9+
docs/build
10+
docs/source/user_guide
11+
docs/source/index.md

.prettierignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.gitlab/ci/release.json
2+
CHANGELOG.md
3+
package-lock.json
4+
packages-lock.json
5+
TableOfContents.md
6+
node_modules
7+
.venv
8+
.gitlab-ci.yml
9+
docs/build/
10+
.readthedocs.yaml

.prettierrc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
trailingComma: "es5"
2+
tabWidth: 4
3+
semi: true
4+
singleQuote: false
5+
printWidth: 120
6+
endOfLine: "auto"
7+
overrides:
8+
- files: "*.yml"
9+
options:
10+
tabWidth: 2
11+
- files: "*.json"
12+
options:
13+
tabWidth: 2

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.10

.readthedocs.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
version: 2
2+
3+
build:
4+
os: ubuntu-22.04
5+
tools:
6+
python: "3.10"
7+
jobs:
8+
post_checkout:
9+
- mkdir -p tools
10+
# Download and uncompress the binary
11+
# https://git-lfs.github.com/
12+
- wget https://github.com/git-lfs/git-lfs/releases/download/v3.1.4/git-lfs-linux-amd64-v3.1.4.tar.gz -P tools
13+
- tar xvfz ./tools/git-lfs-linux-amd64-v3.1.4.tar.gz -C tools
14+
# Modify LFS config paths to point where git-lfs binary was downloaded
15+
- git config filter.lfs.process "`pwd`/tools/git-lfs filter-process"
16+
- git config filter.lfs.smudge "`pwd`/tools/git-lfs smudge -- %f"
17+
- git config filter.lfs.clean "`pwd`/tools/git-lfs clean -- %f"
18+
# Make LFS available in current repository
19+
- ./tools/git-lfs install
20+
# Download content from remote
21+
- ./tools/git-lfs fetch
22+
# Make local files to have the real content on them
23+
- ./tools/git-lfs checkout
24+
- rm -rf ./tools
25+
26+
sphinx:
27+
configuration: docs/source/conf.py
28+
29+
python:
30+
install:
31+
- method: pip
32+
path: .
33+
extra_requirements:
34+
- docs

CLAUDE.md

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Project Overview
6+
7+
MotrixLab is a reinforcement learning framework built on top of MotrixSim simulation backend. It provides a unified interface for training RL agents using multiple simulation backends (MotrixSim) and primarily integrates with the SKRL library. The framework is designed for robotics simulation and supports various environments including basic cartpole, locomotion tasks, and manipulation tasks.
8+
9+
## Development Setup
10+
11+
This project uses UV for dependency management and Python 3.10.
12+
13+
### Installation
14+
15+
```bash
16+
uv sync --all-packages --all-extras
17+
```
18+
19+
For SKRL framework with specific backend:
20+
21+
```bash
22+
uv sync --all-packages --extra skrl-jax # JAX backend
23+
uv sync --all-packages --extra skrl-torch # PyTorch backend
24+
```
25+
26+
**Available dependency groups in MotrixLab:**
27+
28+
- `skrl-jax`: SKRL RL framework with JAX backend
29+
- `skrl-torch`: SKRL RL framework with PyTorch backend
30+
- `test`: Test dependencies (pytest)
31+
32+
**Note**: This is a workspace project with two main packages: `motrix_envs` (simulation environments) and `motrix_rl` (RL framework integration).
33+
34+
## Common Commands
35+
36+
### Training
37+
38+
```bash
39+
uv run scripts/train.py --env cartpole
40+
```
41+
42+
### Environment Visualization
43+
44+
View environment without training:
45+
46+
```bash
47+
uv run scripts/view.py --env cartpole
48+
```
49+
50+
### Playing/Evaluation
51+
52+
```bash
53+
uv run scripts/play.py --env cartpole
54+
```
55+
56+
Specify policy file:
57+
58+
```bash
59+
uv run scripts/play.py --env cartpole --policy <path/to/best.[pickle/pt]>
60+
```
61+
62+
### Rendering
63+
64+
Add `--render` flag to training for visualization:
65+
66+
```bash
67+
uv run scripts/train.py --env cartpole --render
68+
```
69+
70+
### TensorBoard
71+
72+
```bash
73+
uv run tensorboard --logdir runs/{env-name}
74+
```
75+
76+
### Testing
77+
78+
```bash
79+
uv run pytest
80+
```
81+
82+
## Architecture
83+
84+
### Core Components
85+
86+
1. **Workspace Structure**:
87+
88+
- `motrix_envs/`: Simulation environment definitions using MotrixSim backend
89+
- `motrix_rl/`: RL framework integration (primarily SKRL) and training utilities
90+
91+
2. **Scripts** (`scripts/`):
92+
93+
- `train.py`: Main training script with configurable environments and backends
94+
- `view.py`: Environment visualization without training
95+
- `play.py`: Policy evaluation and testing
96+
97+
3. **Environment Registry**: Environments are registered via `motrix_envs.registry` and accessed using string names like "cartpole"
98+
99+
### Key Architecture Points
100+
101+
- **Workspace Project**: Uses UV workspace with two packages sharing dependencies
102+
- **MotrixSim Backend**: Built on MotrixSim simulation engine for physics simulation
103+
- **SKRL Integration**: Primary RL framework supporting both JAX and PyTorch backends
104+
- **Environment Naming**: Simple string-based environment identification (e.g., "cartpole")
105+
- **Automatic Backend Selection**: Training script automatically selects JAX or PyTorch based on GPU availability
106+
- **Multi-Backend Training**: Supports different simulation backends for the same environment
107+
108+
### Environment Usage Pattern
109+
110+
```python
111+
# Environment creation handled internally by scripts
112+
# Use string names to specify environments
113+
uv run scripts/train.py --env cartpole
114+
```
115+
116+
## Results Storage
117+
118+
Training results are saved to `runs/{env-name}/` directory structure with checkpoints and tensorboard logs.
119+
120+
## Important Notes
121+
122+
- **Python Version**: Requires exactly Python 3.10.\*
123+
- **GPU Support**: Includes CUDA support for both JAX and PyTorch backends
124+
- **Private PyPI**: Uses internal PyPI server for MotrixSim packages
125+
- **No Manual Tests**: No test files found in the repository structure

0 commit comments

Comments
 (0)