-
Notifications
You must be signed in to change notification settings - Fork 568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: ensure attached objects update during motion execution #3327
base: main
Are you sure you want to change the base?
fix: ensure attached objects update during motion execution #3327
Conversation
- Check that attached objects in the monitored robot match those in the planned trajectory. - If an object disappears from the monitored robot, remove it from the trajectory waypoint robot_state. - If an object is attached to the monitored robot but missing in the trajectory, add it to enable meaningful collision checking.
for (std::size_t i = std::max(path_segment.second - 1, 0); i < wpc; ++i) | ||
{ | ||
state = t.getWayPoint(i); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only simplification I could think of is that, under the assumption that "attached objects are set to the waypoint's robot state at planning time" (which actually holds) we could query sample_attached_object only once. However, I proposed updating it for each waypoint to ensure robustness, even if this assumption doesn't hold. Do you see any potential issues or improvements with this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah thanks for asking.
I guess I would be thinking about:
- Does it slow things down to be potentially attaching/detaching objects at each waypoint during this check?
- It's difficult for me to know what the user's intent would be on a case by case basis. Right now it seems like the current state is treated as the source of truth, but I'm unsure whether users want that in every case. I guess the previous implementation did the opposite and treated the attached objects from the pre-planned waypoint as the source of truth.
Is it worth maybe adding a flag to this function for whether one wants to prioritize current state vs. planned states? And elevate this up to the config/parameter level?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Does it slow things down to be potentially attaching/detaching objects at each waypoint during this check?
I think it depends on how frequently the planning scene changes. In a highly dynamic environment, this method would be called often, which could impact performance. Since attached objects are processed for all robot states associated with waypoints after the currently executed one, the worst-case scenario with the current implementation occurs when scene updates happen frequently at the start of the trajectory.
With the proposed simplification, this reduces to simply "high-frequency scene updates," as only one robot state from the trajectory is queried for attached objects, while the rest are assumed unchanged.
On the other hand, if future plans include attached objects that are not consistently present throughout the motion, this simplification could introduce errors.
- It's difficult for me to know what the user's intent would be on a case by case basis. Right now it seems like the current state is treated as the source of truth, but I'm unsure whether users want that in every case. I guess the previous implementation did the opposite and treated the attached objects from the pre-planned waypoint as the source of truth.
Is it worth maybe adding a flag to this function for whether one wants to prioritize current state vs. planned states? And elevate this up to the config/parameter level?
As for prioritizing the current state vs. planned states, since world objects are always considered in real-time rather than at planning time, I don’t see a strong reason to let the user choose the source of truth for attached collision objects. Keeping it consistent with real-time world objects could help prevent many erroneous situations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. But at least in your comments on 1., maybe we do need the toggle on using the attached objects only at the start vs. updating this frequently.
Basically, asking the user "do you want this simplification or not?"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just pushed a new commit that automates this process without requiring user input.
Before entering the monitoring phase, it verifies whether the attached objects remain consistent throughout the trajectory. If they do, they are stored and later used by the isRemainingPathValid
method without needing to be queried again.
If the attached objects change during the planned trajectory, the map is left empty, signaling isRemainingPathValid
to query them at each waypoint.
I believe this approach is more robust than using a parameter, as it eliminates the possibility of misconfiguration by the user. What do you think?
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #3327 +/- ##
==========================================
- Coverage 45.60% 45.56% -0.04%
==========================================
Files 716 716
Lines 62443 62475 +32
Branches 7558 7566 +8
==========================================
- Hits 28471 28458 -13
- Misses 33805 33850 +45
Partials 167 167 ☔ View full report in Codecov by Sentry. |
style: `sample_attached_object` -> `sample_attached_objects`
…queried based on their consistency in the planned trajectory. --- Before entering the monitoring phase, it checks whether the attached objects remain consistent throughout the trajectory. If they do, they are stored and later used by the isRemainingPathValid method without needing to be queried again. If the attached objects change during the planned trajectory, the map is left empty, signaling isRemainingPathValid to query them at each waypoint.
Description
Implications
This could impact a few different situations: