Skip to content

Make PyTorch an optional dependency for the batched simulator#5

Merged
Tuxliri merged 2 commits intomainfrom
backup/feat/torch-and-px4-hil
Apr 1, 2026
Merged

Make PyTorch an optional dependency for the batched simulator#5
Tuxliri merged 2 commits intomainfrom
backup/feat/torch-and-px4-hil

Conversation

@Tuxliri
Copy link
Copy Markdown

@Tuxliri Tuxliri commented Apr 1, 2026

Move PyTorch and related packages to optional dependencies to prevent unnecessary installations for users who only need the standard simulator. Refine control handling in the PX4Multirotor step method to improve functionality.

Tuxliri and others added 2 commits March 29, 2026 23:34
torch, torchdiffeq, roma, and opt-einsum are only required for the
batched simulator (BatchedMultirotor, simulate_batch, BatchedSE3Control,
etc.). Moving them to an optional extra avoids forcing all users to
install PyTorch (~2 GB) when they only need the standard single-drone
simulator.

- pyproject.toml: remove the four packages from core dependencies and
  add a new `batched` extra; also include them in `all`
- Wrap top-level torch/roma/torchdiffeq imports with try/except in
  every file that mixes batched and non-batched classes, so those
  modules remain importable without the extra installed

Install the batched simulator with: pip install rotorpy[batched]

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Tuxliri Tuxliri merged commit ad14dcc into main Apr 1, 2026
5 of 9 checks passed
@Tuxliri Tuxliri deleted the backup/feat/torch-and-px4-hil branch April 1, 2026 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant