Using octomap::OcTree as a type in a vector
Hi,
I'm trying to implement a 3D SLAM algorithm based on octomap, however, my particle class which contains an octree as the map, cannot be resized or pushed onto a vector of particles. My class construct for the particles is:
struct SLAMParticle
{
SLAMParticle():m_octree(0.05){
}
octomap::OcTree m_octree;
double weight;
tf::Pose pose;
};
typedef std::vector<SLAMParticle> SLAMParticles;
I get an error when building that seems to be due to the lack of a default constructor, for movement and copying. For example there is no definition of an &operator= for octree, to transfer data between two octrees.
The error is:
/opt/ros/hydro/include/octomap/OcTreeBaseImpl.h:468:37: error: ‘octomap::OcTreeBaseImpl<NODE, INTERFACE>& octomap::OcTreeBaseImpl<NODE, INTERFACE>::operator=(const octomap::OcTreeBaseImpl<NODE, INTERFACE>&) [with NODE = octomap::OcTreeNode, INTERFACE = octomap::AbstractOccupancyOcTree]’ is private
/opt/ros/hydro/include/octomap/OccupancyOcTreeBase.h:69:9: error: within this context
and seems to relate to a point in the code where the SLAMParticles type is resized.
So my question is, is this a problem with using octomap::OcTree and that it is not designed to work within a vector structure or is it due to some other issue. If it is some other issue, can I just create a default constructor or &operator= for OcTree and its parent OccupancyOcTreeBase for use in vectors and general assignments?