Repository navigation
Multiple controller plugins in server for contextual control - #1292
Conversation
…ded, act and warn
| @@ -1,5 +1,6 @@ | |||
| #goal definition | |||
| nav_msgs/Path path | |||
| string controller_name | |||
There was a problem hiding this comment.
This is the string in the map of controller plugins to use. If we call the key the controller name and the value is the controller, ei FollowPath: DWBLocalPlanner::RegisteredPluginType then the field in the action message should also be the name.
Motion type doesn't make clear to me this is the same name as the map in the controller server. The eq. message in the planner uses planner_name so there's some automatic parallels someone can draw if you know one, you know both. I'd be open to other names but I'd like them to be consistent between the 2 servers in style
There was a problem hiding this comment.
My comment was directed towards the fact that we were opening this message to mean any type of control/actuation, but if this is FollowPath.action, then yes, motion_type is not needed.
However, I actually liked naming this action to mean moving the robot's base. This would then allow to specify the type of motion as FollowPath, SuperSafeButSlowFollowPath, RoughlyFollowPath, etc. We don't know/care at this level about the types of controllers (e.g. DWB, MPC, PID), only about the high-level intention. The matching of the motion type string to the plugin name would be done down on the ControllerServer and not hardcoded but on the params file.
I don't see how exposing the names of the controllers at this level provides more contextual control. I could argue that my proposal provides actually more.
There was a problem hiding this comment.
Controller name is FollowPath, SuperSafeButSlowFollowPath, ... its the name of the controller stored in the controllers_ map and the parameter in the configuration file of controller_names.
Again, that's what's happening here as we've discussed. You are defining a map of plugins not a vector. If you make the name of your controller FollowPath and map to MPC and FollowPathSlowButSafe with a carrot follower, then the BT designer doesn't care about the algorithm, they have their abstractions. Now its only the algorithm designer that knows what's under the hood.
There was a problem hiding this comment.
OK, I find it confusing assigning FollowPath to a controller_name. I think it would help if the field was named following_type, or something like that.
There was a problem hiding this comment.
I disagree with the word type, in pluginlib type means something
<library path="nav2_navfn_planner">
<class name="nav2_navfn_planner/NavfnPlanner" type="nav2_navfn_planner::NavfnPlanner" base_class_type="nav2_core::GlobalPlanner">
<description></description>
</class>
</library>
The name is the actual name to load, and is map-able. the type is the actual registered plugin class. Using type here would mix definitions. Therefore the parameters in the config file should use type/name accordingly. If we changed the action file to swap them that'd be pretty confusing
| declare_parameter("controller_frequency", 20.0); | ||
| declare_parameter("local_controller_plugin", "dwb_core::DWBLocalPlanner"); | ||
| std::vector<std::string> default_name, default_type; | ||
| default_type.push_back("dwb_core::DWBLocalPlanner"); |
There was a problem hiding this comment.
I got a bit confused by the names used here, why not instead match a default_motion_type (e.g. FollowPath) to a default_controller_type (e.g. DWBLocalPlanner)?
There was a problem hiding this comment.
I think you read this the opposite way I do. When I use type I'm referring to the type of plugin and the name is the name of the plugin.
With that said, I'm open to naming changes for both of these but if there's confusion, I dont think 'typeorname` should appear at all so there isn't that opportunity.
Maybe default_plugin_name and default_plugin_type to be clear its plugin-centric? Open for thoughts
| void DWBLocalPlanner::configure( | ||
| const rclcpp_lifecycle::LifecycleNode::SharedPtr & node, | ||
| const std::shared_ptr<tf2_ros::Buffer> & tf, | ||
| std::string /*name*/, const std::shared_ptr<tf2_ros::Buffer> & tf, |
There was a problem hiding this comment.
What use do you see for the name?
There was a problem hiding this comment.
Multiple instances in the server so you can tell the difference between them
| controller_names_[i].c_str(), controller_types_[i].c_str()); | ||
| controller->configure(node, controller_names_[i], | ||
| costmap_ros_->getTfBuffer(), costmap_ros_); | ||
| controllers_.insert({controller_names_[i], controller}); |
There was a problem hiding this comment.
I find it more clear if this was controllers_.insert({motion_type[i], controller});
There was a problem hiding this comment.
The phrase motion_type I think is ambiguous and isn't immediately clear to me what that is. I can see that this has caused you some confusion, would adding plugin to these variable names help? controller_plugin_name controller_plugin_type.
Codecov Report
@@ Coverage Diff @@
## master #1292 +/- ##
==========================================
- Coverage 38.75% 38.52% -0.23%
==========================================
Files 244 244
Lines 11040 11072 +32
Branches 4570 4606 +36
==========================================
- Hits 4278 4265 -13
- Misses 3884 3907 +23
- Partials 2878 2900 +22
Continue to review full report at Codecov.
|
00b4d20 to
1b4099c
Compare
|
@orduno beyond our |
|
@orduno @mkhansen-intel @crdelsey take a look things have been renamed. Only place that the word |
8008ec4 to
263ecca
Compare
54c5db7 to
f89dc49
Compare
86a2031 to
7e10a78
Compare
|
@orduno can you review again? |
| </RateController> | ||
| <RecoveryNode number_of_retries="1" name="FollowPath"> | ||
| <FollowPath path="{path}"/> | ||
| <FollowPath path="{path}" controller_name="FollowPath"/> |
There was a problem hiding this comment.
Can we extrapolate here what's decided for the planner?
We'd need to replace controller_name to something else. One option is control_property if we're thinking the input describes some quality about how the path should be followed.
There was a problem hiding this comment.
Yes, of course. I’ll reflect whatever we decide there, here as well
There was a problem hiding this comment.
One consequence of this I really dont like is that now a line reads: controller_properties[action->controller_property]->doThing(). Its very unclear that controller_properties_ means a vector of properties and not a set of properties about 1 planner.
Lets merge this now but we need to discuss this. I'd like to change the variable name back to planner_names_ inside the server so that this is abundantly clear, but still keep property everywhere else.
Is that something you'd agree to?
Also see below, I changed everything. Still need the second review on this one to merge. I left the controller property to FollowPath because its not clear to me how I can clearly tell this as DWB. The more I have to think about how to name NavFn or DWB by "property" the more I think name was the better idea. GridBased or CircleSampling (?) both really make things way way more confusing for a typical user than it needs to be.
There was a problem hiding this comment.
Ticket to continue dialog
0c7abb6 to
9cd972b
Compare
|
I think* this is done (with exception of a name for the property). Also then deciding if property is the right name altogether, but #1330 covers that if we want to move the discussion. The goal here is to be really approachable and easy to think about. I think this naming has become difficult, but if that's just me, then we can keep it. I wrote it, I know what it does, but if that's clear to everyone else the intent, then I don't have a problem. |
|
@orduno pinging for another review / discussion |
|
I'm ok with merging and continuing any naming discussions in #1330. |
See #1269 for planner eq.
I'd highlight that I add a
namefield to the controller interface. This is necessary in case we now load multiple of the same type of plugin. DWB will ignore it because it doesn't have alot of output logs anyhow, but others may require it. Should go in before Eloquent release 1