Hello
Trying to send GPS_Input via pymavlink and include yaw input
I made a sample script (enclosed) which sends the GPS_Input ( #232 ) and it works but without yaw.
If I add the last parameter, yaw, as outlined in ( #232 ) I am getting an error that there are too many parameters.
I am not sure what I am doing wrong, it seems that the script is using an older version of the gps_input instead of the Mavlink V2. I enforced the mavlink version 2 by adding a parameter in the connection opening function but it does not seem to help in using the correct function.
master = mavutil.mavlink_connection(f'udpin:192.168.53.215:9898', source_system=1)
and then:
def send_gps_data(lat, lon, alt, yaw, fix_type=3, satellites_visible=10):
msg = master.mav.gps_input_encode(
# msg = master.mav.gps_input(
0, # Timestamp (not used)
0, # GPS ID (not used)
0, # Ignore flags (not used)
3424,
23,
fix_type, # Fix type: 3 = 3D fix
int(lat * 1e7), # Latitude (scaled to 1e7)
int(lon * 1e7), # Longitude (scaled to 1e7)
alt, # Altitude in meters
0.1, 0.1,
0.01,0.01,0.1, #vn ve vd
0.001, 0.001, 0.001, #spac, hac, vac
satellites_visible # Number of visible satellites
# yaw * 1e2
)
master.mav.send(msg)
What should I do to have yaw included in the GPS_Input?
thank you