Commit Graph

377 Commits

Author SHA1 Message Date
Robert Haschke
defe144b55 Use py:overload_cast<>() 2021-05-20 03:52:32 +02:00
Robert Haschke
fc0abe9dd9 Merge branch 'master' into wip-python-api 2021-05-20 03:49:52 +02:00
Robert Haschke
f006ff7a37 Allow casting of PoseStamped from string 2021-05-19 23:04:44 +02:00
Robert Haschke
84ccd679d9 Fix compiler warnings
unused parameters and functions
2021-05-19 21:54:48 +02:00
j-kuehn
d71c645d83
add visualization for Point goals (#264)
- move visualization from `getPoseGoal` to `compute`
- create target frame from `target_eigen` to allow visualization from Pose and Point goals
2021-05-11 10:53:15 +02:00
Robert Haschke
4fa8c10f44 clang-tidy auto-fixes 2021-04-24 02:03:24 +02:00
v4hn
4e09d78239 Implement pruning inside-to-outside of a container
- Remove public onNewFailure() interface
  Moved to ContainerBasePrivate to reuse logic for serial and parallel containers.
- Add tests
2021-04-01 00:19:15 +02:00
v4hn
472a78800d implement bimap for internal_external state map
Get hashing for inverted lookups, but incur
structural overhead.

Whether this is worth it depends on the number of mapped interface states
and the number of pruning/reactivation requests.
2021-03-30 15:19:49 +02:00
Robert Haschke
0e3ec0b6ec fix constness 2021-03-30 15:19:49 +02:00
v4hn
106c138ef5 Implement pruning inside serial container
By inefficient inverse lookup.

Also add disabled test for the inverted inference (failure inside should prune outside)
2021-03-30 15:19:49 +02:00
Michael Görner
36d9d3e8c0
Rework PipelinePlanner creation (#249)
- Moved Task::createPlanner into PipelinePlanner::create
- Handle mutiple planner pipeline configs as introduced in https://github.com/ros-planning/moveit/pull/2127
2021-03-29 12:00:28 +02:00
v4hn
e33962364d resolve PruningMultiForward test
Every InterfaceState along the partial solution has to be disabled
for pruning, not just the ends that are currently relevant.
2021-03-22 14:42:23 +01:00
v4hn
a82b88355e streamline trait parameters
state asked for a reference, but trajectories for a pointer.
2021-03-22 14:42:23 +01:00
v4hn
bca01e8aa7 rename Status values
Start and End are already used for an entirely different concept,
so if anyone ever wants to read this code, we should use new terms instead.

Because the source state is the disabled state that *failed* to extend,
triggering the whole subtree to be disabled, I went for the new terms
DISABLED and DISABLED_FAILED.
2021-03-22 14:42:23 +01:00
Robert Haschke
d3864596b6 Replace Priority::enabled() with status()
The key to pruning in the Connecting stage was the following:
- Don't remove states during pruning, but only disable them.
  They might become re-enabled due to further input.
- Distinguish START and END sides of a disabled solution tree to break their symmetry.
  The START side from where we started disabling, can be re-enabled by a new partner state in
  Connecting, the END side must not. This was important as, otherwise, the states would simply
  get re-enabled immediately. The END side only gets re-enabled if the START side actually
  connects the whole solution branch.
2021-03-22 14:42:23 +01:00
Robert Haschke
f229743024 Debug evolution of interfaces 2021-03-22 14:42:23 +01:00
Robert Haschke
9466517f72 operator<< for Interface + Priority
Co-authored by v4hn
2021-03-22 14:42:23 +01:00
Robert Haschke
604a0da1e4 Actually implement pruning and re-enabling of states 2021-03-22 14:42:23 +01:00
Robert Haschke
19484cec64 Restore pruning
If a stage fails to find a solution, this often implies that further planning
on the open end(s) of connected InterfaceStates is not needed anymore.
Thus the InterfaceStates along all connected solution paths will be marked as disabled.
They are not removed from the pending state lists though, because they might get
reactivated by solutions found in future.

To this end, we introduced the method ContainerBase::onNewFailure().
2021-03-22 14:42:23 +01:00
Robert Haschke
6c18e2b482 test comparison of ConnectingPrivate's StatePairs 2021-03-22 14:42:23 +01:00
Robert Haschke
2a09daa42f InterfaceState::Priority::enabled()
To allow pruning, we need to enable and disable InterfaceStates to be considered for further
planning. In the past, we just indicated the disabled status with infinite costs.
However, because we might need to re-enable states (with previous state),
we need to separate these two concepts.
2021-03-22 14:42:23 +01:00
Robert Haschke
10f6b7a58e MoveTo/MoveRel: reduce code duplication
... using templated versions for computeForward + computeBackward
as they essentially perform the same operations.
2021-03-19 18:22:04 +01:00
Robert Haschke
dfffd77eee MoveTo/MoveRel: Report errors via solution comments instead of ROS_WARN 2021-03-19 18:22:04 +01:00
Robert Haschke
0b63c590c5 Replace MoveIt! -> MoveIt 2021-03-15 14:29:19 +01:00
v4hn
3d8faea079 add test to validate correct solution state in computeCost
This is somewhat cumbersome because of the additional internal/external
layer introduced through the container.
But it's still better than leaving this unverified.
2021-03-05 14:38:29 +01:00
v4hn
f4fb8c6f71 fix computeCost interface (again)
Fixes the missing creator pointer introduced in a6a23d3775
2021-03-05 14:38:23 +01:00
v4hn
f7a94956c3 output stream formatting for InterfaceState::Priority 2021-03-05 14:38:06 +01:00
Robert Haschke
a6fa45214f Remove return value from Container::insert
adapted Container::add

Logical consequence of removing the ROS_ERROR output in `setParent`
2021-02-24 12:22:38 +01:00
v4hn
4386d0cc60 remove roscpp as an export dependency for the core package
We do use ROS in the background. But there is no need for a public export dependency on it.

This patch also resolves the following catkin_lint issue:

moveit_task_constructor_core: CMakeLists.txt(17): error: package 'roscpp' must be in CATKIN_DEPENDS in catkin_package()
2021-02-24 12:22:38 +01:00
Robert Haschke
9f18219993 minor cleanups
* unify usage of pimpl()
* fix StatePair constructors
* improve/add comments
* test_container: reset MOCK_ID for each test to facilitate identification of stages
2020-12-06 23:55:58 +01:00
Robert Haschke
0925031a81 Propagating: disable infeasible state pruning
Because stages might get re-enabled later, we must not throw them away.
Remove dropFailedStarts(), dropFailedEnds().
Extend Pruning unittest.
2020-12-06 23:55:10 +01:00
Robert Haschke
a6a23d3775 Remove set[Start|End]StateUnsafe
These methods were introduced to temporarily set meaningful states for cost calculation
w/o connecting the solution to these temporary states (to solve a chicken-egg problem).
This commit provides TmpInterfaceStateProvider as an alternative approach to this problem.

This essentially reverts 53c0964618.
2020-12-06 04:11:35 +01:00
Robert Haschke
c8e75ab205 Simplify SolutionCollector 2020-12-06 04:11:35 +01:00
Robert Haschke
576a1aa48d Remove default constructor for Priority
It's better to explicitly state the initial value.
2020-12-06 04:11:35 +01:00
Robert Haschke
56ad37d80e Provide move constructor for InterfaceState
The code was tuned to move InterfaceStates around, but there wasn't the matching constructor!
2020-12-06 04:11:35 +01:00
Robert Haschke
f05b08fa8a SerialContainer: Simplify solution traversal
Compute depth + accumulated cost of a partial solution sequence using InterfaceState::Priority.
2020-12-06 04:09:59 +01:00
Robert Haschke
08dc19f7b3 Fix cost calculation
The default CostTerm should rely on precomputed costs. Only, if a CostTerm is explicitly defined
for a particular stage, it should modify costs.
2020-12-06 04:06:08 +01:00
Robert Haschke
b2adcf0247 Python3 compatibility 2020-11-30 13:34:33 +01:00
Robert Haschke
c97b462024 migration: boost::python -> pybind11 2020-11-30 13:34:33 +01:00
Robert Haschke
8433e460e4 Merge branch 'master' into wip-python-api 2020-11-26 12:05:03 +01:00
Robert Haschke
8b1c66c4b7 Allow naming a Task
which just names the top-level container
2020-10-24 04:43:30 +02:00
Robert Haschke
b071a059f9 Rename TaskPrivate::id -> TaskPrivate::ns
TaskPrivate's id_ actually served as a namespace parameter.
2020-10-24 04:43:30 +02:00
Jafar Abdi
be270cb574
Task: Add ability to set timeout (#213)
Task::setTimeout will allow setting an overall timeout.
2020-10-24 03:22:05 +02:00
Robert Haschke
4089d5eefa Container::remove(): return removed Stage 2020-09-22 10:56:11 +02:00
Robert Haschke
687fcb6a6d Update comments to solution's computeCost() methods 2020-09-21 22:52:19 +02:00
v4hn
62586c2688 rework CostTerm's from support flags to vtable
requested in review.

Without support for custom aggregators, which we dropped again
after finding more flaws with it, I agree that this is the nicer solution.

On the downside, it converts the interfaces from copyable objects
to another round of shared_ptrs.

I added shortcuts for lambda costs to keep support for
`stage->setCostTerm([](auto&& s){ return 42; })`
without the additional
`stage->setCostTerm(LambdaCostTerm{ [](auto&& s){ return 42; } } )`
2020-09-21 22:52:19 +02:00
v4hn
45e6cdb47d Revert "add CostAggregator for SerialContainer"
This reverts commit dc7ce9bdfac97eb468f5a850adcb27cc118b5fd7.

It turns out multiple places in SerialContainer's cost inference
expect 0.0 as the neutral element (which is why std::min and multiply did not work).
While these additional issues can be fixed, it would make the interface much less elegant.

We should consider adding it back if an actual use-case is there to discuss.
2020-09-21 22:52:19 +02:00
v4hn
cce7380f9d Clearance: provide better interface for different modes
Interface::Direction should always designate a valid direction.
2020-09-21 22:52:19 +02:00
v4hn
f63d5b6892 Make transform in cost::Clearance configurable
In theory this can be done with a PassThrough with a modifying transform,
but this specific mapping is intrinsic to the definition of Clearance as a cost.
2020-09-21 22:52:19 +02:00
v4hn
cdc7cb04fc refactor Forward -> PassThrough
based on review feedback
2020-09-21 22:52:19 +02:00