+ p_float + c \ + p_float + c \ + p_float + c \ + p_float + c \ + p_float + c \ + p_float + c \ + p_float \ + r).streamline() p_PitchAutopilotParamsMessage.setParseAction(lambda x: messaging.PitchAutopilotParamsMessage(*x[0])) p_StateRequestMessage = pp.Group(l \ + r).streamline() p_ScriptMessage = pp.Group(l \ + p_ScriptExecRequest \ + r).streamline() p_ScriptMessage.setParseAction(lambda x: messaging.ScriptMessage(*x[0])) p_MotorRampRateMessage = pp.Group(l \ + p_int + c \ + p_int \ + r).streamline() p_MotorRampRateMessage.setParseAction(lambda x: messaging.MotorRampRateMessage(*x[0])) p_SetMotorMapMessage = pp.Group(l \ + p_MotorID + c \ + p_MotorMap \ + r).streamline() p_SetMotorMapMessage.setParseAction(lambda x: messaging.SetMotorMapMessage(*x[0])) p_ResetMCBMessage = pp.Group(l \ + r).streamline() p_ResetMCBMessage.setParseAction(lambda x: messaging.ResetMCBMessage(*x[0])) p_CalibrateNoRotationMessage = pp.Group(l \ + p_int \
#!/usr/bin/env python2.7 # # Copyright 2013 Cambridge Hydronautics Ltd. # # See license.txt for details. # import cauv import cauv.node as node import cauv.messaging as msg import time import sys class ScriptResponseObs(msg.BufferedMessageObserver): def onScriptResponseMessage(self, m): print '>>>', m.response n = node.Node("pyscript2", sys.argv[1:]) n.join("gui") n.addObserver(ScriptResponseObs()) n.send(msg.ScriptMessage("hello, python", 10.0), "control") n.send(msg.ScriptMessage("response('hello, python')", 10.0), "control") n.send(msg.ScriptMessage("import cauv.messaging as msg", 10.0), "control") n.send(msg.ScriptMessage("response(str(dir(msg)))", 10.0), "control") time.sleep(5)