I want to send MAV_CMD_NAV_WAYPOINT message using pymavlink and I’m using this code to send a message
hold = 0
Accept_Radius = 0
Pass_Radius = 0
Yaw = 0
Latitude = -35.3630204
Longitude = 149.1647351
Altitude = 20.0
Request all parameters
master.mav.command_long_send(
master.target_system,
master.target_component,
mavutil.mavlink.MAV_CMD_NAV_WAYPOINT,
0,
hold, Accept_Radius, Pass_Radius, Yaw, Latitude, Longitude, Altitude
)
but when i try to run this code, I’m getting Unsupported message error on console
eg - Got COMMAND_ACK: NAV_WAYPOINT: UNSUPPORTED
Sending NAV_WAYPOINT on GUIDED mode with COMMAND_LONG is unsupported.
Send a NAV_WAYPOINT command with the mission protocol.
Here is an example:
"""
Source: https://mavlink.io/en/messages/common.html#MISSION_ITEM_INT
https://mavlink.io/en/messages/common.html#MAV_FRAME
https://mavlink.io/en/messages/common.html#MAV_CMD_NAV_WAYPOINT
https://mavlink.io/en/messages/common.html#POSITION_TARGET_GLOBAL_INT
https://mavlink.io/en/messages/common.html#GLOBAL_POSITION_INT
"""
import time
import pymavlink.mavutil as utility
import pymavlink.dialects.v20.all as dialect
import geopy.distance
# define some target locations
TARGET_LOCATIONS = [
{
"latitude": -35.36130812,
"longitude": 149.16114736,
"altitude": 30
},
This file has been truncated. show original