From a985e9a6cf2dd9088414849c5c949ed62dca27cc Mon Sep 17 00:00:00 2001 From: Tim Tuxworth Date: Wed, 8 Oct 2025 13:10:17 -0600 Subject: [PATCH 1/8] Create 0017-fence-altitude.ms Proposal for adding minimum and maximum altitude to fences. --- text/0017-fence-altitude.ms | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 text/0017-fence-altitude.ms diff --git a/text/0017-fence-altitude.ms b/text/0017-fence-altitude.ms new file mode 100644 index 0000000..1c4f750 --- /dev/null +++ b/text/0017-fence-altitude.ms @@ -0,0 +1,40 @@ +Start date: 2025-10-08 +Contributors: Tim Tuxworth +RFC PR: mavlink/rfcs#17 + +# Summary + +Allow polygon and circle fences to include minimum and maximum altitude in a specified frame + +# Motivation + +With new (as at 2025) regulations coming into force for BVLOS flying requiring Detect and Avoid capabilites, drones must be capable of flying within regulated airspaces +which are typically specified as horizontal limits with altitude boundaries, and avoiding known fixed obstacles such as cell towers, buidlings or electrical power lines, +which have a limited specific height. + +# Detailed Design + +Existing messages for fence items will use existing unused parameters for minimum and maximum altitude and a single parameter for example: + +MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION (5001) + +Param (Label) Description Values +1 (Vertex Count) Polygon vertex count. This is the number of vertices in the current polygon (all vertices will have the same number). min: 3 inc: 1 +2 (Inclusion Group) Vehicle must be inside ALL inclusion zones in a single group, vehicle must be inside at least one group, must be the same for all points in each polygon min: 0 inc: 1 +3 (Minimum Altitude) Minimum altitude for the fence. NaN for "does not apply", aka all the way to the ground. Frame according to param 7 +4 (Maximum Altitude) Maximum altitude for the fence. NaN for "infinite". +5 (Latitude) Latitude +6 (Longitude) Longitude +7 (Frame) The MAV_FRAME to use for both minimum and maximum altitudes. Applies to both. + +For consistencey, in all related MAV_CMD_NAV_FENCE_POLYGON and CIRCLE messages. param 3 will be minimum altitude, param 4 will be maximum altitude and param 7 will be frame. + +Accomodating different frames for minimum and maximum altitudes will be accomodated by using vertically overlapping fences each with their own min/max alt frames. +By including these overlapping fences in the same fence group, a composite airspace can be described using different altitude frames. + +# Alternatives + +Create a new fence item type that records minimum altitude and maximum altitde with a different frame allowed for minimum and maximum (a real world use case). This would require each horizontal limited +fence to be matched with "altitude limit" fence items. This would be challenging for GCS to implement. + +Add new values to fence items to allow for another frame type value to be added, to allow for a minimum fence to have a differnt frame (e.g. AGL) from the maximum altitude frame which might be AMSL. From f49b5ab92b448db1d09a3aaa124d39a86f6b5031 Mon Sep 17 00:00:00 2001 From: Tim Tuxworth Date: Mon, 13 Oct 2025 19:09:36 -0600 Subject: [PATCH 2/8] Update 0017-fence-altitude.ms Add a reference to TC regulations for containment --- text/0017-fence-altitude.ms | 2 ++ 1 file changed, 2 insertions(+) diff --git a/text/0017-fence-altitude.ms b/text/0017-fence-altitude.ms index 1c4f750..0e32356 100644 --- a/text/0017-fence-altitude.ms +++ b/text/0017-fence-altitude.ms @@ -12,6 +12,8 @@ With new (as at 2025) regulations coming into force for BVLOS flying requiring D which are typically specified as horizontal limits with altitude boundaries, and avoiding known fixed obstacles such as cell towers, buidlings or electrical power lines, which have a limited specific height. +The regulations refere to Transport Canada Standard 922, and in particular 922-008 Containment, which can be found here https://tc.canada.ca/en/corporate-services/acts-regulations/list-regulations/canadian-aviation-regulations-sor-96-433/standards/standard-922-rpas-safety-assurance + # Detailed Design Existing messages for fence items will use existing unused parameters for minimum and maximum altitude and a single parameter for example: From e4288f1566c58da1d7b4c5b7504f2e83d044f250 Mon Sep 17 00:00:00 2001 From: Tim Tuxworth Date: Mon, 13 Oct 2025 19:12:37 -0600 Subject: [PATCH 3/8] Update 0017-fence-altitude.ms Fixed the link to the TC standard 922 --- text/0017-fence-altitude.ms | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/text/0017-fence-altitude.ms b/text/0017-fence-altitude.ms index 0e32356..c8589aa 100644 --- a/text/0017-fence-altitude.ms +++ b/text/0017-fence-altitude.ms @@ -12,7 +12,8 @@ With new (as at 2025) regulations coming into force for BVLOS flying requiring D which are typically specified as horizontal limits with altitude boundaries, and avoiding known fixed obstacles such as cell towers, buidlings or electrical power lines, which have a limited specific height. -The regulations refere to Transport Canada Standard 922, and in particular 922-008 Containment, which can be found here https://tc.canada.ca/en/corporate-services/acts-regulations/list-regulations/canadian-aviation-regulations-sor-96-433/standards/standard-922-rpas-safety-assurance +The regulations refere to [Transport Canada Standard 922](https://tc.canada.ca/en/corporate-services/acts-regulations/list-regulations/canadian-aviation-regulations-sor-96-433/standards/standard-922-rpas-safety-assurance +), and in particular 922-008 Containment. # Detailed Design From 4748c6b9cb2b1d79cf7ed67524bf093ea45e155d Mon Sep 17 00:00:00 2001 From: Tim Tuxworth Date: Mon, 13 Oct 2025 19:14:08 -0600 Subject: [PATCH 4/8] Update 0017-fence-altitude.ms I guess I should mention it's Canadian regulations --- text/0017-fence-altitude.ms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text/0017-fence-altitude.ms b/text/0017-fence-altitude.ms index c8589aa..1f1b495 100644 --- a/text/0017-fence-altitude.ms +++ b/text/0017-fence-altitude.ms @@ -8,7 +8,7 @@ Allow polygon and circle fences to include minimum and maximum altitude in a spe # Motivation -With new (as at 2025) regulations coming into force for BVLOS flying requiring Detect and Avoid capabilites, drones must be capable of flying within regulated airspaces +With new (as at 2025) regulations coming into force for BVLOS flying in Canada, requiring Detect and Avoid capabilites, drones must be capable of flying within regulated airspaces which are typically specified as horizontal limits with altitude boundaries, and avoiding known fixed obstacles such as cell towers, buidlings or electrical power lines, which have a limited specific height. From 85ad064101e92eeffd439c36d3af8f30f98de1d8 Mon Sep 17 00:00:00 2001 From: Tim Tuxworth Date: Thu, 16 Oct 2025 12:42:38 -0600 Subject: [PATCH 5/8] Update text/0017-fence-altitude.ms Improve clarity. Co-authored-by: Hamish Willee --- text/0017-fence-altitude.ms | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/text/0017-fence-altitude.ms b/text/0017-fence-altitude.ms index 1f1b495..759c58e 100644 --- a/text/0017-fence-altitude.ms +++ b/text/0017-fence-altitude.ms @@ -17,7 +17,8 @@ The regulations refere to [Transport Canada Standard 922](https://tc.canada.ca/e # Detailed Design -Existing messages for fence items will use existing unused parameters for minimum and maximum altitude and a single parameter for example: +Existing messages for fence items will use existing unused parameters for minimum and maximum altitude and a single parameter for the frame. +For example: MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION (5001) From a65c9aadf10bf3032c5502bf9f60b8377bdbb471 Mon Sep 17 00:00:00 2001 From: Tim Tuxworth Date: Thu, 16 Oct 2025 17:28:32 -0600 Subject: [PATCH 6/8] Rename 0017-fence-altitude.ms to 0017-fence-altitude.md --- text/{0017-fence-altitude.ms => 0017-fence-altitude.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename text/{0017-fence-altitude.ms => 0017-fence-altitude.md} (100%) diff --git a/text/0017-fence-altitude.ms b/text/0017-fence-altitude.md similarity index 100% rename from text/0017-fence-altitude.ms rename to text/0017-fence-altitude.md From daf202a53642a31707ac75d7159031b2f070b35f Mon Sep 17 00:00:00 2001 From: Hamish Willee Date: Wed, 5 Nov 2025 15:33:04 +1100 Subject: [PATCH 7/8] Tidy up description --- text/0017-fence-altitude.md | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/text/0017-fence-altitude.md b/text/0017-fence-altitude.md index 759c58e..6beda74 100644 --- a/text/0017-fence-altitude.md +++ b/text/0017-fence-altitude.md @@ -8,12 +8,9 @@ Allow polygon and circle fences to include minimum and maximum altitude in a spe # Motivation -With new (as at 2025) regulations coming into force for BVLOS flying in Canada, requiring Detect and Avoid capabilites, drones must be capable of flying within regulated airspaces -which are typically specified as horizontal limits with altitude boundaries, and avoiding known fixed obstacles such as cell towers, buidlings or electrical power lines, -which have a limited specific height. +With new (as at 2025) regulations coming into force for BVLOS flying in Canada, requiring Detect and Avoid capabilities, drones must be capable of flying within regulated airspaces which are typically specified as horizontal limits with altitude boundaries, and avoiding known fixed obstacles such as cell towers, buildings or electrical power lines, which have a limited specific height. -The regulations refere to [Transport Canada Standard 922](https://tc.canada.ca/en/corporate-services/acts-regulations/list-regulations/canadian-aviation-regulations-sor-96-433/standards/standard-922-rpas-safety-assurance -), and in particular 922-008 Containment. +The regulations refer to [Transport Canada Standard 922](https://tc.canada.ca/en/corporate-services/acts-regulations/list-regulations/canadian-aviation-regulations-sor-96-433/standards/standard-922-rpas-safety-assurance), and in particular 922-008 Containment. # Detailed Design @@ -22,23 +19,21 @@ For example: MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION (5001) -Param (Label) Description Values -1 (Vertex Count) Polygon vertex count. This is the number of vertices in the current polygon (all vertices will have the same number). min: 3 inc: 1 -2 (Inclusion Group) Vehicle must be inside ALL inclusion zones in a single group, vehicle must be inside at least one group, must be the same for all points in each polygon min: 0 inc: 1 -3 (Minimum Altitude) Minimum altitude for the fence. NaN for "does not apply", aka all the way to the ground. Frame according to param 7 -4 (Maximum Altitude) Maximum altitude for the fence. NaN for "infinite". -5 (Latitude) Latitude -6 (Longitude) Longitude -7 (Frame) The MAV_FRAME to use for both minimum and maximum altitudes. Applies to both. +Param (Label) | Description | Values +--- | --- | --- +1 (Vertex Count) | Polygon vertex count. Number of vertices in the current polygon (all vertices will have the same number). | min: 3 inc: 1 +2 (Inclusion Group) | Vehicle must be inside ALL inclusion zones in a single group, vehicle must be inside at least one group, must be the same for all points in each polygon | min: 0 inc: 1 +3 (Min Altitude) | Minimum altitude for the fence. | NaN for "does not apply" (all the way to the ground). Frame according to MISSION_ITEM_INT.frame by default and param4 if defined. | +4 (Frame) | The MAV_FRAME to use for Min Altitude (param3) if the default is not used | MAV_FRAME_GLOBAL is default frame. | +5 (Latitude) | Latitude | +6 (Longitude) | Longitude | +7 (Max Altitude) | Maximum altitude for the fence. Frame defined by MISSION_ITEM_INT.frame | NaN for "infinite" (or max=min=0) -For consistencey, in all related MAV_CMD_NAV_FENCE_POLYGON and CIRCLE messages. param 3 will be minimum altitude, param 4 will be maximum altitude and param 7 will be frame. - -Accomodating different frames for minimum and maximum altitudes will be accomodated by using vertically overlapping fences each with their own min/max alt frames. -By including these overlapping fences in the same fence group, a composite airspace can be described using different altitude frames. +For consistency, in all MAV*CMD_NAV_FENCE* messages: param 3 will be minimum altitude, param 7 will be maximum altitude. The default frame for both with be defined in MISSION_ITEM_INT.frame. If param3 and param4 have different frames then param 4 will define the frame for the minimum altitude (param 3). # Alternatives -Create a new fence item type that records minimum altitude and maximum altitde with a different frame allowed for minimum and maximum (a real world use case). This would require each horizontal limited +Create a new fence item type that records minimum altitude and maximum altitude with a different frame allowed for minimum and maximum (a real world use case). This would require each horizontal limited fence to be matched with "altitude limit" fence items. This would be challenging for GCS to implement. -Add new values to fence items to allow for another frame type value to be added, to allow for a minimum fence to have a differnt frame (e.g. AGL) from the maximum altitude frame which might be AMSL. +Add new values to fence items to allow for another frame type value to be added, to allow for a minimum fence to have a different frame (e.g. AGL) from the maximum altitude frame which might be AMSL. From 3cf81f156254ff7422c2e73cfc43dc509b6db728 Mon Sep 17 00:00:00 2001 From: Hamish Willee Date: Thu, 6 Nov 2025 08:54:23 +1100 Subject: [PATCH 8/8] Update text/0017-fence-altitude.md --- text/0017-fence-altitude.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/text/0017-fence-altitude.md b/text/0017-fence-altitude.md index 6beda74..052b169 100644 --- a/text/0017-fence-altitude.md +++ b/text/0017-fence-altitude.md @@ -37,3 +37,20 @@ Create a new fence item type that records minimum altitude and maximum altitude fence to be matched with "altitude limit" fence items. This would be challenging for GCS to implement. Add new values to fence items to allow for another frame type value to be added, to allow for a minimum fence to have a different frame (e.g. AGL) from the maximum altitude frame which might be AMSL. + +## Separate altitude setting command + +Use another command that allows the altitudes for the previous fence point to be set each fence, which might look like this: `MAV_CMD_NAV_FENCE_ALTITUDE`: + +Param (Label) | Description | Values +--- | --- | --- +1 (Max Altitude) | Maximum altitude for the fence. Frame defined by MISSION_ITEM_INT.frame | NaN for "infinite" (or max=min=0) +2 (Min Altitude) | Minimum altitude for the fence. | NaN for "does not apply" (all the way to the ground). Frame according to MISSION_ITEM_INT.frame by default and param3 if defined. | +3 (Frame) | The MAV_FRAME to use for Min Altitude (param3) if the default is not used | MAV_FRAME_GLOBAL is default frame. | + +The main advantage of such an approach is that it more safe. +- If altitudes are not understood on a fence definition a flight stack **should** reject the fence plan. +- With the current proposal an older flight stack will likely accept the command with altitude, but not act on it. This will be non-compliant, and potentially dangerous. + +The main disadvantage is that the the altitudes are separated from the point definition, and hence the FC must process multiple points to know how the fence behaves, and as a reader it is not so easy to work out what each point does. +