Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MAV_FRAME_LOCAL_NED as a valid MAV_FRAME for mission item #23036

Open
vudala opened this issue Apr 20, 2024 · 0 comments
Open

Add MAV_FRAME_LOCAL_NED as a valid MAV_FRAME for mission item #23036

vudala opened this issue Apr 20, 2024 · 0 comments

Comments

@vudala
Copy link

vudala commented Apr 20, 2024

Problem description and how to reproduce

I am trying to plan a mission that uses local NED coordinates as waypoints.

I am creating mission items with MAV_FRAME_LOCAL_NED as MAV_FRAME for the MISSION_ITEM_INT, as defined by the MAVLink protocol:
https://mavlink.io/kr/messages/common.html#MISSION_ITEM_INT
https://mavlink.io/kr/messages/common.html#MAV_FRAME

Relevant code

Here's the relavant part of the MAVSDK code that I'm using to create the mission:

from mavsdk import System

drone = System()
await drone.connect(system_address="udp://:14540")

print("Waiting for drone to connect...")
async for state in drone.core.connection_state():
    if state.is_connected:
        print(f"-- Connected to drone!")
        break

mission_items = []
mission_items.append(mission_raw.MissionItem(
       0,     # start seq at 0
       1,     # MAV_FRAME_LOCAL_NED enum value
       16,    # MAV_CMD_NAV_WAYPOINT enum value
       1,
       1,
       0, 10, 0, float('nan'),
       50, 50, -30.0, # N, E, D
       0
   ))

print("-- Uploading mission")
await drone.mission_raw.upload_mission(mission_items)
print("-- Done")

However when I try to upload the mission, I get an error indicating that I have
invalid mission items.

mavsdk.mission_raw.MissionRawError: UNSUPPORTED: 'Unsupported'; origin: upload_mission(); params: ([<mavsdk.mission_raw.MissionItem object at 0x7b3ae853c5e0>],)

That happens because the mission item parser doesn't treat MAV_FRAME_LOCAL_NED as a supported frame.

Currently it's only possible to add waypoints to the mission using global coordinates, so it would be great to have the support for local coordinates during mission planning.

Solution

Add MAV_FRAME_LOCAL_NED as a supported frame for the mission items. The parser that doesn't recognize this frame as a valid one, is located in modules/mavlink/mavlink_mission.cpp named parse_mavlink_mission_item().

Possible alternatives

Add some other way of planning missions using local coordinates. Like adding MAV_FRAME_LOCAL_ENU or MAV_FRAME_LOCAL_OFFSET_NED as a supported frame.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant