|
|
|
=C=> in shorthand notation) to move to the
next state in your state machine.
If you want to use a CompletionTrans with your own state node,
you can call postStateCompletion() to post a completion event.
This method is inherited from the StateNode class. Writing
is equivalent to writingpostStateCompletion();
erouter->postEvent(EventBase::stateMachineEGID, (size_)this, EventBase::statusETID);
=S=<T>(v)=>
as an abbreviation for SignalTrans, where T is the datatype of the signal
and v is the signal value to check for.
class MyBehavior : public VisualRoutinesStateNode {
public:
enum proceedInstruction {
turnLeft,
turnRight,
straightAhead
};
MyBehavior() : VisualRoutinesStateNode("MyBehavior") {}
class DecideNode : public VisualRoutinesStateNode {
public:
DecideNode() : VisualRoutinesStateNode("DecideNode") {}
virtual void DoStart() {
...
if ( x < -10 ) {
postStateSignal<proceedInstruction>(turnLeft);
return;
}
else ... ...
}
};
virtual void setup() {
|
is equivalent to writingpostStateSignal<proceedInstruction>(turnLeft);
erouter->postEvent(DataEvent<proceedInstruction>(turnLeft, EventBase::stateMachineEGID, (size_t)this, EventBase::statusETID));
|
|
|