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
2 changes: 1 addition & 1 deletion .github/workflows/cmake-linux-deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_WITH_BUNDLED_FREEGLUT=0 -DBUILD_WITH_BUNDLED_EIGEN=0 -DBUILD_WITH_BUNDLED_LIBLASZIP=0
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_WITH_BUNDLED_FREEGLUT=0 -DBUILD_WITH_BUNDLED_EIGEN=0 -DBUILD_WITH_BUNDLED_LIBLASZIP=0 -DBUILD_TESTING=ON

- name: Build
# Build your program with the given configuration
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cmake-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_TESTING=ON

- name: Build
# Build your program with the given configuration
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,18 @@ jobs:
cmake -B ${{github.workspace}}/build \
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-DFREEGLUT_COCOA=ON \
-DHD_CPU_OPTIMIZATION=AUTO
-DHD_CPU_OPTIMIZATION=AUTO \
-DBUILD_TESTING=ON

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j$(sysctl -n hw.ncpu)

- name: Test
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure

- name: List built binaries
run: |
echo "Built binaries:"
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,17 @@ jobs:
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_TESTING=ON

- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target package

- name: Test
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure

- name: Deploy mandeye package
shell: cmd
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ option(BUILD_TESTING "Build HDMapping unit tests" OFF)
if(BUILD_TESTING)
enable_testing()
add_subdirectory(shared/tests)
add_subdirectory(apps/lidar_odometry_step_1/tests)
endif()

set(CORE_LIBRARIES core)
Expand Down
4 changes: 2 additions & 2 deletions apps/lidar_odometry_step_1/lidar_odometry_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -670,12 +670,12 @@ std::unordered_map<std::string, Eigen::Affine3d> MLvxCalib::GetCalibrationFromFi

std::transform(order.begin(), order.end(), order.begin(), ::toupper);
if (order == "COLUMN")
value = value.transpose();
value.transposeInPlace(); // NOTE: `value = value.transpose()` aliases and corrupts the matrix; must transpose in place.
}

bool inverted = JsonGetBool(calibrationEntry.value(), "inverted", false);
if (inverted)
value = value.inverse();
value = value.inverse().eval(); // `value = value.inverse()` aliases: Eigen needs the eval() to use a temporary here.

Eigen::IOFormat HeavyFmt(Eigen::FullPrecision, 0, ", ", ";\n", "[", "]", "[", "]");

Expand Down
49 changes: 49 additions & 0 deletions apps/lidar_odometry_step_1/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
cmake_minimum_required(VERSION 4.0.0)

project(lidar_odometry_step_1_tests)

# Unit tests for the MLvxCalib namespace (lidar_odometry_utils.h/.cpp), which
# parses Livox extrinsic/IMU calibration files (.json/.mjc and .sn). Compiles
# the real lidar_odometry_utils.cpp (no GUI code path, WITH_GUI left
# undefined) instead of the whole lidar_odometry_step_1 app, so the include
# dirs/link libraries below are the subset that TU actually needs: laszip and
# TBB because load_point_cloud()/decimate() (compiled into the same TU) use
# them even though the tests never call those functions, core_no_gui for
# Core/ndt.h & Core/hash_utils.h symbols, and vqf/Fusion/unordered_dense/
# spdlog/UTL for the rest of lidar_odometry_utils.h's includes. Uses doctest,
# same as shared/tests.
add_executable(lidar_odometry_step_1_tests
test_mlvx_calib.cpp
../lidar_odometry_utils.cpp
)

target_include_directories(lidar_odometry_step_1_tests PRIVATE
${THIRDPARTY_DIRECTORY}/doctest
${REPOSITORY_DIRECTORY}/core/include
${THIRDPARTY_DIRECTORY}
${EIGEN3_INCLUDE_DIR}
${THIRDPARTY_DIRECTORY}/json/include
${LASZIP_INCLUDE_DIR}/LASzip/include
${THIRDPARTY_DIRECTORY}/observation_equations/codes
${THIRDPARTY_DIRECTORY}/vqf/vqf/cpp
${THIRDPARTY_DIRECTORY}/Fusion/Fusion
)

target_link_libraries(lidar_odometry_step_1_tests PRIVATE
core_no_gui
vqf
Fusion
unordered_dense::unordered_dense
spdlog::spdlog
UTL::include
${PLATFORM_LASZIP_LIB}
${PLATFORM_MISCELLANEOUS_LIBS}
)

if (MSVC)
target_compile_definitions(lidar_odometry_step_1_tests PRIVATE _USE_MATH_DEFINES)
target_compile_options(lidar_odometry_step_1_tests PRIVATE /bigobj)
endif()

include(CTest)
add_test(NAME lidar_odometry_step_1_tests COMMAND lidar_odometry_step_1_tests)
Loading
Loading