I am trying to send custom status text to my SITL application(it is standard simulation basen od sim_vehicle.py)
I am tryging to send simple message from pymavlink to MAVProxy command window.
autopilot.mav.statustext_send(6, 'D06DDDDDDDDDDDDD', force_mavlink1=False)
But it doesn’t do anything. There is no any effect.
So i tried to checkout how that frame looks like when using QGC. When i arm copter in QGC it shows
APM: Arming motors in MAVProxy.
I have sniff UDP package using https://askubuntu.com/questions/913393/sniff-udp-packets-on-a-local-port
it looks like, despite of fact no information my text wasn’t show. I can see that(https://mavlink.io/en/protocol/overview.html) my sysid and compid looks different ( 255 0 instead of 1 1 ). So i manually change ardupilotmega class MAVLink_statustext_message. I forced it to to be 1 and 1 .
class MAVLink_statustext_message(MAVLink_message): ''' Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz). ''' id = MAVLINK_MSG_ID_STATUSTEXT name = 'STATUSTEXT' fieldnames = ['severity', 'text'] ordered_fieldnames = [ 'severity', 'text' ] format = '<B50s' native_format = bytearray('<Bc', 'ascii') orders = [0, 1] lengths = [1, 1] array_lengths = [0, 50] crc_extra = 83 def __init__(self, severity, text): MAVLink_message.__init__(self, MAVLink_statustext_message.id, MAVLink_statustext_message.name) self._fieldnames = MAVLink_statustext_message.fieldnames self.severity = severity self.text = text def pack(self, mav, force_mavlink1=False): mav_copy=mav mav_copy.srcSystem=1 mav_copy.srcComponent=1 return MAVLink_message.pack(self, mav_copy, 83, struct.pack('<B50s', self.severity, self.text), force_mavlink1=force_mavlink1)
now my message looks like
But It doesn’t effect. I would like to ask if i should MAVProxy to printout custom mesasges? Or change something in my code? Maybe i should change variable srcSystem or srcComponent to another? Or there is some mistakes in char encoding?
Thanks for any help