Hello all,
I am trying to connect to UgCS through mavlink to simulate a vehicle.
In other other words, I have trying to bound socket / server connection to listen for GCS connections and then stream mavlink messages over that as soon as a client connects.
But I can't seem to connect to the right ports or use the right code to send a message through a port.
I have tried using mavutil.py:
self.master = mavutil.mavlink_connection( "udp:127.0.0.1:14550", source_system=1 )
self.master.mav = mavutil.mavlink.MAVLink(self.master, srcSystem=self.master.source_system, srcComponent=1)
msg = self.master.mav.heartbeat_encode( 0,0,0,0)
conn.send( msg.get_msgbuf())
but I get the error:
Traceback (most recent call last):
File "server.py", line 28, in <module>
conn.send( msg.get_msgbuf() )
File "/usr/local/lib/python2.7/dist-packages/pymavlink/dialects/v10/ardupilotmega.py", line 91, in get_msgbuf
return bytearray(self._msgbuf)
TypeError: 'NoneType' object is not iterable
I don't know why it is trying to use ardupilotmega.py.
Does anyone know of any documentation on how to use pymavlink to connect to a port and send mavlink messages?
Thank you.