OctoMap / octomap

An Efficient Probabilistic 3D Mapping Framework Based on Octrees. Contains the main OctoMap library, the viewer octovis, and dynamicEDT3D.
http://octomap.github.io
1.97k stars 660 forks source link

ERROR: Could not create octree of type user-defined OcTree, not in store in classIDMapping #222

Closed lkj1114889770 closed 6 years ago

lkj1114889770 commented 6 years ago

I want to realized a custom Octree, followed the example of ColorOctree and OcTreeStamped, I build my own OcTree, and get the .bt file. but when i load the .bt file wiith octovis. I got the error: ERROR: Could not create octree of type user-defined OcTree, not in store in classIDMapping

I have already includes the following codes, but it seams not works.

` class StaticMemberInitializer{

   public:
     StaticMemberInitializer() {
       SemanticsOcTree* tree = new SemanticsOcTree(0.1);
       tree->clearKeyRays();
       AbstractOcTree::registerTreeType(tree);
     }
     void ensureLinking() {};
};
static StaticMemberInitializer semanticsOcTreeMemberInit;

};`

How can I load a such a OcTree file? Thanks.

lkj1114889770 commented 6 years ago

I see. There is two way to solve such a problem. One is that you have you build you custom octree file with octovis. Another is more simple, if the inner data type of the tree is the same as ColorOctree, just do return "ColorOcTree" in the function of getType.

chengm0-0 commented 3 years ago

Hi, when I use the fcl library to do the path planning, I want to convert the coloroctree to octree, but I do not find any method. I have tried the following way, but it did not make any difference. octomap::ColorOcTree octree = new octomap::ColorOcTree(0.1); octomap::OcTree octree1 = dynamic_castoctomap::OcTree*(octree); Could you help me solve this question? Thanks! :)

ahornung commented 3 years ago

Sorry, but this is not related to the discussed problem. Please create a new issue / question or use the mailing list.

huiwenzhang commented 2 years ago

I see. There is two way to solve such a problem. One is that you have you build you custom octree file with octovis. Another is more simple, if the inner data type of the tree is the same as ColorOctree, just do return "ColorOcTree" in the function of getType.

Hi, I put my custom tree code under the octomap project, and build the octomap and octovis together on Ubuntu with vsocde, the octovis still can't parse my custom tree. The staticMemInitialzer method also doesn't work, any suggestions?