Skip to content

Commit c8c991a

Browse files
committed
async action set to idle by the parent
1 parent eccd4df commit c8c991a

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

src/controls/reactive_fallback.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,14 @@ NodeStatus ReactiveFallback::tick()
3838

3939
if (parent_prt_ != nullptr)
4040
{
41-
4241
parent_prt_->propagateHalt(child_index_);
4342
}
4443

4544
current_child_node->executeTick();
45+
4646
do
4747
{
4848
std::this_thread::sleep_for(std::chrono::milliseconds(10));
49-
5049
child_status = current_child_node->status();
5150

5251
} while (child_status == NodeStatus::IDLE);
@@ -68,11 +67,19 @@ NodeStatus ReactiveFallback::tick()
6867
case NodeStatus::FAILURE:
6968
{
7069
failure_count++;
70+
if (current_child_node->type() == NodeType::ACTION_ASYNC)
71+
{
72+
current_child_node->setStatus(NodeStatus::IDLE);
73+
}
7174
}break;
7275

7376
case NodeStatus::SUCCESS:
7477
{
7578
haltChildren(index+1);
79+
if (current_child_node->type() == NodeType::ACTION_ASYNC)
80+
{
81+
current_child_node->setStatus(NodeStatus::IDLE);
82+
}
7683
return NodeStatus::SUCCESS;
7784
}break;
7885

@@ -93,4 +100,3 @@ NodeStatus ReactiveFallback::tick()
93100
}
94101

95102
}
96-

src/controls/reactive_sequence.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,16 @@ NodeStatus ReactiveSequence::tick()
4141

4242
if (parent_prt_ != nullptr)
4343
{
44-
4544
parent_prt_->propagateHalt(child_index_);
4645
}
4746

4847
current_child_node->executeTick();
48+
4949
do
5050
{
5151
std::this_thread::sleep_for(std::chrono::milliseconds(10));
52-
5352
child_status = current_child_node->status();
53+
5454
} while (child_status == NodeStatus::IDLE);
5555
}
5656
else
@@ -71,11 +71,19 @@ NodeStatus ReactiveSequence::tick()
7171
case NodeStatus::FAILURE:
7272
{
7373
haltChildren(index+1);
74+
if (current_child_node->type() == NodeType::ACTION_ASYNC)
75+
{
76+
current_child_node->setStatus(NodeStatus::IDLE);
77+
}
7478
return NodeStatus::FAILURE;
7579
}
7680
case NodeStatus::SUCCESS:
7781
{
7882
success_count++;
83+
if (current_child_node->type() == NodeType::ACTION_ASYNC)
84+
{
85+
current_child_node->setStatus(NodeStatus::IDLE);
86+
}
7987
}break;
8088

8189
case NodeStatus::IDLE:
@@ -93,5 +101,4 @@ NodeStatus ReactiveSequence::tick()
93101
return NodeStatus::RUNNING;
94102
}
95103

96-
97104
}

0 commit comments

Comments
 (0)