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
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "lidar_odometry_utils.h"

#include <Core/export_laz.h>
#include <Core/hash_utils.h>
#include <Core/pfd_wrapper.hpp>
#include <Core/registration_plane_feature.h>
#include <Core/session.h>
Expand Down Expand Up @@ -272,20 +273,6 @@ std::string formatCompletionTime(double remainingSeconds)
return std::string(timeStr);
}

int get_index_3d(const set<int>& s, int k)
{
int index = 0;
for (auto u : s)
{
if (u == k)
{
return index;
}
index++;
}
return -1;
}

void find_best_stretch(
std::vector<Point3Di> points, std::vector<double> timestamps, std::vector<Eigen::Affine3d> poses, std::string fn1, std::string fn2)
{
Expand Down Expand Up @@ -317,7 +304,7 @@ void find_best_stretch(
std::vector<Point3Di> points_reindexed = points;
for (size_t i = 0; i < points_reindexed.size(); i++)
{
points_reindexed[i].index_pose = get_index_3d(indexes, points[i].index_pose);
points_reindexed[i].index_pose = get_index_in_set(indexes, points[i].index_pose);
}
///
std::vector<Eigen::Affine3d> best_trajectory = trajectory;
Expand Down
17 changes: 2 additions & 15 deletions apps/lidar_odometry_step_1/lidar_odometry_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "lidar_odometry_utils.h"

#include <Core/export_laz.h>
#include <Core/hash_utils.h>
#include <Core/pfd_wrapper.hpp>
#include <Core/registration_plane_feature.h>
#include <Core/session.h>
Expand Down Expand Up @@ -303,20 +304,6 @@ std::vector<std::vector<Point3Di>> get_batches_of_points(std::string laz_file, i
}
#endif

int get_index_3d(const set<int>& s, int k)
{
int index = 0;
for (auto u : s)
{
if (u == k)
{
return index;
}
index++;
}
return -1;
}

void find_best_stretch(
std::vector<Point3Di> points, std::vector<double> timestamps, std::vector<Eigen::Affine3d> poses, std::string fn1, std::string fn2)
{
Expand Down Expand Up @@ -348,7 +335,7 @@ void find_best_stretch(
std::vector<Point3Di> points_reindexed = points;
for (size_t i = 0; i < points_reindexed.size(); i++)
{
points_reindexed[i].index_pose = get_index_3d(indexes, points[i].index_pose);
points_reindexed[i].index_pose = get_index_in_set(indexes, points[i].index_pose);
}
///
std::vector<Eigen::Affine3d> best_trajectory = trajectory;
Expand Down
4 changes: 4 additions & 0 deletions core/include/Core/hash_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@

#include <Eigen/Eigen>

#include <set>

uint64_t get_index_2d(const int16_t x, const int16_t y);
uint64_t get_rgd_index_2d(const Eigen::Vector3d& p, const Eigen::Vector2d& b);

uint64_t get_index_3d(const int16_t x, const int16_t y, const int16_t z);
uint64_t get_rgd_index_3d(const Eigen::Vector3d& p, const Eigen::Vector3d& b);

int32_t get_index_in_set(const std::set<int32_t>& set, const int32_t query);
20 changes: 11 additions & 9 deletions core/include/Core/icp.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,22 @@ class ICP
uint64_t index_begin_inclusive;
uint64_t index_end_exclusive;
};

std::vector<Job> get_jobs(uint64_t size, int num_threads = 8);

ICP()
: search_radius(0.1)
, number_of_threads(std::thread::hardware_concurrency())
, number_of_iterations(6)
, is_adaptive_robust_kernel(false)
, is_ballanced_horizontal_vs_vertical(true)
, barron_c(1.0)
{
search_radius = 0.1;
number_of_threads = std::thread::hardware_concurrency();
number_of_iterations = 6;
is_adaptive_robust_kernel = false;
is_ballanced_horizontal_vs_vertical = true;
barron_c = 1.0;
};
}

~ICP()
{
;
};
}

bool optimize_source_to_target_wc(PointClouds& point_clouds_container, bool fix_first_node);
bool compute_uncertainty(PointClouds& point_clouds_container);
Expand Down Expand Up @@ -76,6 +77,7 @@ class ICP
compute_covariance_matrices_point_to_point_source_to_target_source_to_target_lie_algebra_right_jacobian(
PointClouds& point_clouds_container);

// TODO(mwlasiuk) : private
float search_radius;
int number_of_threads;
int number_of_iterations;
Expand Down
Loading
Loading