-2

I have just started to work with the Point Cloud Library (PCL). I include it,

#include <pcl/point_cloud.h>

and define three points,

pcl::PointXY pA, pB, pC;
pA.x = 1;
pA.y = 2;
pB = pA;

Why isn't the +operator overloaded? If I try

pC = pA + pB;

I get a compilation error. It seems like such a basic operation, and so I took it for granted that all basic operations would be defined, or have I missed something?

I found a filed called "point_operators.h" in an older version of PCL (1.6). This file defines the basic operations I want. However, in my newer version (1.9), this file is empty. How come?

Thank you!

A Hansson
  • 77
  • 2
  • 9

2 Answers2

1

As for mathematical operations between points, see this SO question.

IMHO, the point types in pcl are not used to represent vectors but for physical points in 3D world. It does not make much sense (at least to me) to add two physical points together. What are you expecting when you add a point sampled from a desk to a point sampled from your TV?

Though combinations of points do exist, I guess the backgrounds are not the same.

Jing Zhao
  • 2,420
  • 18
  • 21
0

As I understand, you are trying to merge point clouds. I recommend following the tutorial in this Link

Muzo583
  • 31
  • 6