Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Training with a large number of different objects #40

Closed
AmanuelErgogo opened this issue Mar 24, 2023 · 2 comments
Closed

[Question] Training with a large number of different objects #40

AmanuelErgogo opened this issue Mar 24, 2023 · 2 comments
Labels
question Further information is requested

Comments

@AmanuelErgogo
Copy link

Question

Hi great work!

What is a possible way to clear stage and spawn a random rigid object at each episode without closing the simulator? without running into memory leaks

Thanks,

@Mayankm96
Copy link
Contributor

Hi!

That is a very interesting question. In principle, one can delete a prim and spawn a new prim to the stage at any time when the stage is running. So you don't need to close the simulator.

I haven't tested this but something like this would fit your need:

from omni.isaac.core.utils.prims import delete_prim, create_prim

delete_prim("/World/envs/env_0/Object")
create_prim("/World/envs/env_0/Object", usd_path=cfg.usd_path)

However, spawning assets on the fly (i.e. while the simulation is playing) is somewhat risky. Whenever a new object is spawned, physics needs to allocate memory for it and then the RigidPrimView needs to be re-initialized to access the new memory created. Reinitializing the prim views can be expensive depending on how many objects are present, so definitely not a great thing to do at every new episode.

A workaround can be that you spawn all the assets at the start and hide them far away from the scene (under the ground), and at every reset put one of them back on the table by changing their position. Not an elegant solution though.

@Mayankm96 Mayankm96 changed the title training on a large number of different objects [Question] Training with a large number of different objects Mar 28, 2023
@Mayankm96 Mayankm96 added the question Further information is requested label Mar 28, 2023
@Mayankm96
Copy link
Contributor

Closing the issue due to no activity. Please re-open if still unresolved.

Mayankm96 added a commit that referenced this issue Jul 24, 2023
# Description

Adds a directory `docker` in the root of the repo, containing a
`Dockerfile`, `dockerfile-compose.yaml`, `.env`, and utility script
`container.sh` that wraps docker-compose CLI commands. The instructions
in the documentation specify the installation steps and how to get the
Isaac Sim docker image for completeness.

To run a container, the user needs to create NGC credentials via the
NVIDIA Developers program. After that they can run the script to launch
the container:

```bash
./docker/container.sh start
./docker/container.sh enter
```

Also added an argument `-o` or `--docker` to the `orbit.sh` that calls
the above script. The above then becomes:

```bash
./orbit.sh -o start 
./orbit.sh -o enter
```

Fixes #23 

## Type of change

- New feature (non-breaking change which adds functionality)

## Checklist

- [X] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./orbit.sh --format`
- [X] I have made corresponding changes to the documentation
- [X] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have updated the changelog and the corresponding version in the
extension's `config/extension.toml` file

---------

Co-authored-by: Mayank Mittal <[email protected]>
Mayankm96 added a commit that referenced this issue Dec 22, 2023
# Description

Adds a directory `docker` in the root of the repo, containing a
`Dockerfile`, `dockerfile-compose.yaml`, `.env`, and utility script
`container.sh` that wraps docker-compose CLI commands. The instructions
in the documentation specify the installation steps and how to get the
Isaac Sim docker image for completeness.

To run a container, the user needs to create NGC credentials via the
NVIDIA Developers program. After that they can run the script to launch
the container:

```bash
./docker/container.sh start
./docker/container.sh enter
```

Also added an argument `-o` or `--docker` to the `orbit.sh` that calls
the above script. The above then becomes:

```bash
./orbit.sh -o start 
./orbit.sh -o enter
```

Fixes #23 

## Type of change

- New feature (non-breaking change which adds functionality)

## Checklist

- [X] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./orbit.sh --format`
- [X] I have made corresponding changes to the documentation
- [X] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have updated the changelog and the corresponding version in the
extension's `config/extension.toml` file

---------

Co-authored-by: Mayank Mittal <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants