Esempio n. 1
0
	def __init__(self, comPort, moIP, moPort, mtPort, delay):
		Thread.__init__(self)
		self.udpMavlink = mavlink.MAVLink(0)
		self.serialMavlink = mavlink.MAVLink(0)
		self.udpRx = []
		self.serialRx = None
		self.ipLock = Lock()
		self.serialLock = Lock()
		self.ipTransport = None
		self.status = SatcomStatus.idle
		self.serialTime = 0
		self.delay = delay
		self.terminate = False
		# serial interface to PX4
		self.serialInterface = SerialPort(PX4UartInterface(self.receivedPX4), comPort, reactor, baudrate = 115200)
		self.serialInterface.flushInput()
		self.serialInterface.flushOutput()
		# enpoint for sending MO messages from PX to the relay
		self.relayMoEndpoint = TCP4ClientEndpoint(reactor, moIP, moPort)
		# enpoint receiving MT messages coming from the relay
		self.relayMtEndpoint = TCP4ServerEndpoint(reactor, mtPort)
		self.relayMtEndpoint.listen(relay.IridiumMtReceiverFactory(self.receivedRelay))
Esempio n. 2
0
	def __init__(self):
		# endpoint sending MT messages to the Iridium gateway
		self.mtIridiumEndpoint = TCP4ClientEndpoint(reactor, 'localhost', 10800)

		# enpoint receiving MO messages coming from the Iridium network
		iridiumServerEndpoint = TCP4ServerEndpoint(reactor, 34567)
		iridiumServerEndpoint.listen(IridiumMoReceiverFactory(self.moMsgCallback))

		# interface to QGC
		#self.qgcInterface = reactor.listenUDP(0, QgcUdpProtocol(self.mtMsgCallback))
		qgcInterfaceEndpoint = TCP4ServerEndpoint(reactor, 34568)
		self.qgcInterface = QgcTcpFactory(self.mtMsgCallback)
		qgcInterfaceEndpoint.listen(self.qgcInterface)

		self.mav = mavlink.MAVLink(0)
Esempio n. 3
0
import tornado.web
import tornado.ioloop
import tornado.httpclient
import tornado.httputil
import serial
from enum import Enum
from pymavlink import mavlink
import configparser
import time
import random

ideal_sim = True
fraction_good_signal = 1.0

MAV = mavlink.MAVLink(0)


def printmsg(direction, data):
    m = None
    try:
        m = MAV.parse_buffer(data)
    except:
        pass
    if m is not None:
        for msg in m:
            print('%s MAV MSG %3d %s' %
                  (direction, msg.get_msgId(), msg.get_type()))
            #if (msg.get_msgId() == 76):
            print(msg)
Esempio n. 4
0
	def __init__(self, msgRcvCallback):
		self.setRawMode()
		self.parseState = ParseState.start
		self.satcomMsg = SatcomMessage()
		self.msgCallback = msgRcvCallback
		self.mav = mavlink.MAVLink(0)