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
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ set(EXTERNAL_LIBRARIES_DIRECTORY ${REPOSITORY_DIRECTORY}/external)
set(HD_CPU_OPTIMIZATION "AUTO" CACHE STRING "CPU optimization target (AUTO, INTEL, AMD, ARM, GENERIC)")
set_property(CACHE HD_CPU_OPTIMIZATION PROPERTY STRINGS AUTO INTEL AMD ARM GENERIC)

if(APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
add_compile_definitions(USE_EXECUTION_PAR_UNSEQ=0)
else()
add_compile_definitions(USE_EXECUTION_PAR_UNSEQ=1)
endif()

if (MSVC)
add_definitions(-D_HAS_STD_BYTE=0)

Expand Down
2 changes: 1 addition & 1 deletion apps/compare_trajectories/mandeye_compare_trajectories.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#include <Eigen/Eigen>

#include <transformations.h>
#include <Core/transformations.h>

#include <portable-file-dialogs.h>

Expand Down
2 changes: 1 addition & 1 deletion apps/concatenate_multi_livox/concatenate_multi_livox.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "../lidar_odometry_step_1/lidar_odometry_utils.h"
#include "export_laz.h"
#include <Core/export_laz.h>
#include <filesystem>
#include <iostream>

Expand Down
5 changes: 3 additions & 2 deletions apps/console_tools/matrix_mul.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#include <Eigen/Eigen>
#include <fstream>
#include <iostream>
#include <structures.h>
#include <transformations.h>

#include <Core/structures.h>
#include <Core/transformations.h>

int main(int argc, char* argv[])
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
#include <Eigen/Eigen>
#include <fstream>
#include <iostream>
#include <structures.h>
#include <transformations.h>

#include <point_clouds.h>
#include <Core/export_laz.h>
#include <Core/point_clouds.h>
#include <Core/structures.h>
#include <Core/transformations.h>

#include <laszip/laszip_api.h>

#include <export_laz.h>

#include <spdlog/spdlog.h>

bool load_pc(PointCloud& pc, const std::string& input_file_name)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#include <Eigen/Eigen>
#include <fstream>
#include <iostream>
#include <structures.h>
#include <transformations.h>

#include <point_clouds.h>
#include <Core/point_clouds.h>
#include <Core/structures.h>
#include <Core/transformations.h>

inline void split(std::string& str, char delim, std::vector<std::string>& out)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,18 @@

#include "lidar_odometry.h"
#include "lidar_odometry_utils.h"
#include <export_laz.h>
#include <registration_plane_feature.h>

#include <utils.hpp>
#include <Core/export_laz.h>
#include <Core/pfd_wrapper.hpp>
#include <Core/registration_plane_feature.h>
#include <Core/session.h>
#include <Core/utils.hpp>

#include "toml_io.h"
#include <HDMapping/Version.hpp>
#include <chrono>
#include <ctime>
#include <export_laz.h>
#include <mutex>
#include <pfd_wrapper.hpp>
#include <session.h>
#include <spdlog/cfg/env.h>
#include <spdlog/spdlog.h>

Expand Down
3 changes: 2 additions & 1 deletion apps/lidar_odometry_step_1/lidar_odometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#include "tbb/tbb.h"
#include <UTL/profiler.hpp>
#include <mutex>
#include <system_info.hpp>

#include <Core/system_info.hpp>

namespace fs = std::filesystem;

Expand Down
5 changes: 3 additions & 2 deletions apps/lidar_odometry_step_1/lidar_odometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
#include "lidar_odometry_utils.h"
#include "toml_io.h"
#include <HDMapping/Version.hpp>
#include <export_laz.h>
#include <laszip/laszip_api.h>
#include <nlohmann/json.hpp>
#include <session.h>

#include <Core/export_laz.h>
#include <Core/session.h>

// #define SAMPLE_PERIOD (1.0 / 200.0)

Expand Down
11 changes: 5 additions & 6 deletions apps/lidar_odometry_step_1/lidar_odometry_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,18 @@

#include "lidar_odometry.h"
#include "lidar_odometry_utils.h"
#include <export_laz.h>
#include <registration_plane_feature.h>

#include <utils.hpp>
#include <Core/export_laz.h>
#include <Core/pfd_wrapper.hpp>
#include <Core/registration_plane_feature.h>
#include <Core/session.h>
#include <Core/utils.hpp>

#include "toml_io.h"
#include <HDMapping/Version.hpp>
#include <chrono>
#include <ctime>
#include <export_laz.h>
#include <mutex>
#include <pfd_wrapper.hpp>
#include <session.h>
#include <spdlog/cfg/env.h>
#include <spdlog/spdlog.h>

Expand Down
3 changes: 2 additions & 1 deletion apps/lidar_odometry_step_1/lidar_odometry_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
#include "csv.hpp"
#include <algorithm>
#include <filesystem>
#include <hash_utils.h>
#include <regex>
#include <tbb/parallel_for_each.h>
#include <tbb/parallel_invoke.h>

#include <Core/hash_utils.h>

#include <spdlog/spdlog.h>

namespace fs = std::filesystem;
Expand Down
7 changes: 4 additions & 3 deletions apps/lidar_odometry_step_1/lidar_odometry_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
#include <Fusion.h>
#include <common/include/cauchy.h>
#include <laszip/laszip_api.h>
#include <ndt.h>
#include <nlohmann/json.hpp>
#include <structures.h>
#include <transformations.h>

#include <Core/ndt.h>
#include <Core/structures.h>
#include <Core/transformations.h>

#include <python-scripts/constraints/constraint_fixed_parameter_jacobian.h>
#include <python-scripts/constraints/relative_pose_tait_bryan_wc_jacobian.h>
Expand Down
38 changes: 32 additions & 6 deletions apps/lidar_odometry_step_1/lidar_odometry_utils_optimizers.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#include "lidar_odometry_utils.h"
#include <UTL/profiler.hpp>
#include <hash_utils.h>
#include <spdlog/spdlog.h>
#include <spdlog/stopwatch.h>
#include <tbb/combinable.h>
#include <tbb/parallel_for.h>
#include <thread>

#include <export_laz.h>
#include <Core/export_laz.h>
#include <Core/hash_utils.h>

const double DEG_TO_RAD = M_PI / 180.0f;
const double RAD_TO_DEG = 180.0f / M_PI;
Expand Down Expand Up @@ -598,7 +598,13 @@ void optimize_sf(
{
// spdlog::info("start adding lidar observations");
if (multithread)
std::for_each(std::execution::par_unseq, std::begin(points_local), std::end(points_local), hessian_fun);
std::for_each(
#if USE_EXECUTION_PAR_UNSEQ
std::execution::par_unseq,
#endif
std::begin(points_local),
std::end(points_local),
hessian_fun);
else
std::for_each(std::begin(points_local), std::end(points_local), hessian_fun);
// spdlog::info("adding lidar observations finished");
Expand Down Expand Up @@ -915,7 +921,14 @@ void optimize_sf2(
std::vector<Blocks> AtPAndtBlocksToSum(intermediate_points.size());

if (useMultithread)
std::transform(std::execution::par_unseq, std::begin(indexes), std::end(indexes), std::begin(AtPAndtBlocksToSum), hessian_fun);
std::transform(
#if USE_EXECUTION_PAR_UNSEQ
std::execution::par_unseq,
#endif
std::begin(indexes),
std::end(indexes),
std::begin(AtPAndtBlocksToSum),
hessian_fun);
else
std::transform(std::begin(indexes), std::end(indexes), std::begin(AtPAndtBlocksToSum), hessian_fun);

Expand Down Expand Up @@ -1303,7 +1316,14 @@ void optimize_rigid_sf(
std::vector<Blocks> blocks(indexes.size());

if (useMultithread) // ToDo fix for this case
std::transform(std::execution::par_unseq, std::begin(indexes), std::end(indexes), std::begin(blocks), hessian_fun);
std::transform(
#if USE_EXECUTION_PAR_UNSEQ
std::execution::par_unseq,
#endif
std::begin(indexes),
std::end(indexes),
std::begin(blocks),
hessian_fun);
else
std::transform(std::begin(indexes), std::end(indexes), std::begin(blocks), hessian_fun);

Expand Down Expand Up @@ -3306,7 +3326,13 @@ void Consistency(std::vector<WorkerData>& worker_data, const LidarOdometryParams
};

if (multithread)
std::for_each(std::execution::par_unseq, std::begin(points_local), std::end(points_local), hessian_fun);
std::for_each(
#if USE_EXECUTION_PAR_UNSEQ
std::execution::par_unseq,
#endif
std::begin(points_local),
std::end(points_local),
hessian_fun);
else
std::for_each(std::begin(points_local), std::end(points_local), hessian_fun);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,16 @@

#include <Eigen/Eigen>

#include <transformations.h>

#include "pfd_wrapper.hpp"
#include <Core/export_laz.h>
#include <Core/hash_utils.h>
#include <Core/pair_wise_iterative_closest_point.h>
#include <Core/pfd_wrapper.hpp>
#include <Core/transformations.h>

#include "../lidar_odometry_step_1/lidar_odometry_utils.h"

#include <HDMapping/Version.hpp>

#include <pair_wise_iterative_closest_point.h>

#include <export_laz.h>

#include <hash_utils.h>

#include <filesystem>
#include <mutex>

Expand Down Expand Up @@ -1530,7 +1526,13 @@ void calibrate_intrinsics()
std::cout << "start adding lidar observations" << std::endl;
if (multithread)
{
std::for_each(std::execution::par_unseq, std::begin(point_cloud), std::end(point_cloud), hessian_fun);
std::for_each(
#if USE_EXECUTION_PAR_UNSEQ
std::execution::par_unseq,
#endif
std::begin(point_cloud),
std::end(point_cloud),
hessian_fun);
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,27 @@
#include <glm/gtc/matrix_transform.hpp>

#include <spdlog/spdlog.h>
#include <utils.hpp>

#include <Eigen/Eigen>

#include <transformations.h>

#include "pfd_wrapper.hpp"

#include "../lidar_odometry_step_1/lidar_odometry_utils.h"
#include <filesystem>

#include <HDMapping/Version.hpp>

#include <mutex>

#include <pair_wise_iterative_closest_point.h>
#include <Core/pair_wise_iterative_closest_point.h>
#include <Core/pfd_wrapper.hpp>
#include <Core/transformations.h>
#include <Core/utils.hpp>

#ifdef _WIN32
#include "resource.h"
#include <shellapi.h> // <-- Required for ShellExecuteA
#include <windows.h>
#endif

#include <spdlog/spdlog.h>

///////////////////////////////////////////////////////////////////////////////////

std::string winTitle = std::string("MR calibration ") + HDMAPPING_VERSION_STRING;
Expand Down
15 changes: 6 additions & 9 deletions apps/mandeye_raw_data_viewer/mandeye_raw_data_viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@
#include <glm/gtc/matrix_transform.hpp>

#include <spdlog/spdlog.h>
#include <utils.hpp>

#include <Eigen/Eigen>

#include <transformations.h>
#include <Core/export_laz.h>
#include <Core/hash_utils.h>
#include <Core/pfd_wrapper.hpp>
#include <Core/transformations.h>
#include <Core/utils.hpp>

#include "pfd_wrapper.hpp"
#include <Eigen/Eigen>

#include "../lidar_odometry_step_1/lidar_odometry.h"
#include "../lidar_odometry_step_1/lidar_odometry_utils.h"
Expand All @@ -30,12 +31,8 @@
#include "tbb/tbb.h"
#include <mutex>

#include <export_laz.h>

#include <opencv2/opencv.hpp>

#include <hash_utils.h>

#ifdef _WIN32
#include "resource.h"
#include <shellapi.h> // <-- Required for ShellExecuteA
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
#include <glm/gtc/matrix_transform.hpp>

#include <spdlog/spdlog.h>
#include <utils.hpp>

#include <Eigen/Eigen>

#include <transformations.h>
#include <Core/GL_assert.h>
#include <Core/pfd_wrapper.hpp>
#include <Core/transformations.h>
#include <Core/utils.hpp>

#include "pfd_wrapper.hpp"
#include <Eigen/Eigen>

#include "../lidar_odometry_step_1/lidar_odometry_utils.h"
#include <filesystem>
Expand All @@ -34,7 +34,6 @@
#include <shellapi.h> // <-- Required for ShellExecuteA
#include <windows.h>
#endif
#include <GL_assert.h>

///////////////////////////////////////////////////////////////////////////////////

Expand Down
Loading
Loading