My goal is to get the Bebop2 drone to follow a flight plan in Sphinx. Right now I can’t figure out how to export a flight plan as a mavlink file (see final comment on this question). In the FreeFlight app I have paid for the flight plan feature, created a flight plan and saved it locally, but cant find a way to export the flight plan to my PC.
I need it on my PC so that I can upload it to the drone using an FTP connection (see question). Right now, I am running FreeFlight on my iPad. The only solution I can think of is using FreeFlight on an android system so that I can access the entire file system and extract the flight plan that way? Is there an easier option that I am overlooking?
Have you tried to connect to the drone web server http://10.202.0.1/ for a simulated drone or http://192.168.42.1 for a physical drone ?
There is a Flightplan tab from which you can upload and download your mavlink files.
The Web server only runs on Anafi. For Bebop 2, you can use curl to transfer your file. I am not familiar with bebop_autonomy but it seems that the data field should contain the name of the flight plan to execute:
The problem was with the content of my mavlink file. The short answer was that I had my latitude and longitude mixed up in the file and the drone would go into a pause state. (I assume this was because I was requesting a waypoint 100’s or 1000’s of km away).
In the Mavlink docs they describe <PARAM5/X/LONGITUDE> and <PARAM6/Y/LATITUDE> which is where my mistake originated.
Note: The <PARAM5> and <PARAM6> meanings are based on the <COMMAND> tag, and in all cases I have found they are <PARAM5/LATITUDE> and <PARAM6/LONGITUDE> which is the inverse of the Mavlink docs.
So for instance in our case we are sending waypoints, i.e. <COMMAND>==16 (See above mavlink file). The number 16 refers to a MAV_CMD_NAV_WAYPOINT message whose description can be found in the Mavlink Github Page as seen below:
<description>Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. See https://mavlink.io/en/guide/xml_schema.html#MAV_CMD for information about the structure of the MAV_CMD entries</description>
<entry value="16" name="MAV_CMD_NAV_WAYPOINT" hasLocation="true" isDestination="true">
<description>Navigate to waypoint.</description>
<param index="1" label="Hold" units="s" minValue="0">Hold time. (ignored by fixed wing, time to stay at waypoint for rotary wing)</param>
<param index="2" label="Accept Radius" units="m" minValue="0">Acceptance radius (if the sphere with this radius is hit, the waypoint counts as reached)</param>
<param index="3" label="Pass Radius" units="m">0 to pass through the WP, if > 0 radius to pass by WP. Positive value for clockwise orbit, negative value for counter-clockwise orbit. Allows trajectory control.</param>
<param index="4" label="Yaw" units="deg">Desired yaw angle at waypoint (rotary wing). NaN for unchanged.</param>
Here you can see that <PARAM5> and <PARAM6> are clearly latitude followed by longitude. This is also confirmed in the Mavlink Docs and Ardupilot Docs.