Skip to content

Commit 45c8a63

Browse files
committed
fix:Fix ubuntu22.04 compilation error
1 parent b2ea8da commit 45c8a63

File tree

18 files changed

+29
-16
lines changed

18 files changed

+29
-16
lines changed

camera_intrinsic/calib_verification/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
cmake_minimum_required(VERSION 3.5)
22
project(CameraCalibration C CXX)
33
set(CMAKE_CXX_FLAGS "-std=c++11 -g -Wall")
4+
set(CMAKE_CXX_STANDARD 14)
45

56
find_package(OpenCV REQUIRED)
67

camera_intrinsic/intrinsic_calib/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
cmake_minimum_required(VERSION 3.5)
22
project(CameraCalibration C CXX)
33
set(CMAKE_CXX_FLAGS "-std=c++11 -g -Wall")
4+
set(CMAKE_CXX_STANDARD 14)
45

56
find_package(OpenCV REQUIRED)
67

camera_intrinsic/intrinsic_calib/src/IntrinsicCalibration.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ bool IntrinsicCalibration::Calibrate(const std::string &img_dir_path,
7878
selected_file_names.push_back(file_names[i]);
7979
cv::imwrite(selected_image_path_+file_names[i],
8080
cv::imread(img_dir_path_+file_names[i]));
81-
cv::TermCriteria criteria(CV_TERMCRIT_EPS | CV_TERMCRIT_ITER,
81+
cv::TermCriteria criteria(cv::TermCriteria::EPS | cv::TermCriteria::EPS,
8282
grid_size_, 0.001);
8383
cv::cornerSubPix(input_image, image_corners, cv::Size(5, 5),
8484
cv::Size(-1, -1), criteria);

imu_heading/auto_calib/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
cmake_minimum_required(VERSION 3.5)
22
project(rec_parser C CXX)
33
set(CMAKE_CXX_FLAGS "-std=c++11 -g -Wall")
4+
set(CMAKE_CXX_STANDARD 14)
5+
46
find_package(PCL REQUIRED)
57
find_package(Boost REQUIRED system)
68

lidar2camera/auto_calib/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ project(lidar2camera)
44
set(CMAKE_BUILD_TYPE "Release")
55
set(CMAKE_CXX_FLAGS "-std=c++11")
66
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall -g")
7+
set(CMAKE_CXX_STANDARD 14)
78

89
find_package(OpenCV REQUIRED)
910
include_directories(${OpenCV_INCLUDE_DIRS})

lidar2camera/auto_calib/src/optimizer.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ float Optimizer::MaskRegistrationLoss(
131131
Eigen::Matrix4d T = curr_optim_extrinsic_;
132132
T *= deltaT;
133133
for (const auto &src_pt : register_cloud->points) {
134-
if (!pcl_isfinite(src_pt.x) || !pcl_isfinite(src_pt.y) ||
135-
!pcl_isfinite(src_pt.z))
134+
if (!std::isfinite(src_pt.x) || !std::isfinite(src_pt.y) ||
135+
!std::isfinite(src_pt.z))
136136
continue;
137137
Eigen::Vector4d vec;
138138
vec << src_pt.x, src_pt.y, src_pt.z, 1;
@@ -192,8 +192,8 @@ void Optimizer::SaveProjectResult(
192192
<< translation(2) << std::endl;
193193
cv::Mat image = distance_img->clone();
194194
for (const auto &src_pt : register_cloud->points) {
195-
if (!pcl_isfinite(src_pt.x) || !pcl_isfinite(src_pt.y) ||
196-
!pcl_isfinite(src_pt.z))
195+
if (!std::isfinite(src_pt.x) || !std::isfinite(src_pt.y) ||
196+
!std::isfinite(src_pt.z))
197197
continue;
198198
Eigen::Vector4d vec;
199199
vec << src_pt.x, src_pt.y, src_pt.z, 1;

lidar2camera/joint_calib/src/camera_calibrator.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void CameraCalibrator::get_result(cv::Mat &camera_matrix, cv::Mat &k,
6363
std::vector<cv::Mat> &tvecsMat) {
6464
double re_error =
6565
cv::calibrateCamera(_boards_pts_3d, _imgs_pts, image_size, camera_matrix,
66-
k, rvecsMat, tvecsMat, CV_CALIB_FIX_PRINCIPAL_POINT);
66+
k, rvecsMat, tvecsMat, cv::CALIB_FIX_PRINCIPAL_POINT);
6767
std::cout << "reprojection is " << re_error << std::endl;
6868

6969
Eigen::Matrix3d camera_intrinsic;

lidar2camera/manual_calib/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
cmake_minimum_required(VERSION 2.8.3)
22
project(lidar2camera)
33
set(CMAKE_CXX_FLAGS "-std=c++11 -g -Wall")
4+
set(CMAKE_CXX_STANDARD 14)
45

56
find_package(Pangolin REQUIRED)
67
include_directories(${Pangolin_INCLUDE_DIRS})

lidar2imu/auto_calib/CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
cmake_minimum_required(VERSION 2.8.3)
22
project(LidarToImu)
33
set(CMAKE_CXX_FLAGS "-std=c++11 -g -Wall")
4+
set(CMAKE_CXX_STANDARD 14)
45
## Get Pangolin
56
find_package(Pangolin 0.4 REQUIRED)
67
include_directories(${Pangolin_INCLUDE_DIRS})
@@ -12,7 +13,7 @@ link_directories(${OpenCV_LIBRARY_DIRS})
1213
include_directories(${OpenCV_INCLUDE_DIRS})
1314

1415
add_subdirectory(ceres)
15-
include_directories(${PROJECT_SOURCE_DIR}/eigen3)
16+
include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/eigen3)
1617
include_directories(${PROJECT_SOURCE_DIR}/ceres/include)
1718

1819
include_directories(${EIGEN_ROOT})

lidar2imu/auto_calib/src/calibration.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,8 @@ void Calibrator::SaveStitching(const Eigen::Matrix4d transform,
253253
}
254254
Eigen::Matrix4d T = lidar_poses_[i] * transform;
255255
for (const auto &src_pt : cloud->points) {
256-
if (!pcl_isfinite(src_pt.x) || !pcl_isfinite(src_pt.y) ||
257-
!pcl_isfinite(src_pt.z))
256+
if (!std::isfinite(src_pt.x) || !std::isfinite(src_pt.y) ||
257+
!std::isfinite(src_pt.z))
258258
continue;
259259
Eigen::Vector3d p(src_pt.x, src_pt.y, src_pt.z);
260260
Eigen::Vector3d p_res;

lidar2imu/auto_calib/src/registration.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ void Registrator::SaveStitching(const std::string &stitching_path) {
126126
lidar_pose *= delta_pose;
127127

128128
for (const auto &src_pt : pcds_[i].points) {
129-
if (!pcl_isfinite(src_pt.x) || !pcl_isfinite(src_pt.y) ||
130-
!pcl_isfinite(src_pt.z))
129+
if (!std::isfinite(src_pt.x) || !std::isfinite(src_pt.y) ||
130+
!std::isfinite(src_pt.z))
131131
continue;
132132
Eigen::Vector3d p(src_pt.x, src_pt.y, src_pt.z);
133133
Eigen::Vector3d p_res;
@@ -383,8 +383,8 @@ size_t Registrator::ComputeVoxelOccupancy(float var[6]) {
383383

384384
#pragma omp parallel for
385385
for (const auto &src_pt : pcds_[i].points) {
386-
if (!pcl_isfinite(src_pt.x) || !pcl_isfinite(src_pt.y) ||
387-
!pcl_isfinite(src_pt.z))
386+
if (!std::isfinite(src_pt.x) || !std::isfinite(src_pt.y) ||
387+
!std::isfinite(src_pt.z))
388388
continue;
389389

390390
Eigen::Vector3d p(src_pt.x, src_pt.y, src_pt.z);

lidar2imu/manual_calib/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
cmake_minimum_required(VERSION 2.8.3)
22
project(LidarToImu)
33
set(CMAKE_CXX_FLAGS "-std=c++11 -g -Wall")
4+
set(CMAKE_CXX_STANDARD 14)
45

56
find_package(Pangolin REQUIRED)
67
include_directories(${Pangolin_INCLUDE_DIRS})

lidar2imu/manual_calib/src/run_lidar2imu.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,8 @@ int ProcessLidarFrame(const std::vector<pcl::PointCloud<pcl::PointXYZI>> &pcds,
313313
T *= calibration_matrix_;
314314

315315
for (const auto &src_pt : pcds[i].points) {
316-
if (!pcl_isfinite(src_pt.x) || !pcl_isfinite(src_pt.y) ||
317-
!pcl_isfinite(src_pt.z))
316+
if (!std::isfinite(src_pt.x) || !std::isfinite(src_pt.y) ||
317+
!std::isfinite(src_pt.z))
318318
continue;
319319
pcl::PointXYZI dst_pt;
320320
Eigen::Vector3d p(src_pt.x, src_pt.y, src_pt.z);

lidar2lidar/auto_calib/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
cmake_minimum_required(VERSION 2.8.3)
22
project(LidarToLidar)
33
set(CMAKE_CXX_FLAGS "-std=c++11 -g -Wall")
4+
set(CMAKE_CXX_STANDARD 14)
5+
46
## Get Pangolin
57
find_package(Pangolin 0.4 REQUIRED)
68
include_directories(${Pangolin_INCLUDE_DIRS})

lidar2lidar/manual_calib/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
cmake_minimum_required(VERSION 2.8.3)
22
project(LidarToLidar)
33
set(CMAKE_CXX_FLAGS "-std=c++11 -g -Wall")
4+
set(CMAKE_CXX_STANDARD 14)
45

56
find_package(Pangolin REQUIRED)
67
include_directories(${Pangolin_INCLUDE_DIRS})

radar2camera/manual_calib/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
cmake_minimum_required(VERSION 2.8.3)
22
project(RadarToCamera)
33
set(CMAKE_CXX_FLAGS "-std=c++11 -g -Wall")
4+
set(CMAKE_CXX_STANDARD 14)
45

56
find_package(Pangolin REQUIRED)
67
include_directories(${Pangolin_INCLUDE_DIRS})

radar2camera/manual_calib/include/birdview.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class BirdView {
3838
}
3939

4040
void mouse_event(int event, int x, int y) {
41-
if (event == CV_EVENT_LBUTTONDOWN) {
41+
if (event == cv::EVENT_LBUTTONDOWN) {
4242
picked_points_.push_back(cv::Point2f(x, y));
4343
std::cout << "picked " << x << ", " << y << std::endl;
4444
cv::circle(image_, cv::Point(x, y), 6, cv::Scalar(0, 0, 255), -1);

radar2lidar/manual_calib/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
cmake_minimum_required(VERSION 2.8.3)
22
project(RadarToLidar)
33
set(CMAKE_CXX_FLAGS "-std=c++11 -g -Wall")
4+
set(CMAKE_CXX_STANDARD 14)
45

56
find_package(Pangolin REQUIRED)
67
include_directories(${Pangolin_INCLUDE_DIRS})

0 commit comments

Comments
 (0)