You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently I tried to use MapCollection class, but it seemed to me that this class and its derivatives are still in a early stage, with many TODOs and methods to be improved. I think I was able to understand some of the internal structure but it wasn't clear how to contribute for these classes specifically.
One minor example is that the write method in MapCollection iterate its nodes to create separate files for them. The problem is it tries to append the filename (node id) to the path in a wrong order, creating an invalid filename and thus making writeMap crash.
std::ofstream outfile(filename.c_str());
outfile << "#This file was generated by the write-method of MapCollection\n";
for(typename std::vector<MAPNODE* >::iterator it = nodes.begin(); it != nodes.end(); ++it){
std::string id = (*it)->getId();
pose6d origin = (*it)->getOrigin();
std::string nodemapFilename = "nodemap_";
nodemapFilename.append(id);
nodemapFilename.append(".bt");
outfile << "MAPNODEID " << id << "\n";
outfile << "MAPNODEFILENAME "<< nodemapFilename << "\n";
outfile << "MAPNODEPOSE " << origin.x() << " " << origin.y() << " " << origin.z() << " "
<< origin.roll() << " " << origin.pitch() << " " << origin.yaw() << std::endl;
ok = ok && (*it)->writeMap(nodemapFilename);
}
Another thing that comes to mind is that MapCollection stores the node as a vector of pointers, leaving memory management to the user:
protected:
std::vector<MAPNODE*> nodes;
which may lead to some memory corruption problems (if the user intantiates MAPNODE with new but frees it incorrectly, for example). Maybe it could manage that memory internally.
The text was updated successfully, but these errors were encountered:
As you have observed, the code was added in a quite early stage and can be considered orphaned and unmaintained at the moment.
Pull requests for improvements are welcome!
I will contribute, I'm just not sure if I got a clear enough picture of what theses classes are supposed to be. Is there any information you can share about it, or should I propose something first and we discuss upon that?
From what I can tell, it seems like the MapCollection is a collection of submaps represented by MapNodes, and serves as the basis for some map-sharing use-case. Seems like something that would be very useful to properly implement.
Recently I tried to use MapCollection class, but it seemed to me that this class and its derivatives are still in a early stage, with many TODOs and methods to be improved. I think I was able to understand some of the internal structure but it wasn't clear how to contribute for these classes specifically.
One minor example is that the
write
method inMapCollection
iterate its nodes to create separate files for them. The problem is it tries to append the filename (node id) to the path in a wrong order, creating an invalid filename and thus makingwriteMap
crash.Another thing that comes to mind is that
MapCollection
stores the node as a vector of pointers, leaving memory management to the user:which may lead to some memory corruption problems (if the user intantiates
MAPNODE
withnew
but frees it incorrectly, for example). Maybe it could manage that memory internally.The text was updated successfully, but these errors were encountered: