From 97c21304049348dead1ef8304e83f9dbe19fbd7a Mon Sep 17 00:00:00 2001 From: Robert Haschke Date: Fri, 19 Nov 2021 06:52:31 +0100 Subject: [PATCH] Improve readability --- core/src/stage.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/src/stage.cpp b/core/src/stage.cpp index 09eaf517..0de28926 100644 --- a/core/src/stage.cpp +++ b/core/src/stage.cpp @@ -722,9 +722,10 @@ void ConnectingPrivate::newState(Interface::iterator it, bool updated) { assert(it->priority().enabled()); // new solutions are feasible, aren't they? InterfacePtr other_interface = pullInterface(other); for (Interface::iterator oit = other_interface->begin(), oend = other_interface->end(); oit != oend; ++oit) { - // Don't re-enable states that are marked DISABLED if (static_cast(me_)->compatible(*it, *oit)) { - // re-enable the opposing state oit if its status is FAILED + // re-enable the opposing state oit if its status is FAILED, + // but don't re-enable states that are marked DISABLED + // https://github.com/ros-planning/moveit_task_constructor/pull/221 if (oit->priority().status() == InterfaceState::Status::FAILED) oit->owner()->updatePriority(&*oit, InterfaceState::Priority(oit->priority(), InterfaceState::Status::ENABLED)); @@ -742,9 +743,9 @@ void ConnectingPrivate::newState(Interface::iterator it, bool updated) { template inline bool ConnectingPrivate::hasPendingOpposites(const InterfaceState* source) const { for (const auto& candidate : this->pending) { - static_assert(Interface::FORWARD == 0, "This code assumes FORWARD=0, BACKWARD=1. Don't change their order!"); + static_assert(Interface::FORWARD == 0 && Interface::BACKWARD == 1, + "This code assumes FORWARD=0, BACKWARD=1. Don't change their order!"); const auto src = std::get(candidate); - static_assert(Interface::BACKWARD == 1, "This code assumes FORWARD=0, BACKWARD=1. Don't change their order!"); const auto tgt = std::get()>(candidate); if (&*src == source && tgt->priority().enabled())