open-rmf / rmf

Root repository for the RMF software
Apache License 2.0
225 stars 58 forks source link

model_downloader run failed #172

Closed mbb1234567890 closed 1 year ago

mbb1234567890 commented 1 year ago

Bug report

Required information:

Description of the bug

download demo models use ros2 run rmf_building_map_tools model_downloader rmf_demos_maps -s airport_terminal received error :

Could not parse cache file: /home/bing/.gazebo/models/! [Errno 21] Is a directory: '/home/bing/.gazebo/models/'Fetching page: 117 Fetching page: 118 Could not parse cache file: /home/bing/.gazebo/models/! [Errno 21] Is a directory: '/home/bing/.gazebo/models/'Fetching page: 119 Writing to cache: /home/bing/.gazebo/models/ Traceback (most recent call last): File "/home/bing/rmf_ws/install/rmf_building_map_tools/lib/rmf_building_map_tools/model_downloader", line 11, in load_entry_point('rmf-building-map-tools==1.5.1', 'console_scripts', 'model_downloader')() File "/home/bing/rmf_ws/install/rmf_building_map_tools/lib/python3.8/site-packages/model_downloader/model_downloader.py", line 80, in main download_models(map_dict[name], args.model_path, args.cache) File "/home/bing/rmf_ws/install/rmf_building_map_tools/lib/python3.8/site-packages/building_map_model_downloader/building_map_model_downloader.py", line 122, in download_models missing_models = pit_crew.get_missing_models( File "/home/bing/rmf_ws/install/rmf_building_map_tools/lib/python3.8/site-packages/pit_crew/pit_crew.py", line 153, in get_missing_models cache = build_and_update_cache(cache_file_path=cache_file_path, File "/home/bing/rmf_ws/install/rmf_building_map_tools/lib/python3.8/site-packages/pit_crew/pit_crew.py", line 869, in build_and_update_cache with open(cache_file_path, "w") as f:

Steps to reproduce the bug

  1. build from source colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
  2. source source ~/rmf_ws/install/setup.bash
  3. Download models using ros2 run rmf_building_map_tools model_downloader rmf_demos_maps -s airport_terminal
  4. See the error displayed
Models: [] are used in crowd_sim
ERROR::pit_crew.load_cache():774: Could not parse cache file: /home/bing/.gazebo/models/! [Errno 21] Is a directory: '/home/bing/.gazebo/models/'
Cache found! Model count: 0 

Expected behavior

model_downloader.py line 80, method download_models set wrong params, building_map_model_downloader.py line 91, method download_models definition incorrect, use wrong params value

Actual behavior

Screenshots

Additional information

image image

aaronchongth commented 1 year ago

Hello @mbb1234567890! Thanks for raising this issue, could you check if https://github.com/open-rmf/rmf_traffic_editor/pull/440 fixes your problem?

mbb1234567890 commented 1 year ago

Hi aaronchongth , model_downloader.py line 24 defined default args "~/.gazebo/models/" for -m parser.add_argument("-m", "--model-path", type=str, default="~/.gazebo/models/", help="Path to check models from and download models to")

https://github.com/open-rmf/rmf_traffic_editor/pull/440 will always to be "~/.ignition/fuel/" in building_map_model_downloader.py line 124 Is that right?

image

aaronchongth commented 1 year ago

hello @mbb1234567890, I am not too sure what your question is. Are you perhaps unsure why these 2 model paths are defined?

building_map_model_downloader uses gz-fuel-tools for model downloading, therefore we will need to collect the downloaded models from ~/.ignition/fuel after it has been downloaded, and we will then export it to wherever the user defined as --model-path.

The default value of --model-path is ~/.gazebo/models to accommodate the use of these models for gazebo classic, but users can define wherever they would like the models to be exported to.

mbb1234567890 commented 1 year ago

Thanks , problem solved!

aaronchongth commented 1 year ago

Apologies for closing the issue early, the fix, https://github.com/open-rmf/rmf_traffic_editor/pull/440, has just been merged in