LeoRover / leo_simulator-ros2

MIT License
5 stars 4 forks source link

Mars Yard 2021 and 2022 not working on Humble and Fortress #5

Open Dave-van-der-Meer opened 7 months ago

Dave-van-der-Meer commented 7 months ago

Hi there,

First of all, very nice simulation. Unfortunatelly, I only get the Mars Yard 2020 working. For the other two worlds, I get error messages telling me that it cannot open some textures. The simulator opens, the robot model is loaded, but the terrain models are either missing or faulty.

Mars Yard 2022

[INFO] [create-3]: process has finished cleanly [pid 122396]
[ruby $(which ign) gazebo-1] [Err] [Image.cc:140] Unknown image format[/home/dave/leosim_ws/install/leo_gz_worlds/share/leo_gz_worlds/models/marsyard2022_terrain/dem/marsyard2022_terrain_hm.tif]                                                                                                                                                                                            
[ruby $(which ign) gazebo-1] [Err] [ImageHeightmap.cc:33] Unable to load image file as a terrain [/home/dave/leosim_ws/install/leo_gz_worlds/share/leo_gz_worlds/models/marsyard2022_terrain/dem/marsyard2022_terrain_hm.tif]                                                                                                                                                                 
[ruby $(which ign) gazebo-1] [Err] [Physics.cc:1299] Failed to load heightmap image data from [/home/dave/leosim_ws/install/leo_gz_worlds/share/leo_gz_worlds/models/marsyard2022_terrain/dem/marsyard2022_terrain_hm.tif]                                                                                                                                                                    
[ruby $(which ign) gazebo-1] [Err] [Image.cc:140] Unknown image format[/home/dave/leosim_ws/install/leo_gz_worlds/share/leo_gz_worlds/models/marsyard2022_terrain/dem/marsyard2022_terrain_hm.tif]                                                                                                                                                                                            
[ruby $(which ign) gazebo-1] [Err] [ImageHeightmap.cc:33] Unable to load image file as a terrain [/home/dave/leosim_ws/install/leo_gz_worlds/share/leo_gz_worlds/models/marsyard2022_terrain/dem/marsyard2022_terrain_hm.tif]                                                                                                                                                                 
[ruby $(which ign) gazebo-1] [Err] [SceneManager.cc:709] Failed to load heightmap image data from [/home/dave/leosim_ws/install/leo_gz_worlds/share/leo_gz_worlds/models/marsyard2022_terrain/dem/marsyard2022_terrain_hm.tif]                                                                                                                                                                
[ruby $(which ign) gazebo-1] [Err] [SceneManager.cc:404] Failed to load geometry for visual: terrain_visual
[ruby $(which ign) gazebo-1] [GUI] [Err] [Image.cc:140] Unknown image format[/home/dave/leosim_ws/install/leo_gz_worlds/share/leo_gz_worlds/models/marsyard2022_terrain/dem/marsyard2022_terrain_hm.tif]                                                                                                                                                                                      
[ruby $(which ign) gazebo-1] [GUI] [Err] [ImageHeightmap.cc:33] Unable to load image file as a terrain [/home/dave/leosim_ws/install/leo_gz_worlds/share/leo_gz_worlds/models/marsyard2022_terrain/dem/marsyard2022_terrain_hm.tif]                                                                                                                                                           
[ruby $(which ign) gazebo-1] [GUI] [Err] [SceneManager.cc:709] Failed to load heightmap image data from [/home/dave/leosim_ws/install/leo_gz_worlds/share/leo_gz_worlds/models/marsyard2022_terrain/dem/marsyard2022_terrain_hm.tif]                                                                                                                                                          
[ruby $(which ign) gazebo-1] [GUI] [Err] [SceneManager.cc:404] Failed to load geometry for visual: terrain_visual

Mars Yard 2021

[INFO] [create-3]: process has finished cleanly [pid 122819]
[ruby $(which ign) gazebo-1] [Err] [Image.cc:140] Unknown image format[/home/dave/leosim_ws/install/leo_gz_worlds/share/leo_gz_worlds/models/marsyard2021_terrain/dem/marsyard_terrain_hm.tif]
[ruby $(which ign) gazebo-1] [Err] [ImageHeightmap.cc:33] Unable to load image file as a terrain [/home/dave/leosim_ws/install/leo_gz_worlds/share/leo_gz_worlds/models/marsyard2021_terrain/dem/marsyard_terrain_hm.tif]                                                                                                                                                                     
[ruby $(which ign) gazebo-1] [Err] [Physics.cc:1299] Failed to load heightmap image data from [/home/dave/leosim_ws/install/leo_gz_worlds/share/leo_gz_worlds/models/marsyard2021_terrain/dem/marsyard_terrain_hm.tif]                                                                                                                                                                        
[ruby $(which ign) gazebo-1] [Err] [Image.cc:140] Unknown image format[/home/dave/leosim_ws/install/leo_gz_worlds/share/leo_gz_worlds/models/marsyard2021_terrain/dem/marsyard_terrain_hm.tif]
[ruby $(which ign) gazebo-1] [Err] [ImageHeightmap.cc:33] Unable to load image file as a terrain [/home/dave/leosim_ws/install/leo_gz_worlds/share/leo_gz_worlds/models/marsyard2021_terrain/dem/marsyard_terrain_hm.tif]                                                                                                                                                                     
[ruby $(which ign) gazebo-1] [Err] [SceneManager.cc:709] Failed to load heightmap image data from [/home/dave/leosim_ws/install/leo_gz_worlds/share/leo_gz_worlds/models/marsyard2021_terrain/dem/marsyard_terrain_hm.tif]                                                                                                                                                                    
[ruby $(which ign) gazebo-1] [Err] [SceneManager.cc:404] Failed to load geometry for visual: terrain_visual
[ruby $(which ign) gazebo-1] [GUI] [Err] [Image.cc:140] Unknown image format[/home/dave/leosim_ws/install/leo_gz_worlds/share/leo_gz_worlds/models/marsyard2021_terrain/dem/marsyard_terrain_hm.tif]                                                                                                                                                                                          
[ruby $(which ign) gazebo-1] [GUI] [Err] [ImageHeightmap.cc:33] Unable to load image file as a terrain [/home/dave/leosim_ws/install/leo_gz_worlds/share/leo_gz_worlds/models/marsyard2021_terrain/dem/marsyard_terrain_hm.tif]                                                                                                                                                               
[ruby $(which ign) gazebo-1] [GUI] [Err] [SceneManager.cc:709] Failed to load heightmap image data from [/home/dave/leosim_ws/install/leo_gz_worlds/share/leo_gz_worlds/models/marsyard2021_terrain/dem/marsyard_terrain_hm.tif]                                                                                                                                                              
[ruby $(which ign) gazebo-1] [GUI] [Err] [SceneManager.cc:404] Failed to load geometry for visual: terrain_visual

My system specifications are as follows:

Ubuntu 22.04 running on an Intel i5 laptop, ROS2 Humble and Ignition Gazebo Fortress.

To replicate the issue, you have to follow the steps in the README and then run the command to launch the MarsYard worlds. I changed the path to the world file according to my workspace name (leosim_ws).

I hope these issues can be resolved soon.

bjsowa commented 6 months ago

Hi @Dave-van-der-Meer, The 2021 and 2022 marsyard terrain models use TIF heightmaps which are only supported since Gazebo Garden. They won't work unfortunately if you are using Gazebo Fortress edition.

To use these packages with Gazebo Garden (assuming you are using Ubuntu):

  1. Add official Gazebo apt repositories
  2. Install gz-garden metapackage and ros_gz ROS package (compiled for Gazebo Garden):
    sudo apt install gz-garden ros-humble-ros-gzgarden
  3. Build leo simulation packages according to the README. Remeber to set GZ_VERSION variable to garden

Now you should be able to run the simulation using Garden distribution:

ros2 launch leo_gz_bringup leo_gz.launch.py sim_world:=marsyard2022.sdf
rubenanapu commented 5 months ago

Awesome.

After installing the packages mentioned in the last comment:

sudo apt install gz-garden ros-humble-ros-gzgarden

And launching:

ros2 launch leo_gz_bringup leo_gz.launch.py sim_world:=marsyard2022.sdf

I initially got only a black screen.

But then I launched the simulation again without the sim_world:=marsyard2022.sdf and the robot appeared.

Then I tried again the command with the world, and it finally worked.

ros2 launch leo_gz_bringup leo_gz.launch.py sim_world:=marsyard2022.sdf

Screenshot from 2024-03-14 09-15-11

But I'm also using gz (gazebo) garden compiled from source.

The image you see above is running a local docker container.

The linux specifications:

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.3 LTS
Release:    22.04
Codename:   jammy