Add private buffer & tf listener to PSM#654
Conversation
|
This fixes the issues I was seeing related to #646. Awesome! |
Codecov Report
@@ Coverage Diff @@
## main #654 +/- ##
==========================================
- Coverage 54.22% 54.21% -0.01%
==========================================
Files 192 192
Lines 20227 20224 -3
==========================================
- Hits 10966 10962 -4
- Misses 9261 9262 +1
Continue to review full report at Codecov.
|
v4hn
left a comment
There was a problem hiding this comment.
Having the transforms updated either through the PSM tf listener or through a CSM listener is quite ugly.
Why did you not just add a mechanism to start the tf listener in the CSM when it's used from the PSM - whether or not there are MultiDOF joints around?
| { | ||
| RCLCPP_WARN(LOGGER, "The tf2_ros::Buffer is attached to tf2_ros::TransformListener and the internal tf " | ||
| "subscribers inside CurrentStateMonitor, you may want to remove the transform listener to " | ||
| "avoid duplicate addition to the same transforms"); |
There was a problem hiding this comment.
This is still a very valid warning when CSM is used outside PSM.
There was probably a reason why this was added in the first place and I would be grateful for the feedback in such a case.
There was a problem hiding this comment.
I agree, we should keep the warning
There was a problem hiding this comment.
I added this warning in the last PR to warn about the previous behavior of using an external tf listener, but since we have an internal one now it will always print this warning which may confuse users
There was a problem hiding this comment.
Hmm, so in both cases (PSM+CSM, CSM standalone) we use a dedicated thread for the tf_buffer, right? I guess there is no straight-forward way to check for external listeners anymore. It's fine to remove this warning then, IMO.
Thoughts for a follow-up: Since we don't want external listeners to run at the same time (only PSM is allowed), how about we make the current CSM constructors friend constructors for PSM and only provide public versions without tf_buffer?
moveit_ros/planning/planning_scene_monitor/src/planning_scene_monitor.cpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
I think this is a good step forward, especially removing the buffer from the PSM constructor.
Having the transforms updated either through the PSM tf listener or through a CSM listener is quite ugly.
I totally agree. Ideally, we would be initializing a single listener and then simply registering the CSM callback dynamically. If buffer and listener are maintained by the PSM, this would be straight forward. If we want to be able to run CSM standalone, the buffer and listener need default values in the CSM constructor.
Why did you not just add a mechanism to start the tf listener in the CSM when it's used from the PSM - whether or not there are MultiDOF joints around?
Not sure if I follow you there. Are you basically describing what I wrote above?
moveit_ros/planning/planning_scene_monitor/src/planning_scene_monitor.cpp
Outdated
Show resolved
Hide resolved
24a9f22 to
7bad500
Compare
henningkayser
left a comment
There was a problem hiding this comment.
+1 after addressing the comments
moveit_ros/planning_interface/common_planning_interface_objects/src/common_objects.cpp
Show resolved
Hide resolved
| { | ||
| RCLCPP_WARN(LOGGER, "The tf2_ros::Buffer is attached to tf2_ros::TransformListener and the internal tf " | ||
| "subscribers inside CurrentStateMonitor, you may want to remove the transform listener to " | ||
| "avoid duplicate addition to the same transforms"); |
There was a problem hiding this comment.
I agree, we should keep the warning
tylerjw
left a comment
There was a problem hiding this comment.
minor comment to help users transition to the new psm constructor
...anning/planning_scene_monitor/include/moveit/planning_scene_monitor/planning_scene_monitor.h
Show resolved
Hide resolved
28f1911 to
c6443a4
Compare
henningkayser
left a comment
There was a problem hiding this comment.
I think this has turned out pretty great! lgtm
|
Update: this error log is from an old version of the PR, so there's nothing that needs to be fixed here. |
moveit_ros/planning/planning_scene_monitor/src/planning_scene_monitor.cpp
Show resolved
Hide resolved
schornakj
left a comment
There was a problem hiding this comment.
Explicit re-approval: I tested with the latest version of this PR and it works as expected.
Thanks for looking into this again |
Description
Address #617
Fix: #646
Checklist