mirror of
https://github.com/moveit/moveit_task_constructor.git
synced 2025-11-04 14:49:57 +08:00
relax assertion
This commit is contained in:
parent
6cf0cbb4c9
commit
26f679bd8e
@ -304,8 +304,19 @@ struct SolutionCollector {
|
|||||||
SolutionCollector(size_t max_depth) : max_depth(max_depth) {}
|
SolutionCollector(size_t max_depth) : max_depth(max_depth) {}
|
||||||
|
|
||||||
void operator()(const SolutionSequence::container_type& trace, double cost) {
|
void operator()(const SolutionSequence::container_type& trace, double cost) {
|
||||||
// traced path should not extend past container boundaries
|
#ifndef NDEBUG
|
||||||
assert(trace.size() <= max_depth);
|
// Traced path should not extend past container boundaries, i.e. trace.size() <= max_depth
|
||||||
|
// However, as the Merging-Connect's solution may be composed of several subsolutions, we need to disregard those
|
||||||
|
size_t len = trace.size();
|
||||||
|
const StagePrivate* prev_creator = nullptr;
|
||||||
|
for (const auto& s : trace) {
|
||||||
|
if (s->creator() == prev_creator)
|
||||||
|
--len;
|
||||||
|
else
|
||||||
|
prev_creator = s->creator();
|
||||||
|
}
|
||||||
|
assert(len <= max_depth);
|
||||||
|
#endif
|
||||||
solutions.emplace_back(std::make_pair(trace, cost));
|
solutions.emplace_back(std::make_pair(trace, cost));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user