本主题提供了无人机和使用 PX4 的基本介绍（主要面向新手用户，但对有经验的用户也是一个很好的介绍）。
无人机可被用于 消费级、工业级、政府、军工应用 (opens new window)。 这包括（非详尽）：航空摄影/录像，载货，竞速，搜索和测绘等。
Different types of drones are used for air, ground, sea, and underwater. 这些（更正式地）被称为无人驾驶飞行器（UAV），无人驾驶飞行器系统（UAS），无人驾驶地面车辆（UGV），无人驾驶水面船只（USV），无人驾驶水下潜航器（UUV）。
无人机的“大脑”被称为自动驾驶仪。 It consists of flight stack software running on vehicle controller ("flight controller") hardware.
Some drones also have a separate on-vehicle companion computer. These provide powerful general-purpose computing platform for networking, computer vision, and many other tasks.
# PX4 自动驾驶仪
PX4 (opens new window) is powerful open source autopilot flight stack.
- Controls many different vehicle frames/types, including: aircraft (multicopters, fixed-wing aircraft and VTOLs), ground vehicles and underwater vehicles.
- Robust and deep integration with companion computers and robotics APIs (ROS 2, MAVSDK (opens new window)).
Dronecode 地面控制站称为 QGC 地面站 (opens new window)。 You can use QGroundControl to load (flash) PX4 onto the vehicle control hardware, you can setup the vehicle, change different parameters, get real-time flight information and create and execute fully autonomous missions.
QGroundControl runs on Windows, Android, MacOS or Linux. 从这里 (opens new window)下载并安装。
PX4使用传感器确定机体状态（这是稳定和启动自动控制所必须的）。 The system minimally requires a gyroscope, accelerometer, magnetometer (compass) and barometer. GPS和其他定位系统是启用所有的自动模式以及部分辅助模式所必须的。 Fixed-wing and VTOL-vehicles should additionally include an airspeed sensor (very highly recommended).
PX4 uses outputs to control: motor speed (e.g. via ESC), flight surfaces like ailerons and flaps, camera triggers, parachutes, grippers, and many other types of payloads.
n 通常是从1到6或8)。 They might also be marked as
IO PWM Out and
FMU PWM OUT (or similar).
A flight controller may only have
MAIN PWM outputs (like the Pixhawk 4 Mini), or may have only 6 outputs on either
AUX. Ensure that you select a controller that has enough ports/outputs for your airframe.
You can connect almost any output to any motor or other actuator, by assigning the associated function ("Motor 1") to the desired output ("AUX1") in QGroundControl: Actuator Configuration and Testing. Note that the functions (motor and control surface actuator positions) for each frame are given in the Airframe Reference.
- Pixhawk controllers have an FMU board and may have a separate IO board. 如果有IO 板,
AUX端口直接连接到 FMU 和
- The FMU output ports can use D-shot or One-shot protocols (as well as PWM), which provide much lower-latency behaviour. 这对于竞速机和其他需要更好性能的机体来说是有用的。
AUX中仅有6-8个输出，因为大多数飞行控制器只有这么多的 PWM/Dshot/Oneshot 输出。 理论上来说，如果总线支持，可以有更多的输出（比如UAVCAN总线就不限于这几个节点）。
# 电调 & 电机
Many PX4 drones use brushless motors that are driven by the flight controller via an Electronic Speed Controller (ESC) (the ESC converts a signal from the flight controller to an appropriate level of power delivered to the motor).
有关 PX4 支持的电调和电机的信息，请参阅：
PX4无人机最常使用的是锂聚合物（LiPo）电池。 The battery is typically connected to the system using a Power Module or Power Management Board, which provide separate power for the flight controller and to the ESCs (for the motors).
# Manual Control
PX4 does not _require_ a manual control system for autonomous flight modes.
Both methods can be used for most manual control use cases, such as surveys. RC systems are recommended when first tuning/testing a new frame design or when flying racers/acrobatically (and in other cases where low latency is important).
Radio Control (RC) systems can be used to manually control PX4.
They consist of a ground based RC controller that uses a radio transmitter to communicate stick/control positions to a receiver on the vehicle. 一些遥控系统还可以额外接收自动驾驶仪传回的数传信息。
- Radio/Remote Control Setup - Remote control configuration in QGroundControl.
- Manual Flying - Learn how to fly with a remote control.
- FrSky 数传 - 设置遥控发射机以从 PX4 接收数传/状态更新。
A Joystick/Gamepad connected through QGroundControl can also be used to manually control PX4.
With this approach, QGroundControl translates stick/button information from a connected Joystick into MAVLink-protocol messages, which are then sent to PX4 using the shared telemetry radio link. The telemetry radio must have sufficient bandwidth for both manual control and other telemetry messages, and of course this approach means that you must have a ground station running QGroundControl.
Joysticks are also used to manually fly PX4 in a simulator.
Some vehicles have a safety switch that must be engaged before the vehicle can be armed (when armed, motors are powered and propellers can turn).
Data/Telemetry Radios can provide a wireless MAVLink connection between a ground control station like QGroundControl and a vehicle running PX4. 这使得在飞行过程中调整参数，实时监视遥测信息，更改任务等成为可能。
A Companion Computer (also referred to as "mission computer" or "offboard computer"), is a separate on-vehicle computer that communicates with PX4 to provide higher level command and control.
The companion computer usually runs Linux, as this is a much better platform for "general" software development, and allows drones to leverage pre-existing software for computer vision, networking, and so on.
The flight controller and companion computer may be pre-integrated into a single baseboard, simplifying hardware development, or may be separate, and are connected via a serial cable, Ethernet cable, or wifi. The companion computer typically communicates with PX4 using a high level Robotics API such as MAVSDK (opens new window) or ROS 2.
Relevant topics include:
默认情况下，如果没有 SD 卡，PX4 将在启动时播放 格式化失败（2-声短响） 两次（且上述需要储存卡的功能都不可用）。
Pixhawk 飞控板支持的最大 SD 卡大小为 32 GB 。 The SanDisk Extreme U3 32GB is highly recommended.
尽管如此，SD卡也只是可选的。 不包含 SD 卡槽的飞行控制器可以：
A vehicle is said to be armed when all motors and actuators are powered, and disarmed when nothing is powered. There is also a prearmed state when only actuators are powered.
Armed vehicles can be dangerous as propellors will be spinning.
Arming is triggered by default (on Mode 2 transmitters) by holding the RC throttle/yaw stick on the bottom right for one second (to disarm, hold stick on bottom left). 还可以使用遥控上的按钮来配置 PX4 解锁（也可以从地面站发送MAVLink解锁命令）。
To reduce accidents, vehicles should be armed as little as possible when the vehicle is on the ground. By default, vehicles are:
- Disarmed or Prearmed (motors unpowered) when not in use, and must be explicitly armed before taking off.
- Automatically disarm/prearm if the vehicle does not take off quickly enough after arming (the disarm time is configurable).
- Automatically disarm/prearm shortly after landing (the time is configurable).
- Arming is prevented if the vehicle has a safety switch that has not been engaged.
When prearmed you can still use actuators, while disarming unpowers everything. Prearmed and disarmed should both safe, and a particular vehicle may support either or both.
Sometimes a vehicle will not arm for reasons that are not obvious. QGC v4.2.0 (Daily build at time of writing) and later provide an arming check report in Fly View > Arming and Preflight Checks (opens new window). From PX4 v1.14 this provides comprehensive information about arming problems along with possible solutions.
Flight modes provide different types/levels of vehicle automation and autopilot assistance to the user (pilot). Autonomous modes are fully controlled by the autopilot, and require no pilot/remote control input. These are used, for example, to automate common tasks like takeoff, returning to the home position, and landing. Other autonomous modes execute pre-programmed missions, follow a GPS beacon, or accept commands from an offboard computer or ground station.
Manual modes are controlled by the user (via the RC control sticks/joystick) with assistance from the autopilot. Different manual modes enable different flight characteristics - for example, some modes enable acrobatic tricks, while others are impossible to flip and will hold position/course against wind.
Not all flight modes are available on all vehicle types, and some modes can only be used when specific conditions have been met (e.g. many modes require a global position estimate).
PX4 has configurable failsafe systems to protect and recover your vehicle if something goes wrong! These allow you to specify areas and conditions under which you can safely fly, and the action that will be performed if a failsafe is triggered (for example, landing, holding position, or returning to a specified point).
You can only specify the action for the first failsafe event. Once a failsafe occurs the system will enter special handling code, such that subsequent failsafe triggers are managed by separate system level and vehicle specific code.
The main failsafe areas are listed below:
- Low Battery
- Remote Control (RC) Loss
- Position Loss (global position estimate quality is too low).
- Offboard Loss (e.g. lose connection to companion computer)
- Data Link Loss (e.g. lose telemetry connection to GCS).
- Geofence Breach (restrict vehicle to flight within a virtual cylinder).
- Mission Failsafe (prevent a previous mission being run at a new takeoff location).
- Traffic avoidance (triggered by transponder data from e.g. ADSB transponders).
For more information see: Safety (Basic Configuration).
All the vehicles, boats and aircraft have a heading direction or an orientation based on their forward motion.
For a VTOL Tailsitter the heading is relative to the multirotor configuration (i.e. vehicle pose during takeoff, hovering, landing).
It is important to know the vehicle heading direction in order to align the autopilot with the vehicle vector of movement. Multicopters have a heading even when they are symmetrical from all sides! Usually manufacturers use a colored props or colored arms to indicate the heading.
In our illustrations we will use red coloring for the front propellers of multicopter to show heading.
You can read in depth about heading in Flight Controller Orientation