-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from nilsbore/update_libigl2
Update libigl to newer version and fix cmake install targets
- Loading branch information
Showing
22 changed files
with
126 additions
and
251 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
/* Copyright 2018 Nils Bore ([email protected]) | ||
* | ||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | ||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
#include <cereal/archives/json.hpp> | ||
|
||
#include <cxxopts.hpp> | ||
|
@@ -9,15 +20,16 @@ | |
|
||
#include <bathy_maps/draw_map.h> | ||
#include <bathy_maps/mesh_map.h> | ||
|
||
#include <sparse_gp/sparse_gp.h> | ||
#include <sparse_gp/rbf_kernel.h> | ||
#include <sparse_gp/gaussian_noise.h> | ||
#include <bathy_maps/patch_draper.h> | ||
|
||
#include <opencv2/highgui/highgui.hpp> | ||
#include <chrono> | ||
|
||
using namespace std; | ||
using namespace std_data; | ||
using namespace csv_data; | ||
using namespace gsf_data; | ||
using namespace xtf_data; | ||
|
||
// we should probably put this in data_tools eventually, it's very convenient | ||
template <typename T> | ||
|
@@ -78,18 +90,21 @@ int main(int argc, char** argv) | |
{ | ||
string mbes_folder_str; | ||
string sss_folder_str; | ||
string entries_file_str; | ||
string file_str; | ||
double lsq = 7; //10.; | ||
double sigma = 1.; //5.; | ||
double s0 = 0.03; //.2; | ||
double pose_sigma = 0.2; //0.4; | ||
double sensor_yaw = 5.*M_PI/180.; | ||
string dataset_name = "ping_mesh"; | ||
|
||
cxxopts::Options options("MyProgram", "One line description of MyProgram"); | ||
options.add_options() | ||
("help", "Print help") | ||
("swaths", "Input gsf mb swaths folder pre deployment", cxxopts::value(mbes_folder_str)) | ||
("sss", "Input gsf mb swaths folder pre deployment", cxxopts::value(sss_folder_str)) | ||
("nav", "Nav entries file", cxxopts::value(entries_file_str)) | ||
("file", "Output file", cxxopts::value(file_str)) | ||
("lsq", "RBF length scale", cxxopts::value(lsq)) | ||
("sigma", "RBF scale", cxxopts::value(sigma)) | ||
|
@@ -113,32 +128,50 @@ int main(int argc, char** argv) | |
|
||
boost::filesystem::path mbes_folder(mbes_folder_str); | ||
boost::filesystem::path sss_folder(sss_folder_str); | ||
boost::filesystem::path entries_file(entries_file_str); | ||
boost::filesystem::path path(file_str); | ||
|
||
cout << "Input mbes folder : " << mbes_folder << endl; | ||
cout << "Input sss folder : " << sss_folder << endl; | ||
cout << "Output file : " << path << endl; | ||
|
||
bathy_map_mesh mesh; | ||
csv_nav_entry::EntriesT entries = load_or_parse_entries(entries_file); | ||
for (int counter = 0; counter < entries.size(); counter += 10000) { | ||
cout << "Time stamp: " << entries[counter].time_string_ << endl; | ||
} | ||
|
||
Eigen::MatrixXd V; | ||
Eigen::MatrixXi F; | ||
bathy_map_mesh::BoundsT bounds; | ||
mesh_map::BoundsT bounds; | ||
|
||
// we need to separate the reading of mbes and side scan pings since they consume a lot of memory | ||
{ | ||
gsf_mbes_ping::PingsT pings_mbes = load_or_parse_pings<gsf_mbes_ping>(mbes_folder, dataset_name + "_mbes"); | ||
mbes_ping::PingsT pings = convert_pings(pings_mbes); | ||
|
||
tie(V, F, bounds) = mesh.mesh_from_pings(pings); | ||
tie(V, F, bounds) = mesh_map::mesh_from_pings(pings); | ||
} | ||
//mesh.display_mesh(V, F); | ||
mesh_map::show_mesh(V, F); | ||
cout << "SSS" << endl; | ||
|
||
{ | ||
xtf_sss_ping::PingsT pings_sss = load_or_parse_pings<xtf_sss_ping>(sss_folder, dataset_name + "_sss"); | ||
for (int counter = 0; counter < pings_sss.size(); counter += 100) { | ||
cout << "Time stamp: " << pings_sss[counter].time_string_ << endl; | ||
} | ||
pings_sss = convert_matched_entries(pings_sss, entries); | ||
pings_sss = correct_sensor_offset(pings_sss, Eigen::Vector3d(2., -1.5, 0.)); | ||
cout << "Number of entries in file " << entries_file << ": " << entries.size() << endl; | ||
/*for (xtf_sss_ping& ping : pings_sss) { | ||
ping.pitch_ = 0.2; | ||
//cereal::JSONOutputArchive ar(std::cout); | ||
//ar(ping); | ||
}*/ | ||
cv::Mat waterfall_img = make_waterfall_image(pings_sss); | ||
cv::imshow("My image", waterfall_img); | ||
cv::waitKey(); | ||
mesh.overlay_sss(V, F, bounds, pings_sss); | ||
csv_asvp_sound_speed::EntriesT sound_speeds; | ||
drape_patches(V, F, bounds, pings_sss, sound_speeds, sensor_yaw); | ||
} | ||
|
||
return 0; | ||
|
Oops, something went wrong.