Commit Graph

1058 Commits

Author SHA1 Message Date
Robert Haschke
8d7225d3b6 Connect: better document suppressing recursive loop 2022-03-04 15:01:19 +01:00
Robert Haschke
5310f9063a operator<< for Interface::Direction 2022-03-04 13:13:01 +01:00
Robert Haschke
ca38d11303 Enable InterfaceState's copy operator 2022-02-02 20:51:58 +01:00
Robert Haschke
b2c990b675 core: export rviz_marker_tools dependency 2022-01-07 14:35:15 +01:00
Robert Haschke
c7b2067b86 Merge PR #309: Fix Pruning 2022-01-05 20:19:51 +01:00
Robert Haschke
5956e70956 Merge PR #311: fix Fallbacks 2022-01-05 19:49:38 +01:00
Robert Haschke
4cc1f567d6 FallbacksPrivateConnect
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.
2022-01-05 18:16:34 +01:00
Robert Haschke
7a04a9f603 ParallelContainerBasePrivate::propagateStateTo*All*Children
rename method to emphasize that state updates are propagated to all children
2022-01-05 16:45:57 +01:00
Robert Haschke
986d3c8766 FallbacksPrivateCommon: shared between Generator + Propagator 2022-01-05 16:45:57 +01:00
Robert Haschke
b82b70ed64 FallbacksPrivate::nextChild()
... factoring out functionality shared between FallbacksPrivateGenerator
and FallbacksPrivatePropagator to switch to next child in nextJob().
2022-01-05 16:37:46 +01:00
Robert Haschke
7af3d8ebd7 Improve readability 2022-01-05 16:37:46 +01:00
Robert Haschke
b2c116edab reset(new Interface()) -> std::make_shared<Interface>() 2022-01-05 16:37:46 +01:00
Robert Haschke
442d39ad3e Improve comments 2022-01-05 16:37:46 +01:00
Robert Haschke
b2056745a8 Generalize connectStageInsideFallbacks
Let's consider the following simple situation, where generators produce solutions in the given order.

GEN           1 3
Fallbacks     |X
GEN           2 4

When passing state 4 to the Fallbacks' connector, it forms pending pairs with both 1 and 3.
Thus, the container needs to check whether 1-4 or 3-4 was processed when receiving a success or failure,
to correctly forward the failed one to the next child.
2022-01-05 16:37:46 +01:00
Robert Haschke
184fab8e0a GeneratePlacePose: add property 'allow_z_flip' 2022-01-04 15:58:19 +01:00
Robert Haschke
9630f4d789 ComputeIK: Improve markers
- always provide eef markers (also in case of success)
- tint failures in red
- use different names for "ik frame" and "target frame" markers
- reduce code duplication
2022-01-04 15:57:34 +01:00
Jafar Abdi
7dbe0b87e1
Return MoveItErrorCode from task::plan (#319)
... to know whether the plan failed due to timeout, preemption, or actual planning failure
2022-01-02 15:32:37 +01:00
Michael Görner
f9c0a894f9
Merge pull request #320 from v4hn/pr-master-fix-move-rel-ikframe
Fix using IKFrame with MoveRelative
2021-12-20 10:40:12 +01:00
v4hn
84f96ec74c MoveRelative: Interpret direction relative to IKFrame
bugfix
2021-12-20 10:19:52 +01:00
v4hn
191ff253fd add tests for MoveRelative 2021-12-20 10:19:52 +01:00
Robert Haschke
4be448641f Improve debug output
- printChildrenInterfaces(): fix/add usage
- printPendingPairs(): full colorization according to status
2021-11-28 18:28:20 +01:00
Robert Haschke
0587129916 CI: asan with debug symbols 2021-11-25 22:02:21 +01:00
Robert Haschke
b4a9e2033d
Stage::reset() should reset total_compute_time_ (#310) 2021-11-25 19:47:00 +03:00
Robert Haschke
e296bd7aed Simplify: job_has_solutions_
Just set a flag when we received a full solution
2021-11-25 07:37:28 +01:00
Robert Haschke
7237e81547 Rework FallbacksPrivate*
Further factorize and simplify FallbacksPrivate classes employing ideas from @v4hn.
The key difference between the variants his how they advance to the next job.
Thus, the only virtual method required is nextJob().
2021-11-25 07:36:32 +01:00
Robert Haschke
070c6e9ab6 Disable failing test FallbacksFixtureConnect.connectStageInsideFallbacks
... as we are now missing the implementation for CONNECT interfaces
2021-11-25 07:35:28 +01:00
Robert Haschke
8dd8022ef9 Factorize implementation of FallbacksPrivate into 3 classes 2021-11-24 21:17:49 +01:00
Robert Haschke
e67b3252fc static TaskPrivate::swap() -> ContainerBasePrivate::operator=()
- Enable moving/swapping of other container impls (e.g. Fallbacks)
- Clarify (via move semantics) that content of source impl will be lost
- Get rid of friend declarations
2021-11-24 21:17:49 +01:00
Robert Haschke
b84bb87102 pre-commit autoupdate 2021-11-24 21:17:49 +01:00
Robert Haschke
c822fd3822 Remove logger configuration
Logger config can be more easily handled via ROSCONSOLE_CONFIG_FILE.
2021-11-24 15:08:20 +01:00
Robert Haschke
a0bc0602e8 Enable tests
Adapt test results FallbacksFixturePropagate.computeFirstSuccessfulStagePerSolutionOnly
due to 2e63c154aa:

The order of computations has changed, because we lock the processed state
as soon as it is forwarded to the first fallback child.

In this case, after processing GEN1 und FWD1 once, we have the two states with costs 2, 4 in the queue.
The first one, i.e. with cost 2 is forwarded to the child FWD2, which fails.
In the next cycle, although we have new states in the queue (1, 2, 3, 4), we stick with state "2"
and forward it two FWD3, which adds costs 210, resulting in 212.

With previous code, the Fallback container switched to state "1", forwarded to FWD2.
2021-11-24 15:07:21 +01:00
Robert Haschke
2e63c154aa Reintroduce pending state 2021-11-22 01:39:45 +01:00
Robert Haschke
5c235ab580 debugging helper function 2021-11-22 01:39:45 +01:00
Robert Haschke
dcb6857f36 Simplify computePropagate()
- Drop variable current_external_state_
- Instead encode the info that the external state wasn't yet forwarded to any child via stage = children().cend()
- If all children have exhausted their solutions for this state, it is removed from the pending list
2021-11-22 01:39:45 +01:00
Robert Haschke
c33b1967bc Handle updates on external states 2021-11-22 01:36:34 +01:00
Robert Haschke
e5b20ac11f Fix pruning
Pruning - if acting on the external state - needs to pass the current stage (this).
2021-11-22 01:36:34 +01:00
Robert Haschke
6653c4853a Rename: computeFromExternal -> computePropagate 2021-11-22 01:36:34 +01:00
Robert Haschke
b783173b27 GENERATE: return correct canCompute() result as early as possible
Moving to next child generator only in compute() requires an extra call
to canCompute() to notice the failure of the next generator(s).
2021-11-22 01:35:34 +01:00
Robert Haschke
aef991602f Propagate either STATUS or PRIORITY updates into a container 2021-11-22 00:12:50 +01:00
Robert Haschke
a48b932dce Distinguish STATUS and PRIORITY updates in notify() callbacks
to allow propagating status updates only if the STATUS actually changed.
2021-11-21 15:05:29 +01:00
Robert Haschke
fdd5ff880b templatize: pullInterface(dir) -> pullInterface<dir>()
Also remove unused pushInterface(dir)
2021-11-21 14:15:59 +01:00
Robert Haschke
a31e52dd53 Propagate status across Connecting gap
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.
2021-11-21 14:15:59 +01:00
Robert Haschke
3648db43ed Never overwrite ARMED with PRUNED 2021-11-21 14:00:50 +01:00
Robert Haschke
9d37495c0b Recombine both variants of Interface::updatePriority()
As only the InterfaceState* variant is actually called,
we can drop the splitting introduced for performance reasons in
29d1e44c5d
2021-11-21 14:00:50 +01:00
Robert Haschke
ffb8598363 Recursively prune new CONNECT state if there is no enabled opposite
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).
2021-11-21 14:00:50 +01:00
Robert Haschke
ab9af6a0fa Recursively re-enable states when matching an ARMED state 2021-11-21 14:00:50 +01:00
Robert Haschke
3c4ef68dbe Rename Interface::Status FAILED -> ARMED
... to better indicate that such a state can be immediately re-enabled.
2021-11-21 14:00:50 +01:00
Robert Haschke
1dda3d14d8 Switch order of function declarations
... to avoid explicit template initialization
2021-11-20 06:24:19 +01:00
Robert Haschke
52dc494525 Fix test Pruning.NoPruningIfAlternativesExist 2021-11-20 06:24:19 +01:00
Robert Haschke
06ae5ddf9c Fix hasPendingOpposites()
- 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.
2021-11-20 01:24:29 +01:00