Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions core/src/point_clouds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ bool PointClouds::load(
std::getline(infile, line);
std::istringstream iss(line);

int num_scans;
int num_scans = 0;
iss >> num_scans;

std::cout << "number of scans: " << num_scans << std::endl;
Expand Down Expand Up @@ -133,13 +133,13 @@ bool PointClouds::update_poses_from_RESSO(const std::string& folder_with_point_c
if (!infile.good())
{
std::cout << "problem with file: '" << poses_file_name << "' (!infile.good())" << std::endl;
// return false;
return false;
}
std::string line;
std::getline(infile, line);
std::istringstream iss(line);

int num_scans;
int num_scans = 0;
iss >> num_scans;

std::cout << "number of scans: " << num_scans << std::endl;
Expand Down Expand Up @@ -226,13 +226,13 @@ bool PointClouds::update_poses_from_RESSO_inverse(const std::string& folder_with
if (!infile.good())
{
std::cout << "problem with file: '" << poses_file_name << "' (!infile.good())" << std::endl;
// return false;
return false;
}
std::string line;
std::getline(infile, line);
std::istringstream iss(line);

int num_scans;
int num_scans = 0;
iss >> num_scans;

std::cout << "number of scans: " << num_scans << std::endl;
Expand Down Expand Up @@ -330,7 +330,7 @@ bool PointClouds::update_initial_poses_from_RESSO(const std::string& folder_with
std::getline(infile, line);
std::istringstream iss(line);

int num_scans;
int num_scans = 0;
iss >> num_scans;

std::cout << "number of scans: " << num_scans << std::endl;
Expand Down
20 changes: 14 additions & 6 deletions core/src/session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,17 +219,25 @@ bool Session::load(const std::string& file_name, bool is_decimate, double bucket
std::cout << "updated: " << point_clouds_container.point_clouds.size() << " point_clouds" << std::endl;
}

if (!point_clouds_container.update_poses_from_RESSO(working_directory.c_str(), poses_file_name.c_str()))
// fallback
std::string poses_source_file_name = poses_file_name;
std::error_code ec;
if (!fs::exists(poses_file_name, ec) || fs::file_size(poses_file_name, ec) == 0)
{
std::cout << "poses file '" << poses_file_name << "' is missing or empty, using initial poses from '"
<< initial_poses_file_name << "'" << std::endl;
poses_source_file_name = initial_poses_file_name;
}

if (!point_clouds_container.update_poses_from_RESSO(working_directory.c_str(), poses_source_file_name.c_str()))
{
std::cout << __FILE__ << " " << __LINE__ << std::endl;
std::cout << "check input files" << std::endl;
return false;
}
else
{
std::cout << "updated: " << point_clouds_container.point_clouds.size() << " point_clouds" << std::endl;
point_clouds_container.poses_file_name = poses_file_name;
}

std::cout << "updated: " << point_clouds_container.point_clouds.size() << " point_clouds" << std::endl;
point_clouds_container.poses_file_name = poses_file_name;
}

pose_graph_loop_closure.edges = loop_closure_edges;
Expand Down
Loading