- Notifications
You must be signed in to change notification settings - Fork33
Modern C++ and python library for reading and processing sonar data
License
nilsbore/auvlib
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Tools for reading AUV deployment data files and forprocessing and visualization of side scan and multibeam data.Extensive documentation for the python API is availableat this site.
To use auvlib on Linux, it is recommended to build the library on your machine (see the following sections).On Windows, it is instead recommended to use the pre-compiled statically linked pythonlibraries. See thereleases page for detailson how to install and use the latest release.
auvlib has been tested on Ubuntu 16.04, 18.04 and 20.04.On Ubuntu 16.04, 18.04 and 20.04, use the following command to install all dependencies:
sudo apt-get install libcereal-dev libglfw3-dev libtinyxml2-dev libboost-all-dev libopencv-dev xorg-dev
Once cloned, you need to get the libigl submodule and some of its dependencies:
git submodule update --init
When done, create abuild
folder in the repo root, and enter:
mkdir build && cd build
Then execute the followingcmake
command depending on your platform:
- Ubuntu 16.04:
cmake -DCMAKE_INSTALL_PREFIX=../install .. -DAUVLIB_USE_LIBIGL_TINYXML=OFF -DAUVLIB_USE_LIBIGL_GLFW=OFF
- Ubuntu 18.04:
cmake -DCMAKE_INSTALL_PREFIX=../install ..
- Ubuntu 20.04:
cmake -DCMAKE_INSTALL_PREFIX=../install ..
NOTE: If you are using a conda python executable, you first need to change the flag on line 78 fromset(PYTHON_EXECUTABLE /usr/bin/python3)
to something likeset(PYTHON_EXECUTABLE /home/user/anaconda3/envs/[YOUR ENV NAME]/bin/python)
.
NOTE: Ignore the errors about thetinyxml2
andglfw
targets not being in the export set;build files are still generated properly.
When done, build and intall the code using
make -j4 && make install
You should now have a compiled version of auvlib in the folder/path/to/auvlib/install
. When done, please execute
export PYTHONPATH=$PYTHONPATH:/path/to/auvlib/install/lib
in any terminal where you want to use the python version ofthe library, or add this line to your~/.bashrc
.
Python 3 is the preferred interface for auvlib. In general, the python bindings have morecomplete documentation and supports most of the use cases of the c++ library.Extensive documentation is availableat this site.
As an example, in the snippet below, we read multibeam data from a.gsf
file,and create an image with the vehicle track and a multibeam height map.
fromauvlib.data_toolsimportstd_data,gsf_datafromauvlib.bathy_mapsimportdraw_mapimportsysgsf_pings=gsf_data.gsf_mbes_ping.parse_folder(sys.argv[1])# parse folder of gsf datambes_pings=gsf_data.convert_pings(gsf_pings)# convert to std_data pingsd=draw_map.BathyMapImage(mbes_pings,500,500)# create a bathymetry height mapd.draw_height_map(mbes_pings)# draw the height mapd.draw_track(mbes_pings)# draw the track of the vehicled.write_image("height_map.png")# save the height map to "height_map.png"
This example show how to drape a bathymetric mesh with sidescan data, and togenerate a visualization similar to the image above. The program allows the userto click on any point in the mesh, and the draping will find all sidescan observationsof that point and plot the corresponding intensity images using thedata_vis.plot_patch_views
function.
fromauvlib.data_toolsimportstd_data,gsf_data,xtf_data,csv_data,utilsfromauvlib.bathy_mapsimportmesh_map,patch_draper,data_visimportsys,os,mathimportnumpyasnpsensor_yaw=5.*math.pi/180.# rotation of sidescan wrt nav framesensor_offset=np.array([2.,-1.5,0.])# translation of sidescan wrt nav framegsf_pings=utils.parse_or_load_gsf(sys.argv[1])# parse_or_load* functions will just parse the first timembes_pings=gsf_data.convert_pings(gsf_pings)# convert to std_data pingsV,F,bounds=mesh_map.mesh_from_pings(mbes_pings,0.5)# generate a bathymetry meshxtf_pings=utils.parse_or_load_xtf(sys.argv[2])# load sidescan pingsnav_entries=utils.parse_or_load_csv(sys.argv[3])# load gps nav entriesxtf_pings=csv_data.convert_matched_entries(xtf_pings,nav_entries)# match sidescan with gpsxtf_pings=xtf_data.correct_sensor_offset(xtf_pings,sensor_offset)# correct for sidescan translationsound_speeds=csv_data.csv_asvp_sound_speed.parse_file(sys.argv[4])# parse sound speed fileviewer=patch_draper.PatchDraper(V,F,xtf_pings,bounds,sound_speeds)# create a draper objectviewer.set_sidescan_yaw(sensor_yaw)# set the rotation of sensor wrt nav frameviewer.set_vehicle_mesh(*patch_draper.get_vehicle_mesh())# add a vehicle model for visualizationviewer.set_patch_callback(lambdapatch:data_vis.plot_patch_views([patch]))# add a plotter callbackviewer.show()# show the visualization and drape
The project directories contains examples and documentation, seepybathy_maps,pydata_tools orpysonar_tracing.
First, initialize the submodules, same as for the previous section. For using auvlib as a library in an external project,check out the example projects.If you just want to use auvlib for reading data, please see the minimaldata project.
For more complete documentation on C++ library usage, seethe overview document.
This work was supported by Stiftelsen för Strategisk Forskning (SSF)through the Swedish Maritime Robotics Centre (SMaRC) (IRC15-0046).Seethe SMARC website for details.
About
Modern C++ and python library for reading and processing sonar data