btx0424 / OmniDrones

https://omnidrones.readthedocs.io/
MIT License
126 stars 23 forks source link

Question about the use of custom environment #59

Open jinwoolee1230 opened 3 months ago

jinwoolee1230 commented 3 months ago

Dear maintainers,

In accordance with the purpose of this project, I am now trying to develop a RL project on Omnidrones.

I want to train a new task on this platform, so I need to use custom environment. However, I could not find no files related to map except the python files located at Omnidrones/omni_drones/envs. I assume that those python files are defining the environment (map) settings, but I would like to know if there is more intuitive way to set up the training environment (map).

Is there any way to make a map using Isaac Sim, saving the map, and import it while training? It would be great if it is possible, like other simulators (for example, AirSim).

Maybe this issue is due to my lack of experience on Isaac Sim and Omnidrones but I would be thankful if you could provide instruction on this.

Thank you for your kind help

viveksahukar commented 3 months ago

I too have the similar question. I'm trying to use this Omnidrones repository for my AI Safety course. I want to introduce few obstacles in the custom environment. I then want to make the drone learn to fly through while avoiding obstacles and I will introduce some AI safety constraints. How to make changes to the environment and use other RL algorithms for training?

btx0424 commented 3 months ago

Sorry for the delayed response. Currently, there are several ways you could customize the physical environment (scene/map):

  1. Create a USD of the scene. It allows you to make complex and photo-realistic scenes like in Isaac Sim's doc: image However, you need expertise working with USDs to do this.
  2. Another way is to take advantage of the terrains implemented by Orbit. The Forest environment used it to generate a cluttered environment. The drawback is flexibility. You may need to write your own mesh or heightfield configs to generate a specific terrain.
  3. You can also add objects of primitive shapes to construct a simple environment. Search for create_obstacle in the code to see example usage.

All these should be done for a template environment /World/envs/env_0 inside IsaacEnv._design_scene, after which the template environment is cloned to create the parallel environments. Some aspects, e.g., mesh of the ground plane and lighting are global.

I understand that it might be confusing. It took me quite a while when I was writing the repo. I am currently refactoring it to partially depend on Orbit to make customizing the scene easier. But I am not sure about the timeline. By then, you will be able to create and configure your environment like (a yaml file):

scene:
  lighting: ...
  terrain: ...
  drone:
    model: Hummingbird
    motor: ...
  obstacle_0:
    type: cylinder
    size: ...
    pose: ...
  obstacle_1:
    type: box
    ...
task:
  observations:
    dynamic_state: {...}
    lidar: {range: 3, vfov: 20}
  rewards:
    tracking: {weight: 1.0}
    energy: {weight: 0.1}

It would be great if you are interested in long-term usage and helping me out a bit here.

jinwoolee1230 commented 3 months ago

Thank you for your kind and quick response!

By the way, I think the first method (creating USD custom environment) sounds the best for my project. I understand this part is closely related to the use of isaac sim rather than this project but it would be nice to have a brief introduction on this part!

I really appreciate all of your efforts and I am very interested in long-term usage. It would be wonderful if you could support and maintain this project in long-term.

btx0424 commented 3 months ago

Hi. Really thanks for your interest. Maybe we can communicate through Discord or something like a Zoom meeting, which is more in-time and convenient. You can reach me at btx0424@outlook.com.