def run(self):
        global aircraft_id

        dmw.init_sub()
        dmw.subscribe( "mavlink", "opaque", "ground%d"%( aircraft_id ), self.forward_message ) 
        dmw.loop()
        print "exited subscription thread"
Beispiel #2
0
    def run(self):
        global vehicle

        dmw.init_sub()
        dmw.subscribe( "pprz", "opaque", "ground%d"%( vehicle.ac_id ), self.forward_opaque ) 
        dmw.loop()
        print "exited subscription thread"
Beispiel #3
0
    def run(self):
        global aircraft_id

        dmw.init_sub()
        dmw.subscribe("mavlink", "opaque", "ground%d" % (aircraft_id),
                      self.forward_message)
        dmw.loop()
        print "exited subscription thread"
    def run(self):
        try:
            dmw.init_sub()
        except DmwException:
            pass

        dmw.subscribe( "mavlink", "opaque", self.aircraft_id, self.forward_opaque ) 
        dmw.subscribe( "vehicle", "heartbeat", self.aircraft_id, self.forward_heartbeat ) 
        dmw.subscribe( "vehicle", "position", self.aircraft_id, self.forward_position ) 
        dmw.loop()
        print( "exited subscription thread" )
Beispiel #5
0
    def run(self):
        try:
            dmw.init_sub()
        except DmwException:
            pass

        dmw.subscribe("pprz", "opaque", self.aircraft_id, self.forward_opaque)
        dmw.subscribe("vehicle", "heartbeat", self.aircraft_id,
                      self.forward_heartbeat)
        dmw.subscribe("vehicle", "position", self.aircraft_id,
                      self.forward_position)
        dmw.loop()
        print("exited subscription thread")
Beispiel #6
0
    if messageLookup.has_key( msgkey ):
        msg = messageLookup[ msgkey ]()
        msg.ParseFromString( message )
        print( "Contents: %s"%( msg ) )
    else:
        print( "Contents are unknown or opaque" )

if __name__ == "__main__":

    if len(sys.argv) < 2:
        print ("Must supply message subscription path: python monitor.py x[.y[.z]]")
        sys.exit(-1)

    sub = sys.argv[1]
    elems = sub.split(".")

    dmw.init()
    dmw.init_sub()
    if len(elems) == 3:
        dmw.subscribe( elems[0], elems[1], elems[2], print_message ) 
    elif len(elems) == 2:
        dmw.subscribe( elems[0], elems[1], "", print_message ) 
    elif len(elems) == 1:
        dmw.subscribe( elems[0], "", "", print_message ) 
    else:
        print ("Invalid subscription path %s"%( sub ) )
        sys.exit(-1)
    dmw.loop()


Beispiel #7
0
        msg = messageLookup[msgkey]()
        msg.ParseFromString(message)
        print("Contents: %s" % (msg))
    else:
        print("Contents are unknown or opaque")


if __name__ == "__main__":

    if len(sys.argv) < 2:
        print(
            "Must supply message subscription path: python monitor.py x[.y[.z]]"
        )
        sys.exit(-1)

    sub = sys.argv[1]
    elems = sub.split(".")

    dmw.init()
    dmw.init_sub()
    if len(elems) == 3:
        dmw.subscribe(elems[0], elems[1], elems[2], print_message)
    elif len(elems) == 2:
        dmw.subscribe(elems[0], elems[1], "", print_message)
    elif len(elems) == 1:
        dmw.subscribe(elems[0], "", "", print_message)
    else:
        print("Invalid subscription path %s" % (sub))
        sys.exit(-1)
    dmw.loop()
Beispiel #8
0
 def run(self):
     print "initializing sub, subscribing and running"
     dmw.init_sub()
     dmw.subscribe("telemetry", "position", "", print_rcvd_message)
     dmw.loop()
     print "exited run"
Beispiel #9
0
 def run(self):
     print "initializing sub, subscribing and running"
     dmw.init_sub()
     dmw.subscribe( "telemetry", "position", "", print_rcvd_message ) 
     dmw.loop()
     print "exited run"