Skip to content

Commit f8337dd

Browse files
committed
Use Eigen/Core in rift.hpp
* Use `Eigen::Map` in `rift.hpp` * Add missing `pcl/point_types.h` includes in tests where `rift.h` is used Signed-off-by: Ramir Sultanov <sumir0@proton.me>
1 parent 1b6ad03 commit f8337dd

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

features/include/pcl/features/impl/rift.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
#define PCL_FEATURES_IMPL_RIFT_H_
4343

4444
#include <pcl/features/rift.h>
45-
#include <pcl/point_types.h> // for pcl::Vector3fMapConst
45+
46+
#include <Eigen/Core> // for Eigen::Map<const Eigen::Vector3f>
4647

4748
//////////////////////////////////////////////////////////////////////////////////////////////
4849
template <typename PointInT, typename GradientT, typename PointOutT> void
@@ -62,14 +63,14 @@ pcl::RIFTEstimation<PointInT, GradientT, PointOutT>::computeRIFT (
6263
int nr_gradient_bins = static_cast<int> (rift_descriptor.cols ());
6364

6465
// Get the center point
65-
pcl::Vector3fMapConst p0 = cloud[p_idx].getVector3fMap ();
66+
const Eigen::Map<const Eigen::Vector3f> p0 = cloud[p_idx].getVector3fMap ();
6667

6768
// Compute the RIFT descriptor
6869
rift_descriptor.setZero ();
6970
for (std::size_t idx = 0; idx < indices.size (); ++idx)
7071
{
7172
// Compute the gradient magnitude and orientation (relative to the center point)
72-
pcl::Vector3fMapConst point = cloud[indices[idx]].getVector3fMap ();
73+
const Eigen::Map<const Eigen::Vector3f> point = cloud[indices[idx]].getVector3fMap ();
7374
Eigen::Map<const Eigen::Vector3f> gradient_vector (& (gradient[indices[idx]].gradient[0]));
7475

7576
float gradient_magnitude = gradient_vector.norm ();

test/features/test_ptr.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939

4040
#include <pcl/test/gtest.h>
4141
#include <pcl/point_cloud.h>
42+
#include <pcl/point_types.h>
4243
#include <pcl/features/vfh.h>
4344
#include <pcl/features/usc.h>
4445
#include <pcl/features/statistical_multiscale_interest_region_extraction.h>

test/features/test_rift_estimation.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939

4040
#include <pcl/test/gtest.h>
4141
#include <pcl/point_cloud.h>
42+
#include <pcl/point_types.h>
4243
#include <pcl/features/rift.h>
4344
#include <pcl/search/kdtree.h> // for KdTree
4445

0 commit comments

Comments
 (0)