Skip to content

Commit 3dc7b01

Browse files
committed
fix noise bound & print statement for rot err
1 parent eaf7c6c commit 3dc7b01

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

examples/teaser_cpp_fpfh/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ set (CMAKE_CXX_STANDARD 14)
66
find_package(Eigen3 REQUIRED)
77
find_package(teaserpp REQUIRED)
88
find_package(PCL 1.9 REQUIRED COMPONENTS common features kdtree)
9+
find_package(OpenMP)
910

1011
# Change this line to include your own executable file
1112
add_executable(teaser_cpp_fpfh teaser_cpp_fpfh.cc)
1213

1314
# Link to teaserpp & Eigen3
1415
target_link_libraries(teaser_cpp_fpfh Eigen3::Eigen teaserpp::teaser_registration teaserpp::teaser_features
15-
teaserpp::teaser_io ${PCL_LIBRARIES})
16+
teaserpp::teaser_io ${PCL_LIBRARIES} OpenMP::OpenMP_CXX)
1617

1718
# Copy the data files to build directory
1819
file(COPY ../example_data/

examples/teaser_cpp_fpfh/teaser_cpp_fpfh.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <teaser/matcher.h>
1111

1212
// Macro constants for generating noise and outliers
13-
#define NOISE_BOUND 0.05
13+
#define NOISE_BOUND 0.001
1414
#define N_OUTLIERS 1700
1515
#define OUTLIER_TRANSLATION_LB 5
1616
#define OUTLIER_TRANSLATION_UB 10
@@ -22,8 +22,7 @@ inline double getAngularError(Eigen::Matrix3d R_exp, Eigen::Matrix3d R_est) {
2222
void addNoiseAndOutliers(Eigen::Matrix<double, 3, Eigen::Dynamic>& tgt) {
2323
// Add uniform noise
2424
Eigen::Matrix<double, 3, Eigen::Dynamic> noise =
25-
Eigen::Matrix<double, 3, Eigen::Dynamic>::Random(3, tgt.cols()) * NOISE_BOUND;
26-
NOISE_BOUND / 2;
25+
Eigen::Matrix<double, 3, Eigen::Dynamic>::Random(3, tgt.cols()) * NOISE_BOUND / 2;
2726
tgt = tgt + noise;
2827

2928
// Add outliers
@@ -120,7 +119,7 @@ int main() {
120119
std::cout << T.topLeftCorner(3, 3) << std::endl;
121120
std::cout << "Estimated rotation: " << std::endl;
122121
std::cout << solution.rotation << std::endl;
123-
std::cout << "Error (deg): " << getAngularError(T.topLeftCorner(3, 3), solution.rotation)
122+
std::cout << "Error (rad): " << getAngularError(T.topLeftCorner(3, 3), solution.rotation)
124123
<< std::endl;
125124
std::cout << std::endl;
126125
std::cout << "Expected translation: " << std::endl;

examples/teaser_cpp_ply/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ set(CMAKE_CXX_STANDARD 14)
55

66
find_package(Eigen3 REQUIRED)
77
find_package(teaserpp REQUIRED)
8+
find_package(OpenMP)
89

910
# Change this line to include your own executable file
1011
add_executable(teaser_cpp_ply teaser_cpp_ply.cc)
1112

1213
# Link to teaserpp & Eigen3
13-
target_link_libraries(teaser_cpp_ply Eigen3::Eigen teaserpp::teaser_registration teaserpp::teaser_io)
14+
target_link_libraries(teaser_cpp_ply Eigen3::Eigen teaserpp::teaser_registration teaserpp::teaser_io OpenMP::OpenMP_CXX)
1415

1516
# Copy the data files to build directory
1617
file(COPY ../example_data/

examples/teaser_cpp_ply/teaser_cpp_ply.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ inline double getAngularError(Eigen::Matrix3d R_exp, Eigen::Matrix3d R_est) {
2121
void addNoiseAndOutliers(Eigen::Matrix<double, 3, Eigen::Dynamic>& tgt) {
2222
// Add uniform noise
2323
Eigen::Matrix<double, 3, Eigen::Dynamic> noise =
24-
Eigen::Matrix<double, 3, Eigen::Dynamic>::Random(3, tgt.cols()) * NOISE_BOUND;
25-
NOISE_BOUND / 2;
24+
Eigen::Matrix<double, 3, Eigen::Dynamic>::Random(3, tgt.cols()) * NOISE_BOUND / 2;
2625
tgt = tgt + noise;
2726

2827
// Add outliers
@@ -103,7 +102,7 @@ int main() {
103102
std::cout << T.topLeftCorner(3, 3) << std::endl;
104103
std::cout << "Estimated rotation: " << std::endl;
105104
std::cout << solution.rotation << std::endl;
106-
std::cout << "Error (deg): " << getAngularError(T.topLeftCorner(3, 3), solution.rotation)
105+
std::cout << "Error (rad): " << getAngularError(T.topLeftCorner(3, 3), solution.rotation)
107106
<< std::endl;
108107
std::cout << std::endl;
109108
std::cout << "Expected translation: " << std::endl;

0 commit comments

Comments
 (0)