Hello everyone,
I am currently attempting to write a workaround for the FS_PILOT_TIMEOUT on the BlueROV2, which automatically disarms the ROV after a certain amount of seconds once it starts receiving ‘rc’ commands from the user. My aim is to prevent the ROV from automatically disarming itself.
The method I am using is to rapidly send MODE_MANUAL commands to the ROV, by calling mavutil.mavfile.set_mode_manual() at high frequencies. Unfortunately, the Pixhawk doesn’t appear to receive the command, and MAVProxy instead raises a RuntimeError(‘no write() method supplied’), which is thrown by mavutil.mavfile.write(). After examining the stack trace for the function, I discovered that the caller for write() is send(), located in the file pymavlink/dialects/v20/ardupilotmega.py. Surprisingly enough, the send() function doesn’t appear to include any command for sending commands to the Pixhawk:
def send(self, mavmsg, force_mavlink1=False):
'''send a MAVLink message'''
buf = mavmsg.pack(self, force_mavlink1=force_mavlink1)
self.file.write(buf) <<<<<<<<here's where mavutil.mavfile.write() is called
self.seq = (self.seq + 1) % 256
self.total_packets_sent += 1
self.total_bytes_sent += len(buf)
if self.send_callback:
self.send_callback(mavmsg, *self.send_callback_args, **self.send_callback_kwargs)
The full calling pattern is:
set_mode_manual() → command_long_send() → send() → write()
Even more surprising, I actually managed to use this technique successfully just last week, and the ROV was able to follow ‘rc’ commands without disarming, even with long intervals between each command.
Any insight would be appreciated. Thank you.