How to change occupancy in a OcTree
I am using Ubuntu 16.04 and Ros Kinetic. I have an OcTree "prueba.ot" and I want to change the occupancy status of all the nodes. For example, if a node is occupied I would like to put it like unoccupied. For example:
for(OcTree::tree_iterator it = ot->begin_tree(), end = ot->end_tree(); it!=end; ++it){
OcTreeNode *n = ot->search(it.getX(), it.getY(), it.getZ());
if(n){
if(ot->isNodeOccupied(n)){
//Update the node to unoccupied
}
else{
//Update the node to occupied
}
}
Is it possible to do that? Thanks in advance!