What is wrong about this FSM? It always remains in “Off” state.
from direct.fsm import FSM
class StateFSM(FSM.FSM):
def __init__(self, name):
FSM.FSM.__init__(self, name)
def filterWait(self, datatype, args):
print "filterWait"
if datatype == "distance" and args >= 60:
return "Wait"
else:
return None
def filterPursue(self, datatype, args):
if datatype == "distance" and args < 60:
return "Pursue"
else:
return None
def enterWait(self):
print "enterWait"
def exitWait(self):
print "exitWait"
def enterPursue(self):
print "enterPursue"
def exitPursue(self):
print "exitPursue"
I call it with:
stateFSM = StateFSM("stateFSM")
stateFSM.request("distance", 70)
but it doesn’t react…