コード例 #1
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"
コード例 #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"
コード例 #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"
コード例 #4
0
    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" )
コード例 #5
0
ファイル: pprz_ground.py プロジェクト: lmhtz/drone-middleware
    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")
コード例 #6
0
ファイル: monitor.py プロジェクト: lmhtz/drone-middleware
    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()


コード例 #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()
コード例 #8
0
ファイル: test.py プロジェクト: lmhtz/drone-middleware
 def run(self):
     print "initializing sub, subscribing and running"
     dmw.init_sub()
     dmw.subscribe("telemetry", "position", "", print_rcvd_message)
     dmw.loop()
     print "exited run"
コード例 #9
0
ファイル: test.py プロジェクト: lmhtz/drone-middleware
 def run(self):
     print "initializing sub, subscribing and running"
     dmw.init_sub()
     dmw.subscribe( "telemetry", "position", "", print_rcvd_message ) 
     dmw.loop()
     print "exited run"