def run(modules, args): #set up nodes node = cauv.node.Node('pybatmon', args) try: #set up loggers slow_logger = slowLogger(filename=log_file, frequency=2, node=node, modules=modules) slow_logger.load_from_file() slow_logger.run() finally: node.stop()
-self.location.depth) r.speed = messaging.floatXYZ(self.speed.x, self.speed.y, self.speed.z) return r if __name__ == '__main__': parser = argparse.ArgumentParser( usage='usage: %prog -m simple|exponential') parser.add_argument( "-m", "--mode", dest="mode", default="simple", help="integration mode: 'simple' or 'exponential' see" + "displacement_integrator.py for exponential integrator constants") opts, args = parser.parse_known_args() node = cauv.node.Node('py-dspl', args) try: auv = control.AUV(node) d = Location(node, opts.mode) while True: time.sleep(3) ll = d.getLocation() info('%s : %s' % (d.location, ll)) node.send( messaging.LocationMessage(ll.location, messaging.floatXYZ(0, 0, 0))) finally: node.stop()