Nav2 Planner + Navfn plugin#1107
Conversation
…ntains more information
b56d2f8 to
c6ec564
Compare
|
@mkhansen-intel @crdelsey this is analogous to the controller PR but I think with some updates I think are better (but open for discussion) EI
Should you also agree, I'd like the controller PR to mirror in those respects |
mkhansenbot
left a comment
There was a problem hiding this comment.
Overall, this looks really good. I have a few questions / change requests.
One that it wouldn't let me make inline is - can we get rid of the /test/.gitignore file? It should be removed.
| planner_plugin_name_.c_str(), goal->pose.pose.position.x, | ||
| goal->pose.pose.position.y, ex.what()); | ||
|
|
||
| // TODO(orduno): provide information about fail error to parent task, |
There was a problem hiding this comment.
@orduno - Are these TODO's still relevant? It seems like the exception should already provide this information
Co-Authored-By: Matt Hansen <matthew.k.hansen@intel.com>
Co-Authored-By: Matt Hansen <matthew.k.hansen@intel.com>
Co-Authored-By: Matt Hansen <matthew.k.hansen@intel.com>
Co-Authored-By: bpwilcox <bpwilcox@eng.ucsd.edu>
|
Travis failed on |
|
@mkhansen-intel do you have thoughts on the 3 bullets in my first comment? I don't want to steam roll those changes if there's any other thoughts on the table |
|
I agree with those bullets. See my comment above about documenting the 'how to' of using this plugin interface. Can you add a few sentences to the nav2_planner README for that? |
|
@mkhansen-intel will do @bpwilcox can you re-review so I can get this in and move onto recovery plugin-izing this afternoon? |
cec0d44 to
ee184fc
Compare
Looks like there is a bug in the CircleCI config. If I read it right, it isn't actually running rosdep on our workspace - just the underlay. I'll take a stab at fixing it. |
Wouldn't the plugin already know it's name? It could be compiled into the plugin.
I'm ok with raw pointers in some cases, but, by and large, ROS2 doesn't use them. I tried once to use raw pointers in some places in the code, but it caused more pain than it was worth. Everytime I wanted to make a call into rclcpp, I had to create a shared ptr out of it. We'd be swimming upstream and I don't think it's worth the effort for this.
@yathartha3 's not going to like this. Didn't you ask him to remove this from the controller interface? ;-) |
Not if you have many of them, you want unique names. The costmap is still a shared_ptr, but rather than giving the plugins a shared_ptr I just give them the raw poitner from the shared ptr. Since the server owns the costmap and it'll destroy it, there's not a huge reason to give the plugin a smart pointer. It wouldn't hurt either, but it was causing me trouble is it was just the path of least resistance .... oh sh*t, I did. Uh, um, er, what do you think? TF buffer or no TF buffer |
Oh. You want to be able to load multiple instances of the same plugin within the planner_server? In that case a name would be appropriate. Do you have an idea of why you'd want multiple instances of the same planner? Even if not, it would be possible to do with this architecture, so I agree, a name would still be a good idea.
Do you recall what the trouble was? It usually seems easier to me to stick with shared_ptrs and not fight the system. In this case, it might not matter though. We don't really expect users to interact with costmap as a node, so they probably don't need to pass it to any rclcpp calls. I have a slight preference for shared_ptr since everywhere else somebody gets or uses a pointer in ROS2, it's a shared_ptr. Just seems more consistent.
I don't have a use case in mind for a separate TF buffer. Did you have something in mind? |
I re-introduced the TF buffer, so no worries. |
|
I suppose wanting to load multiple of the same -- I took inspiration from that from the costmap layer API, but maybe doesnt make sense in this context. I could change it to have a virtual method for the plugin to implement called
Viva la revolución. But seriously, I don't remember off hand. If you have a strong preference for giving it the shared_ptr, I can take a look at it again |
If we're already doing it this way elsewhere, lets leave the name in. I don't have a good reason to be inconsistent.
I'm ok with using bare pointers internally where appropriate, but I think we should follow convention and use the shared_ptr on the public interface if not too inconvenient. |
|
@crdelsey made the changes requested
I'm not sure its inconsistent, but it certainly doesnt hurt if someone wants to do something wacky. Lets leave it as a shared_ptr for now, and I'll file a ticket to audit the use of raw pointers |
|
I was going to chime in on the shared_ptr vs raw ptr and agree with @crdelsey that we should use a shared_ptr. I think this is now agreed? |
|
I filed this ticket to cover that #1114 I'll plan to take another stab at it when I do the recovery server work |
|
@crdelsey I think a very reasonable next update here would be to move to the shared_ptr & potentially remove the name field. @yathartha3 then wouldnt need to add it to the local planner. |
|
I now remember why TF buffer: so both that it can have another TF buffer and future proofing for if/when we remove the costmap object from the direct process, it'll require the buffer and that way we can change the API and the plugins wouldnt need to do a whole lot to migrate |
Major items