mirror of
https://github.com/moveit/moveit_task_constructor.git
synced 2025-11-04 14:49:57 +08:00
Pruning: Relax too strong assertion: PRUNED => !ARMED
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.
This commit is contained in:
parent
8d7225d3b6
commit
096c671887
@ -83,8 +83,9 @@ bool InterfaceState::Priority::operator<(const InterfaceState::Priority& other)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void InterfaceState::updatePriority(const InterfaceState::Priority& priority) {
|
void InterfaceState::updatePriority(const InterfaceState::Priority& priority) {
|
||||||
// Never overwrite ARMED with PRUNED: PRUNED => !ARMED
|
// Never overwrite ARMED with PRUNED
|
||||||
assert(priority.status() != InterfaceState::Status::PRUNED || priority_.status() != InterfaceState::Status::ARMED);
|
if (priority.status() == InterfaceState::Status::PRUNED && priority_.status() == InterfaceState::Status::ARMED)
|
||||||
|
return;
|
||||||
|
|
||||||
if (owner()) {
|
if (owner()) {
|
||||||
owner()->updatePriority(this, priority);
|
owner()->updatePriority(this, priority);
|
||||||
|
|||||||
@ -193,3 +193,17 @@ TEST_F(Pruning, PropagateFromParallelContainerMultiplePaths) {
|
|||||||
// the failure in one branch of Alternatives must not prune computing back
|
// the failure in one branch of Alternatives must not prune computing back
|
||||||
EXPECT_EQ(back->runs_, 1u);
|
EXPECT_EQ(back->runs_, 1u);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(Pruning, TwoConnects) {
|
||||||
|
add(t, new GeneratorMockup({ 0 }));
|
||||||
|
add(t, new ForwardMockup({ INF }));
|
||||||
|
add(t, new ConnectMockup());
|
||||||
|
|
||||||
|
add(t, new GeneratorMockup());
|
||||||
|
add(t, new ConnectMockup());
|
||||||
|
|
||||||
|
add(t, new GeneratorMockup());
|
||||||
|
add(t, new ForwardMockup());
|
||||||
|
|
||||||
|
EXPECT_FALSE(t.plan());
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user