地理围栏
围栏是一个虚拟边界,用于定义机体可以在哪些地方行驶。 围栏可用于防止机体飞出遥控器的范围,或进入不安全或受限制的空域。
PX4提供了两个独立的机制来指定围栏:
- 一个是基本的“故障保护”地理围栏,定义了一个简单的圆柱体。
- More complicated geometries can be defined using a Geofence Plan (QGroundControl).
INFO
GeoFences apply in all modes, including both missions and manual flight.
故障保护地理围栏
The Geofence Failsafe defines a cylinder centered on the home position, with a specified maximum radius and altitude.
设置中还包括越界时的故障保护动作。 This may simply be a warning notification, but more commonly a vehicle will immediately Return to a safe location.
For more information see: Safety > Geofence Failsafe.
地理围栏规划
PX4 支持由多个圆形和多边形区域组成的复杂地理围栏边界,这些区域可以定义为包含(禁出)或排除(禁入)区域。
The Geofence is planned in QGroundControl alongside the mission and rally points.
Geofence planning is fully documented in Plan View > GeoFence (QGroundControl User Guide).
总结:
- Open QGroundControl > Plan View.
- Select the Plan Type radio button: Fence. This will display the GeoFence Editor.
- Select the Polygon Fence or Circular Fence button to add a basic fence of the desired type to the map. 这也在编辑器中增加了此类围栏的条目。
- 在地图上调整围栏的形状和位置。
- 围栏中心的圆点可以用来调整围栏的位置。
- 边界上的圆点可以用来调整半径。
- 角(顶点)上的圆点可以用来改变多边形的形状。 点击线段中间可以在两个顶点中添加新的顶点。
- Use the Geofence Editor to set a fence as an inclusion or exclusion, and to select a fence to edit (Edit radio button) or Delete (Del button).
- 可添加任意数量的围栏
- Once finished, click on the Upload button (top right) to send the fence (along with rally points and mission) to the vehicle.
- Set the breach action in the Geofence Failsafe.
INFO
Any geofence that does not include the Home position will be rejected by the flight controller and not uploaded. If the vehicle is flying, also any geofence that would immediately get breached after the upload is rejected.
INFO
PX4 implements the MAVLink Mission microservice, which includes support for GeoFences.