I request 1 time per second a message about the position of the RC_CHANNELS, but recv_match gives me outdated messages (see time_boot)
I know that if I constantly make requests everything will be fine, but I want to handle the case when the data stops being synchronized, how can I fix it? Dirty solution to reconnect via mavutil.mavlink_connection but maybe there is a better solution?
import time from pymavlink import mavutil master = mavutil.mavlink_connection('/dev/serial0', baud=921600) master.wait_heartbeat() while True: message = master.recv_match(type='RC_CHANNELS', blocking=True).to_dict() print('time_boot sec:',message['time_boot_ms']/1000, message) time.sleep(1)#1sec sleep print()
any advice would be greatly appreciated)