Skip to content
Permalink
Browse files

logic: Reduced delays when combining TaskDecoratorRepeat and TaskSele…

…ctor
  • Loading branch information
egraether committed Nov 5, 2018
1 parent ddc37ae commit dfa6230ad6c98ed36c55f305489eed85966d51e6
@@ -28,7 +28,7 @@ Task::TaskState TaskDecoratorRepeat::doUpdate(std::shared_ptr<Blackboard> blackb
}
else if (state == Task::STATE_FAILURE)
{
state = m_exitState;
return m_exitState;
}
break;
}
@@ -1,6 +1,7 @@
#include "TaskGroupSelector.h"

TaskGroupSelector::TaskGroupSelector()
: m_taskIndex(0)
{
}

@@ -20,20 +21,21 @@ Task::TaskState TaskGroupSelector::doUpdate(std::shared_ptr<Blackboard> blackboa
{
return STATE_FAILURE;
}
else if (m_taskIndex < 0)
{
return STATE_SUCCESS;
}

TaskState state = m_taskRunners[m_taskIndex]->update(blackboard);

if (state == STATE_FAILURE)
{
m_taskIndex++;

if (m_taskIndex >= int(m_taskRunners.size()))
{
return STATE_FAILURE;
}
}
else if (state == STATE_SUCCESS)
{
m_taskIndex = -1;
return STATE_SUCCESS;
}
else if (state == STATE_HOLD)
{

0 comments on commit dfa6230

Please sign in to comment.
You can’t perform that action at this time.