looks like I should use both custom spacetraits and custom point. My custom SpaceTraits are as follows:
template <>
struct PointTraits<pcl::PointXYZI> {
using PointType = pcl::PointXYZI;
using ScalarType = float;
// Spatial dimension. Set to pico_tree::kDynamicSize when the dimension is
// only known at run-time.
static std::size_t constexpr Dim = 3;
// Returns a pointer to the coordinates of the input point.
inline static float const* data(pcl::PointXYZI const& point) { return point.data; }
// Returns the number of coordinates or spatial dimension of each point.
inline static constexpr std::size_t size(pcl::PointXYZI const&) { return Dim; }
};
// Provides an interface for an std::deque<std::array>.
template <typename Scalar_, std::size_t Dim_>
struct SpaceTraits<std::deque<pcl::PointXYZI>> {
using SpaceType = std::deque<pcl::PointXYZI>;
using PointType = pcl::PointXYZI;
using ScalarType = Scalar_;
// Spatial dimension. Set to pico_tree::kDynamicSize when the dimension is
// only known at run-time.
static std::size_t constexpr Dim = Dim_;
// Returns a point from the input space at the specified index.
template <typename Index_>
inline static PointType const& PointAt(
SpaceType const& space, Index_ const index) {
return space[static_cast<std::size_t>(index)];
}
// Returns number of points contained by the space.
inline static std::size_t size(SpaceType const& space) {
return space.size();
}
// Returns the number of coordinates or spatial dimension of each point.
inline static constexpr std::size_t sdim(SpaceType const&) { return Dim; }
};
error: template parameters not deducible in partial specialization:
struct SpaceTraits<std::deque<pcl::PointXYZI>>