btx0424 / OmniDrones

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

forest.py error when run script/train_lidar.py #47

Closed SuuTTT closed 4 months ago

SuuTTT commented 4 months ago

Hi all,

when i run python train_lidar.py headless=true eval_interval=200 task=Forest task.lidar_range=4. task.lidar_vfov=[-10.,20.]got error:

Error executing job with overrides: ['headless=true', 'eval_interval=200', 'task=Forest', 'task.lidar_range=4.', 'task.lidar_vfov=[-10.,20.]']
Traceback (most recent call last):
  File "/home/user/learn-OmniDrones/scripts/train_lidar.py", line 200, in main
    base_env = env_class(cfg, headless=cfg.headless)
  File "/home/user/miniconda3/envs/orbit/lib/python3.10/site-packages/torchrl/envs/common.py", line 158, in __call__
    instance: EnvBase = super().__call__(*args, **kwargs)
  File "/home/user/learn-OmniDrones/omni_drones/envs/forest.py", line 133, in __init__
    self.lidar._initialize_impl()
  File "/home/user/orbit/source/extensions/omni.isaac.orbit/omni/isaac/orbit/sensors/ray_caster/ray_caster.py", line 136, in _initialize_impl
    raise RuntimeError(f"Failed to find a prim at path expression: {self.cfg.prim_path}")
RuntimeError: Failed to find a prim at path expression: /World/envs/env_*/Hummingbird_0/base_link

env: installed orbit, ISAAC_SIM 2023.1.0-hotfix.


remarks:

https://github.com/NVIDIA-Omniverse/orbit/issues/236 this issue is similar to mine, but it's not working for me.

I've checked there exists /World/envs/env_1023/Hummingbird_0/base_link in simulator

I think it might be issues with wildcard (env_*), since when i changed env_* to env_0, this error solved. ( which caused another error File "/home/user/learn-OmniDrones/omni_drones/envs/forest.py", line 335, in _compute_state_and_obs (self.lidar.data.ray_hits_w - self.lidar.data.pos_w.unsqueeze(1)) RuntimeError: shape '[1024, 1, 36, 4]' is invalid for input of size 144)

btx0424 commented 4 months ago

Hi there. It is probably because they have changed the rule for regex matching. Changing env_* to env_.* solves the issue. I will fix that with a PR shortly.

BTW, may I kindly ask what you plan to do using OmniDrones? I am glad to provide specific support if needed.

SuuTTT commented 4 months ago

thanks, I recently work on MARL algo for drone swarm. OmniDrones is the best among all other drone swarm simulator I used.

btx0424 commented 4 months ago

Glad to hear that. Feedback on any aspect is welcomed!