Repository navigation
Multiple planner plugins server for contextual planning - #1269
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1269 +/- ##
=========================================
- Coverage 38.75% 37.7% -1.05%
=========================================
Files 244 244
Lines 11040 11064 +24
Branches 4570 4599 +29
=========================================
- Hits 4278 4172 -106
- Misses 3884 4054 +170
+ Partials 2878 2838 -40
Continue to review full report at Codecov.
|
724ad60 to
f9ba3f3
Compare
|
In CI, I'm seeing this error: However it can load fine locally. I have other test failures locally on unrelated packages (amcl test, costmap test) that i don't see in the CircleCI CI. I think everything is fine -- but I do recall a recent PR to change the location the the behavior trees are installed. It seems all PRs right now are failing on this. I'll start on this tomorrow afternoon if no one beats me to it a8fece3 fixes the XML path issue, but remains the issue with multirobot test failing on finding the spawn_robot node, see #1283 |
68df938 to
a8fece3
Compare
If we're going to do it this way, well, seems like we should break out djikstra and A* as separate plugins. Then we'd have two ComputePlan plugins with fairly obvious names - "Dijkstra" and "A*". In the meantime, I'd just keep it as Navfn. Just my 2 bits. Take it or leave it. |
|
Well conceptually you could actually load multiple instances of NavFn, one with A* the other with Dij! But I'm not opposed to it, I can just make a wrapper plugin that sets the use_astar param on bringup. I think it's a little excessive to split them up personally since they accomplish the same class of task, but I dont have a strong opinion |
|
I know we discussed this a couple months ago in the WG, but was a design issue ever opened so we could discuss this? I don't understand the use case that this is targeting and why it's an improvement. I have a couple issues with this we should discuss in the Nav2 WG.
My thinking right now is that we can add "ComputePlan" but it shouldn't replace "ComputePathToPose". |
What do have in mind for this feature, if not that? Every plugin you instantiate takes a goal pose and computes a path. They are all the same class of task, aren't they? |
|
Lets talk in the meeting but high level
This allows multiple plugins for a server, both to share resources (costmaps, tf buffers, etc) and to share action interfaces. There's a planning action with a parameter as to which of the high level primatives to use, right now that's just NavFn mapped to ComputePlan (I think changing the mapped name to ComputePathToPose again would be reasonable). Conceptually now you can have really interesting behaviors with different types of planners called in the behavior tree at different times. For instance if you have a security robot, then you could have a coverage planner going and once a person is detected, change from a full-space sweeping planner to a compute path to a position planner. Those are two such classes of planners but the list is much larger including multirobot planners, switching planners from static environments to save power to a time-variant planner when its highly dynamic environments. As you suggested in our last conversation, I'm mapping the names of the specific plugins to their tasks to give a level of abstraction between similar coverage vs. time-variant vs. "normal" planners. Another example is a retail robot who's goal is to scan shelves but may be interrupted by a customer to make the robot show them to an aisle, switching planners to a human aware planner would allow that all to happen within the behavior tree structure and without creating unique resources for each planner. In terms of design doc, that seems overkill. Its just a map of plugins & a string name for planner to use. ComputePathToPose as the name mapped to NavFn makes sense, but that verbage is extremely restrictive. A planner is not just something to make a plan to a position, there can be other classes of planners. We are indeed changing the action msgs definition, and that's why its important this change goes in right before a new distribution.
We also talked about this and agreed that as long as we weren't specifying a plugin but a task to complete (compute path to pose, compute coverage plan, compute short time horizon, etc) and then the server has mapped a plugin to accomplish that task that would be fine.
ComputePathToPose isn't really want the planner server is doing, its what the NavFn plugin happens to be doing, that name really needs to go. It can be remapped to the NavFn-like task of computing a path from start to goal, and I can change the mapped name + BT name for the mapped NavFn planner to that, but the task needs to be more general. ComputePlan or ComputePath and similar is more generic for all uses Without allowing for contextual planners and controllers, I don't see the point in the behavior tree, so I view this as really critical to getting the advanced behavior and really unlocking the good work you all did on the behavior tree orchestrator |
|
Action items
|
|
@mkhansen-intel revisiting this with the reduced scope of: only planners for going to pose are intended, backward compatible if only 1 planner plugin loaded, and renaming the action server "topic" the same... Is there an issue with leaving the message name as |
Yes. Backward compatible meaning the BT doesn't have to include the plugin type. One thing I forgot to mention yesterday was that part of the reason we have an abstract action interface is so that people can implement their own planners in different languages such as Python if they want. Please make sure we don't break that requirement.
I'd prefer you didn't, as that will mean the action name and message name are different, that seems confusing. Again, as I said yesterday in the WG. If you want However, it seems you don't want both, so I think the compromise here is what we agreed to. You are basically adding an optional field to the |
|
Ok. I’ll change the name of the message as well. I resist the idea of having multiple action servers accomplishing the same task since that will add layers of confusion to a typical user when to use each when both will provide identical behavior in a typical application. This is acceptable for high level operations with GoToPose where we have an action and a topic but for internal structure I think that makes poor design and opens the gate for adding arbitrary number of additional nuanced servers. I believe that an algorithm developer creating a plugin should not have to deal with anything else in the navigation stack to enable their application since this is a ‘pro-user’ feature. The interface Nav1 used was called GetPlan https://github.com/ros/common_msgs/blob/jade-devel/nav_msgs/srv/GetPlan.srv with mostly the same content and that was not specifying that its a shortest-path planner. There are examples of ros planner plugins using the planner plugin to do coverage and other tasks and fit inside this general interface. It seems to me adding the specification to shortest path planning only is restrictive when it provides adequately the information required for many planning styles that the nav stack in ROS1 did support without an issue. Nav2 will also support if someone ignores the names of everything involved, which encourages off-design uses, or we just name things to be sufficiently general. If the action server name is specific, thats fine it can be remapped, but the message type used shouldn’t tell a user what it can and cannot do in my opinion. Having the name ComputePathToPose everywhere reinforces the idea that the navigation stack can only support moving a robot from point A to B and that’s incorrect and I do not want people walking away with that impression. This is a configurable navigation solution that is as powerful as the algorithm plugins you can write. I fundamentally don’t see the harm in using general terms when the interfaces will work for the general case. You and I can both come up with a short list of other planners that don’t fit in this general title, and they wouldnt have in ROS1 either (and they used GetPlan), and that’s when hosting your own server is reasonable when you’re up to something very very niche. The the edges cases shouldn’t affect everything else for defining the general usecase that are good for everyone else. We have a sensor_msgs/PointCloud2, works for 90% of what we need pointcloud datatypes for, but for very very niche things I’ve had to create my own. This is no different as I can see it. Rabble rabble rabble. I’ll change the message back to. We can continue this spirited inquiry at another point. This will enable what I’m looking for but wouldn’t be clear to outside users that you can do those things. |
|
I got a few comments on the PR but I'd like to start with clarifying the action description because the rest depends on this.
I'm ok with adding a field to the message that specifies the type of planning to do (but not the planner to use) for example Other types of plans require more information than a single point, for example, (as you mention above) coverage. For that, I would consider creating a different action. @mkhansen-intel @crdelsey I have similar comments on the PR for the controller #1292 (comment) |
|
I am summarizing my position, I'm making the changes as requested but mentioning the fact that this interface was taken from ROS1 with a more general name and was used by people to implement other types of planners. I for one already do use that interface for a global coverage plugin. I don't want to continue beating this with a stick. |
OK, I got confused with the naming. Do you think |
|
@orduno see comments in the controller, the So up the chain to the action file definition, we could I suppose flip definitions, but that's pretty un-ideal. I think |
|
If the tag is
|
|
@orduno @mkhansen-intel @crdelsey take a look things have been renamed. Only place that the word |
f9416a2 to
1b99a08
Compare
| <Fallback> | ||
| <GoalReached/> | ||
| <ComputePathToPose goal="{goal}"/> | ||
| <ComputePathToPose goal="{goal}" planner_name="ComputePathToPose"/> |
There was a problem hiding this comment.
I'm not blocking if you really think this is the correct way to go. However, I see the duplication of ComputePathToPose as an indication that something is not quite right.
I understand your intention that this planner_name field will map to some plugin (planner_type) that will actually compute that path. But I think we haven't clarified what is the meaning of the key in that mapping.
I see the following options:
- Action name is
ComputePathToPose, but now planner_name="nav2_navfn_planner/NavfnPlanner" and remove the mapping altogether from the server. No contextual planning in this case; a user designing a navigation behavior should be familiar with the characteristics of the plan computed by Navfn. - Action name is
ComputePathToPose, keep mapping in the server and clarify what is the meaning of theplanner_namekey. This action is always computing a path to a pose, so does this field refers to some property of the resulting path? e.g. "ShortestPath", "LongestPath", etc. Is so, thenplanner_nameis not the correct name. We start to add some context here. - Change the action name to
ComputePath, now the key should provide info if we're computing to a pose, covering some area, going to and back, etc.
There was a problem hiding this comment.
I'd think the planner name should be the algorithm name which implements the ComputePathToPose action, so here it would be planner_name="Navfn".
There was a problem hiding this comment.
3 was the original thing we discussed in the meeting and was shot down- so I wouldn’t like to revert that unless some critical mass of changes in people’s opinions.
On the name, agreed, any other suggestion, maybe ComputeGridPath since its a grid based wavefront planner?
There was a problem hiding this comment.
Optionally, I can just add no xml key. No key & 1 plugin in server will default to the given plugin. Though this feature loses all self-documentation
There was a problem hiding this comment.
Here's option 2.1:
<ComputePathToPose goal="{goal}" path_property="GridBased"/>Path property could mean anything: lenght/optimality, what representation is used to compute, computation time, etc. but we require the property to plugin mapping to be specified on the nav2_params.yaml:
planner_server:
ros__parameters:
path_properties: ["ShortestPath", "FastestComputation", "GridBased", "Safest"]
path_property_plugin: ["some_package/MPC", "nav2_navfn_planner/NavfnPlanner", ...]Here the path_property_plugins match the plugin types, but we could use some other name and allow us to set multiple properties to the same plugin type but with different settings:
planner_server:
ros__parameters:
path_properties: ["FastestComputation", "GridBased",]
path_property_plugin: ["NavfnAstar", "NavfnDijkstra"]
plugin_types: ["nav2_navfn_planner/NavfnPlanner", "nav2_navfn_planner/NavfnPlanner"]
NavfnDijkstra:
use_astar: false
NavfnAstart:
use_astar: trueThere was a problem hiding this comment.
I could live with path_property. Do you think GridBased is a good name to replace ComputePathToPose? Are these 2 names exclusive decisions or do you want them both paired.
There was a problem hiding this comment.
I guess GridBased is good enough for now.
I could live with path_property
another option is path_type
Are these 2 names exclusive decisions or do you want them both paired.
I'm not sure what you mean here. Could you elaborate?
|
@orduno changed names. Merging on CI |
f5307bc to
fec4509
Compare
fec4509 to
65dab92
Compare
Multiple planner plugins server for contextual planning
…gure to improve real-time performance (ros-navigation#1269)
This is a draft currently addressing the discussion to allow for multiple planners and controller to be available in each.
Right now its just the planner server being able to host multiple planners, but I wanted to throw this out here early for comments if someone has an issue.
My plan:
If anyone has strong thoughts on plugins within BT at this time, maybe we start here
If anyone has a better name than
ComputePlanas the map name forNavfnPlannerplugin, let me know, I'm not good at naming things