Field-Robotics-Lab / dave

Project DAVE
Apache License 2.0
224 stars 72 forks source link

Jessica/new heightmap #207

Closed j-herman closed 2 years ago

j-herman commented 2 years ago

This PR adds an alternate seafloor that can be used in place of the UUV simulator sandy bottom. It's a simple heightmap, about 6 meter resolution, scaled down from the same Santorini Island data that @woensug-choi used to build the alternate tiled bathymetry. See the draft wiki for a screenshot and a description of the process I used to create it.
To run the world: roslaunch dave_demo_launch dave_new_environment.launch You should see the rexrov in a new world with the ocean surface and a new heightmap for the seafloor.

Not planning to merge this immediately - just making it available in case it's needed. If we can find a higher-resolution file, we can import it pretty quickly. This one was tricky because of the proprietary file format, but overall the process is straightforward.

quarkytale commented 2 years ago

The link to the wiki seems broken, use this.

j-herman commented 2 years ago

Fixed the package reference - thanks @quarkytale ! I forgot to mention some known error messages that will show up with this world. With all of the manipulation of formats, the geographic references are not being maintained. This is not a bad thing in this example, I think - we wouldn't want the simulation to think we have valid geo coordinates stored in a heightmap that has been scaled. PROJ will complain about this and you'll see a sequence of messages like:

ERROR 1: PROJ: proj_create_from_database: SQLite error on SELECT name, type, coordinate_system_auth_name, coordinate_system_code, datum_auth_name, datum_code, area_of_use_auth_name, area_of_use_code, text_definition, deprecated FROM geodetic_crs WHERE auth_name = ? AND code = ?: no such column: area_of_use_auth_name ERROR 1: PROJ: proj_create: unrecognized format / unknown name ERROR 6: Cannot find coordinate operations from' to GEOGCRS["WGS 84",DATUM["World Geodetic System 1984",ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["latitude",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["longitude",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]]' When using an input format that gdal can ingest directly, these errors should not be present.

woensug-choi commented 2 years ago

If needed, this command will launch bash environment with gdal installed.

docker pull woensugchoi/bathymetry_converter:release && docker run -it --rm -v $PWD:/home/mkbathy/workdir -w /home/mkbathy/workdir woensugchoi/bathymetry_converter:release bash
j-herman commented 2 years ago

@quarkytale I've given the wiki a once-over and added the dependencies and docker instructions. Building a seafloor seems a bit more art than science, so I tried to provide some options and some description of what each step is doing (or avoiding) rather than very specific instructions, but I'm not sure how well that will work. Let me know what you think - I can rework the style as well as the content if it doesn't make sense to you.

quarkytale commented 2 years ago

@j-herman Its taking me time to run through the full tutorial, might not be able to do that for the release. I reviewed the code, looks good to me! But I'm not able to run the example world, getting a blank black screen (seg fault), working on it. The wiki's content is exhaustive and complete, but could rework the style a little with bullet points. Do you mind if I suggest some changes with a commit?

bsb808 commented 2 years ago

@j-herman and @quarkytale Please keep me in the loop on this. I'd like to get this into the 4.3.0 release.

I renamed the wiki to remove "DRAFT" https://github.com/Field-Robotics-Lab/dave/wiki/Building-a-simple-underwater-environment-via-heightmaps IMHO all wikis are always drafts ;)

I also added a link from the wiki home page to the wiki.

quarkytale commented 2 years ago

@j-herman, @bbingham-nps Update: The seg fault is not occurring with other launch files. When I launch this example in debug mode, I'm getting: Thread 1 "gzserver" received signal SIGSEGV, Segmentation fault. 0x00007f076deb165c in gazebo::physics::HeightmapShape::Init() () from /usr/lib/x86_64-linux-gnu/libgazebo_physics.so.11 (gdb) [WARN] [1645816514.437411, 0.000000]: Controller Spawner couldn't find the expected controller_manager ROS interface. I checked ros-control packges exist for my noetic installation but the controller_manager isn't running. No transform found between base_link and base_link_ned for vehicle /rexrov/, message=ROS shutdown request

j-herman commented 2 years ago

@quarkytale I am not sure what's going on with the controllers - no seg fault still for me - but will keep working on it. Were you working in docker? And edit the wiki however you like!

j-herman commented 2 years ago

@quarkytale Could you try installing gdal and see if that fixes the seg fault? It shouldn't be required for the demo, but there is a #ifdef in the gazebo heightmap library that may be the difference between your results and mine.

quarkytale commented 2 years ago

@j-herman I am using latest dockwater to run dave in this feature branch. I installed gdal and proj-bin, still the same error.

j-herman commented 2 years ago

@quarkytale This is strange - I am not sure where to troubleshoot next, other than eliminating elements from the launch file and world, and adding them back in one at a time. Do you have time to play with this? I still can't duplicate the issue in either docker or my local machine environment. We could eliminate some of the complexity by removing all of the vehicle components from the launch file to see if that helps. @bsb808 This seemed like a quick and easy add-on for the release but a mystery seg fault may be tough to track down. If you have a spare minute to give it a try, it would be helpful to see if you're getting the same error messages or some other failure condition. I'll keep poking at it to see if I can come up with a fix.

quarkytale commented 2 years ago

@j-herman Yes definitely! It is strange indeed, it might be a local issue, but I tried with a fresh docker container too. I could get the ocean (with the currents) and robot load up well, only the heightmap is giving me error. Working on it.

j-herman commented 2 years ago

@quarkytale Shot in the dark here, but I tried changing the media path - seems like we'd get a more informative error if a file couldn't be opened, but maybe it will work.

j-herman commented 2 years ago

@quarkytale Thank you so much for the help with this!