Skip to content
Snippets Groups Projects
Commit e4040baf authored by Andreas Rauschert's avatar Andreas Rauschert
Browse files

Merge branch '25-acts-are-not-started-with-autogenerated-engine' into 'main'

:beetle: Allow Acts and Events to trigger at different times

Closes #25

See merge request eclipse/openpass/openscenario1_engine!116
parents 5e0244f8 7f8a55dc
No related branches found
No related tags found
No related merge requests found
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
</Action> </Action>
<StartTrigger> <StartTrigger>
<ConditionGroup> <ConditionGroup>
<Condition name="NotAtStart" delay="0" conditionEdge="rising"> <Condition name="NotAtStart" delay="0" conditionEdge="none">
<ByValueCondition> <ByValueCondition>
<SimulationTimeCondition value="0" rule="greaterThan" /> <SimulationTimeCondition value="0" rule="greaterThan" />
</ByValueCondition> </ByValueCondition>
...@@ -148,9 +148,9 @@ ...@@ -148,9 +148,9 @@
</ManeuverGroup> </ManeuverGroup>
<StartTrigger> <StartTrigger>
<ConditionGroup> <ConditionGroup>
<Condition name="EndTime" delay="0" conditionEdge="rising"> <Condition name="FromStart" delay="0" conditionEdge="rising">
<ByValueCondition> <ByValueCondition>
<SimulationTimeCondition value="5.0" rule="greaterThan"/> <SimulationTimeCondition value="0.0" rule="greaterOrEqual" />
</ByValueCondition> </ByValueCondition>
</Condition> </Condition>
</ConditionGroup> </ConditionGroup>
......
...@@ -209,14 +209,14 @@ private: ...@@ -209,14 +209,14 @@ private:
///@brief tick as if no stop trigger would decorate the start trigger ///@brief tick as if no stop trigger would decorate the start trigger
void tickWithStartTrigger() void tickWithStartTrigger()
{ {
if (start_trigger_node_) if (start_trigger_node_ && start_trigger_status != NodeStatus::kSuccess)
{ {
const auto status = start_trigger_node_->executeTick(); start_trigger_status = start_trigger_node_->executeTick();
if (status == NodeStatus::kRunning) if (start_trigger_status == NodeStatus::kRunning)
{ {
return; return;
} }
if (status == NodeStatus::kFailure) if (start_trigger_status == NodeStatus::kFailure)
{ {
throw std::runtime_error("StartTrigger reported failure"); throw std::runtime_error("StartTrigger reported failure");
} }
...@@ -249,6 +249,7 @@ private: ...@@ -249,6 +249,7 @@ private:
return NodeStatus::kRunning; return NodeStatus::kRunning;
} }
NodeStatus start_trigger_status{NodeStatus::kIdle};
TransientNode::Ptr stop_trigger_node_{nullptr}; TransientNode::Ptr stop_trigger_node_{nullptr};
TransientNode::Ptr start_trigger_node_{nullptr}; TransientNode::Ptr start_trigger_node_{nullptr};
TransientNode::Ptr m_child_node{nullptr}; TransientNode::Ptr m_child_node{nullptr};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment