Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Changes from 2 commits
b94e50b
20df675
99bdd41
b63718d
8ccb626
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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:
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.
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.
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?