ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
I found the solution: I was declaring my point cloud as
namespace velodyne {
struct PointType : pcl::PointXYZRGB { ... };
struct PointCloud : pcl::PointCloud<PointType> { ... };
}
but if I use a typedef instead then my compilation error disappears:
namespace velodyne {
struct PointType : pcl::PointXYZRGB { ... };
typedef PointCloud<PointType> PointCloud;
}
2 | No.2 Revision |
I found the solution: I was declaring my point cloud as
namespace velodyne {
struct PointType : pcl::PointXYZRGB { ... };
struct PointCloud : pcl::PointCloud<PointType> { ... };
}
but if I use a typedef instead then my compilation error disappears:
namespace velodyne {
struct PointType : pcl::PointXYZRGB { ... };
typedef PointCloud<PointType> PointCloud;
}
EDIT: Actually, I am now declaring my point type following PCL's model: it does not inherit from pcl::PointXYZRGB but rather copies the body of pcl::PointXYZRGB. In the end it looks as follows:
namespace velodyne
{
struct EIGEN_ALIGN16 _PointType
{
PCL_ADD_POINT4D;
PCL_ADD_RGB;
...
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
};
struct EIGEN_ALIGN16 PointType : public _PointType
{
inline PointType () { ... }
}
} // namespace velodyne
POINT_CLOUD_REGISTER_POINT_STRUCT (velodyne::_PointType,
(float, x, x)
(float, y, y)
(float, z, z)
(uint32_t, rgb, rgb)
...
)
POINT_CLOUD_REGISTER_POINT_WRAPPER(velodyne::PointType, velodyne::_PointType)
namespace velodyne {
typedef pcl::PointCloud<PointType> PointCloud;
typedef boost::shared_ptr<PointCloud> PointCloudPtr;
typedef boost::shared_ptr<PointCloud const> PointCloudConstPtr;
} // namespace velodyne