Hi,
I’m trying to get the distance to waypoint using custom python code and pymavlink. I followed a tutorial where after sending the position_target_global_int message creates a while loop to filter with recv_match the NAV_CONTROLLER_OUTPUT but in my case, the recv_match with NAV_CONTROLLER_OUTPUT always returns None.
What can be the issue?
Thanks in advance for the help.
from pymavlink import mavutil
the_connection = mavutil.mavlink_connection('tcp:localhost:5762')
the_connection.wait_heartbeat()
print("Heartbeat from system (system %u component %u)" % (the_connection.target_system, the_connection.target_component))
the_connection.mav.send(mavutil.mavlink.MAVLink_set_position_target_global_int_message(10, the_connection.target_system, the_connection.target_component, mavutil.mavlink.MAV_FRAME_GLOBAL_RELATIVE_ALT, int(0b110111111000), int(41.2763083 * 10 ** 7), int(1.9884215 * 10 ** 7), 20, 0, 0, 0, 0, 0, 0, 0, 0))
while 1:
msg = the_connection.recv_match(type='NAV_CONTROLLER_OUTPUT', blocking=True)
print(msg)