[WIP] Nav2 3D Map server support#1898
[WIP] Nav2 3D Map server support#1898ShivamPR21 wants to merge 25 commits intoros-navigation:mainfrom
Conversation
|
Before I review this - that pcd file needs to be downloaded on test use, that cannot live in this repo or in the git history, you will need to remove it and rebase. It's 11MB, way too big for git storage. |
|
You also un-linted a bunch of code, you must revert all of that. 2 spaces, functions start lower case, etc. ament_cpplint and ament_uncrustify will scream bloody murder when CI finishes |
a229c50 to
32445c9
Compare
Looks like you missed a dependency |
There was a problem hiding this comment.
I can't seriously review this until you fix all the linting mistakes introduced. Take a slow, critical look at your work and why you made changes. Run ament_cpplint and ament_uncrustify, its going to scream about hundreds of errors introduced in this PR.
Your builds are failing too. Ping me back when you have builds and tests passing and I can start reviewing at that point.
|
@SteveMacenski The error messages due to badly formatted code are now fixed the build is still failing this time even after adding dependencies and I think you should have a look at it and start reviewing it again. |
You have dependency errors, you need to add this to the underlay workspace repos file.
What's boost for? That's a really extreme dependency to add, typically we try to avoid that at pretty much all costs. C++14 has some filesystem capabilities, but I'm not sure exactly you need. The yaml parser didn't require it for the 2D maps so I imagine you can make something to work without it here as well. The PCD files are taken care of by PCL so that shouldn't be an issue either. Lets get this building and passing tests before I dig into it. @AlexeyMerzlyakov can you also review? Sorry it took me awhile to get to this, I've been slammed. Can you talk through your design process? I'm not seeing much patterns to follow in reviewing. I think understanding your thought process and why you designed it the way you did is important. To be fair, map_server has never been in a really great design state, but looks to make things considerably more complicated |
|
@SteveMacenski dependency on BOOST is removable and will be done soon. As far as design is concerned the main motive is to augment the existing one for 3D capabilities rather than changing them which could break other usages of this. For For In the case of |
|
@SteveMacenski a lot of your points about |
What are your expectations with |
|
|
Apologies for long time no being. I will also be connected and review the commit shortly, as possible. |
|
Lets put a pause on this until Alexey takes a look. Theres a bunch of potential issues here and new messages that I don't 100% buy into being necessary. I'm not sure its worth putting any more time into it @ShivamPR21 until we get a plan. I value your time and interest in getting this done, but this PR's changes is not very well structured and it would be difficult to maintain or ever modify in the future. We should slow down and come up with a design to implement and/or take a step back and use the lessons learned from this PR moving forward. Lets focus not on just capability but also code quality and maintainability. |
There was a problem hiding this comment.
Here is a big change trying to preserve current Map Server's concept adding there 3D library which seems to be consecutive. I've started a review today and tomorrow will continue it trying to better understand the details and implementation of the intention by adding more comments about the change.
But the main items appear to put an attention I can highlight today:
-
Files/modules structure and naming.
If you are making a newnav2_map_server_3dnamespace for a new library, it is better to separate sources and includes by: general files, like map_server or map_saver; map_io library for 2D case and map_io_3d library for 3D? It will be better for understanding rather than mixing them into one place, or separating only 3D part. -
Making the united code to be more simple.
Themap_server.cpp/map_saver.cppcode having both 2D/3D working callbacks should be simplified, e.g. as Steve mentioned - by using templates. In current implementation, there are a lot of boilerplate code, came from 2d part almost without changes which will make further code maintenance to be really difficult. -
Mixing origin and orientation. This is two different concepts: origin has its own position and orientation. So, it is better to use
geometry_msgs/Poseor something similar (origin.position and origin.orientation) or 7-itemsoriginvector for it. In my opinion -geometry_msgs/Poseis the best choice. -
There are a lot of new messages added for 3D part. Do we really need them?
I also think, we need to work out the design first, in order to make it simple as we can in order to not get confused in the details in the future. We need to carefully think over it and about required messages from HLD point of view which is required to complete this item.
|
Regarding overall design and messages/service, I suppose the following structure as attached below: This is very similar to what @ShivamPR21 made, however a new |
|
@AlexeyMerzlyakov here is a detailed structure of what is there to support 3D structure including the name of services. |
|
So looking over that, so the map_server would then have both sets of publishers/service servers? Ideally I'd want to create network interfaces based on the type of inputs (e.g. if the I'm starting to come around to the idea of having seperate 2D and 3D servers unless we can work through those issues. Each would have some base class server with the basic functionality required and then only the 2D vs 3D specifics would be in their respective derived classes. The idea is to reduce the amount of overhead of adding new features or changes in the future. Templating is always preferred over inheritance, so I'd like to give that a stab first, but would need to be thoughtfully implemented to refactor the code to make that work. |
|
I believe, we can get along with one map_server and one map_saver having a templated code structure with two different implementations of main API methods depending map: 2D or 3D type. Could be made for publishers in map_server as well? I think why not. Regarding MapIO: from first sight, MapIO and MapIO_3D have less common in the code to have templated API. Additionally, MapIO was initially designed to work only per one type of maps. So, I consider to have two separate libraries: MapIO and MapIO_3D and one common map_server/map_saver components. I also agree with @SteveMacenski that templating is preferred over inheritance. Regarding sets of services: unfortunately yes. In current services structure So, the main question today is - how can we make a templated structure of |
|
I think that's a good analysis. For the services, the base server would need to have both callbacks in the class but we can just create the one that the template uses, we can have an if/else based on Or we modify the services themselves to support both... but that doesn't seem ideal, that would have alot of waste in each message. |
|
So, we have 2 main requirements,
@AlexeyMerzlyakov @SteveMacenski as you have suggested for this I also think the template(metaprogramming) is a better option, actually, there could be a much straightforward option if all custom messages are inherited from a unified class but that's not the case at this moment so we should go with metaprogramming. I have tried it to do this in the past while developing this in the initial phase, yet to retain the current implementations chosen the simple way, but as of now here is the solution based on templates. The solution to the problem:-I think here is a simple solution which would make us achieve both the targets mentioned above. Use of simple class modules:-
// The base class restricting the structure of module
// base_class____.hpp
class base_class{
virtual void configure();
virtual void clean();
virtual void activate();
// ..................... more methods
};// Defining module class and overriding methods to be used
// modeule_class____.hpp
class module_class : public base_class {
// service and message list
// .......................
void configure() override {
// do something whatever system needs
// this function will be called during configure
}
// ......................... implement more methods
void clean() override {
// do something whatever system needs
// this function will be called during cleanup
}
};Once defined these would be used as template parameters in template<class T> class map_server{
// ................. existing structure
void on_confiure(){ // For example only
services.configure();
}
T services;
};#include "module_class___.hpp"
#include "map_server.hpp"
// usage
int main(){
map_server<module_class> a; // dummy usage actual may be different
}For upgrading the existing capabilities one has to only make his own @SteveMacenski I think that this structure would lead to better maintainability as the new capabilities won't need to be directly added to the library instead of just create another class and use it. @AlexeyMerzlyakov what's your say on this?? Note:- The presented structure is only a dummy not in its actual form as it would be in the code. |
|
@SteveMacenski @AlexeyMerzlyakov in Yet, I'm a bit hopping b/w the two ideas for What do you suggest on this?? Now with the end of this comment I'm a bit leaned towards the templated version?
|
|
@AlexeyMerzlyakov the method proposed above I think has the capability to release the hold on extension name for files as well as you pointed out
Till now I didn't see anything in the PCL source that restricts the extension of the file even if it is so the method would be able to handle this by decoupling all the Overall the method would decouple both |
|
Okay, @ShivamPR21 it looks like we have caught the right direction. There are many ways how to simple this. An example above - is just an idea how to handle it. In the Regarding |
39f53e8 to
659537b
Compare
…etMap3D.srv, SaveMap3D.srv : new messages PCD2.msg
…ver.cpp and map_saver
…age requirements < 14
…e changes(reverts) to reduce linting error.
…) to saver and server
…map_server switching 2D <-> 3D, some extra testing of .pcd load.
…whole project to cope with coding pattern
Signed-off-by: ShivamPR21 <pandeyshivam2017robotics@gmail.com>
Signed-off-by: ShivamPR21 <pandeyshivam2017robotics@gmail.com>
Signed-off-by: ShivamPR21 <pandeyshivam2017robotics@gmail.com>
…picking the right io for saver and server, added support for 3d PointCloud maps Signed-off-by: ShivamPR21 <pandeyshivam2017robotics@gmail.com>
Signed-off-by: ShivamPR21 <pandeyshivam2017robotics@gmail.com>
Signed-off-by: ShivamPR21 <pandeyshivam2017robotics@gmail.com>
Signed-off-by: ShivamPR21 <pandeyshivam2017robotics@gmail.com>
…ge about origin topic Signed-off-by: ShivamPR21 <pandeyshivam2017robotics@gmail.com>
659537b to
775b8e1
Compare
|
Closing from inactivity We can readdress this if we can get another PR going with these issues fixed, but closing out inactive PRs for the end of the year to help start 2020 with a cleaner slate. |


nav2 map server for 3D #1787
Basic Info