[ros-users] POINT_CLOUD_REGISTER_POINT_STRUCT and using templated user defined points

Radu Bogdan Rusu rusu at willowgarage.com
Sun Feb 13 19:07:47 UTC 2011


Kadir,

There are a few point types that contain arrays. Look at pcl/point_types.h for an example.

You're right in the sense that this has to be done at compile time and not at runtime.

Cheers,
Radu.
--
http://pointclouds.org

On 02/13/2011 10:52 AM, kadir wrote:
>
> Radu,
>
> Thank you for the links. I partially solved the problem and skipped the part
> regarding the type-definition for the moment. What I did is as follows:
>
> template<int how_many>
>          struct FeaturePoint{
>          float a;
>          float b;
>          float c;
>          float d[how_many]
> };
>
> #define HOW_MANY an_int_value
> POINT_CLOUD_REGISTER_POINT_STRUCT(
>          pcl::FeaturePoint<HOW_MANY>,
>          (float,   a, a)
>          (float,   b, b)
>          (float,   c, c)
>          (float[HOW_MANY],d, d));
>
> But of course, this is not sth that I want at the end. Since I cannot change
> values of macros or const declarations at run time, I cannot add different
> sized  "FeaturePoint"s to the PointCloud2 structure. I have to define each
> FeaturePoint having different sized "d" member and register them one by one
> to achieve this purpose.
>
> Later,
>
> -Kadir-
>
>



More information about the ros-users mailing list