Skip to content
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

[ros2]: Sync with master branch #367

Merged
merged 76 commits into from
May 31, 2022
Merged

[ros2]: Sync with master branch #367

merged 76 commits into from
May 31, 2022

Conversation

JafarAbdi
Copy link
Member

@JafarAbdi JafarAbdi commented May 26, 2022

Please fast-forward merge

v4hn and others added 30 commits November 15, 2021 09:29
Keep the previous logic around for Generator stages.
Note that this only makes sense for *pure* Generators and not for MonitoringGenerator,
because for the latter we would expect monitored solutions to be passed individually
(similar to pruning).
give an elaborate reason for an empty overload that doesn't call the parent.
Note that while this ensures other stages outside the Fallbacks container
can compute as well, it does not solve the problem internally.
A new incoming state will only ever be considered once
the current stage cannot compute any more.

We have no way of telling a child to compute for *a specific state* for now.
So once we copied a state to its interface we have to let it compute until
all possibilities are exhausted to detect whether or not it could generate a solution for it.
If we wouldn't do so, there were no way of knowing when to fall back
to the next child as long as the stage can still compute on *any* copied solution.
Setting up a demo for
Fallbacks({CartesianPath,PTP,RRTConnect})
I found the logic did not work as expected yet.

- process last job spec as well
- ignore failures when looking for a solution
- add more debug output
Both, failed and pruned states might get re-enabled later!
This also required rework (simplification) of the sorting function for pending pairs.
- Centrally distinguish between have owner() or not in InterfaceState::updatePriority()
- Have a separate updateStatus() method to just update the pruning status
- Split Interface::updatePriority() into a method taking the InterfaceState*
  and one taking an Interface::iterator (for efficiency)
- Early return in container.cpp's updateStatePrios()
- Switch directions: FORWARD <-> BACKWARD to make the function reusable for status propagation.
- We need to ignore the source state when looking for opposite states of the target state.
  Thus add both, source and target state arguments.
... to avoid explicit template initialization
... to better indicate that such a state can be immediately re-enabled.
This also requires to drop the assertion in SerialContainer::onNewSolution()
that new solutions will have enabled start+end states (a CONNECT stage's solution might not).
As only the InterfaceState* variant is actually called,
we can drop the splitting introduced for performance reasons in
29d1e44
Not only propagate updates along solution paths, but also bridge
the gap of a `Connecting` stage.

- If a state becomes enabled, re-enable opposite `ARMED` states as well.
- If a state becomes pruned, also prune opposite states if they don't have alternatives.
- Make sure that we don't run into a recursive update loop by disabling notify() callbacks.
Also remove unused pushInterface(dir)
to allow propagating status updates only if the STATUS actually changed.
Moving to next child generator only in compute() requires an extra call
to canCompute() to notice the failure of the next generator(s).
rhaschke and others added 20 commits January 5, 2022 16:37
... factoring out functionality shared between FallbacksPrivateGenerator
and FallbacksPrivatePropagator to switch to next child in nextJob().
rename method to emphasize that state updates are propagated to all children
Implement Fallbacks behavior for children of type Connecting.
All other connect-like children are currently infeasible to handle,
because we cannot forward a single job, i.e. a pair (from, to)
to the next child, but only individual states.
However, passing states, will cause creation of undesired state pairs
as jobs in subsequent children.
Check collisions for FixedState's scene and report failure if needed.
Optionally, disable the check via the property ignore_collisions=true.
If two Connect stages are sequenced, both sides can become ARMED.
However, that means that the wave of PRUNED status updates, shouldn't
overwrite a present ARMED state.
Added unit test.
@codecov
Copy link

codecov bot commented May 26, 2022

Codecov Report

Merging #367 (d6284ea) into ros2 (0128cd9) will increase coverage by 3.19%.
The diff coverage is 79.49%.

@@            Coverage Diff             @@
##             ros2     #367      +/-   ##
==========================================
+ Coverage   38.85%   42.03%   +3.19%     
==========================================
  Files          78       78              
  Lines        7520     7767     +247     
==========================================
+ Hits         2921     3264     +343     
+ Misses       4599     4503      -96     
Impacted Files Coverage Δ
core/include/moveit/task_constructor/container.h 50.00% <0.00%> (-30.00%) ⬇️
core/include/moveit/task_constructor/task.h 33.34% <ø> (ø)
core/include/moveit/task_constructor/task_p.h 100.00% <ø> (ø)
core/include/moveit/task_constructor/utils.h 100.00% <ø> (ø)
core/src/solvers/pipeline_planner.cpp 0.00% <0.00%> (ø)
core/src/stages/compute_ik.cpp 18.66% <0.00%> (-0.77%) ⬇️
core/src/stages/generate_place_pose.cpp 0.00% <0.00%> (ø)
core/src/utils.cpp 61.77% <ø> (-4.90%) ⬇️
core/include/moveit/task_constructor/storage.h 86.82% <45.46%> (-5.68%) ⬇️
core/src/storage.cpp 51.30% <58.63%> (-0.21%) ⬇️
... and 24 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0128cd9...d6284ea. Read the comment docs.

Copy link
Member

@henningkayser henningkayser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look all good to me. The only thing I was wondering is if most of the classes that now support move semantics should actually have deleted copy/assignment functions.

@JafarAbdi JafarAbdi merged commit d6284ea into moveit:ros2 May 31, 2022
@JafarAbdi JafarAbdi deleted the pr-sync branch May 31, 2022 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants