diff --git a/docs/zh/SUMMARY.md b/docs/zh/SUMMARY.md index e76cec75140..7264bc56c5d 100644 --- a/docs/zh/SUMMARY.md +++ b/docs/zh/SUMMARY.md @@ -211,6 +211,7 @@ - [ThePeach FCC-R1](flight_controller/thepeach_r1.md) - [AP-H743-R1](flight_controller/x-mav_ap-h743r1.md) - [VOLOLAND NarinFC-H7](flight_controller/vololand_narinfc_h7.md) + - [ZenFC H743](flight_controller/zenfc_h743.md) - [SIYI-UniFC-6-PICO](flight_controller/siyi-unifc-6-pico.md) - [Experimental Autopilots](flight_controller/autopilot_experimental.md) - [BeagleBone Blue](flight_controller/beaglebone_blue.md) @@ -335,6 +336,7 @@ - [Vertiq Motor/ESC Modules](peripherals/vertiq.md) - [VESC Project ESCs](peripherals/vesc.md) - [Zubax Telega ESCs](dronecan/zubax_telega.md) + - [Internal Combustion Engines](actuators/internal_combustion_engine.md) - [Manual Control](config/manual_control.md) - [Radio Control (RC)](getting_started/rc_transmitter_receiver.md) @@ -586,7 +588,6 @@ - [VehicleAttitudeSetpoint](msg_docs/VehicleAttitudeSetpoint.md) - [VehicleCommand](msg_docs/VehicleCommand.md) - [VehicleCommandAck](msg_docs/VehicleCommandAck.md) - - [VehicleControlMode](msg_docs/VehicleControlMode.md) - [VehicleGlobalPosition](msg_docs/VehicleGlobalPosition.md) - [VehicleLandDetected](msg_docs/VehicleLandDetected.md) - [VehicleLocalPosition](msg_docs/VehicleLocalPosition.md) @@ -605,6 +606,7 @@ - [EventV0](msg_docs/EventV0.md) - [HomePositionV0](msg_docs/HomePositionV0.md) - [HomePositionV1](msg_docs/HomePositionV1.md) + - [ManualControlSetpointV0](msg_docs/ManualControlSetpointV0.md) - [RegisterExtComponentReplyV0](msg_docs/RegisterExtComponentReplyV0.md) - [RegisterExtComponentRequestV0](msg_docs/RegisterExtComponentRequestV0.md) - [RegisterExtComponentRequestV1](msg_docs/RegisterExtComponentRequestV1.md) @@ -669,6 +671,7 @@ - [EstimatorStates](msg_docs/EstimatorStates.md) - [EstimatorStatus](msg_docs/EstimatorStatus.md) - [EstimatorStatusFlags](msg_docs/EstimatorStatusFlags.md) + - [ExternalGimbalManagerStatus](msg_docs/ExternalGimbalManagerStatus.md) - [FailsafeFlags](msg_docs/FailsafeFlags.md) - [FailureDetectorStatus](msg_docs/FailureDetectorStatus.md) - [FailureInjection](msg_docs/FailureInjection.md) @@ -678,6 +681,7 @@ - [FixedWingLateralGuidanceStatus](msg_docs/FixedWingLateralGuidanceStatus.md) - [FixedWingLateralStatus](msg_docs/FixedWingLateralStatus.md) - [FixedWingRunwayControl](msg_docs/FixedWingRunwayControl.md) + - [FixedWingTakeoffStatus](msg_docs/FixedWingTakeoffStatus.md) - [FlightPhaseEstimation](msg_docs/FlightPhaseEstimation.md) - [FollowTarget](msg_docs/FollowTarget.md) - [FollowTargetEstimator](msg_docs/FollowTargetEstimator.md) @@ -694,6 +698,7 @@ - [GimbalManagerInformation](msg_docs/GimbalManagerInformation.md) - [GimbalManagerSetAttitude](msg_docs/GimbalManagerSetAttitude.md) - [GimbalManagerSetManualControl](msg_docs/GimbalManagerSetManualControl.md) + - [GimbalManagerSetPitchyaw](msg_docs/GimbalManagerSetPitchyaw.md) - [GimbalManagerStatus](msg_docs/GimbalManagerStatus.md) - [GpioConfig](msg_docs/GpioConfig.md) - [GpioIn](msg_docs/GpioIn.md) @@ -758,6 +763,7 @@ - [PowerMonitor](msg_docs/PowerMonitor.md) - [PpsCapture](msg_docs/PpsCapture.md) - [PrecLandStatus](msg_docs/PrecLandStatus.md) + - [PrecTakeoffStatus](msg_docs/PrecTakeoffStatus.md) - [PurePursuitStatus](msg_docs/PurePursuitStatus.md) - [PwmInput](msg_docs/PwmInput.md) - [Px4ioStatus](msg_docs/Px4ioStatus.md) @@ -789,6 +795,8 @@ - [SensorCombined](msg_docs/SensorCombined.md) - [SensorCorrection](msg_docs/SensorCorrection.md) - [SensorGnssRelative](msg_docs/SensorGnssRelative.md) + - [SensorGnssRf](msg_docs/SensorGnssRf.md) + - [SensorGnssSpectrum](msg_docs/SensorGnssSpectrum.md) - [SensorGnssStatus](msg_docs/SensorGnssStatus.md) - [SensorGps](msg_docs/SensorGps.md) - [SensorGyro](msg_docs/SensorGyro.md) @@ -822,6 +830,7 @@ - [VehicleAcceleration](msg_docs/VehicleAcceleration.md) - [VehicleAirData](msg_docs/VehicleAirData.md) - [VehicleConstraints](msg_docs/VehicleConstraints.md) + - [VehicleControlMode](msg_docs/VehicleControlMode.md) - [VehicleImu](msg_docs/VehicleImu.md) - [VehicleImuStatus](msg_docs/VehicleImuStatus.md) - [VehicleLocalPositionSetpoint](msg_docs/VehicleLocalPositionSetpoint.md) @@ -934,8 +943,6 @@ - [FlightGear 仿真](sim_flightgear/index.md) - [FlightGear 机体](sim_flightgear/vehicles.md) - [用 FlightGear 进行多机仿真](sim_flightgear/multi_vehicle.md) - - [jMAVSim 模拟](sim_jmavsim/index.md) - - [使用 JMAVSim 进行多飞行器仿真](sim_jmavsim/multi_vehicle.md) - [JSBSim Simulation](sim_jsbsim/index.md) - [PteroSim Simulation](sim_pterosim/index.md) - [RotorPy Simulation](sim_rotorpy/index.md) @@ -994,6 +1001,8 @@ - [在 RPi 安装 ROS/MAVROS ](ros/raspberrypi_installation.md) - [外部位置估计(基于视觉/运动)](ros/external_position_estimation.md) +- [Security](security/index.md) + - [Community](contribute/index.md) - [开发者会议](contribute/dev_call.md) - [Maintainers](contribute/maintainers.md) diff --git a/docs/zh/actuators/index.md b/docs/zh/actuators/index.md index a60d1068894..2874ad5ec26 100644 --- a/docs/zh/actuators/index.md +++ b/docs/zh/actuators/index.md @@ -10,6 +10,8 @@ - [电调校准](../advanced_config/esc_calibration.md) — PWM 电调的校准 (DShot/CAN 电调/舵机不需要) 。 +- [Internal Combustion Engines](../actuators/internal_combustion_engine.md) — Petrol/nitro engines, including start/stop sequencing and idle RPM control. + ## 另见 - [外设](../peripherals/index.md) - 包括非核心执行器,如夹具, 降落伞等。 diff --git a/docs/zh/actuators/internal_combustion_engine.md b/docs/zh/actuators/internal_combustion_engine.md new file mode 100644 index 00000000000..6e63e2003da --- /dev/null +++ b/docs/zh/actuators/internal_combustion_engine.md @@ -0,0 +1,339 @@ +# Internal Combustion Engines (ICE) + +PX4 can operate a single spark-ignition internal combustion engine (ICE) — a petrol/nitro two- or four-stroke engine — as the propulsion system of a fixed-wing, VTOL, or helicopter vehicle. + +Unlike an electric motor, an engine cannot simply be commanded to a thrust value: it has to be _started_ (choke, ignition, electric starter), it can _die_ in flight and need restarting, and it must be kept above a minimum idle speed to keep running at all. +The [`internal_combustion_engine_control`](../modules/modules_system.md#internal-combustion-engine-control) module implements this logic as a state machine that drives four dedicated actuator outputs and closes the loop on a measured engine speed (RPM). + +:::warning +A running combustion engine with a propeller attached is dangerous. +The engine can be commanded to start automatically (for example on arming, or on a VTOL transition to fixed-wing), and the starter motor will crank the propeller without further warning. + +- Always do your first bench tests with the propeller removed. +- For continuous operation without a propeller, a flywheel is recommended. +- Keep clear of the propeller arc whenever the vehicle is powered. +- Verify that the engine stop functionality (ignition off, choke closed) reliably stops the engine before you rely on it. + +::: + +## Hardware Requirements + +- **Throttle servo** connected to a PWM/AUX output. +- **Ignition cut** on an output, typically through a relay or opto-isolated switch that shorts or interrupts the ignition circuit. + Optional. +- **Choke servo** on an output (optional if the engine has no choke, or an automatic one — set [ICE_CHOKE_ST_DUR](../advanced_config/parameter_reference.md#ICE_CHOKE_ST_DUR) to `0` and leave the function unassigned). +- **Electric starter** on an output, typically through a relay or an ESC driving the starter motor. + Optionally, the engine can also be hand-started. +- **RPM sensor** feeding the `RPM Input` function on a timer-capture-capable PWM pin, for example a Hall-effect or optical sensor on the crankshaft, or an ignition-pulse pickup. + + Many engines have a built-in spark-timing sensor that can be used for this. + If yours does not, see [Tachometers](../sensor/tachometers.md) for other options. + +:::warning +RPM feedback is **required**. +The state machine only leaves `Starting` for `Running` once it sees a measured engine speed above [ICE_MIN_RUN_RPM](../advanced_config/parameter_reference.md#ICE_MIN_RUN_RPM). +Without a working RPM sensor the module will exhaust its start attempts and latch into the `Fault` state. +::: + +## Firmware Configuration + +The module and the RPM capture driver are not in the default builds. +Add them to the [board configuration](../hardware/porting_guide_config.md) for your flight controller: + +```text +CONFIG_MODULES_INTERNAL_COMBUSTION_ENGINE_CONTROL=y +CONFIG_DRIVERS_RPM_CAPTURE=y +``` + +Both can also be enabled interactively with `make boardconfig`, under **modules** and **drivers** respectively. + +## Parameter Setup + +Set the following and reboot: + +- [ICE_EN](../advanced_config/parameter_reference.md#ICE_EN) to `Enabled`. + The startup script only starts the module if this is set. +- [RPM_CAP_ENABLE](../advanced_config/parameter_reference.md#RPM_CAP_ENABLE) to `Enabled`. +- [RPM_PULS_PER_REV](../advanced_config/parameter_reference.md#RPM_PULS_PER_REV) to the number of sensor pulses per crankshaft revolution (for example `2` for a two-magnet setup, or `1` for a single ignition pulse per revolution on a two-stroke). + +Then work through the remaining `ICE_*` parameters: + +- [Actuator Configuration](#actuator-configuration) — wire up the engine outputs. +- [Start/Stop Command Source](#start-stop-command-source) — choose what commands the engine on and off. +- [Idle RPM Governor](#idle-rpm-governor) — set up and tune closed-loop idle, and the `ICE_IDLE_*` parameters. +- [Parameter Reference](#parameter-reference) — the full list, including the start sequence timing. + +## Actuator Configuration + +Assign the four engine functions and the RPM input in [Actuator Configuration](../config/actuators.md), for example: + +![Actuator setup for ICE, with the engine output functions and the RPM input highlighted](../../assets/hardware/ice/ice_actuator_setup.png) + +Each setpoint is in the range `[0, 1]` and is mapped to the `[-1, 1]` servo range before being scaled to the output's **Minimum**/**Maximum** values. +In other words, a setpoint of `0` produces the configured **Minimum** output and `1` produces the configured **Maximum** output (or the reverse, if **Rev Range** is ticked). + +:::info +When the engine is commanded off, the throttle setpoint is `NAN`, which by definition drives the output to its configured **Disarmed** value rather than to **Minimum**. +This lets you park the throttle servo at an idle-stop position that is different from the closed-throttle position used to switch off the engine. + +The throttle output also goes to _Disarmed_ while the engine is running if the [idle governor](#idle-rpm-governor) is disabled and the throttle demand drops to near zero (the fixed-wing controller stops the motor below 2% thrust). +::: + +Points to note when setting the values: + +- `IC Engine Throttle` uses **Minimum** for closed throttle and **Maximum** for full throttle. + Setting **Disarmed** to a value other than **Minimum** parks the servo at an idle stop when the engine is off, rather than at closed throttle. +- `IC Engine Choke` uses **Minimum** for choke open and **Maximum** for choke closed; tick **Rev Range** if the servo linkage is inverted. +- `IC Engine Ignition` and `IC Engine Starter` behave as on/off outputs: **Minimum** is "off" and **Maximum** is "on". + Set both values so that the relay switches reliably, and make sure **Disarmed** corresponds to ignition off and starter off. +- `RPM Input` must be on a channel that supports timer capture on your board. + +:::tip +In the example above the **Actuators** tab stays red in the sidebar, and the page shows "One or more actuator still needs to be assigned to an output". +This is expected for an engine setup and does not stop the engine from running: the airframe's `Motor 1` slot is deliberately left unassigned, because the throttle reaches the servo through `IC Engine Throttle` instead — see [How It Works](#how-it-works). +::: + +:::warning +While the vehicle is disarmed, every output — including ignition, choke, and starter — is held at its **Disarmed** value, regardless of what the module commands. +The engine can only be commanded when [armed or prearmed](../advanced_config/prearm_arm_disarm.md). +::: + +Whether prearming happens at all is set by [COM_PREARM_MODE](../advanced_config/parameter_reference.md#COM_PREARM_MODE), which matters if you want to start the engine before arming (for example from an AUX switch, see [Start/Stop Command Source](#start-stop-command-source)): + +| `COM_PREARM_MODE` | Effect on the engine outputs | +| --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Disabled` (default) | Never prearms, so the outputs stay at their **Disarmed** values until the vehicle is armed. | +| `Safety button` | Outputs become live once the safety switch is released. Has no effect on boards that have no safety button — prearm then never engages. | +| `Always` | Outputs become live 5 s after boot. | + +:::warning +With `Always` the ignition, choke, and starter outputs are live shortly after power-up, before any arming check has run. +The engine can be commanded to crank on a vehicle that was never armed, so treat the propeller as live whenever the vehicle is powered. +::: + +## Start/Stop Command Source {#start-stop-command-source} + +[ICE_ON_SOURCE](../advanced_config/parameter_reference.md#ICE_ON_SOURCE) selects what asks for the engine to run: + +| 值 | Engine is requested on when | +| ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `On arming - disarming` (0) | The vehicle is armed. This is the default. | +| `Aux1` (1) | The AUX1 manual control channel is above `0.5`; requested off when it goes below `-0.5`. Map a switch to it with `RC_MAP_AUX1`. | +| `Aux2` (2) | As above, using AUX2 and `RC_MAP_AUX2`. | +| `On Vtol Transitions` (3) | The vehicle is in fixed-wing mode or transitioning to fixed-wing. Use this on a hybrid VTOL where the engine only drives the pusher/forward propeller. | + +:::info +For the AUX sources, values between `-0.5` and `0.5` leave the request unchanged. +This dead zone means a three-position switch has a middle position that does not change the engine state, and it prevents a channel that is momentarily centred (or lost and defaulted to zero) from cutting the engine. +::: + +## Idle RPM Governor + +Left at a fixed low throttle, an engine tends either to die or to sit at an unpredictable idle speed that depends on temperature, air density, and mixture. +The idle governor closes the loop on measured RPM whenever the throttle demand is low, keeping the engine alive and ready to accelerate. + +It is enabled by setting [ICE_IDLE_RPM](../advanced_config/parameter_reference.md#ICE_IDLE_RPM) to a non-zero idle speed. +When enabled, the `Running` state has two sub-states, reported in `InternalCombustionEngineStatus.substate`: + +- `Run` — the throttle demand from allocation is passed straight through. +- `Idle` — the throttle output is produced by the governor instead. + +The module enters `Idle` when the throttle demand drops below 2% (or becomes invalid, i.e. the vehicle is disarmed), **or** whenever the measured RPM falls below the idle setpoint. +The second condition is what catches a sagging engine: even at high commanded throttle, if the engine is being dragged below its idle speed the governor takes over and pushes the throttle to recover it. +It leaves `Idle` again as soon as the throttle demand exceeds the governor's current output, so the handover happens without a step in the output. + +### Control Structure + +The governor is a feed-forward plus PI controller with output clamped to `[0, 1]`: + +``` +throttle = ICE_IDLE_THR_FF + P · e + ∫ I · e dt + e = ICE_IDLE_RPM − rpm_estimate + P = ICE_IDLE_RPM_P · 1e-3 + I = ICE_IDLE_RPM_I · 1e-3 +``` + +The `1e-3` scaling is what makes the gains convenient to reason about: + +- [ICE_IDLE_RPM_P](../advanced_config/parameter_reference.md#ICE_IDLE_RPM_P) is the normalised throttle added per **1000 RPM** of error. + `ICE_IDLE_RPM_P = 1` means an engine running 500 RPM slow gets `+0.5` throttle. +- [ICE_IDLE_RPM_I](../advanced_config/parameter_reference.md#ICE_IDLE_RPM_I) is the normalised throttle added per **1000 RPM·s** of accumulated error. + `ICE_IDLE_RPM_I = 1` means a steady 100 RPM error winds the output up by `0.1` every second. +- [ICE_IDLE_THR_FF](../advanced_config/parameter_reference.md#ICE_IDLE_THR_FF) is the throttle that holds the idle speed on its own, so the PI terms only have to correct for the difference. + It is applied as a constant offset whenever the governor is active. + +The integrator is limited to `±1` and uses conditional integration: it stops winding up in whichever direction is already driving the output into saturation. +It is reset to zero every time the engine reaches `Running`, so a start never inherits wind-up from a previous run. + +### Tuning Procedure + +Do this on the ground, with the propeller removed or the vehicle firmly restrained, and with the engine warm. + +1. **Find the idle speed.** + Pick the [ICE_IDLE_RPM](../advanced_config/parameter_reference.md#ICE_IDLE_RPM) you want — low enough not to produce useful thrust, high enough that the engine runs smoothly and can accelerate without hesitating. + The engine's specification or a hand-throttled test is the starting point. +2. **Find the feed-forward.** + With the governor still off (`ICE_IDLE_RPM = 0`), start the engine and hold it at that RPM with the throttle stick in a manual mode. + Read the commanded throttle off the log (`internal_combustion_engine_control.throttle_control`), set [ICE_IDLE_THR_FF](../advanced_config/parameter_reference.md#ICE_IDLE_THR_FF) to it, and set `ICE_IDLE_RPM` to the target. +3. **Verify feed-forward only.** + With both gains still at `0`, restart and let the engine idle. + It should settle near the setpoint. + A large steady offset means the feed-forward is wrong — correct it before adding gains, because the PI terms are only meant to trim. +4. **Add proportional gain.** + Raise [ICE_IDLE_RPM_P](../advanced_config/parameter_reference.md#ICE_IDLE_RPM_P) in steps (`0.2` is a reasonable first step) until the engine recovers briskly when you disturb it — for example by briefly blipping the throttle up and releasing it. + Back off as soon as you see the RPM hunting or the throttle oscillating. +5. **Add integral gain.** + Raise [ICE_IDLE_RPM_I](../advanced_config/parameter_reference.md#ICE_IDLE_RPM_I) just enough to remove any remaining steady-state RPM offset within a few seconds. + Too much integral shows up as a slow oscillation around the setpoint. +6. **Check the handover.** + Sweep the throttle demand up and back down through the idle point and confirm there is no jump or dead spot as the sub-state switches between `Idle` and `Run`. + +The signals to look at in the [flight log](../log/flight_log_analysis.md): + +| 信号 | Use | +| --------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `rpm.rpm_estimate` | Measured engine speed — compare against `ICE_IDLE_RPM`. | +| `internal_combustion_engine_control.throttle_control` | Throttle actually commanded, after the governor and the slew rate limit. | +| `internal_combustion_engine_status.substate` | Whether the governor is active (`1` = `Idle`). | +| `internal_combustion_engine_status.pid_idle_rpm_integral` | Integrator state. Parked at `±1` means it is saturated and the feed-forward is far off. | +| `internal_combustion_engine_status.state` | State machine state — reveals unnoticed restarts. | + +Both `internal_combustion_engine_*` topics are logged when the module is running. + +:::info +`rpm_capture` low-pass filters the RPM estimate with a 0.5 s time constant. +That lag is part of the loop you are tuning and puts a practical ceiling on how high the gains can go before the governor starts hunting. +::: + +## Parameter Reference + +| Parameter | Unit | 默认值 | 描述 | +| --------------------------------------------------------------------------------------------------------------------------------------------- | ---- | ------ | --------------------------------------------------------------------------------------------------------- | +| [ICE_EN](../advanced_config/parameter_reference.md#ICE_EN) | — | `0` | Start the ICE control module. Requires a reboot. | +| [ICE_ON_SOURCE](../advanced_config/parameter_reference.md#ICE_ON_SOURCE) | — | `0` | What requests the engine on/off: arming, AUX1, AUX2, or VTOL transitions. | +| [ICE_MIN_RUN_RPM](../advanced_config/parameter_reference.md#ICE_MIN_RUN_RPM) | rpm | `2000` | RPM above which the engine counts as running. | +| [ICE_IGN_DELAY](../advanced_config/parameter_reference.md#ICE_IGN_DELAY) | s | `0` | Delay between switching on the ignition and engaging the starter. | +| [ICE_CHOKE_ST_DUR](../advanced_config/parameter_reference.md#ICE_CHOKE_ST_DUR) | s | `5` | How long the choke stays closed on the first start attempt. | +| [ICE_STRT_DUR](../advanced_config/parameter_reference.md#ICE_STRT_DUR) | s | `5` | Cranking time per attempt after the choke opens, before declaring a timeout. | +| [ICE_STRT_THR](../advanced_config/parameter_reference.md#ICE_STRT_THR) | norm | `0.1` | Throttle held during choking and cranking. | +| [ICE_STRT_ATTEMPT](../advanced_config/parameter_reference.md#ICE_STRT_ATTEMPT) | — | `3` | Start attempts before entering `Fault`. `0` means a single attempt. | +| [ICE_RUN_FAULT_D](../advanced_config/parameter_reference.md#ICE_RUN_FAULT_D) | — | `1` | Detect an engine stop while running and attempt a restart. | +| [ICE_STOP_CHOKE](../advanced_config/parameter_reference.md#ICE_STOP_CHOKE) | — | `1` | Close the choke while the engine is stopped or in fault. | +| [ICE_THR_SLEW](../advanced_config/parameter_reference.md#ICE_THR_SLEW) | 1/s | `0.5` | Maximum rate of change of the throttle output. | +| [ICE_IDLE_RPM](../advanced_config/parameter_reference.md#ICE_IDLE_RPM) | rpm | `0` | Idle RPM setpoint. `0` disables the idle governor. | +| [ICE_IDLE_THR_FF](../advanced_config/parameter_reference.md#ICE_IDLE_THR_FF) | norm | `0` | Feed-forward throttle for the idle governor. | +| [ICE_IDLE_RPM_P](../advanced_config/parameter_reference.md#ICE_IDLE_RPM_P) | — | `0` | Idle governor proportional gain, per 1000 RPM of error. | +| [ICE_IDLE_RPM_I](../advanced_config/parameter_reference.md#ICE_IDLE_RPM_I) | — | `0` | Idle governor integral gain, per 1000 RPM·s of error. | + +## 故障处理 + +| Symptom | Likely cause | +| ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Nothing happens at all; `internal_combustion_engine_control status` reports the module is not running | `ICE_EN` is not set, or the module is not in the firmware. Check the [build configuration](#firmware-configuration) and reboot. | +| The engine runs but the state machine goes to [`Fault`](#state-machine) | The RPM sensor is not working or is misconfigured. Check `RPM_CAP_ENABLE`, `RPM_PULS_PER_REV`, and that the sensor is on a capture-capable pin; compare `rpm.rpm_estimate` against a hand tachometer. | +| Outputs never move even though the state machine advances | The vehicle is disarmed and not prearmed, so outputs are held at their **Disarmed** values. See the [note above](#actuator-configuration) on `COM_PREARM_MODE`. | +| The starter cranks but the engine never fires | There may be no fuel in the engine yet. Closing the choke is what draws fuel in, so a dry engine needs a longer priming window — increase `ICE_CHOKE_ST_DUR`. Also check the cranking time (`ICE_STRT_DUR`) and the start throttle (`ICE_STRT_THR`), and note that too much choke floods the engine. | +| The engine fires and then dies just after `Starting` finishes | No idle governor. Set up the [idle governor](#idle-rpm-governor); with `ICE_IDLE_RPM = 0` there is nothing holding the engine up when the throttle demand is zero. | +| Repeated in-air restarts logged as `IC engine fault detected` | `ICE_MIN_RUN_RPM` is set too close to the actual idle speed, so normal idle dips read as an engine stop. Raise the idle setpoint or lower the threshold. | +| The engine bogs down or stalls on throttle up | `ICE_THR_SLEW` is too high for the engine. Reduce it so the throttle opens more gradually. | + +## 开发人员信息 + +### How It Works + +ICE control architecture + +The module sits between the [control allocator](../config/actuators.md) and the outputs: + +- It takes the **throttle demand** from `actuator_motors.control[0]`, i.e. the thrust that allocation computed for `Motor 1`. + ::: info + The engine takes its throttle from whichever rotor the airframe geometry defines as `Motor 1` (rotor 0, `CA_ROTOR0_*`), so you must set up the geometry with the engine as rotor 0. + On a standard VTOL, this means making the pusher rotor 0 rather than the last rotor. + You do not need to (and should not) assign an output for the `Motor 1` function. + +::: +- It takes the **on/off request** from [VehicleStatus](../msg_docs/VehicleStatus.md) (arming state, or the VTOL transition) or from [ManualControlSetpoint](../msg_docs/ManualControlSetpoint.md) (the AUX channels), depending on [ICE_ON_SOURCE](#start-stop-command-source). +- It runs the start/stop state machine and publishes [InternalCombustionEngineControl](../msg_docs/InternalCombustionEngineControl.md) with the setpoints for ignition, throttle, choke, and starter. +- The mixer maps those four fields to the four `IC Engine *` [output functions](../config/actuators.md), which is where you wire the engine hardware. +- It subscribes to [Rpm](../msg_docs/Rpm.md) to know whether the engine is actually turning, and publishes [InternalCombustionEngineStatus](../msg_docs/InternalCombustionEngineStatus.md) with the current state. + +The module runs at 50 Hz. + +#### Output Functions + +| Output function | Field in `InternalCombustionEngineControl` | 含义 | +| -------------------- | ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `IC Engine Ignition` | `ignition_on` | Spark/ignition enable. `false` cuts the spark and stops the engine (optional: many engine spark boxes always run when powered). | +| `IC Engine Throttle` | `throttle_control` | Throttle servo setpoint, `0`…`1`. `NAN` while the engine is commanded off. | +| `IC Engine Choke` | `choke_control` | Choke servo setpoint, `0`…`1`, where `1` is fully closed (richest mixture). Optional actuator. | +| `IC Engine Starter` | `starter_engine_control` | Electric starter motor setpoint, `0`…`1`. Optional actuator: the engine can also be hand-started. | + +### State Machine + +ICE control state machine + +The module has four states, reported in `InternalCombustionEngineStatus.state`: + +| State | Ignition | Throttle | Choke | Starter | +| ---------- | -------- | ----------------------------------------------- | ------------------------------------- | ------------------------------------- | +| `Stopped` | off | `NAN` (→ **Disarmed** value) | `ICE_STOP_CHOKE ? 1 : 0` | `0` | +| `Starting` | on | `ICE_STRT_THR` | see [start sequence](#start-sequence) | see [start sequence](#start-sequence) | +| `Running` | on | motor 1 demand, or idle governor output | `0` | `0` | +| `Fault` | off | `0` | `ICE_STOP_CHOKE ? 1 : 0` | `0` | + +Transitions: + +- `Stopped` → `Starting` when the engine is requested on and the start attempt budget is not exhausted. +- `Starting` → `Running` as soon as the measured RPM exceeds [ICE_MIN_RUN_RPM](../advanced_config/parameter_reference.md#ICE_MIN_RUN_RPM). + This can happen part way through an attempt. +- `Starting` → `Fault` when all attempts have been used without the engine coming up. +- `Running` → `Starting` if the RPM drops back below the threshold and [ICE_RUN_FAULT_D](../advanced_config/parameter_reference.md#ICE_RUN_FAULT_D) is enabled — this is the automatic in-air restart. + An `IC engine fault detected` event is emitted. +- Any state → `Stopped` when the engine is requested off. + This also resets the attempt counter, so switching the request off and on again is the way to clear a `Fault`. + +Both `Starting` and `Running` have sub-states, reported in `InternalCombustionEngineStatus.substate`. +`Starting` alternates between cranking and a one-second rest between attempts (see [Start Sequence](#start-sequence)), and `Running` switches between passing the throttle demand straight through and running the [idle governor](#idle-rpm-governor). + +:::info +The throttle setpoint is rate limited by [ICE_THR_SLEW](../advanced_config/parameter_reference.md#ICE_THR_SLEW) in all states, which protects the engine from abrupt throttle steps that would make it bog down or stall. +The limit does not apply to the `NAN` used in `Stopped`; the slew state is reset to zero instead, so the next start ramps up from closed throttle. +::: + +#### Start Sequence + +One start attempt runs the following timeline, measured from entry into the attempt: + +| From | To | Ignition | Choke | Starter | Throttle | +| ---------------------------------- | ------------------------------------------------- | -------- | ----- | ------- | -------------- | +| `0` | `ICE_IGN_DELAY` | on | `1` | `0` | `ICE_STRT_THR` | +| `ICE_IGN_DELAY` | `ICE_IGN_DELAY + ICE_CHOKE_ST_DUR` | on | `1` | `1` | `ICE_STRT_THR` | +| `ICE_IGN_DELAY + ICE_CHOKE_ST_DUR` | `ICE_IGN_DELAY + ICE_CHOKE_ST_DUR + ICE_STRT_DUR` | on | `0` | `1` | `ICE_STRT_THR` | + +- [ICE_IGN_DELAY](../advanced_config/parameter_reference.md#ICE_IGN_DELAY) holds the starter off for a moment after the ignition is switched on, for ignition systems that need time to come up. +- [ICE_CHOKE_ST_DUR](../advanced_config/parameter_reference.md#ICE_CHOKE_ST_DUR) is how long the choke stays closed. + Note that the starter is already cranking during this window. +- [ICE_STRT_DUR](../advanced_config/parameter_reference.md#ICE_STRT_DUR) is how much longer the starter cranks with the choke open before the attempt is declared timed out. + +If the attempt times out, the module rests for **1 second** with the ignition off and the throttle at its disarmed value (to reduce starter motor wear) and then begins the next attempt. + +:::info +Choke and ignition delay are applied on the **first** attempt only. +Retries crank with the choke open immediately, on the assumption that the first attempt already primed the engine and that further choking would flood it. +::: + +[ICE_STRT_ATTEMPT](../advanced_config/parameter_reference.md#ICE_STRT_ATTEMPT) caps the number of attempts before the module gives up and enters `Fault`. +A value of `0` means a single attempt with no retry. + +### Status and Telemetry + +- [InternalCombustionEngineControl](../msg_docs/InternalCombustionEngineControl.md) carries the commanded setpoints and the current user request. +- [InternalCombustionEngineStatus](../msg_docs/InternalCombustionEngineStatus.md) carries the state machine state and the governor's integrator. + The same topic is used by the [DroneCAN](../dronecan/index.md) ICE bridge (`UAVCAN_SUB_ICE`), which fills in the richer engine telemetry — temperatures, pressures, fuel flow — reported by a smart ECU. +- The status topic is streamed to a ground station as the MAVLink [EFI_STATUS](https://mavlink.io/en/messages/common.html#EFI_STATUS) message. + +## 另见 + +- [`internal_combustion_engine_control`](../modules/modules_system.md#internal-combustion-engine-control) — module command line reference. +- [Actuator Configuration](../config/actuators.md) — assigning output functions. +- [DroneCAN Peripherals](../dronecan/index.md) — for engines with a smart ECU reporting over DroneCAN. diff --git a/docs/zh/advanced/community_supported_dev_env.md b/docs/zh/advanced/community_supported_dev_env.md index 3f89fe0589f..8b4c112598f 100644 --- a/docs/zh/advanced/community_supported_dev_env.md +++ b/docs/zh/advanced/community_supported_dev_env.md @@ -3,14 +3,12 @@ 本章节包含社区支持的开发环境搭建,IDE,模拟器和其他工具。 :::warning -这些设置没有核心开发团队的维护、测试或支持 -他们可能与当前版本的 PX4 工作, 也可能不工作。 +这些设置没有核心开发团队的维护、测试或支持他们可能与当前版本的 PX4 工作, 也可能不工作。 关于核心开发团队支持的环境和工具的信息,请参阅 [工具链安装](../dev_setup/dev_env.md) ::: -这些工具有来自其社区的不同程度的支持 (有些得到很好的支持,有些则没有) 。 -关于这些工具的问题应该在 [讨论论坛](../contribute/support.md#forums-and-chat)提出 +这些工具有来自其社区的不同程度的支持 (有些得到很好的支持,有些则没有) 。关于这些工具的问题应该在 [讨论论坛](../contribute/support.md#forums-and-chat)提出 - 开发平台/设置 - [CentOS Linux](../dev_setup/dev_env_linux_centos.md) diff --git a/docs/zh/advanced/computer_vision.md b/docs/zh/advanced/computer_vision.md index d559016780c..aef8af1bf98 100644 --- a/docs/zh/advanced/computer_vision.md +++ b/docs/zh/advanced/computer_vision.md @@ -59,29 +59,24 @@ One difference between VIO and [MoCap](#motion-capture) is that VIO cameras/IMU ### 本地位置估计 光学流 对 VIO -这两种技术都使用照相机并测量帧之间的差异。 -光学流使用向下照相机,而VIO则使用立体照相机或45度跟踪照相机。 -假定两者的校准都很好,哪个对本地地位置估计更好? +这两种技术都使用照相机并测量帧之间的差异。光学流使用向下照相机,而VIO则使用立体照相机或45度跟踪照相机。假定两者的校准都很好,哪个对本地地位置估计更好? The consensus [appears to be](https://discuss.px4.io/t/vio-vs-optical-flow/34680): Optical flow: - Downward facing optical flow gives you a planar velocity that's corrected for angular velocity with the gyro. -- 需要准确的地面距离并假定地面为平面。 - 在这种情况下,它可能与VIO一样准确可靠(例如室内飞行) +- 需要准确的地面距离并假定地面为平面。在这种情况下,它可能与VIO一样准确可靠(例如室内飞行) - 它比VIO更健壮,因为它的状态较少。 - 更便宜和更容易设置,因为它只需要一个流传感器,一个范围探测器。 并设置几个参数(可以连接到飞行控制器)。 VIO -- 购买更加昂贵,设置更加困难。 - 它需要一台单独的配套计算机、校准、软件、配置等等。 +- 购买更加昂贵,设置更加困难。它需要一台单独的配套计算机、校准、软件、配置等等。 - 如果没有可跟踪的点特征(实际上现实世界一般有点特征),效果将会减弱。 - 较为灵活,可以增加诸如避免障碍和制图等其他功能。 -组合(两者兼用)可能是最可靠的,但在大多数现实世界的情景中并不必要。 -通常您将选择适合您的运行环境、所需功能和成本限制的系统: +组合(两者兼用)可能是最可靠的,但在大多数现实世界的情景中并不必要。通常您将选择适合您的运行环境、所需功能和成本限制的系统: - 如果您打算在没有GPS的情况下在室外飞行(或室外和室内飞行),请使用 VIO 或者如果您需要支持避障碍和其他计算机视觉特性。 - 如果您只计划在室内飞行(不使用 GPS),且成本是一个重要的考虑因素,使用Optical Flow。 diff --git a/docs/zh/advanced/gimbal_control.md b/docs/zh/advanced/gimbal_control.md index 9207fc16c22..96d4436145f 100644 --- a/docs/zh/advanced/gimbal_control.md +++ b/docs/zh/advanced/gimbal_control.md @@ -6,13 +6,10 @@ PX4 包含了一个通用的挂载设备/云台的控制驱动,它含有多种输入输出方式。 -- 输入方式定义控制云台挂在的协议,该协议由 PX4 管理。 - 该输入方式可能是一个遥控器,一个可以发送 MAVLink 的地面站,或者两者 — 两种可以自动切换。 -- 输出方式定义了 PX4 如何与连接的云台通信。 - 推荐的协议是 MAVLink v2, 但您也可以直接连接到飞控的 PWM 输出端口。 +- 输入方式定义控制云台挂在的协议,该协议由 PX4 管理。该输入方式可能是一个遥控器,一个可以发送 MAVLink 的地面站,或者两者 — 两种可以自动切换。 +- 输出方式定义了 PX4 如何与连接的云台通信。推荐的协议是 MAVLink v2, 但您也可以直接连接到飞控的 PWM 输出端口。 -PX4 接收输入信号,并且将其路由/翻译后发送到输出。 -任何输入方式都可以被选择来驱动任何输出。 +PX4 接收输入信号,并且将其路由/翻译后发送到输出。任何输入方式都可以被选择来驱动任何输出。 输入和输出都使用参数进行配置。 The input is set using the parameter [MNT_MODE_IN](../advanced_config/parameter_reference.md#MNT_MODE_IN). @@ -29,10 +26,17 @@ See [Fixed Attitude Gimbal](#fixed-attitude-gimbal) below. The output is set using the [MNT_MODE_OUT](../advanced_config/parameter_reference.md#MNT_MODE_OUT) parameter. By default the output is set to a PXM port (`AUX (0)`). If the [MAVLink Gimbal Protocol v2](https://mavlink.io/en/services/gimbal_v2.html) is supported by your gimbal, you should instead select `MAVLink gimbal protocol v2 (2)`. +If the gimbal has its own gimbal manager, select `Forward to external gimbal manager (3)` instead (see [External Gimbal Manager](#external-gimbal-manager)). +A second gimbal can be driven in parallel using [MNT_MODE_OUT2](../advanced_config/parameter_reference.md#MNT_MODE_OUT2) (see [Multiple Gimbal Support](#multiple-gimbal-support)). The full list of parameters for setting up the mount driver can be found in [Parameter Reference > Mount](../advanced_config/parameter_reference.md#mount). 下面介绍了一些通用的云台相关设置。 +:::tip +To debug a gimbal setup, use `gimbal status` in the MAVLink console to see the active inputs and outputs, and `gimbal test` to move the gimbal without any input. +See [Driver Testing](#driver-testing). +::: + ## MAVLink 云台 (MNT_MODE_OUT=MAVLINK) 系统上的每个物理云台装置必须有自己的高级云台管理器, 地面站通过使用MAVLink云台协议发现它。 @@ -51,16 +55,27 @@ For example, if the `TELEM2` port on the flight controller is unused you can con - [MAV_1_FORWARD](../advanced_config/parameter_reference.md#MAV_1_FORWARD) to **Enabled** (Note strictly necessary as forwarding is enabled when `MAV_1_MODE` is set to Gimbal). - [SER_TEL2_BAUD](../advanced_config/parameter_reference.md#SER_TEL2_BAUD) to manufacturer recommended baud rate. +### External Gimbal Manager + +Some gimbals implement the gimbal _manager_ protocol themselves, rather than only the gimbal device protocol. +A ground station controls such a gimbal directly, PX4 does not need to manage it. + +Set [MNT_MODE_OUT](../advanced_config/parameter_reference.md#MNT_MODE_OUT) to `Forward to external gimbal manager (3)` so that PX4 forwards onboard inputs (RC, ROI) to it as well. +PX4 then acts as a client of that manager: it acquires control while there is onboard input and releases it afterwards, and the manager arbitrates between PX4 and the ground station. + +Connect the gimbal to a MAVLink instance in `Gimbal` (or `Onboard`) mode with forwarding enabled, as described [above](#mavlink-gimbal-mnt-mode-out-mavlink). +Forwarding is required so that the ground station and the gimbal manager can see each other, and PX4 discovers the manager from the `GIMBAL_MANAGER_STATUS` it streams. + ### 多云台支持 -PX4 可以自动为已连接的 PWM 云台或第一个在任何接口上检测到相同的系统 id 的 MAVLink 云台设备创建一个云台管理器。 -它不会自动为它检测到的其他MAVLink云台设备创建云台管理器。 +PX4 creates one gimbal manager, for the gimbal driven by `MNT_MODE_OUT`. -You can support additional MAVLink gimbals provided that they: +A second gimbal can be driven in parallel with the same inputs by setting [MNT_MODE_OUT2](../advanced_config/parameter_reference.md#MNT_MODE_OUT2) to a different output mode than `MNT_MODE_OUT`, e.g. a MAVLink gimbal (`2`) and a gimbal with an [external gimbal manager](#external-gimbal-manager) (`3`). + +Additional MAVLink gimbals that are not driven by PX4 are supported provided that they: - Implement the gimbal _manager_ protocol. -- 在 MAVLink 网络上对地面站和 PX4 可见。 - 这可能需要在PX4、GCS和云台之间配置流量转接。 +- 在 MAVLink 网络上对地面站和 PX4 可见。这可能需要在PX4、GCS和云台之间配置流量转接。 - Have a unique component id, and this component id must be in the range 7 - 255. ## 飞控 PWM 输出上的云台 (MNT_MODE_OUT=AUX) diff --git a/docs/zh/advanced/out_of_tree_modules.md b/docs/zh/advanced/out_of_tree_modules.md index c7cbcc8cf57..93c74390827 100644 --- a/docs/zh/advanced/out_of_tree_modules.md +++ b/docs/zh/advanced/out_of_tree_modules.md @@ -1,7 +1,6 @@ # 外部模块(Out-of-Tree) -外部模块为开发人员提供了一种便捷的机制,可以管理/分组他们想要添加(或更新)PX4 固件的专有模块。 -外部模块可以使用与内部模块相同的includes,并可以通过uORB与内部模块交互。 +外部模块为开发人员提供了一种便捷的机制,可以管理/分组他们想要添加(或更新)PX4 固件的专有模块。外部模块可以使用与内部模块相同的includes,并可以通过uORB与内部模块交互。 本主题说明如何将外部(“out of tree”)模块添加到 PX4 编译中。 diff --git a/docs/zh/advanced/package_delivery.md b/docs/zh/advanced/package_delivery.md index 814c3f58337..003e892cadb 100644 --- a/docs/zh/advanced/package_delivery.md +++ b/docs/zh/advanced/package_delivery.md @@ -4,8 +4,7 @@ 包裹投递任务是航点任务的拓展,用户可以计划将包裹作为航点进行投递。 -本节解释了包裹投递功能的架构。 -它的目的是为从事扩展架构的开发者提供支持,例如支持新的有效载荷投递机制。 +本节解释了包裹投递功能的架构。它的目的是为从事扩展架构的开发者提供支持,例如支持新的有效载荷投递机制。 :::info Currently only [Grippers](../peripherals/gripper.md) can be used for package delivery. @@ -33,8 +32,7 @@ Likewise, since PX4 automatically translates the [`COMMAND_ACK`](https://mavlink ## 导航器 -导航器处理接收车辆命令 ACK (下文所述)。 -在收到成功部署确认消息后,它会设置任务块级别中的标志,以表示有效载荷部署已成功。 +导航器处理接收车辆命令 ACK (下文所述)。在收到成功部署确认消息后,它会设置任务块级别中的标志,以表示有效载荷部署已成功。 这允许任务安全地继续到下一个项目(例如路径点),因为我们确信部署已成功得到确认。 @@ -49,8 +47,7 @@ This is possible since all the Mission item has the `MAV_CMD` to execute (e.g. L In the Mission logic (green box above) if either Gripper/Winch mission item is reached, it implements brake_for_hold functionality (which sets the `valid` flag of the next mission item waypoint to `false`) for rotary wings (e.g. Multicopter) so that the vehicle would hold it's position while the deployment is getting executed. -固定翼飞机和其他车辆不考虑特殊制动条件。 -所以如果你有一个固定翼的悬停任务,飞机在悬停的同时投递包裹,飞机不会停止 (因为这是不可能的)。 +固定翼飞机和其他车辆不考虑特殊制动条件。所以如果你有一个固定翼的悬停任务,飞机在悬停的同时投递包裹,飞机不会停止 (因为这是不可能的)。 ## 任务块 diff --git a/docs/zh/advanced/parameters_and_configurations.md b/docs/zh/advanced/parameters_and_configurations.md index 3ccc0aedb9b..45b6c666a0a 100644 --- a/docs/zh/advanced/parameters_and_configurations.md +++ b/docs/zh/advanced/parameters_and_configurations.md @@ -130,15 +130,13 @@ API 之间的一个重要区别是,C++ 版本具有更有效的标准化机制 Your code should _always_ use the current value from the parameter store. If getting the latest version is not possible, then a reboot will be required after the parameter is changed (set this requirement using the `@reboot_required` metadata). -此外,C++ 版本有更好的类型安全和更小的 RAM 开销。 -缺点是参数名称必须在编译时知道,而 C 语言 API 可以将动态创建的名称作为字符串。 +此外,C++ 版本有更好的类型安全和更小的 RAM 开销。缺点是参数名称必须在编译时知道,而 C 语言 API 可以将动态创建的名称作为字符串。 #### C++ API The C++ API provides macros to declare parameters as _class attributes_. You add some "boilerplate" code to regularly listen for changes in the [uORB Topic](../middleware/uorb.md) associated with _any_ parameter update. -框架代码然后 (在不可见的情况下) 处理追踪影响 uORB 消息,并保持参数属性和 uORB 消息同步。 -在代码的其余部分中,您只能使用定义的参数属性,它们将始终是最新的! +框架代码然后 (在不可见的情况下) 处理追踪影响 uORB 消息,并保持参数属性和 uORB 消息同步。在代码的其余部分中,您只能使用定义的参数属性,它们将始终是最新的! 首先在您的模块或驱动程序的类头文件中包含所需的头文件: diff --git a/docs/zh/advanced/px4_metadata.md b/docs/zh/advanced/px4_metadata.md index 8e5c39512ec..1e037c46403 100644 --- a/docs/zh/advanced/px4_metadata.md +++ b/docs/zh/advanced/px4_metadata.md @@ -18,13 +18,11 @@ PX4 使用并生成人类和机器可读的元数据: ## 元数据翻译 -在 Crowdin 项目 [PX4-Metadata-Translations](https://crowdin.com/project/px4-metadata-translations) 中翻译 PX4 元数据。 -更多关于 PX4 和 Crowdin 信息请参阅[Translation](../contribute/translation.md)。 +在 Crowdin 项目 [PX4-Metadata-Translations](https://crowdin.com/project/px4-metadata-translations) 中翻译 PX4 元数据。更多关于 PX4 和 Crowdin 信息请参阅[Translation](../contribute/translation.md)。 ## 元数据定义 -PX4 元数据是在 PX4 源代码及其相关数据中定义的。 -这可以通过在 C/C++ 注释中使用特殊标记来指示元数据字段及其值,或者使用 YAML 文件来完成。 +PX4 元数据是在 PX4 源代码及其相关数据中定义的。这可以通过在 C/C++ 注释中使用特殊标记来指示元数据字段及其值,或者使用 YAML 文件来完成。 更多信息请参阅每种数据类型的章节: @@ -38,13 +36,9 @@ PX4 元数据是在 PX4 源代码及其相关数据中定义的。 每次构建 PX4 时,元数据都会被收集到 JSON 文件中。 -对于大多数飞控(因为大多数都有足够的可用 FLASH 存储空间),JSON文件经过 xz 压缩并存储在生成的二进制文件中。 -然后使用 MAVLink [Component Metadata Protocol](https://mavlink.io/en/services/component_information.html)共享该文件。 -使用组件元数据协议确保接收者总是能够为运行在载具的代码获取最新元数据。 -事件元数据也会被添加到日志文件中,允许日志分析工具 (如飞行回放) 使用正确的元数据来显示事件。 +对于大多数飞控(因为大多数都有足够的可用 FLASH 存储空间),JSON文件经过 xz 压缩并存储在生成的二进制文件中。然后使用 MAVLink [Component Metadata Protocol](https://mavlink.io/en/services/component_information.html)共享该文件。使用组件元数据协议确保接收者总是能够为运行在载具的代码获取最新元数据。事件元数据也会被添加到日志文件中,允许日志分析工具 (如飞行回放) 使用正确的元数据来显示事件。 -内存受限的飞控二进制文件不会在二进制文件中存储参数元数据,而是引用存储在`px4-travis.s3.amazonaws.com`上的相同数据。 -例如,这适用于[Umnibus F4 SD](../flight_controller/omnibus_f4_sd.md)。 +内存受限的飞控二进制文件不会在二进制文件中存储参数元数据,而是引用存储在`px4-travis.s3.amazonaws.com`上的相同数据。例如,这适用于[Umnibus F4 SD](../flight_controller/omnibus_f4_sd.md)。 The metadata is uploaded via the [build_all_targets](https://github.com/PX4/PX4-Autopilot/blob/main/.github/workflows/build_all_targets.yml) GitHub CI workflow for all build targets (and hence will only be available once parameters have been merged into main). :::info @@ -53,13 +47,9 @@ The metadata is uploaded via the [build_all_targets](https://github.com/PX4/PX4- 如果在 FLASH 受限板上进行自定义开发,您可以调整此处的 URL 以指向另一台服务器[here](https://github.com/PX4/PX4-Autopilot/blob/main/src/lib/component_information/CMakeLists.txt#L41)。 ::: -如果载具上没有显示参数元数据,则使用 `px4-travis.s3.amazonaws.com` 上的元数据。 -它也可以用作后退,以避免对低速遥测链接进行非常缓慢的下载。 +如果载具上没有显示参数元数据,则使用 `px4-travis.s3.amazonaws.com` 上的元数据。它也可以用作后退,以避免对低速遥测链接进行非常缓慢的下载。 -用于 CI 构建 `main` 分支的元数据 JSON 文件也拷贝到了 github 仓库:[PX4/PX4-Metadata-Translations](https://github.com/PX4/PX4-Metadata-Translations/)。 -这与Crowdin集成,用于获取翻译,这些翻译存储在 [translated](https://github.com/PX4/PX4-Metadata-Translations/tree/main/translated) 文件夹中,每种语言都有 xz 压缩的翻译文件。 -这些是由载具的组件元数据引用的,并在需要时下载。 -有关更多信息,请参阅 [PX4-Metadata-Translations](https://github.com/PX4/PX4-Metadata-Translations/) 和 [Component Metadata Protocol > Translation](https://mavlink.io/en/services/component_information.html#translation)。 +用于 CI 构建 `main` 分支的元数据 JSON 文件也拷贝到了 github 仓库:[PX4/PX4-Metadata-Translations](https://github.com/PX4/PX4-Metadata-Translations/)。这与Crowdin集成,用于获取翻译,这些翻译存储在 [translated](https://github.com/PX4/PX4-Metadata-Translations/tree/main/translated) 文件夹中,每种语言都有 xz 压缩的翻译文件。这些是由载具的组件元数据引用的,并在需要时下载。有关更多信息,请参阅 [PX4-Metadata-Translations](https://github.com/PX4/PX4-Metadata-Translations/) 和 [Component Metadata Protocol > Translation](https://mavlink.io/en/services/component_information.html#translation)。 This is orchestrated by the [docs-orchestrator](https://github.com/PX4/PX4-Autopilot/blob/main/.github/workflows/docs-orchestrator.yml) GitHub CI workflow, which also regenerates auto-generated documentation such as parameter reference, airframe reference, and uORB message docs. :::info @@ -77,8 +67,7 @@ This is orchestrated by the [docs-orchestrator](https://github.com/PX4/PX4-Autop - **Left**: 元数据在不同模快的 `module.yml` 文件中定义。 `control_allocator` 模块定义几何形状,而每个输出驱动程序则定义其通道集和配置参数。 [schema file](https://github.com/PX4/PX4-Autopilot/blob/main/validation/module_schema.yaml) 描写了这些 yaml 文件的结构。 -- **Middle**: 在构建时间, 当前构建目标的所有已启用模块的 `module.yml` 文件都会被解析并变成一个驱动程序。 使用 [Tools/module_config/generate_actuators_metadata.py](https://github.com/PX4/PX4-Autopilot/blob/main/Tools/module_config/generate_actuators_metadata.py)脚本的文件。 - 这里还有[schema file](https://github.com/mavlink/mavlink/blob/master/component_metadata/actuators.schema.json)。 +- **Middle**: 在构建时间, 当前构建目标的所有已启用模块的 `module.yml` 文件都会被解析并变成一个驱动程序。 使用 [Tools/module_config/generate_actuators_metadata.py](https://github.com/PX4/PX4-Autopilot/blob/main/Tools/module_config/generate_actuators_metadata.py)脚本的文件。这里还有[schema file](https://github.com/mavlink/mavlink/blob/master/component_metadata/actuators.schema.json)。 - **Right**: 运行时,QGroundControl 通过 MAVLink 组件元数据 API 请求 JSON 文件(上文已经描述)。 ## 更多信息 diff --git a/docs/zh/advanced/realsense_intel_driver.md b/docs/zh/advanced/realsense_intel_driver.md index 2a8f31d9dc7..69219898846 100644 --- a/docs/zh/advanced/realsense_intel_driver.md +++ b/docs/zh/advanced/realsense_intel_driver.md @@ -5,19 +5,18 @@ RealSense R200 相机头如下图所示: ![Intel Realsense Camera front view](../../assets/hardware/sensors/realsense/intel_realsense.png) -驱动程序包的安装是在 Virtual Box 中作为虚拟机运行的 Ubuntu 操作系统 (OS) 上执行的。 -运行 Virtual Box 的宿主机、虚拟机的规格如下: +驱动程序包的安装是在 Virtual Box 中作为虚拟机运行的 Ubuntu 操作系统 (OS) 上执行的。运行 Virtual Box 的宿主机、虚拟机的规格如下: - 主机操作系统:Windows 8 - 处理器:Intel(R) Core(TM) i7-4702MQ CPU @ 2.20GHz -- Virtual Box:Oracle VM。 版本 5.0.14 r105127 +- Virtual Box:Oracle VM。版本 5.0.14 r105127 - 扩展:安装了 Virtual Box 的扩展包(用于 USB3.0 支持) - 客户机操作系统:Linux - Ubuntu 14.04.3 LTS -本教程按以下方式排序: 在第一部分中, 演示如何在 Virtual Box 中安装 Ubuntu 14.04 作为客户机系统。 第二部分会演示如何安装 ROS Indigo 和相机驱动程序。 常用短语解释如下: +本教程按以下方式排序: 在第一部分中, 演示如何在 Virtual Box 中安装 Ubuntu 14.04 作为客户机系统。第二部分会演示如何安装 ROS Indigo 和相机驱动程序。常用短语解释如下: -- Virtual Box(VB):运行不同虚拟机的程序。 此处使用 Oracle 虚拟机。 -- Virtual Machine(VM):作为访客系统在虚拟框中运行的操作系统。 此处使用 Ubuntu。 +- Virtual Box(VB):运行不同虚拟机的程序。此处使用 Oracle 虚拟机。 +- Virtual Machine(VM):作为访客系统在虚拟框中运行的操作系统。此处使用 Ubuntu。 ## 在 Virtual Box 中安装 Ubuntu 14.04.3 LTS @@ -30,13 +29,11 @@ RealSense R200 相机头如下图所示: - 安装完成后,您可能需要启用 Virtual Box 在整个桌面上显示 Ubuntu: - Start VM Ubuntu and login, Click on **Devices->Insert Guest Additions CD image** in the menu bar of the Virtual Box. - Click on **Run** and enter password on the windows that pop up in Ubuntu. - - 等待安装完成,然后重新启动。 - 现在,应该可以在整个桌面上显示 VM。 + - 等待安装完成,然后重新启动。现在,应该可以在整个桌面上显示 VM。 - 如果 ubuntu 中弹出一个窗口, 询问是否更新, 请在此时拒绝更新。 - 在 Virtual Box 中启用 USB 3 控制器: - 关闭虚拟机。 - - 转到 "虚拟机" 的设置到菜单选择 USB,然后选择: "USB 3.0(xHCI)"。 - 只有在安装了虚拟框的扩展包时, 才有可能执行此操作。 + - 转到 "虚拟机" 的设置到菜单选择 USB,然后选择: "USB 3.0(xHCI)"。只有在安装了虚拟框的扩展包时, 才有可能执行此操作。 - 再次启动虚拟机。 ## 安装 ROS Indigo diff --git a/docs/zh/advanced/rtk_gps.md b/docs/zh/advanced/rtk_gps.md index fc2e8151bee..b8e70083b9b 100644 --- a/docs/zh/advanced/rtk_gps.md +++ b/docs/zh/advanced/rtk_gps.md @@ -9,8 +9,7 @@ Instructions for _using_ RTK GNSS are provided in [Hardware > RTK GPS](../gps_co ## 综述 -RTK是使用导航信号的载波相位来进行测距的,而不是使用导航信号所搭载的信息。 -它依靠一个单一的参考基站站实时校正,这种校正可以与多个流动站一起工作。 +RTK是使用导航信号的载波相位来进行测距的,而不是使用导航信号所搭载的信息。它依靠一个单一的参考基站站实时校正,这种校正可以与多个流动站一起工作。 PX4 配置 RTK 需要两个 RTK GPS 模块和一个数传。 The fixed-position ground-based GPS unit is called the _Base_ and the in-air unit is called the _Rover_. @@ -79,14 +78,13 @@ QGroundControl 配置RTK 基地站输出以下 RTCM3.2 帧, 每个帧均为 1 Hz ## 上行数据速率 The raw RTCM messages from the base are packed into a MAVLink `GPS_RTCM_DATA` message and sent over the datalink. -MAVLink 消息的最大长度是182字节。 根据RTCM的信息类型,MAVLink信息是不会填满的。 +MAVLink 消息的最大长度是182字节。根据RTCM的信息类型,MAVLink信息是不会填满的。 RTCM 基础位置消息(1005)长度为 22 字节, 而其他卫星的长度则因可见卫星的数量和卫星信号的数量而异(M8P等L1单元只有一个)。 Since at a given time, the _maximum_ number of satellites visible from any single constellation is 12, under real-world conditions, theoretically an uplink rate of 300 B/s is sufficient. If _MAVLink 1_ is used, a 182-byte `GPS_RTCM_DATA` message is sent for every RTCM message, irrespective of its length. -因此,大约每秒上行需求是700多个字节。 -这可能导致低带宽半双轨遥测模块 (如3DR Telemetry Radios) 连接的饱和。 +因此,大约每秒上行需求是700多个字节。这可能导致低带宽半双轨遥测模块 (如3DR Telemetry Radios) 连接的饱和。 If _MAVLink 2_ is used then any empty space in the `GPS_RTCM_DATA message` is removed. 由此产生的上行链路需求与理论值 (约 300 字节/秒) 大致相同。 @@ -95,7 +93,7 @@ If _MAVLink 2_ is used then any empty space in the `GPS_RTCM_DATA message` is re PX4 automatically switches to MAVLink 2 if the GCS and telemetry modules support it. ::: -MAVLink 2 必须用于低带宽链接以保证 RTK 性能。 必须注意确保数传链在整个过程中使用 MAVLink 2。 +MAVLink 2 必须用于低带宽链接以保证 RTK 性能。必须注意确保数传链在整个过程中使用 MAVLink 2。 You can verify the protocol version by using the `mavlink status` command on the system console: ```sh diff --git a/docs/zh/advanced/switching_state_estimators.md b/docs/zh/advanced/switching_state_estimators.md index 359a3fd4ced..eca2669c6a1 100644 --- a/docs/zh/advanced/switching_state_estimators.md +++ b/docs/zh/advanced/switching_state_estimators.md @@ -43,6 +43,5 @@ If more than one is enabled, the first to publish the UOrb topics [vehicle_attit :::info For FMU-v2 (only) you will also need to build PX4 to specifically include required estimator (e.g. EKF2: `make px4_fmu-v2`, LPE: `make px4_fmu-v2_lpe`). -这是因为 FMU-v2 不具有足够的资源同时包含这两个估计器。 -其他的 Pixhawk FMU 版本同时拥有两个估计器。 +这是因为 FMU-v2 不具有足够的资源同时包含这两个估计器。其他的 Pixhawk FMU 版本同时拥有两个估计器。 ::: diff --git a/docs/zh/advanced/system_tunes.md b/docs/zh/advanced/system_tunes.md index 70548c0b22c..cb8bb3b5a59 100644 --- a/docs/zh/advanced/system_tunes.md +++ b/docs/zh/advanced/system_tunes.md @@ -17,8 +17,7 @@ Tune strings are defined using [ANSI Music notation](http://artscene.textfiles.c More information about the format can be found in [QBasic PLAY statement](https://en.wikibooks.org/wiki/QBasic/Appendix#PLAY) (Wikibooks) and has been reproduced in [tune_definition.desc](https://github.com/PX4/PX4-Autopilot/blob/main/src/lib/tunes/tune_definition.desc). ::: -创建新调节的最简单方式是使用音乐编辑器。 -这允许您编辑音乐并在您的电脑上播放, 然后导出为 PX4 可以播放的格式。 +创建新调节的最简单方式是使用音乐编辑器。这允许您编辑音乐并在您的电脑上播放, 然后导出为 PX4 可以播放的格式。 ANSI 音乐在 ANSI BBS 系统中很受欢迎,因此最好的编辑工具是 DOS 实用程序。 On Windows, one option is to use _Melody Master_ within _Dosbox_. @@ -54,8 +53,7 @@ On Windows, one option is to use _Melody Master_ within _Dosbox_. - Press **F7**, the scroll down the list of output formats on the right to get to ANSI. The file will be exported to the _root_ of the Melody Master directory (with the same name and a file-type specific extension). -8. 打开文件。 - 输出可能看起来像这样: +8. 打开文件。输出可能看起来像这样: ![ANSI Output from file](../../assets/tunes/tune_musicmaker_ansi_output.png) diff --git a/docs/zh/advanced_config/compass_power_compensation.md b/docs/zh/advanced_config/compass_power_compensation.md index b0f9c15500c..8f7da0082e5 100644 --- a/docs/zh/advanced_config/compass_power_compensation.md +++ b/docs/zh/advanced_config/compass_power_compensation.md @@ -34,8 +34,7 @@ The process is demonstrated for a multicopter, but is equally valid for other ve 4. Set the parameter [SDLOG_PROFILE](../advanced_config/parameter_reference.md#SDLOG_PROFILE) checkbox for _Sensor comparison_ (bit 6) to get more data points. -5. 固定好无人机使其无法移动,然后装好螺旋桨(这样电机可以获得与实际飞行中同样大的电流)。 - 本例中用带子固定了无人机。 +5. 固定好无人机使其无法移动,然后装好螺旋桨(这样电机可以获得与实际飞行中同样大的电流)。本例中用带子固定了无人机。 ![strap](../../assets/advanced_config/strap.png) @@ -67,9 +66,7 @@ The process is demonstrated for a multicopter, but is equally valid for other ve ::: -8. 这个脚本将返回基于推力和基于电流的补偿参数,并打印输出到控制台。 - 脚本弹出的数值显示了每个罗盘匹配的程度,以及使用了建议的补偿值后数据将是什么样的。 - 如果有电流测数,那么依据电流补偿通常可以获得更好的结果。这里是一个日志的例子,电流匹配得很好,然而因为不是线性关系推力参数则完全不可用。 +8. 这个脚本将返回基于推力和基于电流的补偿参数,并打印输出到控制台。脚本弹出的数值显示了每个罗盘匹配的程度,以及使用了建议的补偿值后数据将是什么样的。如果有电流测数,那么依据电流补偿通常可以获得更好的结果。这里是一个日志的例子,电流匹配得很好,然而因为不是线性关系推力参数则完全不可用。 ![line fit](../../assets/advanced_config/line_fit.png) diff --git a/docs/zh/advanced_config/esc_calibration.md b/docs/zh/advanced_config/esc_calibration.md index 27bda2805d9..eff0dd549f2 100644 --- a/docs/zh/advanced_config/esc_calibration.md +++ b/docs/zh/advanced_config/esc_calibration.md @@ -5,20 +5,16 @@ These instructions are only relevant to [PWM ESCs](../peripherals/pwm_escs_and_s [DShot](../peripherals/dshot.md) and [CAN](../can/index.md) ESCs ([DroneCAN](../dronecan/escs.md)/Cyphal) do not require this kind of calibration. ::: -电子速度控制器(ESC)根据飞行控制器的输入指令(FC)调节电机的速度(和方向)。 -电调响应的输入范围是可配置的,甚至同一型号的不同电调之间的默认范围也是不同的。 +电子速度控制器(ESC)根据飞行控制器的输入指令(FC)调节电机的速度(和方向)。电调响应的输入范围是可配置的,甚至同一型号的不同电调之间的默认范围也是不同的。 -此校准将使用来自飞行控制器的固定最大值 (2000us) 和最小值 (1000us) PWM 输入更新所有ESC。 -因此,载具上的所有ESC/电机都将以同样的方式在整个输入范围内响应飞行控制器的输入。 +此校准将使用来自飞行控制器的固定最大值 (2000us) 和最小值 (1000us) PWM 输入更新所有ESC。因此,载具上的所有ESC/电机都将以同样的方式在整个输入范围内响应飞行控制器的输入。 建议使用此工具校准支持它的所有 PWM/OneShot ESC。 :::info Calibration is particularly important for low-cost ESC, as they commonly vary a lot in their response to input. -然而,也建议为高质量的控制员提供这种校准。 -即使这些都是工厂校准的,而且都应以同样的方式作出反应,但实际上输入范围可能有所不同。 -例如,如果控制器在离开工厂后被手动校准,它可能不再以同样的方式动作。 +然而,也建议为高质量的控制员提供这种校准。即使这些都是工厂校准的,而且都应以同样的方式作出反应,但实际上输入范围可能有所不同。例如,如果控制器在离开工厂后被手动校准,它可能不再以同样的方式动作。 ::: :::warning @@ -36,8 +32,7 @@ OneShot ESCs should be [configured to use OneShot](../peripherals/oneshot.md#px4 如果使用 Pixhawk 飞行控制器,推荐这样做的方式是通过USB单独为飞行控制器提供电力。 并在需要时连接/断开ESC的电池供电。 Flight control systems that can't power the autopilot via USB will need a [different approach](#problem_power_module). -如果电池通过电源模块连接,校准程序可以检测电池连接并用它来驱动校准序列。 -如果无法检测到电池电力,则根据超时执行校准顺序。 +如果电池通过电源模块连接,校准程序可以检测电池连接并用它来驱动校准序列。如果无法检测到电池电力,则根据超时执行校准顺序。 ## 步骤 @@ -56,8 +51,7 @@ Flight control systems that can't power the autopilot via USB will need a [diffe 2. Map the ESCs you're calibrating as motors in the vehicle's [Actuator Configuration](../config/actuators.md). 只有映射的驱动器才能获得输出,并且只有被映射为电机的ESC将被校准。 -3. 拔下电池,断开ESC电源。 - 飞行控制器必须保持供电,例如将USB连接到地面站。 +3. 拔下电池,断开ESC电源。飞行控制器必须保持供电,例如将USB连接到地面站。 4. Open the _QGroundControl_ **Settings > Power**, then press the **Calibrate** button. @@ -80,10 +74,9 @@ Flight control systems that can't power the autopilot via USB will need a [diffe 7. Go back to the [Actuator Configuration](../config/actuators.md) section. - 在ESC 校准后,所有具有相同(重新)校准的 ESC的电机对同样的输入应以同样的方式动作。 驱动器配置中默认的 PWM 输出设置现在应该能开箱即用。 + 在ESC 校准后,所有具有相同(重新)校准的 ESC的电机对同样的输入应以同样的方式动作。驱动器配置中默认的 PWM 输出设置现在应该能开箱即用。 - 你需要确认电机确实正常工作。 - 由于默认配置值已经设置为保守的设置,您可能也希望调整它们以适用于您的特定的 ESC。 + 你需要确认电机确实正常工作。由于默认配置值已经设置为保守的设置,您可能也希望调整它们以适用于您的特定的 ESC。 ::: info The steps below are similar to those described in [Actuator Configuration > Motor Configuration](../config/actuators.md#motor-configuration). diff --git a/docs/zh/advanced_config/ethernet_setup.md b/docs/zh/advanced_config/ethernet_setup.md index 615bc913cf8..4d73e1454e6 100644 --- a/docs/zh/advanced_config/ethernet_setup.md +++ b/docs/zh/advanced_config/ethernet_setup.md @@ -2,8 +2,7 @@ 以太网连接提供了一种快速、可靠和灵活的通信选择,可替代使用USB或其他串行连接。 -它可以用于连接地面站、机载计算机和其他MAVLink系统。 -特别建议使用它连接到"原生"使用以太网的系统——例如IP数传。 +它可以用于连接地面站、机载计算机和其他MAVLink系统。特别建议使用它连接到"原生"使用以太网的系统——例如IP数传。 本主题涵盖: @@ -38,8 +37,7 @@ PX4 supports Ethernet connectivity on [Pixhawk 5X-standard](https://github.com/p ## 设置以太网网络 -要通过以太网连接系统,您需要将它们连接到同一个网络,以便每个系统有一个唯一的IP地址并且可以找到其他系统。 -可以使用DHCP服务器来分配地址,或者通过手动配置网络上每个系统的地址来完成。 +要通过以太网连接系统,您需要将它们连接到同一个网络,以便每个系统有一个唯一的IP地址并且可以找到其他系统。可以使用DHCP服务器来分配地址,或者通过手动配置网络上每个系统的地址来完成。 我们不能提供一个确保可以在您的本地网络中工作的“开箱即用配置”。 Therefore as an example of the kind of configuration you might do, below we show how to set up the systems on an IP network with static addresses in the range `10.41.10.Xxx`, where PX4 has a statically allocated address `10.41.10.2` (PX4-default) and the computer has address `10.41.10.1`. diff --git a/docs/zh/advanced_config/flight_termination.md b/docs/zh/advanced_config/flight_termination.md index fca2a398b06..f679623d958 100644 --- a/docs/zh/advanced_config/flight_termination.md +++ b/docs/zh/advanced_config/flight_termination.md @@ -22,9 +22,7 @@ Termination may be triggered by: - RC termination switch (mapped to an RC channel using [RC_MAP_TERM_SW](../advanced_config/parameter_reference.md#RC_MAP_TERM_SW)). - The MAVLink [MAV_CMD_DO_FLIGHTTERMINATION](https://mavlink.io/en/messages/common.html#MAV_CMD_DO_FLIGHTTERMINATION) MAVLink command from a GCS or companion computer (see [MAVLink Trigger](#mavlink-trigger) below). -飞行终止是无法取消的。 -在飞行终止触发后,您应尽快拔下电池。 -您需要在重启载具或重新上电后才能再次使用。 +飞行终止是无法取消的。在飞行终止触发后,您应尽快拔下电池。您需要在重启载具或重新上电后才能再次使用。 ### Termination Actions diff --git a/docs/zh/advanced_config/imu_factory_calibration.md b/docs/zh/advanced_config/imu_factory_calibration.md index 3b804044cbc..3bace80c3ea 100644 --- a/docs/zh/advanced_config/imu_factory_calibration.md +++ b/docs/zh/advanced_config/imu_factory_calibration.md @@ -1,7 +1,6 @@ # IMU/指南针工厂校准 -PX4 OEM制造商可以执行IMU和罗盘工厂校准,以便将加速度计、陀螺仪和磁力计校准的数值存储到持久存储器中(通常是EEPROM)。 -这将确保最终用户总是能够重置车辆配置并调整到安全状态以供飞行。 +PX4 OEM制造商可以执行IMU和罗盘工厂校准,以便将加速度计、陀螺仪和磁力计校准的数值存储到持久存储器中(通常是EEPROM)。这将确保最终用户总是能够重置车辆配置并调整到安全状态以供飞行。 This procedure will write the following parameters to `/fs/mtd_caldata`: [CAL_ACC\*](../advanced_config/parameter_reference.md#CAL_ACC0_ID), [CAL_GYRO\*](../advanced_config/parameter_reference.md#CAL_GYRO0_ID), [CAL_MAG\*](../advanced_config/parameter_reference.md#CAL_MAG0_ID). 当参数被设置(或重置)为其默认值时,此数据将被使用。 diff --git a/docs/zh/advanced_config/land_detector.md b/docs/zh/advanced_config/land_detector.md index 1191cc3940f..f60f802e4fa 100644 --- a/docs/zh/advanced_config/land_detector.md +++ b/docs/zh/advanced_config/land_detector.md @@ -1,7 +1,6 @@ # 着陆探测器配置 -着陆探测器是一个动态飞行器模型,代表了从接触地面到着陆的关键飞行器状态。 -本节主题说明您可能希望调整的主要参数,以改善飞行器着陆行为。 +着陆探测器是一个动态飞行器模型,代表了从接触地面到着陆的关键飞行器状态。本节主题说明您可能希望调整的主要参数,以改善飞行器着陆行为。 ## 自动上锁 @@ -20,8 +19,7 @@ Information about how the parameters affect landing can be found below in [Land 为了改善特定机架上的着陆,您可能需要调整的其他关键参数包括: - [MPC_THR_HOVER](../advanced_config/parameter_reference.md#MPC_THR_HOVER) - the hover throttle of the system (default is 50%). - 正确设置这一点是很重要的, 因为它使高度控制更加准确, 并确保正确的地面检测。 - 没有安装有效载荷的穿越机或大型相机的无人机可能需要更低的悬停油门 (例如 35%)。 + 正确设置这一点是很重要的, 因为它使高度控制更加准确, 并确保正确的地面检测。没有安装有效载荷的穿越机或大型相机的无人机可能需要更低的悬停油门 (例如 35%)。 ::: info Incorrectly setting `MPC_THR_HOVER` may result in ground-contact or maybe-landed detection while still in air (in particular, while descending in [Position mode](../flight_modes_mc/position.md) or [Altitude mode](../flight_modes_mc/altitude.md)). @@ -36,8 +34,7 @@ Information about how the parameters affect landing can be found below in [Land ### MC Land Detector States -为了探测着陆,多旋翼首先必须经历三个不同的状态,其中每个状态都包含来自先前状态的条件以及更严格的约束。 -如果由于缺少传感器而无法达到条件,则默认情况下认为该条件为真。 +为了探测着陆,多旋翼首先必须经历三个不同的状态,其中每个状态都包含来自先前状态的条件以及更严格的约束。如果由于缺少传感器而无法达到条件,则默认情况下认为该条件为真。 For instance, in [Acro mode](../flight_modes_mc/acro.md) and no sensor is active except for the gyro sensor, then the detection solely relies on thrust output and time. In order to proceed to the next state, each condition has to be true for 300ms. diff --git a/docs/zh/advanced_config/parameters.md b/docs/zh/advanced_config/parameters.md index 1ac17c1fb2d..9410056a5d1 100644 --- a/docs/zh/advanced_config/parameters.md +++ b/docs/zh/advanced_config/parameters.md @@ -76,8 +76,7 @@ This is a problem (in particular) for _FMUv2 firmware_, which omits many modules ## 更改参数 -要更改参数的值,请单击组或搜索列表中的参数行。 -单击后屏幕侧边会显示一个对话框,您在其中更改参数的值(这个对话框还提供了该参数的额外细节信息——包括是否需要重启才能使参数生效)。 +要更改参数的值,请单击组或搜索列表中的参数行。单击后屏幕侧边会显示一个对话框,您在其中更改参数的值(这个对话框还提供了该参数的额外细节信息——包括是否需要重启才能使参数生效)。 ![Changing a parameter value](../../assets/qgc/setup/parameters/parameters_changing.png) diff --git a/docs/zh/advanced_config/prearm_arm_disarm.md b/docs/zh/advanced_config/prearm_arm_disarm.md index 77f01862d0b..b42c739a09d 100644 --- a/docs/zh/advanced_config/prearm_arm_disarm.md +++ b/docs/zh/advanced_config/prearm_arm_disarm.md @@ -30,8 +30,7 @@ Users can control progression though these states using a [safety switch](../get - 也可以通过地面站发送 MAVLink 命令来解锁/锁定载具。 -如果在解锁后的一段时间内没有起飞,和如果着陆后没有手动锁定, PX4 会自动锁定载具。 -这减少了解锁的载具在地面上的时间。 +如果在解锁后的一段时间内没有起飞,和如果着陆后没有手动锁定, PX4 会自动锁定载具。这减少了解锁的载具在地面上的时间。 PX4 allows you to configure how pre-arming, arming and disarming work using parameters (which can be edited in _QGroundControl_ via the [parameter editor](../advanced_config/parameters.md)), as described in the following sections. diff --git a/docs/zh/advanced_config/sensor_thermal_calibration.md b/docs/zh/advanced_config/sensor_thermal_calibration.md index faab995b7c9..94fabd832fc 100644 --- a/docs/zh/advanced_config/sensor_thermal_calibration.md +++ b/docs/zh/advanced_config/sensor_thermal_calibration.md @@ -32,13 +32,9 @@ The board should be placed in a ziplock/anti-static bag containing a silica pack The bag/silica is to prevent condensation from forming on the board. ::: -它可以在没有商业级环境房间的情况下进行校准。 -可以使用内部空间很小的泡沫塑料盒来创造一个简单的环境容器。 -这允许自驾仪将空气相对快速地自加热(确保盒子有一个小孔以平衡容器内外压力,但仍然能够在容器内加热)。 +它可以在没有商业级环境房间的情况下进行校准。可以使用内部空间很小的泡沫塑料盒来创造一个简单的环境容器。这允许自驾仪将空气相对快速地自加热(确保盒子有一个小孔以平衡容器内外压力,但仍然能够在容器内加热)。 -使用这种设置可以将电路板加热到约 70C 。 -经验表明,许多普通电路板可以加热到这个温度不会产生不良副作用。 -如有疑问,请与制造商核实安全操作的温度范围。 +使用这种设置可以将电路板加热到约 70C 。经验表明,许多普通电路板可以加热到这个温度不会产生不良副作用。如有疑问,请与制造商核实安全操作的温度范围。 :::tip To check the status of the onboard thermal calibration use the MAVlink console (or NuttX console) to check the reported internal temp from the sensor. @@ -61,8 +57,8 @@ To perform and onboard calibration: 1. 确保在校准前设置机架类型,否则在设置飞控板时校准参数将丢失。 2. Power the board and set the `SYS_CAL_*` parameters to 1 to enable calibration of the required sensors at the next startup. [^1] -3. Set the [SYS_CAL_TDEL](../advanced_config/parameter_reference.md#SYS_CAL_TDEL) parameter to the number of degrees of temperature rise required for the onboard calibrator to complete. 如果此参数太小,则校准将提前完成,并且校准的温度范围将不足以在电路板完全预热时进行补偿。 如果此参数设置得太大,则板载校准器将永远不会完成。 在设置此参数时,应考虑到电路板自加热导致的温度升高。 如果传感器的温升量未知,则应使用板外校准方法。 -4. Set the [SYS_CAL_TMIN](../advanced_config/parameter_reference.md#SYS_CAL_TMIN) parameter to the lowest temperature data that you want the calibrator to use. 更低的冷却温度能够用于减少冷却时间,同时保持对校准最低温度的控制。 如果校准器温度低于此参数设置的值,则不会使用传感器的数据。 +3. Set the [SYS_CAL_TDEL](../advanced_config/parameter_reference.md#SYS_CAL_TDEL) parameter to the number of degrees of temperature rise required for the onboard calibrator to complete. 如果此参数太小,则校准将提前完成,并且校准的温度范围将不足以在电路板完全预热时进行补偿。如果此参数设置得太大,则板载校准器将永远不会完成。在设置此参数时,应考虑到电路板自加热导致的温度升高。如果传感器的温升量未知,则应使用板外校准方法。 +4. Set the [SYS_CAL_TMIN](../advanced_config/parameter_reference.md#SYS_CAL_TMIN) parameter to the lowest temperature data that you want the calibrator to use. 更低的冷却温度能够用于减少冷却时间,同时保持对校准最低温度的控制。如果校准器温度低于此参数设置的值,则不会使用传感器的数据。 5. Set the [SYS_CAL_TMAX](../advanced_config/parameter_reference.md#SYS_CAL_TMAX) parameter to the highest starting sensor temperature that should be accepted by the calibrator. 如果起始温度高于此参数设置的值,校准将退出并报告错误。 Note that if the variation in measured temperature between different sensors exceeds the gap between `SYS_CAL_TMAX` and `SYS_CAL_TMIN`, then it will be impossible for the calibration to start. 6. Remove power and cold soak the board to below the starting temperature specified by the `SYS_CAL_TMIN` parameter. 请注意,在校准开始之前启动过程有10秒的延迟,以允许所有传感器稳定,并且传感器在此期间会内部发热。 7. Keeping the board stationary[^2], apply power and warm to a temperature high enough to achieve the temperature rise specified by the `SYS_CAL_TDEL` parameter. 校准期间,完成百分比将打印到系统控制台。 [^3] @@ -104,7 +100,7 @@ To perform an offboard calibration: 11. After parameters have finished loading, set `SDLOG_MODE` to 1 to re-enable normal logging and remove power. -12. Power the board and perform a normal accelerometer sensor calibration using _QGroundControl_. 重要的是,此步骤在飞控板处于校准温度范围内进行。 此步骤后的首次飞行之前,应重新启动电路板,因为突然的偏置变化会扰乱导航估计器,并且某些参数直到下次启动时才会被使用它们的算法加载。 +12. Power the board and perform a normal accelerometer sensor calibration using _QGroundControl_. 重要的是,此步骤在飞控板处于校准温度范围内进行。此步骤后的首次飞行之前,应重新启动电路板,因为突然的偏置变化会扰乱导航估计器,并且某些参数直到下次启动时才会被使用它们的算法加载。 ## Implementation Detail {#implementation} diff --git a/docs/zh/advanced_config/tuning_the_ecl_ekf.md b/docs/zh/advanced_config/tuning_the_ecl_ekf.md index b46b936886b..a92afca6b08 100644 --- a/docs/zh/advanced_config/tuning_the_ecl_ekf.md +++ b/docs/zh/advanced_config/tuning_the_ecl_ekf.md @@ -23,23 +23,16 @@ PX4 的导航滤波器使用扩展卡尔曼滤波 (EKF) 算法来处理传感器 为了提高稳定性,实施了“误差状态 (error-state)”表述, 这在估计旋转(即 3D 向量,SO(3) 的切空间)的不确定性时尤为重要。 -EKF 在延迟的“融合时域 (fusion time horizon)”上运行,以允许每个测量值相对于 IMU 存在不同的时间延迟。 -每个传感器的数据都经过 FIFO 缓冲,并由 EKF 从缓冲区中检索,以便在正确的时间使用。 -每个传感器的延迟补偿由 [EKF2\_\*\_DELAY](../advanced_config/parameter_reference.md#ekf2) 参数控制。 +EKF 在延迟的“融合时域 (fusion time horizon)”上运行,以允许每个测量值相对于 IMU 存在不同的时间延迟。每个传感器的数据都经过 FIFO 缓冲,并由 EKF 从缓冲区中检索,以便在正确的时间使用。每个传感器的延迟补偿由 [EKF2\_\*\_DELAY](../advanced_config/parameter_reference.md#ekf2) 参数控制。 -互补滤波器用于使用缓冲的 IMU 数据将状态从“融合时域”向前传播到当前时间。 -该滤波器的时间常数由 [EKF2_TAU_VEL](../advanced_config/parameter_reference.md#EKF2_TAU_VEL) 和 [EKF2_TAU_POS](../advanced_config/parameter_reference.md#EKF2_TAU_POS) 参数控制。 +互补滤波器用于使用缓冲的 IMU 数据将状态从“融合时域”向前传播到当前时间。该滤波器的时间常数由 [EKF2_TAU_VEL](../advanced_config/parameter_reference.md#EKF2_TAU_VEL) 和 [EKF2_TAU_POS](../advanced_config/parameter_reference.md#EKF2_TAU_POS) 参数控制。 :::info -缓冲区的“融合时域”延迟和长度由 [EKF2_DELAY_MAX](../advanced_config/parameter_reference.md#EKF2_DELAY_MAX) 决定。 -该值应至少与最长的 `EKF2\_\*\_DELAY` 延迟一样大。 -减小“融合时域”延迟会减少用于将状态向前传播到当前时间的互补滤波器的误差。 +缓冲区的“融合时域”延迟和长度由 [EKF2_DELAY_MAX](../advanced_config/parameter_reference.md#EKF2_DELAY_MAX) 决定。该值应至少与最长的 `EKF2\_\*\_DELAY` 延迟一样大。减小“融合时域”延迟会减少用于将状态向前传播到当前时间的互补滤波器的误差。 ::: EKF 仅将 IMU 数据用于状态预测。 -IMU 数据不作为观测值用于 EKF 推导。 -协方差预测和测量雅可比矩阵的代数方程是使用 [SymForce](https://symforce.org/) 推导的,可以在这里找到:[符号推导](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/ekf2/EKF/python/ekf_derivation/derivation.py)。 -协方差更新使用 [约瑟夫稳定形式 (Joseph Stabilized form)](https://en.wikipedia.org/wiki/Kalman_filter#Deriving_the_posteriori_estimate_covariance_matrix) 完成,以提高数值稳定性并允许独立状态的条件更新。 +IMU 数据不作为观测值用于 EKF 推导。协方差预测和测量雅可比矩阵的代数方程是使用 [SymForce](https://symforce.org/) 推导的,可以在这里找到:[符号推导](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/ekf2/EKF/python/ekf_derivation/derivation.py)。协方差更新使用 [约瑟夫稳定形式 (Joseph Stabilized form)](https://en.wikipedia.org/wiki/Kalman_filter#Deriving_the_posteriori_estimate_covariance_matrix) 完成,以提高数值稳定性并允许独立状态的条件更新。 ### 关于位置输出的精度 @@ -49,15 +42,11 @@ IMU 数据不作为观测值用于 EKF 推导。 IMU 相对于机体坐标系的位置由 `EKF2_IMU_POS_X,Y,Z` 参数设置。 -除了纬度/经度/高度的全局位置估计外,滤波器还通过使用以任意原点为中心的 [等距方位投影 (azimuthal_equidistant_projection)](https://en.wikipedia.org/wiki/Azimuthal_equidistant_projection) 投影全局位置估计值,提供局部位置估计(以米为单位的 NED)。 -当融合全局位置测量值时,会自动设置此原点,也可以手动指定。 -如果未提供全局位置信息,则只有局部位置可用,并且 INS 积分是在球形地球模型上执行的。 +除了纬度/经度/高度的全局位置估计外,滤波器还通过使用以任意原点为中心的 [等距方位投影 (azimuthal_equidistant_projection)](https://en.wikipedia.org/wiki/Azimuthal_equidistant_projection) 投影全局位置估计值,提供局部位置估计(以米为单位的 NED)。当融合全局位置测量值时,会自动设置此原点,也可以手动指定。如果未提供全局位置信息,则只有局部位置可用,并且 INS 积分是在球形地球模型上执行的。 ## 运行单个 EKF 实例 -_默认行为_ 是运行单个 EKF 实例。 -在这种情况下,传感器选择和故障转移是在数据被 EKF 接收之前执行的。 -这针对有限数量的传感器故障(例如数据丢失)提供了保护,但无法防止传感器提供超出 EKF 和控制回路补偿能力的不准确数据。 +_默认行为_ 是运行单个 EKF 实例。在这种情况下,传感器选择和故障转移是在数据被 EKF 接收之前执行的。这针对有限数量的传感器故障(例如数据丢失)提供了保护,但无法防止传感器提供超出 EKF 和控制回路补偿能力的不准确数据。 运行单个 EKF 实例的参数设置如下: @@ -68,10 +57,7 @@ _默认行为_ 是运行单个 EKF 实例。 ## 运行多个 EKF 实例 -根据 IMU 和磁力计的数量以及飞控的 CPU 能力,可以运行多个 EKF 实例。 -这针对更广泛的传感器误差提供了保护,并通过每个 EKF 实例使用不同的传感器组合来实现。 -通过比较每个 EKF 实例的内部一致性,EKF 选择器能够确定具有最佳数据一致性的 EKF 和传感器组合。 -这使得可以检测并隔离诸如 IMU 零偏突变、饱和或数据卡死等故障。 +根据 IMU 和磁力计的数量以及飞控的 CPU 能力,可以运行多个 EKF 实例。这针对更广泛的传感器误差提供了保护,并通过每个 EKF 实例使用不同的传感器组合来实现。通过比较每个 EKF 实例的内部一致性,EKF 选择器能够确定具有最佳数据一致性的 EKF 和传感器组合。这使得可以检测并隔离诸如 IMU 零偏突变、饱和或数据卡死等故障。 EKF 实例的总数是 [EKF2_MULTI_IMU](../advanced_config/parameter_reference.md#EKF2_MULTI_IMU) 和 [EKF2_MULTI_MAG](../advanced_config/parameter_reference.md#EKF2_MULTI_MAG) 选择的 IMU 数量和磁力计数量的乘积,由以下公式给出: @@ -84,9 +70,7 @@ EKF 实例的总数是 [EKF2_MULTI_IMU](../advanced_config/parameter_reference.m - EKF 实例 3 : IMU 2, 磁力计 1 - EKF 实例 4 : IMU 2, 磁力计 2 -可以处理的 IMU 或磁力计传感器的最大数量各为 4 个,理论最大值为 4 x 4 = 16 个 EKF 实例。 -实际上,这受到可用计算资源的限制。 -在此功能的开发过程中,使用基于 STM32F7 CPU 的硬件进行的测试表明,4 个 EKF 实例具有可接受的处理负载和内存利用率余量。 +可以处理的 IMU 或磁力计传感器的最大数量各为 4 个,理论最大值为 4 x 4 = 16 个 EKF 实例。实际上,这受到可用计算资源的限制。在此功能的开发过程中,使用基于 STM32F7 CPU 的硬件进行的测试表明,4 个 EKF 实例具有可接受的处理负载和内存利用率余量。 :::warning 飞行前应进行地面测试以检查 CPU 和内存利用率。 @@ -99,48 +83,34 @@ EKF 实例的总数是 [EKF2_MULTI_IMU](../advanced_config/parameter_reference.m - [SENS_IMU_MODE](../advanced_config/parameter_reference.md#SENS_IMU_MODE): 如果是以 IMU 传感器多样性运行多个 EKF 实例,即 [EKF2_MULTI_IMU](../advanced_config/parameter_reference.md#EKF2_MULTI_IMU) > 1,则设置为 0。 - 当设置为 1(单个 EKF 的默认值)时,传感器模块选择 EKF 使用的 IMU 数据。 - 这提供了针对传感器数据丢失的保护,但不提供针对错误传感器数据的保护。 - 当设置为 0 时,传感器模块不进行选择。 + 当设置为 1(单个 EKF 的默认值)时,传感器模块选择 EKF 使用的 IMU 数据。这提供了针对传感器数据丢失的保护,但不提供针对错误传感器数据的保护。当设置为 0 时,传感器模块不进行选择。 - [SENS_MAG_MODE](../advanced_config/parameter_reference.md#SENS_MAG_MODE): 如果是以磁力计传感器多样性运行多个 EKF 实例,即 [EKF2_MULTI_MAG](../ advanced_config/parameter_reference.md#EKF2_MULTI_MAG) > 1,则设置为 0。 - 当设置为 1(单个 EKF 的默认值)时,传感器模块选择 EKF 使用的磁力计数据。 - 这提供了针对传感器数据丢失的保护,但不提供针对错误传感器数据的保护。 - 当设置为 0 时,传感器模块不进行选择。 + 当设置为 1(单个 EKF 的默认值)时,传感器模块选择 EKF 使用的磁力计数据。这提供了针对传感器数据丢失的保护,但不提供针对错误传感器数据的保护。当设置为 0 时,传感器模块不进行选择。 - [EKF2_MULTI_IMU](../advanced_config/parameter_reference.md#EKF2_MULTI_IMU): - 此参数指定多个 EKF 使用的 IMU 传感器数量。 - 如果 `EKF2_MULTI_IMU` <= 1,则仅使用第一个 IMU 传感器。 - 当 [SENS_IMU_MODE](../advanced_config/parameter_reference.md#SENS_IMU_MODE) = 1 时,这将是传感器模块选择的传感器。 - 如果 `EKF2_MULTI_IMU` >= 2,那么将为指定数量的 IMU 传感器运行独立的 EKF 实例,最多支持 4 个或实际存在的 IMU 数量(取两者中的较小值)。 + 此参数指定多个 EKF 使用的 IMU 传感器数量。如果 `EKF2_MULTI_IMU` <= 1,则仅使用第一个 IMU 传感器。当 [SENS_IMU_MODE](../advanced_config/parameter_reference.md#SENS_IMU_MODE) = 1 时,这将是传感器模块选择的传感器。如果 `EKF2_MULTI_IMU` >= 2,那么将为指定数量的 IMU 传感器运行独立的 EKF 实例,最多支持 4 个或实际存在的 IMU 数量(取两者中的较小值)。 - [EKF2_MULTI_MAG](../advanced_config/parameter_reference.md#EKF2_MULTI_MAG): 此参数指定多个 EKF 使用的磁力计传感器数量。 - 如果 `EKF2_MULTI_MAG` <= 1,则仅使用第一个磁力计传感器。 - 当 [SENS_MAG_MODE](../advanced_config/parameter_reference.md#SENS_MAG_MODE) = 1 时,这将是传感器模块选择的传感器。 - 如果 `EKF2_MULTI_MAG` >= 2,那么将为指定数量的磁力计传感器运行独立的 EKF 实例,最多支持 4 个或实际存在的磁力计数量(取两者中的较小值)。 + 如果 `EKF2_MULTI_MAG` <= 1,则仅使用第一个磁力计传感器。当 [SENS_MAG_MODE](../advanced_config/parameter_reference.md#SENS_MAG_MODE) = 1 时,这将是传感器模块选择的传感器。如果 `EKF2_MULTI_MAG` >= 2,那么将为指定数量的磁力计传感器运行独立的 EKF 实例,最多支持 4 个或实际存在的磁力计数量(取两者中的较小值)。 :::info -不支持多 EKF 实例飞行日志的记录和 [EKF2 回放](../debug/system_wide_replay.md#ekf2-replay)。 -要启用 EKF 回放记录,必须设置参数以启用 [单个 EKF 实例](#running-a-single-ekf-instance)。 +不支持多 EKF 实例飞行日志的记录和 [EKF2 回放](../debug/system_wide_replay.md#ekf2-replay)。要启用 EKF 回放记录,必须设置参数以启用 [单个 EKF 实例](#running-a-single-ekf-instance)。 ::: ## 它使用哪些传感器测量? -EKF 具有不同的操作模式,允许不同的传感器测量组合。 -启动时,滤波器会检查传感器的最小可用组合,并在初始倾斜、偏航和高度对准完成后,进入提供旋转、垂直速度、垂直位置、IMU 角度增量零偏和 IMU 速度增量零偏估计的模式。 +EKF 具有不同的操作模式,允许不同的传感器测量组合。启动时,滤波器会检查传感器的最小可用组合,并在初始倾斜、偏航和高度对准完成后,进入提供旋转、垂直速度、垂直位置、IMU 角度增量零偏和 IMU 速度增量零偏估计的模式。 -此模式需要 IMU 数据、偏航源(磁力计或外部视觉)和高度数据源。 -所有 EKF 工作模式都需要此最小数据集。 -其他传感器数据可用于估计额外状态。 +此模式需要 IMU 数据、偏航源(磁力计或外部视觉)和高度数据源。所有 EKF 工作模式都需要此最小数据集。其他传感器数据可用于估计额外状态。 ### IMU -- 固定在机体上的三轴 IMU,以至少100Hz的频率获取增量角度和角速度数据 。 - 注意:在 EKF 使用 IMU 角度增量数据之前,应该使用圆锥校正算法校正。 +- 固定在机体上的三轴 IMU,以至少100Hz的频率获取增量角度和角速度数据 。注意:在 EKF 使用 IMU 角度增量数据之前,应该使用圆锥校正算法校正。 ### 磁力计 @@ -149,8 +119,7 @@ EKF 具有不同的操作模式,允许不同的传感器测量组合。 ::: info - 磁力计 **零偏 (biases)** 仅在无人机旋转时可观测。 -- 当载具处于加速状态(线性加速度)时,可通过融合绝对位置或速度测量数据(例如GPS)来观测真实航向。 - 这意味着在初始化后,如果满足上述条件且频率足够高以约束(由陀螺仪偏置引起的)航向漂移,则磁力计航向测量是可选的。 +- 当载具处于加速状态(线性加速度)时,可通过融合绝对位置或速度测量数据(例如GPS)来观测真实航向。这意味着在初始化后,如果满足上述条件且频率足够高以约束(由陀螺仪偏置引起的)航向漂移,则磁力计航向测量是可选的。 ::: @@ -162,22 +131,18 @@ EKF 具有不同的操作模式,允许不同的传感器测量组合。 - 不正确的磁场测量会降低倾斜估计的质量。 - 磁力计零偏会在可观测时被估计。 1. 磁航向 (Magnetic heading): - - 仅修正航向。 - 倾斜估计永远不会受到不正确磁场测量的影响。 + - 仅修正航向。倾斜估计永远不会受到不正确磁场测量的影响。 - 使用此方法时,不会修正因没有速度/位置辅助飞行而产生的倾斜误差。 - 磁力计零偏会在可观测时被估计。 2. 已弃用 3. 已弃用 4. 已弃用 5. 无 (None): - - 永不使用磁力计数据。 - 当数据完全不可信时(例如:传感器附近有大电流、外部异常),这很有用。 + - 永不使用磁力计数据。当数据完全不可信时(例如:传感器附近有大电流、外部异常),这很有用。 - 估计器将使用其他航向源:[GPS 航向](#yaw-measurements) 或外部视觉。 - - 当使用 GPS 测量而没有其他航向源时,航向只能在获得足够的水平加速度后才能初始化。 - 参见下文的 [从载具运动估计偏航](#yaw-from-gps-velocity)。 + - 当使用 GPS 测量而没有其他航向源时,航向只能在获得足够的水平加速度后才能初始化。参见下文的 [从载具运动估计偏航](#yaw-from-gps-velocity)。 6. 仅初始化 (Init only): - - 磁力计数据仅用于初始化航向估计。 - 当数据可以在解锁前使用但解锁后不能使用(例如:载具解锁后有大电流)时,这很有用。 + - 磁力计数据仅用于初始化航向估计。当数据可以在解锁前使用但解锁后不能使用(例如:载具解锁后有大电流)时,这很有用。 - 初始化后,航向使用其他观测值进行约束。 - 与 `None` 模式不同,当与 GPS 测量结合使用时,此方法允许位置控制模式在起飞期间直接运行。 @@ -189,9 +154,7 @@ EKF 具有不同的操作模式,允许不同的传感器测量组合。 需要高度数据源 - GPS、气压计、测距仪、外部视觉或这些源的组合,最小速率为 5Hz。 -如果不存在任何选定的测量值,EKF 将不会启动。 -当检测到这些测量值时,EKF 将初始化状态并完成倾斜和偏航对准。 -当倾斜和偏航对准完成后,EKF 可以转换到其他操作模式,从而能够使用额外的传感器数据: +如果不存在任何选定的测量值,EKF 将不会启动。当检测到这些测量值时,EKF 将初始化状态并完成倾斜和偏航对准。当倾斜和偏航对准完成后,EKF 可以转换到其他操作模式,从而能够使用额外的传感器数据: 可以使用其专用控制参数启用/禁用每个高度源: @@ -200,8 +163,7 @@ EKF 具有不同的操作模式,允许不同的传感器测量组合。 - [测距仪](#range-finder): [EKF2_RNG_CTRL](../advanced_config/parameter_reference.md#EKF2_RNG_CTRL) - [外部视觉](#external-vision-system): 当 [EKF2_HGT_REF](../advanced_config/parameter_reference.md#EKF2_HGT_REF) 设置为 "Vision" 时启用 -从长远来看,高度估计遵循高度数据的“参考源”。 -此参考由 [EKF2_HGT_REF](../advanced_config/parameter_reference.md#EKF2_HGT_REF) 参数定义。 +从长远来看,高度估计遵循高度数据的“参考源”。此参考由 [EKF2_HGT_REF](../advanced_config/parameter_reference.md#EKF2_HGT_REF) 参数定义。 #### 典型配置 @@ -216,18 +178,13 @@ EKF 具有不同的操作模式,允许不同的传感器测量组合。 使用 [EKF2_BARO_CTRL](../advanced_config/parameter_reference.md#EKF2_BARO_CTRL) 启用/禁用作为 [高度](#height) 数据的来源。 -注意,即使有多个气压计可用,也只融合来自一个气压计的数据。 -首先选择具有最高 [CAL_BAROx_PRIO](../advanced_config/parameter_reference.md#CAL_BARO0_PRIO) 优先级值的气压计,如果检测到传感器故障,则回退到下一个最高优先级的气压计。 -如果气压计具有相同的最高优先级,则使用第一个检测到的气压计。 -可以通过将其 `CAL_BAROx_PRIO` 值设置为 `0`(禁用)来完全禁用某个气压计作为可能的来源。 +注意,即使有多个气压计可用,也只融合来自一个气压计的数据。首先选择具有最高 [CAL_BAROx_PRIO](../advanced_config/parameter_reference.md#CAL_BARO0_PRIO) 优先级值的气压计,如果检测到传感器故障,则回退到下一个最高优先级的气压计。如果气压计具有相同的最高优先级,则使用第一个检测到的气压计。可以通过将其 `CAL_BAROx_PRIO` 值设置为 `0`(禁用)来完全禁用某个气压计作为可能的来源。 有关高度源配置的更多详细信息,请参阅 [高度](#height)。 #### 静压位置误差校正 -气压高度容易受到由载具风相对速度和方向产生的气动扰动引起的误差的影响。 -这在航空学中被称为 _静压位置误差 (static pressure position error)_。 -使用 ECL/EKF2 估计器库的 EKF2 模块提供了一种补偿这些误差的方法,前提是风速状态估计处于激活状态。 +气压高度容易受到由载具风相对速度和方向产生的气动扰动引起的误差的影响。这在航空学中被称为 _静压位置误差 (static pressure position error)_。使用 ECL/EKF2 估计器库的 EKF2 模块提供了一种补偿这些误差的方法,前提是风速状态估计处于激活状态。 对于以固定翼模式运行的飞行器,风速状态估计需要启用 [空速](#airspeed) 和/或 [合成侧滑](#synthetic-sideslip) 融合。 @@ -257,9 +214,7 @@ EKF2 模块将误差建模为一个机体固定的椭球体,该椭球体指定 #### 气压计零偏补偿 -恒定高度下的气压计容易因环境压力变化或传感器温度变化而产生测量漂移。 -为了补偿这种测量误差,EKF2 使用 GNSS 高度(如果可用)作为“无漂移”参考来估计零偏。 -不需要调参。 +恒定高度下的气压计容易因环境压力变化或传感器温度变化而产生测量漂移。为了补偿这种测量误差,EKF2 使用 GNSS 高度(如果可用)作为“无漂移”参考来估计零偏。不需要调参。 ### GNSS/GPS @@ -268,59 +223,38 @@ EKF2 模块将误差建模为一个机体固定的椭球体,该椭球体指定 如果满足以下条件,将使用 GPS 测量进行位置和速度估计: - 通过设置 [EKF2_GPS_CTRL](../advanced_config/parameter_reference.md#EKF2_GPS_CTRL) 参数启用 GPS 使用。 -- GPS 质量检查已通过。 - 这些检查由 [EKF2_GPS_CHECK](../advanced_config/parameter_reference.md#EKF2_GPS_CHECK) 和 `EKF2_REQ_*` 参数控制。 +- GPS 质量检查已通过。这些检查由 [EKF2_GPS_CHECK](../advanced_config/parameter_reference.md#EKF2_GPS_CHECK) 和 `EKF2_REQ_*` 参数控制。 有关高度源配置的更多详细信息,请 [点击这里](#height)。 #### 偏航角测量 -某些 GPS 接收机,例如 [Trimble MB-Two RTK GPS 接收机](https://oemgnss.trimble.com/en/products/receiver-modules/mb-two),可用于提供航向测量,以替代磁力计数据的使用。 -当在存在大型磁异常的环境中或在地球磁场倾角较大的纬度地区运行时,这可能是一个显著的优势。 -通过将 [EKF2_GPS_CTRL](../advanced_config/parameter_reference.md#EKF2_GPS_CTRL) 参数中的第 3 位设置为 1(加 8)来启用 GPS 偏航测量。 +某些 GPS 接收机,例如 [Trimble MB-Two RTK GPS 接收机](https://oemgnss.trimble.com/en/products/receiver-modules/mb-two),可用于提供航向测量,以替代磁力计数据的使用。当在存在大型磁异常的环境中或在地球磁场倾角较大的纬度地区运行时,这可能是一个显著的优势。通过将 [EKF2_GPS_CTRL](../advanced_config/parameter_reference.md#EKF2_GPS_CTRL) 参数中的第 3 位设置为 1(加 8)来启用 GPS 偏航测量。 #### 从 GPS 速度数据获取偏航角 -EKF 在内部运行一个额外的多假设滤波器,该滤波器使用多个 3 状态扩展卡尔曼滤波器 (EKF),其状态为北东 (NE) 速度和偏航角。 -然后使用高斯求和滤波器 (GSF) 组合这些单独的偏航角估计值。 -单独的 3 状态 EKF 使用 IMU 和 GPS 水平速度数据(加上可选的空速数据),不依赖于偏航角或磁力计测量的任何先验知识。 -这为自主滤波器的偏航提供了备份,并用于在起飞后导航丢失表明来自磁力计的偏航估计错误时重置主 24 状态 EKF 的偏航。 -这将导致 GCS 显示 `Emergency yaw reset - magnetometer use stopped`(紧急航向重置 - 磁力计停止使用)信息消息。 +EKF 在内部运行一个额外的多假设滤波器,该滤波器使用多个 3 状态扩展卡尔曼滤波器 (EKF),其状态为北东 (NE) 速度和偏航角。然后使用高斯求和滤波器 (GSF) 组合这些单独的偏航角估计值。单独的 3 状态 EKF 使用 IMU 和 GPS 水平速度数据(加上可选的空速数据),不依赖于偏航角或磁力计测量的任何先验知识。这为自主滤波器的偏航提供了备份,并用于在起飞后导航丢失表明来自磁力计的偏航估计错误时重置主 24 状态 EKF 的偏航。这将导致 GCS 显示 `Emergency yaw reset - magnetometer use stopped`(紧急航向重置 - 磁力计停止使用)信息消息。 -启用 ekf2 回放日志记录后,将记录来自此估计器的数据,并可在 `yaw_estimator_status` 消息中查看。 -来自各个 3 状态 EKF 偏航估计器的单独偏航估计值位于 `yaw` 字段中。 +启用 ekf2 回放日志记录后,将记录来自此估计器的数据,并可在 `yaw_estimator_status` 消息中查看。来自各个 3 状态 EKF 偏航估计器的单独偏航估计值位于 `yaw` 字段中。 GSF 组合偏航估计值位于 `yaw_composite` 字段中。 -GSF 偏航估计值的方差位于 `yaw_variance` 字段中。 -所有角度均以弧度为单位。 +GSF 偏航估计值的方差位于 `yaw_variance` 字段中。所有角度均以弧度为单位。 GSF 应用于各个 3 状态 EKF 输出的权重位于 `weight` 字段中。 -这也可以实现在没有任何磁力计数据或双天线 GPS 接收机的情况下进行偏航操作,前提是起飞后可以进行一些水平运动以使偏航变得可观测。 -要使用此功能,请将 [EKF2_MAG_TYPE](../advanced_config/parameter_reference.md#EKF2_MAG_TYPE) 设置为 `none` (5) 以禁用磁力计使用。 -一旦载具进行了足够的水平运动使偏航可观测,主 24 状态 EKF 将把它的偏航对准 GSF 估计值并开始使用 GPS。 +这也可以实现在没有任何磁力计数据或双天线 GPS 接收机的情况下进行偏航操作,前提是起飞后可以进行一些水平运动以使偏航变得可观测。要使用此功能,请将 [EKF2_MAG_TYPE](../advanced_config/parameter_reference.md#EKF2_MAG_TYPE) 设置为 `none` (5) 以禁用磁力计使用。一旦载具进行了足够的水平运动使偏航可观测,主 24 状态 EKF 将把它的偏航对准 GSF 估计值并开始使用 GPS。 #### 双 GPS 接收器 -可以使用一种算法混合来自 GPS 接收机的数据,该算法根据报告的精度对数据进行加权(如果两个接收机以相同的速率输出数据并使用相同的精度,效果最佳)。 -如果来自接收机的数据丢失,该机制还提供自动故障转移(例如,它允许使用标准 GPS 作为更精确的 RTK 接收机的备份)。 -这由 [SENS_GPS_MASK](../advanced_config/parameter_reference.md#SENS_GPS_MASK) 参数控制。 +可以使用一种算法混合来自 GPS 接收机的数据,该算法根据报告的精度对数据进行加权(如果两个接收机以相同的速率输出数据并使用相同的精度,效果最佳)。如果来自接收机的数据丢失,该机制还提供自动故障转移(例如,它允许使用标准 GPS 作为更精确的 RTK 接收机的备份)。这由 [SENS_GPS_MASK](../advanced_config/parameter_reference.md#SENS_GPS_MASK) 参数控制。 -[SENS_GPS_MASK](../advanced_config/parameter_reference.md#SENS_GPS_MASK) 参数默认设置为禁用混合并始终使用第一个接收机,因此必须设置它以选择使用哪些接收机精度指标来决定每个接收机输出对混合解算的贡献程度。 -当使用不同的接收机型号时,重要的是将 [SENS_GPS_MASK](../advanced_config/parameter_reference.md#SENS_GPS_MASK) 参数设置为两个接收机都支持的精度指标值。 -例如,除非两个接收机的驱动程序都在 `vehicle_gps_position` 消息的 `s_variance_m_s` 字段中发布可比较的值,否则不要将第 0 位设置为 `true`。 -由于不同制造商定义精度的方式不同(例如 CEP 与 1-sigma 等),这对于来自不同制造商的接收机可能很困难。 +[SENS_GPS_MASK](../advanced_config/parameter_reference.md#SENS_GPS_MASK) 参数默认设置为禁用混合并始终使用第一个接收机,因此必须设置它以选择使用哪些接收机精度指标来决定每个接收机输出对混合解算的贡献程度。当使用不同的接收机型号时,重要的是将 [SENS_GPS_MASK](../advanced_config/parameter_reference.md#SENS_GPS_MASK) 参数设置为两个接收机都支持的精度指标值。例如,除非两个接收机的驱动程序都在 `vehicle_gps_position` 消息的 `s_variance_m_s` 字段中发布可比较的值,否则不要将第 0 位设置为 `true`。由于不同制造商定义精度的方式不同(例如 CEP 与 1-sigma 等),这对于来自不同制造商的接收机可能很困难。 设置期间应检查以下项目: -- 验证第二个接收机的数据是否存在。 - 这将记录为 `vehicle_gps_position_1`,也可以在连接 _nsh console_ 时使用命令 `listener vehicle_gps_position -i 1` 进行检查。 +- 验证第二个接收机的数据是否存在。这将记录为 `vehicle_gps_position_1`,也可以在连接 _nsh console_ 时使用命令 `listener vehicle_gps_position -i 1` 进行检查。 [GPS_2_CONFIG](../advanced_config/parameter_reference.md#GPS_2_CONFIG) 参数需要正确设置。 -- 检查来自每个接收机的 `s_variance_m_s`、`eph` 和 `epv` 数据,并决定可以使用哪些精度指标。 - 如果两个接收机都输出合理的 `s_variance_m_s` 和 `eph` 数据,并且 GPS 垂直位置未直接用于导航,则建议将 [SENS_GPS_MASK](../advanced_config/parameter_reference.md#SENS_GPS_MASK) 设置为 3。 - 如果只有 `eph` 数据可用,且两个接收机都不输出 `s_variance_m_s` 数据,则将 [SENS_GPS_MASK](../advanced_config/parameter_reference.md#SENS_GPS_MASK) 设置为 2。 - 只有当 GPS 已通过 [EKF2_HGT_REF](../advanced_config/parameter_reference.md#EKF2_HGT_REF) 参数被选为参考高度源,且两个接收机都输出合理的 `epv` 数据时,第 2 位才会被置位。 +- 检查来自每个接收机的 `s_variance_m_s`、`eph` 和 `epv` 数据,并决定可以使用哪些精度指标。如果两个接收机都输出合理的 `s_variance_m_s` 和 `eph` 数据,并且 GPS 垂直位置未直接用于导航,则建议将 [SENS_GPS_MASK](../advanced_config/parameter_reference.md#SENS_GPS_MASK) 设置为 3。如果只有 `eph` 数据可用,且两个接收机都不输出 `s_variance_m_s` 数据,则将 [SENS_GPS_MASK](../advanced_config/parameter_reference.md#SENS_GPS_MASK) 设置为 2。只有当 GPS 已通过 [EKF2_HGT_REF](../advanced_config/parameter_reference.md#EKF2_HGT_REF) 参数被选为参考高度源,且两个接收机都输出合理的 `epv` 数据时,第 2 位才会被置位。 - 混合接收机数据的输出记录为 `ekf_gps_position`,可以在连接 nsh 终端时使用命令 `listener ekf_gps_position` 进行检查。 -- 若各接收机输出速率不同,融合后的输出速率将与速率较慢的接收机保持一致。 - 在可能的情况下,接收机应配置为以相同的速率输出。 +- 若各接收机输出速率不同,融合后的输出速率将与速率较慢的接收机保持一致。在可能的情况下,接收机应配置为以相同的速率输出。 #### GNSS 性能要求 @@ -328,8 +262,7 @@ GSF 应用于各个 3 状态 EKF 输出的权重位于 `weight` 字段中。 最小值在 [EKF2_REQ_\*](../advanced_config/parameter_reference.md#EKF2_REQ_EPH) 参数中定义,并且可以使用 [EKF2_GPS_CHECK](../advanced_config/parameter_reference.md#EKF2_GPS_CHECK) 参数启用/禁用每个检查。 -下表列出了直接从 GNSS 数据中报告或计算的不同指标,以及 ECL 使用这些数据所需满足的最低要求值。 -此外,_平均值 (Average Value)_ 列显示了可能从标准 GNSS 模块(例如 u-blox M8 系列)合理获得的典型值 - 即被认为良好/可接受的值。 +下表列出了直接从 GNSS 数据中报告或计算的不同指标,以及 ECL 使用这些数据所需满足的最低要求值。此外,_平均值 (Average Value)_ 列显示了可能从标准 GNSS 模块(例如 u-blox M8 系列)合理获得的典型值 - 即被认为良好/可接受的值。 | 指标 (Metric) | 最低要求 | 平均值 (Average Value) | 单位 (Units) | 备注 | | ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- | ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -345,22 +278,17 @@ GSF 应用于各个 3 状态 EKF 输出的权重位于 `weight` 字段中。 | 报告的 GNSS 垂直速度的滤波幅值。 | < 0.2 ([EKF2_REQ_EPH](../advanced_config/parameter_reference.md#EKF2_REQ_VDRIFT)) | 0.02 | 米/秒 | 所报告的全球导航卫星系统垂直速度的滤波量级。 | :::info -`hpos_drift_rate`、`vpos_drift_rate` 和 `hspd` 是在 10 秒的时间段内计算的,并在 `ekf2_gps_drift` 主题中发布。 -注意 `ekf2_gps_drift` 不会被记录! +`hpos_drift_rate`、`vpos_drift_rate` 和 `hspd` 是在 10 秒的时间段内计算的,并在 `ekf2_gps_drift` 主题中发布。注意 `ekf2_gps_drift` 不会被记录! ::: #### GNSS 故障检测 PX4 的 GNSS 故障检测使用基于测量验证的选择性融合控制来防止恶意或错误的 GNSS 信号。 -故障检测逻辑取决于 GPS 模式,并且对于水平位置和高度测量的操作也有所不同。 -该模式使用 [EKF2_GPS_MODE](../advanced_config/parameter_reference.md#EKF2_GPS_MODE) 参数设置: +故障检测逻辑取决于 GPS 模式,并且对于水平位置和高度测量的操作也有所不同。该模式使用 [EKF2_GPS_MODE](../advanced_config/parameter_reference.md#EKF2_GPS_MODE) 参数设置: -- **自动 (`0`)** (默认): 假设 GNSS 通常是可靠的,并且很可能会恢复。 - 如果此时没有其他位置源可用,EKF2 会在融合超时时重置。 -- **航位推算 (`1`)**: 假设 GNSS 可能会无限期丢失,因此当我们有其他位置数据估计时应避免重置。 - 如果没有其他位置或速度源可用,EKF2 可能会重置。 - 如果 GNSS 高度或水平位置数据漂移,系统将同时禁用这两个测量值的融合(即使其中一个仍能通过验证),并避免执行重置。 +- **自动 (`0`)** (默认): 假设 GNSS 通常是可靠的,并且很可能会恢复。如果此时没有其他位置源可用,EKF2 会在融合超时时重置。 +- **航位推算 (`1`)**: 假设 GNSS 可能会无限期丢失,因此当我们有其他位置数据估计时应避免重置。如果没有其他位置或速度源可用,EKF2 可能会重置。如果 GNSS 高度或水平位置数据漂移,系统将同时禁用这两个测量值的融合(即使其中一个仍能通过验证),并避免执行重置。 :::tip See also [Fault Detection](https://youtu.be/CMGQJNPiTJg?si=sFtdf4AQbcOH8-u8) in "Fuse, Reset, or Reject? 处理EKF2中的各种数据来源"_PX4 开发者峰会2025_, Marco Hauswirth, Auterion AG @@ -385,8 +313,7 @@ See also [Fault Detection](https://youtu.be/CMGQJNPiTJg?si=sFtdf4AQbcOH8-u8) in 系统无法在载具启动期间自动检测错误的 GNSS 数据,因为不存在基线比较。 -如果启用了 GNSS 融合 ([EKF2_GPS_CTRL](../advanced_config/parameter_reference.md#EKF2_GPS_CTRL)),操作员将在地图上观察到不正确的位置,并应禁用 GNSS 融合,然后通过地面站手动设置正确的位置。 -全局位置得到修正,如果启用了 [SENS_BAR_AUTOCAL](../advanced_config/parameter_reference.md#SENS_BAR_AUTOCAL),气压计偏移量会自动调整(通过零偏校正,而不是参数更改)。 +如果启用了 GNSS 融合 ([EKF2_GPS_CTRL](../advanced_config/parameter_reference.md#EKF2_GPS_CTRL)),操作员将在地图上观察到不正确的位置,并应禁用 GNSS 融合,然后通过地面站手动设置正确的位置。全局位置得到修正,如果启用了 [SENS_BAR_AUTOCAL](../advanced_config/parameter_reference.md#SENS_BAR_AUTOCAL),气压计偏移量会自动调整(通过零偏校正,而不是参数更改)。 ##### 飞行中启用 GNSS 融合 @@ -430,14 +357,10 @@ To counter this, [EKF2_POS_LOCK](../advanced_config/parameter_reference.md#EKF2_ #### 条件测距辅助 -条件测距仪融合(又名 _条件测距辅助_)在低速/低空操作期间激活测距仪融合以进行高度估计(除了其他活动的高度源之外)。 -如果测距仪被设置为参考高度源(使用 [EKF2_HGT_REF](../advanced_config/parameter_reference.md#EKF2_HGT_REF)),其他活动的高度源(如气压计和 GNSS 高度)将随着时间的推移调整其测量值以匹配测距仪的读数。 -当不满足启动测距辅助的条件时,会自动选择次要参考。 +条件测距仪融合(又名_条件测距辅助_)在低速/低空操作期间激活测距仪融合以进行高度估计(除了其他活动的高度源之外)。如果测距仪被设置为参考高度源(使用 [EKF2_HGT_REF](../advanced_config/parameter_reference.md#EKF2_HGT_REF)),其他活动的高度源(如气压计和 GNSS 高度)将随着时间的推移调整其测量值以匹配测距仪的读数。当不满足启动测距辅助的条件时,会自动选择次要参考。 :::info -在高度参考之间切换会导致绝对高度估计随时间漂移。 -当在位置模式下飞行时,这不是问题,但如果无人机应该在特定的 GNSS 高度执行任务,则可能会有问题。 -如果不希望出现绝对高度漂移,建议将 GNSS 高度设置为高度参考,即使在使用条件测距辅助时也是如此。 +在高度参考之间切换会导致绝对高度估计随时间漂移。当在位置模式下飞行时,这不是问题,但如果无人机应该在特定的 GNSS 高度执行任务,则可能会有问题。如果不希望出现绝对高度漂移,建议将 GNSS 高度设置为高度参考,即使在使用条件测距辅助时也是如此。 ::: 它主要用于 _起飞和降落_,在这些情况下,气压计的设置可能会受到旋翼气流的过度干扰,从而破坏 EKF 状态估计。 @@ -445,8 +368,7 @@ To counter this, [EKF2_POS_LOCK](../advanced_config/parameter_reference.md#EKF2_ 测距辅助也可用于改善载具静止时的高度保持。 :::tip -对于地形保持,推荐使用 [地形保持](../flying/terrain_following_holding.md#terrain_hold) 而不是 _测距辅助_。 -这是因为地形保持使用正常的 ECL/EKF 估计器来确定高度,这在大多数情况下比距离传感器更可靠。 +对于地形保持,推荐使用 [地形保持](../flying/terrain_following_holding.md#terrain_hold) 而不是 _测距辅助_。这是因为地形保持使用正常的 ECL/EKF 估计器来确定高度,这在大多数情况下比距离传感器更可靠。 ::: _条件测距辅助_ 通过设置 [EKF2_RNG_CTRL](../advanced_config/parameter_reference.md#EKF2_RNG_CTRL) = "Enabled (conditional mode)" (1) 来启用。 @@ -458,29 +380,23 @@ _条件测距辅助_ 通过设置 [EKF2_RNG_CTRL](../advanced_config/parameter_r #### 测距高度融合 -PX4 允许您持续融合测距仪作为高度源(在任何飞行模式/载具类型中)。 -当载具 _保证_ 仅在接近平坦的表面上飞行(例如室内)时,这可能对应用程序有用。 +PX4 允许您持续融合测距仪作为高度源(在任何飞行模式/载具类型中)。当载具 _保证_ 仅在接近平坦的表面上飞行(例如室内)时,这可能对应用程序有用。 当使用距离传感器作为高度源时,飞行者应注意: - 飞越障碍物可能导致估计器拒绝测距仪数据(由于内部数据一致性检查),这可能导致高度保持效果不佳,而估计器仅依赖加速度计估计。 这种情况可能会发生在载具以相对于地面几乎恒定的高度爬坡时,因为测距仪高度没有变化,而加速度计估计的高度却在变化。 - EKF 执行新息一致性检查,该检查考虑了测量值与当前状态之间的误差以及状态的估计方差和测量本身的方差。 - 如果检查失败,测距仪数据将被拒绝,高度将根据加速度计和其他选定的高度源(GNSS、气压计、视觉,如果启用且可用)进行估计。 - 如果距离传感器是活动的高度数据源,在数据不一致持续 5 秒后,估计器会重置高度状态以匹配当前的距离传感器数据。 - 如果一个或多个其他高度源处于活动状态,则测距仪被声明为故障,估计器继续使用其他传感器估计其高度。 - 测量结果也可能再次保持一致,例如当载具下降时,或者当估计高度漂移至与测距仪测得的高度相匹配时。 + EKF 执行新息一致性检查,该检查考虑了测量值与当前状态之间的误差以及状态的估计方差和测量本身的方差。如果检查失败,测距仪数据将被拒绝,高度将根据加速度计和其他选定的高度源(GNSS、气压计、视觉,如果启用且可用)进行估计。 + 如果距离传感器是活动的高度数据源,在数据不一致持续 5 秒后,估计器会重置高度状态以匹配当前的距离传感器数据。如果一个或多个其他高度源处于活动状态,则测距仪被声明为故障,估计器继续使用其他传感器估计其高度。测量结果也可能再次保持一致,例如当载具下降时,或者当估计高度漂移至与测距仪测得的高度相匹配时。 ::: - 局部 NED 原点将随地平面上下移动。 -- 测距仪在不平坦表面(例如树木)上的性能可能非常差,导致数据嘈杂且不一致。 - 这同样会导致高度保持不佳。 +- 测距仪在不平坦表面(例如树木)上的性能可能非常差,导致数据嘈杂且不一致。这同样会导致高度保持不佳。 -该功能通过将 [EKF2_RNG_CTRL](../advanced_config/parameter_reference.md#EKF2_RNG_CTRL) 设置为 "Enabled" (2) 来启用。 -要在活动时使测距仪成为高度参考,请设置:[EKF2_HGT_REF](../advanced_config/parameter_reference.md#EKF2_HGT_REF) 为 "Range sensor"。 +该功能通过将 [EKF2_RNG_CTRL](../advanced_config/parameter_reference.md#EKF2_RNG_CTRL) 设置为 "Enabled" (2) 来启用。要在活动时使测距仪成为高度参考,请设置:[EKF2_HGT_REF](../advanced_config/parameter_reference.md#EKF2_HGT_REF) 为 "Range sensor"。 :::tip 要仅在无人机静止时启用测距仪融合(以便在起飞和降落期间获得更好的高度估计),但在其余时间不融合测距仪,请使用 [EKF2_RNG_CTRL](../advanced_config/parameter_reference.md#EKF2_RNG_CTRL) 的 [条件模式](#conditional-range-aiding) (1)。 @@ -488,13 +404,11 @@ PX4 允许您持续融合测距仪作为高度源(在任何飞行模式/载具 #### 测距仪遮挡检测 -EKF 可以使用垂直速度估计值与测距仪数据数值导数之间的运动学一致性检查,来检测测距仪对地路径是否被遮挡(可能被负载遮挡)。 -如果测距仪在统计上与 EKF2 不一致,则在本次飞行的剩余时间内传感器将被拒绝,除非统计测试在 0.5m/s 或更高的垂直速度下再次通过至少 1 秒。 +EKF 可以使用垂直速度估计值与测距仪数据数值导数之间的运动学一致性检查,来检测测距仪对地路径是否被遮挡(可能被负载遮挡)。如果测距仪在统计上与 EKF2 不一致,则在本次飞行的剩余时间内传感器将被拒绝,除非统计测试在 0.5m/s 或更高的垂直速度下再次通过至少 1 秒。 该检查仅在测距仪未用作主要高度源时启用,并且仅在载具未水平移动时处于活动状态(因为它假设地面高度是静态的)。 -为了进行有效的遮挡检测,需要使用飞行数据对测距仪噪声参数进行严格调整。 -然后可以调整运动学一致性门限参数以获得所需的故障检测灵敏度。 +为了进行有效的遮挡检测,需要使用飞行数据对测距仪噪声参数进行严格调整。然后可以调整运动学一致性门限参数以获得所需的故障检测灵敏度。 调参参数: @@ -503,21 +417,17 @@ EKF 可以使用垂直速度估计值与测距仪数据数值导数之间的运 ### 空速: -通过将 [EKF2_ARSP_THR](../advanced_config/parameter_reference.md#EKF2_ARSP_THR) 设置为正值,可以使用等效空速 (EAS) 数据来估计风速并在 GPS 丢失时减少漂移。 -当空速超过 [EKF2_ARSP_THR](../advanced_config/parameter_reference.md#EKF2_ARSP_THR) 正值设置的阈值且载具类型不是旋翼机时,将使用空速数据。 +通过将 [EKF2_ARSP_THR](../advanced_config/parameter_reference.md#EKF2_ARSP_THR) 设置为正值,可以使用等效空速 (EAS) 数据来估计风速并在 GPS 丢失时减少漂移。当空速超过 [EKF2_ARSP_THR](../advanced_config/parameter_reference.md#EKF2_ARSP_THR) 正值设置的阈值且载具类型不是旋翼机时,将使用空速数据。 ### 合成侧滑 -固定翼平台可以利用假设的零侧滑观测来改善风速估计,并且还可以在没有空速传感器的情况下启用风速估计。 -这是通过将 [EKF2_FUSE_BETA](../advanced_config/parameter_reference.md#EKF2_FUSE_BETA) 参数设置为 1 来启用的。 +固定翼平台可以利用假设的零侧滑观测来改善风速估计,并且还可以在没有空速传感器的情况下启用风速估计。这是通过将 [EKF2_FUSE_BETA](../advanced_config/parameter_reference.md#EKF2_FUSE_BETA) 参数设置为 1 来启用的。 ### 使用阻力比力的多旋翼风速估计 {#mc_wind_estimation_using_drag} -多旋翼平台可以利用空速与沿 X 和 Y 机体轴的阻力之间的关系来估计风速的北/东分量。 -可以使用 [EKF2_DRAG_CTRL](../advanced_config/parameter_reference.md#EKF2_DRAG_CTRL) 启用此功能。 +多旋翼平台可以利用空速与沿 X 和 Y 机体轴的阻力之间的关系来估计风速的北/东分量。可以使用 [EKF2_DRAG_CTRL](../advanced_config/parameter_reference.md#EKF2_DRAG_CTRL) 启用此功能。 -空速与沿 X 和 Y 机体轴的比力(IMU 加速度计测量值)之间的关系由 [EKF2_BCOEF_X](../advanced_config/parameter_reference.md#EKF2_BCOEF_X)、[EKF2_BCOEF_Y](../advanced_config/parameter_reference.md#EKF2_BCOEF_Y) 和 [EKF2_MCOEF](../advanced_config/parameter_reference.md#EKF2_MCOEF) 参数控制,这些参数分别设置 X 和 Y 方向飞行的弹道系数以及螺旋桨产生的动量阻力。 -比力观测噪声的大小由 [EKF2_DRAG_NOISE](../advanced_config/parameter_reference.md#EKF2_DRAG_NOISE) 参数设置。 +空速与沿 X 和 Y 机体轴的比力(IMU 加速度计测量值)之间的关系由 [EKF2_BCOEF_X](../advanced_config/parameter_reference.md#EKF2_BCOEF_X)、[EKF2_BCOEF_Y](../advanced_config/parameter_reference.md#EKF2_BCOEF_Y) 和 [EKF2_MCOEF](../advanced_config/parameter_reference.md#EKF2_MCOEF) 参数控制,这些参数分别设置 X 和 Y 方向飞行的弹道系数以及螺旋桨产生的动量阻力。比力观测噪声的大小由 [EKF2_DRAG_NOISE](../advanced_config/parameter_reference.md#EKF2_DRAG_NOISE) 参数设置。 可以通过以下方式获得良好的调参: @@ -548,17 +458,14 @@ EKF 可以使用垂直速度估计值与测距仪数据数值导数之间的运 通过将 [EKF2_EV_CTRL](../advanced_config/parameter_reference.md#EKF2_EV_CTRL) 的相应位设置为 `true` 来配置融合的测量值: - `0`: 水平位置数据 -- `1`: 垂直位置数据。 - 垂直位置数据。 +- `1`: 垂直位置数据。垂直位置数据。 高度源还可以使用 [EKF2_HGT_REF](../advanced_config/parameter_reference.md#EKF2_HGT_REF) 进行配置(参见 [高度](#height) 部分)。 - `2`:速度数据 - `3`:偏航角数据 注意,如果使用偏航数据(第 3 位),则航向是相对于外部视觉坐标系的;否则航向是相对于北方的。 -EKF 会考虑视觉位姿估计中的不确定性。 -此不确定性信息可以通过 MAVLink [ODOMETRY](https://mavlink.io/en/messages/common.html#ODOMETRY) 消息中的协方差字段发送,也可以通过参数 [EKF2_EVP_NOISE](../advanced_config/parameter_reference.md#EKF2_EVP_NOISE)、[EKF2_EVV_NOISE](../advanced_config/parameter_reference.md#EKF2_EVV_NOISE) 和 [EKF2_EVA_NOISE](../advanced_config/parameter_reference.md#EKF2_EVA_NOISE) 进行设置。 -您可以使用 [EKF2_EV_NOISE_MD](../advanced_config/parameter_reference.md#EKF2_EV_NOISE_MD) 选择不确定性的来源。 +EKF 会考虑视觉位姿估计中的不确定性。此不确定性信息可以通过 MAVLink [ODOMETRY](https://mavlink.io/en/messages/common.html#ODOMETRY) 消息中的协方差字段发送,也可以通过参数 [EKF2_EVP_NOISE](../advanced_config/parameter_reference.md#EKF2_EVP_NOISE)、[EKF2_EVV_NOISE](../advanced_config/parameter_reference.md#EKF2_EVV_NOISE) 和 [EKF2_EVA_NOISE](../advanced_config/parameter_reference.md#EKF2_EVA_NOISE) 进行设置。您可以使用 [EKF2_EV_NOISE_MD](../advanced_config/parameter_reference.md#EKF2_EV_NOISE_MD) 选择不确定性的来源。 ## 如何使用 'ecl' 库中的EKF? @@ -566,15 +473,13 @@ EKF2 默认启用(有关更多信息,请参阅 [切换状态估计器](../ad ## ecl EKF相较于其他估计器的优缺点是什么? -像所有估计器一样,大部分性能来自于与传感器特性相匹配的调参。 -调参是精度和鲁棒性之间的折衷,虽然我们试图提供满足大多数用户需求的参数,但仍会有需要更改参数的应用。 +像所有估计器一样,大部分性能来自于与传感器特性相匹配的调参。调参是精度和鲁棒性之间的折衷,虽然我们试图提供满足大多数用户需求的参数,但仍会有需要更改参数的应用。 因此,相对于 `attitude_estimator_q` + `local_position_estimator` 的传统组合,我们不对精度做出声明,最佳的估计器选择将取决于应用和调参。 ### 缺点 -- ecl EKF 是一个复杂的算法,需要充分理解扩展卡尔曼滤波理论及其在导航问题中的应用才能成功调参。 - 因此,对于没有获得良好结果的用户来说,知道要更改什么比较困难。 +- ecl EKF 是一个复杂的算法,需要充分理解扩展卡尔曼滤波理论及其在导航问题中的应用才能成功调参。因此,对于没有获得良好结果的用户来说,知道要更改什么比较困难。 - ecl EKF 使用更多的 RAM 和闪存空间。 - ecl EKF 使用更多的日志空间。 @@ -585,23 +490,17 @@ EKF2 默认启用(有关更多信息,请参阅 [切换状态估计器](../ad - ecl EKF 检测并报告传感器数据中统计上的显著不一致,协助诊断传感器错误。 - 对于固定翼操作,ecl EKF 在有或没有空速传感器的情况下均可估计风速,并且能够在飞行中 GPS 丢失时结合空速测量和侧滑假设来使用估计的风速,以延长可用的航位推算时间。 - ecl EKF 估计三轴加速度计零偏,这提高了尾座式飞机和其他在飞行阶段之间经历大姿态变化的载具的精度。 -- 联合架构(结合姿态与位置/速度估计)意味着姿态估计能够利用所有传感器的测量数据。 - 若调参得当,这应能提升姿态估算的精度。 +- 联合架构(结合姿态与位置/速度估计)意味着姿态估计能够利用所有传感器的测量数据。若调参得当,这应能提升姿态估算的精度。 ## 如何检查 EKF 性能? -EKF 输出、状态和状态数据发布到许多 uORB 主题,这些主题在飞行期间记录到 SD 卡。 -以下指南假设已使用 _.ulog 文件格式_ 记录数据。 -可以使用 [PX4 pyulog 库](https://github.com/PX4/pyulog) 在 python 中解析 **.ulog** 格式数据。 +EKF 输出、状态和状态数据发布到许多 uORB 主题,这些主题在飞行期间记录到 SD 卡。以下指南假设已使用 _.ulog 文件格式_ 记录数据。可以使用 [PX4 pyulog 库](https://github.com/PX4/pyulog) 在 python 中解析 **.ulog** 格式数据。 大多数 EKF 数据可以在记录到 .ulog 文件的 [EstimatorInnovations](https://github.com/PX4/PX4-Autopilot/blob/main/msg/EstimatorInnovations.msg) 和 [EstimatorStatus](https://github.com/PX4/PX4-Autopilot/blob/main/msg/EstimatorStatus.msg) uORB 消息中找到。 -可以在 [这里](https://github.com/PX4/PX4-Autopilot/blob/main/Tools/ecl_ekf/process_logdata_ekf.py) 找到自动生成分析图和元数据的 python 脚本。 -要使用此脚本文件,请 cd 到 `Tools/ecl_ekf` 目录并输入 `python process_logdata_ekf.py `。 -这将性能元数据保存在名为 **.mdat.csv** 的 csv 文件中,并将图表保存在名为 `.pdf` 的 pdf 文件中。 +可以在 [这里](https://github.com/PX4/PX4-Autopilot/blob/main/Tools/ecl_ekf/process_logdata_ekf.py) 找到自动生成分析图和元数据的 python 脚本。要使用此脚本文件,请 cd 到 `Tools/ecl_ekf` 目录并输入 `python process_logdata_ekf.py `。这将性能元数据保存在名为 **.mdat.csv** 的 csv 文件中,并将图表保存在名为 `.pdf` 的 pdf 文件中。 -可以使用 [batch_process_logdata_ekf.py](https://github.com/PX4/PX4-Autopilot/blob/main/Tools/ecl_ekf/batch_process_logdata_ekf.py) 脚本分析目录中的多个日志文件。 -完成后,可以使用 [batch_process_metadata_ekf.py](https://github.com/PX4/PX4-Autopilot/blob/main/Tools/ecl_ekf/batch_process_metadata_ekf.py) 脚本处理性能元数据文件,以对日志总体的估计器性能进行统计评估。 +可以使用 [batch_process_logdata_ekf.py](https://github.com/PX4/PX4-Autopilot/blob/main/Tools/ecl_ekf/batch_process_logdata_ekf.py) 脚本分析目录中的多个日志文件。完成后,可以使用 [batch_process_metadata_ekf.py](https://github.com/PX4/PX4-Autopilot/blob/main/Tools/ecl_ekf/batch_process_metadata_ekf.py) 脚本处理性能元数据文件,以对日志总体的估计器性能进行统计评估。 ### 输出数据 @@ -640,8 +539,7 @@ covariances\[24\] 的索引映射如下: ### 观测新息与新息方差 -观测 `estimator_innovations`、`estimator_innovation_variances` 与 `estimator_innovation_test_ratios` 消息字段定义在 [EstimatorInnovations.msg](https://github.com/PX4/PX4-Autopilot/blob/main/msg/EstimatorInnovations.msg) 中。 -这些消息字段名称/类型相同(但单位不同)。 +观测 `estimator_innovations`、`estimator_innovation_variances` 与 `estimator_innovation_test_ratios` 消息字段定义在 [EstimatorInnovations.msg](https://github.com/PX4/PX4-Autopilot/blob/main/msg/EstimatorInnovations.msg) 中。这些消息字段名称/类型相同(但单位不同)。 :::info 这些消息具有相同的字段,因为它们是从相同的字段定义生成的。 @@ -664,8 +562,7 @@ covariances\[24\] 的索引映射如下: - 阻力特定力((m/s)^2):`drag` - 速度和位置新息:每个传感器 -此外,每个传感器都有其自己的字段,即横向和纵向位置和/或速度值(视情况而定)。 -这些字段基本自说明,下面给出原始定义: +此外,每个传感器都有其自己的字段,即横向和纵向位置和/或速度值(视情况而定)。这些字段基本自说明,下面给出原始定义: ``` float32[2] gps_hvel # 水平 GPS 速度新息 (m/sec) 与新息方差 ((m/sec)**2) @@ -696,36 +593,26 @@ float32 aux_vvel # 来自着陆目标测量的垂直辅助速度新息 (m/sec ### 输出互补滤波器 -输出互补滤波器用于将状态从融合时间地平线推进到当前时间。 -要检查融合时间地平线处测得的角度、速度与位置跟踪误差大小,可参考 `ekf2_innovations` 消息中的 `output_tracking_error[3]`。 +输出互补滤波器用于将状态从融合时间地平线推进到当前时间。要检查融合时间地平线处测得的角度、速度与位置跟踪误差大小,可参考 `ekf2_innovations` 消息中的 `output_tracking_error[3]`。 索引映射如下: - \[0\] 角度跟踪误差量级 (rad) -- \[1\] 速度跟踪误差量级(m/s)。 - 速度跟踪时间常数可通过 [EKF2_TAU_VEL](../advanced_config/parameter_reference.md#EKF2_TAU_VEL) 调整。 - 减小此参数可减少稳态误差,但会增加 NED 速度输出上的观测噪声量。 -- \[2\] 位置跟踪误差量级 \(m\)。 - 位置跟踪时间常数可通过 [EKF2_TAU_POS](../advanced_config/parameter_reference.md#EKF2_TAU_POS) 调整。 - 减小此参数可减少稳态误差,但会增加 NED 位置输出上的观测噪声量。 +- \[1\] 速度跟踪误差量级(m/s)。速度跟踪时间常数可通过 [EKF2_TAU_VEL](../advanced_config/parameter_reference.md#EKF2_TAU_VEL) 调整。减小此参数可减少稳态误差,但会增加 NED 速度输出上的观测噪声量。 +- \[2\] 位置跟踪误差量级 \(m\)。位置跟踪时间常数可通过 [EKF2_TAU_POS](../advanced_config/parameter_reference.md#EKF2_TAU_POS) 调整。减小此参数可减少稳态误差,但会增加 NED 位置输出上的观测噪声量。 ### EKF 错误 -EKF 包含针对严重条件状态和协方差更新的内部错误检查。 -请参考 [EstimatorStatus](https://github.com/PX4/PX4-Autopilot/blob/main/msg/EstimatorStatus.msg) 中的 `filter_fault_flags`。 +EKF 包含针对严重条件状态和协方差更新的内部错误检查。请参考 [EstimatorStatus](https://github.com/PX4/PX4-Autopilot/blob/main/msg/EstimatorStatus.msg) 中的 `filter_fault_flags`。 ### 观测错误 观测故障分为两类: -- 数据丢失。 - 一个例子是测距仪无法提供返回数据。 -- 新息,即状态预测和传感器观测之间的差异过度。 - 这种情况的一个例子是过度振动导致大的垂直位置误差,导致气压计高度测量被拒绝。 +- 数据丢失。一个例子是测距仪无法提供返回数据。 +- 新息,即状态预测和传感器观测之间的差异过度。这种情况的一个例子是过度振动导致大的垂直位置误差,导致气压计高度测量被拒绝。 -这两者都可能导致观测数据被拒绝,如果时间足够长,使得 EKF 尝试重置状态以使用传感器观测数据。 -所有观测结果均对新息进行了统计置信度检查。 -各观测类型的检查标准差数由对应的 `EKF2_*_GATE` 参数控制。 +这两者都可能导致观测数据被拒绝,如果时间足够长,使得 EKF 尝试重置状态以使用传感器观测数据。所有观测结果均对新息进行了统计置信度检查。各观测类型的检查标准差数由对应的 `EKF2_*_GATE` 参数控制。 测试指标可在 [EstimatorStatus](https://github.com/PX4/PX4-Autopilot/blob/main/msg/EstimatorStatus.msg) 中查看: @@ -740,16 +627,11 @@ EKF 包含针对严重条件状态和协方差更新的内部错误检查。 ### GPS 数据质量检查 -EKF 在开始 GPS 辅助前会执行一系列 GPS 质量检查。 -这些检查由 [EKF2_GPS_CHECK](../advanced_config/parameter_reference.md#EKF2_GPS_CHECK) 和 `EKF2_REQ_*` 参数控制。 -这些检查的通过/失败状态记录在 [EstimatorStatus](https://github.com/PX4/PX4-Autopilot/blob/main/msg/EstimatorStatus.msg) 的 `gps_check_fail_flags` 字段中。 -当所有所需的 GPS 检查通过后,此整数将为零。 -如果 EKF 未启动 GPS 对齐,请将该整数与 [EstimatorStatus](https://github.com/PX4/PX4-Autopilot/blob/main/msg/EstimatorStatus.msg) 中 `gps_check_fail_flags` 的位掩码定义进行对比。 +EKF 在开始 GPS 辅助前会执行一系列 GPS 质量检查。这些检查由 [EKF2_GPS_CHECK](../advanced_config/parameter_reference.md#EKF2_GPS_CHECK) 和 `EKF2_REQ_*` 参数控制。这些检查的通过/失败状态记录在 [EstimatorStatus](https://github.com/PX4/PX4-Autopilot/blob/main/msg/EstimatorStatus.msg) 的 `gps_check_fail_flags` 字段中。当所有所需的 GPS 检查通过后,此整数将为零。如果 EKF 未启动 GPS 对齐,请将该整数与 [EstimatorStatus](https://github.com/PX4/PX4-Autopilot/blob/main/msg/EstimatorStatus.msg) 中 `gps_check_fail_flags` 的位掩码定义进行对比。 ### EKF 数值误差 -EKF 对其所有计算使用单精度浮点运算,并使用一阶近似来推导协方差预测和更新方程,以降低处理要求。 -这意味着,当重新调整 EKF 时,可能遇到协方差矩阵运算条件恶化到足以导致发散或状态估计出现重大误差的情况。 +EKF 对其所有计算使用单精度浮点运算,并使用一阶近似来推导协方差预测和更新方程,以降低处理要求。这意味着,当重新调整 EKF 时,可能遇到协方差矩阵运算条件恶化到足以导致发散或状态估计出现重大误差的情况。 为防止这种情况,每个协方差和状态更新步骤都包含以下错误检测和更正步骤: @@ -765,24 +647,19 @@ EKF 对其所有计算使用单精度浮点运算,并使用一阶近似来推 ## 如何应对高度估计的发散? -在飞行期间 EKF 高度偏离 GPS 和高度计测量的最常见原因是由振动引起的 IMU 测量的削波和/或混叠。 -出现该问题时,通常会在数据中看到以下迹象: +在飞行期间 EKF 高度偏离 GPS 和高度计测量的最常见原因是由振动引起的 IMU 测量的削波和/或混叠。出现该问题时,通常会在数据中看到以下迹象: - [EstimatorInnovations](https://github.com/PX4/PX4-Autopilot/blob/main/msg/EstimatorInnovations.msg).vel_pos_innov\[2\] 与 [EstimatorInnovations](https://github.com/PX4/PX4-Autopilot/blob/main/msg/EstimatorInnovations.msg).vel_pos_innov\[5\] 同号。 - [EstimatorStatus](https://github.com/PX4/PX4-Autopilot/blob/main/msg/EstimatorStatus.msg).hgt_test_ratio 大于 1.0 -建议的第一步是使用有效的隔振安装方式将飞控与机架隔离。 -隔离安装座具有 6 个自由度,因此具有 6 个谐振频率。 -作为一般规则,隔离支架上的自动驾驶仪的 6 个共振频率应高于 25Hz,以避免与无人机动力学相互作用并低于电动机的频率。 +建议的第一步是使用有效的隔振安装方式将飞控与机架隔离。隔离安装座具有 6 个自由度,因此具有 6 个谐振频率。作为一般规则,隔离支架上的自动驾驶仪的 6 个共振频率应高于 25Hz,以避免与无人机动力学相互作用并低于电动机的频率。 如果谐振频率与电动机或螺旋桨叶片通过频率一致,则隔离安装件会使振动更严重。 通过调整以下参数,可增强 EKF 对振动诱发高度发散的抗扰性: -- 将主高度传感器的创新门限加倍。 - 若使用气压高度,可调 [EKF2_BARO_GATE](../advanced_config/parameter_reference.md#EKF2_BARO_GATE)。 -- 将 [EKF2_ACC_NOISE](../advanced_config/parameter_reference.md#EKF2_ACC_NOISE) 增大到 0.5 作为初值。 - 若仍发散,则每次增加 0.1,但不应超过 1.0。 +- 将主高度传感器的创新门限加倍。若使用气压高度,可调 [EKF2_BARO_GATE](../advanced_config/parameter_reference.md#EKF2_BARO_GATE)。 +- 将 [EKF2_ACC_NOISE](../advanced_config/parameter_reference.md#EKF2_ACC_NOISE) 增大到 0.5 作为初值。若仍发散,则每次增加 0.1,但不应超过 1.0。 注意 这些变化的影响将使 EKF 对 GPS 垂直速度和气压的误差更敏感。 @@ -794,8 +671,7 @@ EKF 对其所有计算使用单精度浮点运算,并使用一阶近似来推 - 通过改进无人机的机械隔离来解决。 - 增大 [EKF2_ACC_NOISE](../advanced_config/parameter_reference.md#EKF2_ACC_NOISE) 和 [EKF2_GYR_NOISE](../advanced_config/parameter_reference.md#EKF2_GYR_NOISE) 也有帮助,但会让 EKF 更容易受 GPS 突变影响。 - 过大的陀螺仪偏差偏移。 - - 通过重新校准陀螺仪来修复。 - 检查过度温度灵敏度(> 3 deg/sec 偏差在从冷机开始热启动时发生变化,如果受隔热影响以减缓温度变化的速度,则替换传感器。 + - 通过重新校准陀螺仪来修复。检查过度温度灵敏度(> 3 deg/sec 偏差在从冷机开始热启动时发生变化,如果受隔热影响以减缓温度变化的速度,则替换传感器。 - 不好的偏航对齐 - 检查磁力计校准和对齐。 - 检查显示的航向 QGC 是否在 15 度以内 @@ -822,46 +698,35 @@ EKF 对其所有计算使用单精度浮点运算,并使用一阶近似来推 ![Position, Velocity, Height and Magnetometer Test Ratios](../../assets/ecl/test_ratios_-_successful.png) -下图显示了具有良好隔离的多旋翼飞行器的 EKF 振动指标。 -可以看到着陆冲击和起飞和着陆期间增加的振动。 -目前尚无足够数据给出最大阈值的具体建议。 +下图显示了具有良好隔离的多旋翼飞行器的 EKF 振动指标。可以看到着陆冲击和起飞和着陆期间增加的振动。目前尚无足够数据给出最大阈值的具体建议。 ![Vibration metrics - successful](../../assets/ecl/vibration_metrics_-_successful.png) -上述振动指标的数值有限值,因为在接近 IMU 采样频率的频率下存在的振动(大多数电路板为 1kHz)将导致在高频振动指标中未显示的数据中出现偏移。 -检测混叠误差的唯一方法是它们对惯性导航精度和新息水平的提高。 +上述振动指标的数值有限值,因为在接近 IMU 采样频率的频率下存在的振动(大多数电路板为 1kHz)将导致在高频振动指标中未显示的数据中出现偏移。检测混叠误差的唯一方法是它们对惯性导航精度和新息水平的提高。 除了产生较大的位置与速度测试比值( > 1.0)外,不同误差机制对其他测试比值的影响也不同: ### 确定过度振动 -高振动通常会影响垂直位置与速度新息以及水平分量。 -磁力计测试级别仅受到很小程度的影响。 +高振动通常会影响垂直位置与速度新息以及水平分量。磁力计测试级别仅受到很小程度的影响。 \(在此插入示例绘图显示不好振动\) ### 确定过度的陀螺偏差 -陀螺零偏过大通常表现为飞行中增量角偏置变化超过 5E-4(约 3 deg/sec),若影响航向轴,还会导致磁力计测试比值显著上升。 -除极端情况外,高度通常不受影响。 -如果滤波器在飞行前给定时间稳定,则可以容忍接通最高 5 度/秒的偏差值。 -若位置发散,指挥器(commander)的预飞检查应阻止解锁。 +陀螺零偏过大通常表现为飞行中增量角偏置变化超过 5E-4(约 3 deg/sec),若影响航向轴,还会导致磁力计测试比值显著上升。除极端情况外,高度通常不受影响。如果滤波器在飞行前给定时间稳定,则可以容忍接通最高 5 度/秒的偏差值。若位置发散,指挥器(commander)的预飞检查应阻止解锁。 \(在此插入示例图表显示不好的陀螺偏差\) ### 确定较差的偏航精度 -由于惯性导航和 GPS 测量计算出的速度方向不一致,因此不良偏航对准导致无人机开始移动时速度测试比率迅速增加。 -磁强计的新息受到轻微影响。 -高度通常不受影响。 +由于惯性导航和 GPS 测量计算出的速度方向不一致,因此不良偏航对准导致无人机开始移动时速度测试比率迅速增加。磁强计的新息受到轻微影响。高度通常不受影响。 \(在此插入示例绘图显示不好的偏航对齐\) ### 确定较差的GPS 数据精度 -GPS 数据精度差通常伴随着接收器报告的速度误差的增加以及新息的增加。 -由多路径,遮蔽和干扰引起的瞬态误差是更常见的原因。 -以下为 GPS 精度暂时下降的示例:多旋翼开始偏离悬停点,需要使用摇杆修正。 +GPS 数据精度差通常伴随着接收器报告的速度误差的增加以及新息的增加。由多路径,遮蔽和干扰引起的瞬态误差是更常见的原因。以下为 GPS 精度暂时下降的示例:多旋翼开始偏离悬停点,需要使用摇杆修正。 [EstimatorStatus](https://github.com/PX4/PX4-Autopilot/blob/main/msg/EstimatorStatus.msg).vel_test_ratio 上升到 1 以上,说明 GPS 速度与其他测量不一致并已被拒绝。 ![GPS glitch - test ratios](../../assets/ecl/gps_glitch_-_test_ratios.png) @@ -876,14 +741,11 @@ GPS 数据精度差通常伴随着接收器报告的速度误差的增加以及 ### 确定 GPS 数据的丢失 -GPS 数据丢失会表现为速度与位置创新测试比值“贴平(flat-lining)”。 -出现该情况时,请检查 `vehicle_gps_position` 中的其他 GPS 状态数据。 +GPS 数据丢失会表现为速度与位置创新测试比值“贴平(flat-lining)”。出现该情况时,请检查 `vehicle_gps_position` 中的其他 GPS 状态数据。 下图显示了使用 SITL Gazebo 模拟 VTOL 飞行生成的 NED GPS 速度新息 `ekf2_innovations_0.vel_pos_innov[0 ... 2]`、GPS NE 位置新息 `ekf2_innovations_0.vel_pos_innov[3 ... 4]` 以及气压垂直位置新息 `ekf2_innovations_0.vel_pos_innov[5]`。 -模拟的 GPS 在 73 秒时失锁。 -注意 GPS 丢失后 NED 速度新息与 NE 位置新息“贴平(flat-line)”。 -注意 GPS 丢失 10 秒后,EKF 会回退到使用最后已知位置的静态位置模式,NE 位置新息开始再次变化。 +模拟的 GPS 在 73 秒时失锁。注意 GPS 丢失后 NED 速度新息与 NE 位置新息“贴平(flat-line)”。注意 GPS 丢失 10 秒后,EKF 会回退到使用最后已知位置的静态位置模式,NE 位置新息开始再次变化。 ![GPS Data Loss - in SITL](../../assets/ecl/gps_data_loss_-_velocity_innovations.png) @@ -891,21 +753,17 @@ GPS 数据丢失会表现为速度与位置创新测试比值“贴平(flat-lini 如果飞行器在降落接近地面时倾向于再次上升,最可能的原因是气压计地面效应。 -这种情况是在推进器向地面推进并在无人机下空形成高压区时造成的。 -其结果是降低了对压力高度的解读,从而导致了不必要的爬升。 -下图显示了存在地面效应的典型情况。 -注意气压信号在飞行开始与结束时的下探。 +这种情况是在推进器向地面推进并在无人机下空形成高压区时造成的。其结果是降低了对压力高度的解读,从而导致了不必要的爬升。下图显示了存在地面效应的典型情况。注意气压信号在飞行开始与结束时的下探。 ![Barometer ground effect](../../assets/ecl/gnd_effect.png) 可启用 _地面效应补偿_ 修复该问题: -- 从绘图中估算出气压计在起飞或着陆期间的跌落程度。 上图中可读出降落时约 6 米的气压下探。 -- 将 [EKF2_GND_EFF_DZ](../advanced_config/parameter_reference.md#EKF2_GND_EFF_DZ) 设为该值并加 10% 裕量。 因此,在这种情况下,6.6 米是合适的起始值。 +- 从绘图中估算出气压计在起飞或着陆期间的跌落程度。上图中可读出降落时约 6 米的气压下探。 +- 将 [EKF2_GND_EFF_DZ](../advanced_config/parameter_reference.md#EKF2_GND_EFF_DZ) 设为该值并加 10% 裕量。因此,在这种情况下,6.6 米是合适的起始值。 如果有地形估计(例如配备测距仪),还可设置 [EKF2_GND_MAX_HGT](../advanced_config/parameter_reference.md#EKF2_GND_MAX_HGT) 来指定启用地面效应补偿的离地高度上限。 -若没有地形估计,该参数无效,系统会使用启发式方法判断是否启用地面效应补偿。 -若没有地形估计,该参数无效,系统会使用启发式方法判断是否启用地面效应补偿。 +若没有地形估计,该参数无效,系统会使用启发式方法判断是否启用地面效应补偿。若没有地形估计,该参数无效,系统会使用启发式方法判断是否启用地面效应补偿。 ## 更多信息 diff --git a/docs/zh/advanced_features/detect_and_avoid.md b/docs/zh/advanced_features/detect_and_avoid.md index 46dc69fb90a..4f475c7f0b1 100644 --- a/docs/zh/advanced_features/detect_and_avoid.md +++ b/docs/zh/advanced_features/detect_and_avoid.md @@ -877,8 +877,8 @@ Click here to view the expected results - Hold triggered on augmented WC breach: `DAA 9F3FA3: Hold! lvl 1. 2366 m.` - `DAA Main: 9F3FA3 lvl UP 2. 1773 m.` - Return triggered on augmented NMAC breach: `DAA 9F3FA3: Return! lvl 2. 1773 m.` - - `[commander] Returning to launch` - - `[navigator] RTL: start return at 519 m (30 m above destination)` + - `[commander] Switching to Return` + - `[navigator] Return: start return at 519 m (30 m above destination)` - `DAA Main: 9F3FA3 lvl 2. 849 m.` (the periodic most-urgent status, emitted because the level held at 2 for [DAA_NOTIF_STATE](../advanced_config/parameter_reference.md#DAA_NOTIF_STATE) since the previous `9F3FA3` message) - `DAA Main: 9F3FA3 lvl UP 3. 527 m.` - Land triggered on WC breach: `DAA 9F3FA3: Land! lvl 3. 527 m.` diff --git a/docs/zh/advanced_features/precland.md b/docs/zh/advanced_features/precland.md index da61fdeced7..9a2ceec68ad 100644 --- a/docs/zh/advanced_features/precland.md +++ b/docs/zh/advanced_features/precland.md @@ -186,18 +186,18 @@ If `LTEST_MODE` is set to stationary, the target measurements are also used by t Other relevant parameters are listed in the parameter reference under [Landing_target estimator](../advanced_config/parameter_reference.md#landing-target-estimator) and [Precision land](../advanced_config/parameter_reference.md#precision-land) parameters. Some of the most useful ones are listed below. -| Parameter | 描述 | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [SENS_EN_IRLOCK](../advanced_config/parameter_reference.md#SENS_EN_IRLOCK) | IR-LOCK Sensor (external I2C). Disable: `0` (default): Enable: `1`). | -| [LTEST_MODE](../advanced_config/parameter_reference.md#LTEST_MODE) | Landing target is moving (`0`) or stationary (`1`). Default is moving. | -| [PLD_HACC_RAD](../advanced_config/parameter_reference.md#PLD_HACC_RAD) | Horizontal acceptance radius, within which the vehicle will start descending. Default is 0.2m. | -| [PLD_MOVING_T_MIN](../advanced_config/parameter_reference.md#PLD_MOVING_T_MIN) | Minimum moving-target prediction time for the precision landing setpoint. | -| [PLD_MOVING_T_MAX](../advanced_config/parameter_reference.md#PLD_MOVING_T_MAX) | Maximum moving-target prediction time for the precision landing setpoint. | -| [PLD_BTOUT](../advanced_config/parameter_reference.md#PLD_BTOUT) | Landing Target Timeout, after which the target is assumed lost. Default is 5 seconds. | -| [PLD_FAPPR_ALT](../advanced_config/parameter_reference.md#PLD_FAPPR_ALT) | Final approach altitude. Default is 0.1 metres. | -| [PLD_MAX_SRCH](../advanced_config/parameter_reference.md#PLD_MAX_SRCH) | Maximum number of search attempts in a required landing. | -| [PLD_YAW_EN](../advanced_config/parameter_reference.md#PLD_YAW_EN) | Enable yaw alignment during precision landing when target orientation is available. | -| [RTL_PLD_MD](../advanced_config/parameter_reference.md#RTL_PLD_MD) | RTL precision land mode. `0`: disabled, `1`: [Opportunistic](#opportunistic-mode), `2`: [Required](#required-mode). | +| Parameter | 描述 | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| [SENS_EN_IRLOCK](../advanced_config/parameter_reference.md#SENS_EN_IRLOCK) | IR-LOCK Sensor (external I2C). Disable: `0` (default): Enable: `1`). | +| [LTEST_MODE](../advanced_config/parameter_reference.md#LTEST_MODE) | Landing target is moving (`0`) or stationary (`1`). Default is moving. | +| [PLD_HACC_RAD](../advanced_config/parameter_reference.md#PLD_HACC_RAD) | Horizontal acceptance radius, within which the vehicle will start descending. Default is 0.2m. | +| [PLD_MOVING_T_MIN](../advanced_config/parameter_reference.md#PLD_MOVING_T_MIN) | Minimum moving-target prediction time for the precision landing setpoint. | +| [PLD_MOVING_T_MAX](../advanced_config/parameter_reference.md#PLD_MOVING_T_MAX) | Maximum moving-target prediction time for the precision landing setpoint. | +| [PLD_BTOUT](../advanced_config/parameter_reference.md#PLD_BTOUT) | Landing Target Timeout, after which the target is assumed lost. Default is 5 seconds. | +| [PLD_FAPPR_ALT](../advanced_config/parameter_reference.md#PLD_FAPPR_ALT) | Final approach altitude. Default is 0.1 metres. | +| [PLD_MAX_SRCH](../advanced_config/parameter_reference.md#PLD_MAX_SRCH) | Maximum number of search attempts in a required landing. | +| [PLD_YAW_EN](../advanced_config/parameter_reference.md#PLD_YAW_EN) | Enable yaw alignment during precision landing when target orientation is available. | +| [RTL_PLD_MD](../advanced_config/parameter_reference.md#RTL_PLD_MD) | Return precision land mode. `0`: disabled, `1`: [Opportunistic](#opportunistic-mode), `2`: [Required](#required-mode). | ### IR Beacon Scaling diff --git a/docs/zh/advanced_features/satcom_roadblock.md b/docs/zh/advanced_features/satcom_roadblock.md index 5f4a5f4d864..c5d0269959c 100644 --- a/docs/zh/advanced_features/satcom_roadblock.md +++ b/docs/zh/advanced_features/satcom_roadblock.md @@ -2,8 +2,7 @@ 卫星通信系统可在地面站和车辆之间提供远距离、高延迟的连接。 -本专题介绍如何建立一个使用RockBlock作为运营商的铱星短报文(Short Burst Data,SBD)卫星通信系统。 -在信号质量良好的情况下,用户端延迟在10至15秒左右。 +本专题介绍如何建立一个使用RockBlock作为运营商的铱星短报文(Short Burst Data,SBD)卫星通信系统。在信号质量良好的情况下,用户端延迟在10至15秒左右。 ## 综述 diff --git a/docs/zh/assembly/quick_start_cuav_pixhawk_v6x.md b/docs/zh/assembly/quick_start_cuav_pixhawk_v6x.md index c4bacb60c0d..31d36f2cff3 100644 --- a/docs/zh/assembly/quick_start_cuav_pixhawk_v6x.md +++ b/docs/zh/assembly/quick_start_cuav_pixhawk_v6x.md @@ -4,8 +4,7 @@ This quick start guide shows how to power the [Pixhawk V6X®](../f ## 接线图概述 -下图展示了如何连接最重要的传感器和外围设备(电机和伺服舵机输出除外)。 -我们将在下面各节中介绍它们的细节。 +下图展示了如何连接最重要的传感器和外围设备(电机和伺服舵机输出除外)。我们将在下面各节中介绍它们的细节。 ![wiring](../../assets/flight_controller/cuav_pixhawk_v6x/quickstart_01_en.jpg) diff --git a/docs/zh/assembly/quick_start_cuav_x25_evo.md b/docs/zh/assembly/quick_start_cuav_x25_evo.md index 2d4c5e5ddc5..13d7be39cce 100644 --- a/docs/zh/assembly/quick_start_cuav_x25_evo.md +++ b/docs/zh/assembly/quick_start_cuav_x25_evo.md @@ -15,8 +15,7 @@ The following flight controller models are applicable to this quick start guide. ## 接线图概述 -下图展示了如何连接最重要的传感器和外围设备(电机和伺服舵机输出除外)。 -我们将在下面各节中介绍它们的细节。 +下图展示了如何连接最重要的传感器和外围设备(电机和伺服舵机输出除外)。我们将在下面各节中介绍它们的细节。 ![wiring](../../assets/flight_controller/cuav_x25-evo/x25_evo_quickstart_01.jpg) diff --git a/docs/zh/assembly/quick_start_durandal.md b/docs/zh/assembly/quick_start_durandal.md index e349ec3bc18..fd29f545906 100644 --- a/docs/zh/assembly/quick_start_durandal.md +++ b/docs/zh/assembly/quick_start_durandal.md @@ -21,8 +21,7 @@ The content of the box with the _PM02 V3_ power module is shown below (the box a ## 接线图概述 -下图展示了如何连接最重要的传感器和外围设备(电机和伺服舵机输出除外)。 -我们将在下面各节中介绍它们的细节。 +下图展示了如何连接最重要的传感器和外围设备(电机和伺服舵机输出除外)。我们将在下面各节中介绍它们的细节。 ![Durandal Wiring Overview](../../assets/flight_controller/durandal/durandal_wiring_overview.jpg) diff --git a/docs/zh/assembly/quick_start_holybro_pix32_v5.md b/docs/zh/assembly/quick_start_holybro_pix32_v5.md index bc1f1951a67..4c8c0045eaf 100644 --- a/docs/zh/assembly/quick_start_holybro_pix32_v5.md +++ b/docs/zh/assembly/quick_start_holybro_pix32_v5.md @@ -20,8 +20,7 @@ The box also includes a pinout guide and power module instructions, and Base boa ## 接线图概述 -下图展示了如何连接最重要的传感器和外围设备(电机和伺服舵机输出除外)。 -我们将在下面各节中介绍它们的细节。 +下图展示了如何连接最重要的传感器和外围设备(电机和伺服舵机输出除外)。我们将在下面各节中介绍它们的细节。 ![Pix32 v5 Wiring Overview](../../assets/flight_controller/holybro_pix32_v5/pix32_v5_wiring_overview.jpg) diff --git a/docs/zh/assembly/quick_start_pixhawk4.md b/docs/zh/assembly/quick_start_pixhawk4.md index 3cfc0bbd9c8..a21365a6094 100644 --- a/docs/zh/assembly/quick_start_pixhawk4.md +++ b/docs/zh/assembly/quick_start_pixhawk4.md @@ -11,7 +11,7 @@ This quick start guide shows how to power the [Pixhawk 4](../flight_controller/p ## 接线图概述 -下图展示了如何连接最重要的传感器和外围设备(电机和伺服舵机输出除外)。 我们将在下面各节中介绍它们的细节。 +下图展示了如何连接最重要的传感器和外围设备(电机和伺服舵机输出除外)。我们将在下面各节中介绍它们的细节。 ![Pixhawk 4 Wiring Overview](../../assets/flight_controller/pixhawk4/pixhawk4_wiring_overview.png) diff --git a/docs/zh/assembly/vibration_isolation.md b/docs/zh/assembly/vibration_isolation.md index c65df46d723..d46a6a4384a 100644 --- a/docs/zh/assembly/vibration_isolation.md +++ b/docs/zh/assembly/vibration_isolation.md @@ -5,10 +5,9 @@ ## 综述 Flight Control boards with in-built accelerometers or gyros are sensitive to vibrations. -高振动会引发一系列问题,包含飞行效率或性能降低,缩短飞行时间,增加机体磨损。 在极端情况下,振动可能会引发传感器削波失真/故障,可能导致姿态估算失败,失控。 +高振动会引发一系列问题,包含飞行效率或性能降低,缩短飞行时间,增加机体磨损。在极端情况下,振动可能会引发传感器削波失真/故障,可能导致姿态估算失败,失控。 -设计很好的机身会在自驾仪安装的位置处减少特定结构共振的幅度。 -为了将振动降低到敏感元器件能够处理的程度,进一步的隔离是需要的。(例如 ,一些飞控必须使用某种防震泡沫安装固定在机身上,其他的是一些内部隔离)。 +设计很好的机身会在自驾仪安装的位置处减少特定结构共振的幅度。为了将振动降低到敏感元器件能够处理的程度,进一步的隔离是需要的。(例如 ,一些飞控必须使用某种防震泡沫安装固定在机身上,其他的是一些内部隔离)。 ## 振动分析 @@ -20,8 +19,7 @@ Flight Control boards with in-built accelerometers or gyros are sensitive to vib - 确保所有的东西都可靠的固定在机身上(起落架,GPS 天线等)。 - 使用平衡螺旋桨。 -- 确保使用高质量的螺旋桨、发动机、电调和机架。 - 这些组成部分中的每一个都有很大的不同。 +- 确保使用高质量的螺旋桨、发动机、电调和机架。这些组成部分中的每一个都有很大的不同。 - 使用隔振方法安装自动驾驶仪。 Many flight controllers come with _mounting foam_ that you can use for this purpose, while others have inbuilt vibration-isolation mechanisms. - As a _last_ measure, adjust the [software filters](../config_mc/filter_tuning.md). diff --git a/docs/zh/camera/index.md b/docs/zh/camera/index.md index eebbdabcef8..87fc0a84f53 100644 --- a/docs/zh/camera/index.md +++ b/docs/zh/camera/index.md @@ -1,7 +1,6 @@ # 相机 -相机对许多[有效载荷使用](../payloads/use_cases.md)很重要,包括绘图和勘测、监视、搜索和救援、作物健康和虫害检测等等。 -它们通常安装在一个 [云台](../advanced/gimbal_control.md)上,它能够提供相机稳定性、点跟踪和独立运动。 +相机对许多[有效载荷使用](../payloads/use_cases.md)很重要,包括绘图和勘测、监视、搜索和救援、作物健康和虫害检测等等。它们通常安装在一个 [云台](../advanced/gimbal_control.md)上,它能够提供相机稳定性、点跟踪和独立运动。 ## 相机类型 @@ -11,8 +10,7 @@ PX4 集成了三种类型的相机: - [简单的 MAVLink 摄像头](../camera/mavlink_v1_camera.md) 支持旧的 [Camera Protocol v1](https://mavlink.io/en/services/camera.html)。 - [Cameras attached to flight controller outputs](../camera/fc_connected_camera.md), which are controlled using the [Camera Protocol v1](https://mavlink.io/en/services/camera.html). -推荐[MAVLink 摄像头](../camera/mavlink_v2_camera.md),因为它们使用简单一致的命令/消息集提供了最广泛的相机功能访问。 -如果相机不支持该协议,则可以在一台机载计算机上运行[摄像机管理器](../camera/mavlink_v2_camera.md#camera-managers)以在 MAVLink 和相机的本机协议之间进行接口交互。 +推荐[MAVLink 摄像头](../camera/mavlink_v2_camera.md),因为它们使用简单一致的命令/消息集提供了最广泛的相机功能访问。如果相机不支持该协议,则可以在一台机载计算机上运行[摄像机管理器](../camera/mavlink_v2_camera.md#camera-managers)以在 MAVLink 和相机的本机协议之间进行接口交互。 ## 另见 diff --git a/docs/zh/camera/mavlink_v1_camera.md b/docs/zh/camera/mavlink_v1_camera.md index 7b4f215d229..e2408fe2d2f 100644 --- a/docs/zh/camera/mavlink_v1_camera.md +++ b/docs/zh/camera/mavlink_v1_camera.md @@ -3,8 +3,7 @@ 本节说明了如何使用 PX4 的 MAVLink [相机](../camera/index.md), 实现了 [Camera Protocol v1 (简单触发协议)](https://mavlink.io/en/services/camera_v1.html) 的 PX4 和地面站。 :::warning -[MAVLink 相机](../camera/mavlink_v2_camera.md) 使用[MAVLink 相机协议 v2](https://mavlink.io/en/services/camera.html)应在可能时使用! -此方法保留用于旧的 MAVLink 相机。 +[MAVLink 相机](../camera/mavlink_v2_camera.md) 使用[MAVLink 相机协议 v2](https://mavlink.io/en/services/camera.html)应在可能时使用!此方法保留用于旧的 MAVLink 相机。 ::: ## 综述 @@ -36,8 +35,7 @@ PX4 also re-emits any camera mission items it encounters in a mission as camera - [MAV_CMD_OBLIQUE_SURVEY](https://mavlink.io/en/messages/common.html#MAV_CMD_OBLIQUE_SURVEY) - [MAV_CMD_DO_CONTROL_VIDEO](https://mavlink.io/en/messages/common.html#MAV_CMD_DO_CONTROL_VIDEO) -MAVLink 摄像头将支持这些命令的一些子集。 -由于协议没有发现过程的功能,唯一的方法是检查响应中返回的[COMMAND_ACK](https://mavlink.io/en/messages/common.html#COMMAND_ACK)。 +MAVLink 摄像头将支持这些命令的一些子集。由于协议没有发现过程的功能,唯一的方法是检查响应中返回的[COMMAND_ACK](https://mavlink.io/en/messages/common.html#COMMAND_ACK)。 相机在每次拍摄图像时也应发出[CAMERA_TRIGGER](https://mavlink.io/en/messages/common.html#CAMERA_TRIGGER)。 @@ -45,11 +43,9 @@ MAVLink 摄像头将支持这些命令的一些子集。 ### 地面站 -地面站可以使用 [Camera Protocol v1(简单触发协议)](https://mavlink.io/en/services/camera_v1.html) 中的任何命令,并且应该将这些命令发送给自驾仪组件 id。 -如果相机不支持命令,它将返回带有错误结果的[COMMAND_ACK](https://mavlink.io/en/messages/common.html#COMMAND_ACK)。 +地面站可以使用 [Camera Protocol v1(简单触发协议)](https://mavlink.io/en/services/camera_v1.html) 中的任何命令,并且应该将这些命令发送给自驾仪组件 id。如果相机不支持命令,它将返回带有错误结果的[COMMAND_ACK](https://mavlink.io/en/messages/common.html#COMMAND_ACK)。 -通常命令是针对自驾仪的,因为这样无论相机是通过 MAVLink 连接还是直接连接飞控都能工作。 -如果发送给自驾仪 PX4,每次拍摄图像时 PX4 都会发出[CAMERA_TRIGGER](https://mavlink.io/en/messages/common.html#CAMERA_TRIGGER),并可能记录相机拍摄事件。 +通常命令是针对自驾仪的,因为这样无论相机是通过 MAVLink 连接还是直接连接飞控都能工作。如果发送给自驾仪 PX4,每次拍摄图像时 PX4 都会发出[CAMERA_TRIGGER](https://mavlink.io/en/messages/common.html#CAMERA_TRIGGER),并可能记录相机拍摄事件。 @@ -80,13 +76,11 @@ PX4 重新使用与自驾仪相同的系统 ID 和组件 ID [MAV_COMP_ID_ALL](ht ### MAVLink 端口和转发配置 -将 PX4 连接到您的 MAVLink 相机上,将它连接到您飞控上一个未使用的串口,如`TELEM2`。 -然后,您可以将端口配置为[MAVLink 外设](../peripherals/mavlink_peripherals.md). +将 PX4 连接到您的 MAVLink 相机上,将它连接到您飞控上一个未使用的串口,如`TELEM2`。然后,您可以将端口配置为[MAVLink 外设](../peripherals/mavlink_peripherals.md). 本文件解释了如何做,总的来说: 1. 修改一个未使用的 `MAV_n_CONFIG` 参数,例如[MAV_2_CONFIG](../advanced_config/parameter_reference.md#MAV_2_CONFIG),使其分配给相机连接的端口。 -2. 将对应的 [MAV_2_MODE](../advanced_config/parameter_reference.md#MAV_2_MODE) 设置为 `2` (板载)。 - 这确保正确的 MAVLink 消息集被发出和转发。 +2. 将对应的 [MAV_2_MODE](../advanced_config/parameter_reference.md#MAV_2_MODE) 设置为 `2` (板载)。这确保正确的 MAVLink 消息集被发出和转发。 3. 您可能需要设置一些其他参数,取决于您的连接 - 例如波特率。 然后按照其用户指南中的建议连接和配置相机。 diff --git a/docs/zh/can/index.md b/docs/zh/can/index.md index aa36cca636a..f91c0396682 100644 --- a/docs/zh/can/index.md +++ b/docs/zh/can/index.md @@ -16,16 +16,12 @@ See [Asset Tracking](../debug/asset_tracking.md) for more information. PX4 支持与 CAN 设备通信的两个软件协议: -- [DroneCAN](../dronecan/index.md): PX4 推荐大多数常见的设置。 - 它得到了 PX4 的很好支持,是一个成熟的产品,具有广泛的外围支持,并经过多年的测试。 +- [DroneCAN](../dronecan/index.md): PX4 推荐大多数常见的设置。它得到了 PX4 的很好支持,是一个成熟的产品,具有广泛的外围支持,并经过多年的测试。 - [Cyphal](https://opencyphal.org):PX4 支持是一个“在进行中的工作”。 - Cyphal 是一种更新的协议,允许更多的灵活性和配置,尤其是对于较大和较复杂的载具。 - 它还没有被广泛应用。 + Cyphal 是一种更新的协议,允许更多的灵活性和配置,尤其是对于较大和较复杂的载具。它还没有被广泛应用。 :::info -DroneCAN 和 Cyphal 都是早先一个叫做UAVCAN的项目。 -在2022年,该项目分为两个部分:原始版本的 UAVCAN (UAVCAN v0) 更名为 DroneCAN,较新的 UAVCAN v1 更名为 Cyphal。 -这两项协议之间的差异在[Cyphal vs. DroneCAN](https://forum.opencyphal.org/t/cyphal-vs-dronecan/1814)中作了概述。 +DroneCAN 和 Cyphal 都是早先一个叫做UAVCAN的项目。在2022年,该项目分为两个部分:原始版本的 UAVCAN (UAVCAN v0) 更名为 DroneCAN,较新的 UAVCAN v1 更名为 Cyphal。这两项协议之间的差异在[Cyphal vs. DroneCAN](https://forum.opencyphal.org/t/cyphal-vs-dronecan/1814)中作了概述。 ::: PX4不支持KDECAN等无人驾驶飞机的其他CAN软件协议(撰写时)。 @@ -41,36 +37,29 @@ Don't connect each CAN peripheral to a separate CAN port! Unlike UARTs, CAN peripherals are designed to be daisy chained, with additional ports such as `CAN2` used for [redundancy](#redundancy). ::: -在链的任一端,应该在两个数据线之间连接一个 120Ω 的终端电阻。 -飞控和一些 GNSS 模块为了方便使用内置了终端电阻, 因此应该放在链的终端。 -否则,你可以使用终端电阻,比如 [Zubax Robotics 的这款](https://shop.zubax.com/products/uavcan-micro-termination-plug?variant=6007985111069)。如果你有JST - GH压接工具,也可以自己焊接一个。 +在链的任一端,应该在两个数据线之间连接一个 120Ω 的终端电阻。飞控和一些 GNSS 模块为了方便使用内置了终端电阻, 因此应该放在链的终端。否则,你可以使用终端电阻,比如 [Zubax Robotics 的这款](https://shop.zubax.com/products/uavcan-micro-termination-plug?variant=6007985111069)。如果你有JST - GH压接工具,也可以自己焊接一个。 下图显示了一个 CAN 总线连接飞控到 4 个 CAN 电调和一个 GNSS 的示例。 It includes a redundant bus connected to `CAN 2`. ![CAN 布线](../../assets/can/uavcan_wiring.svg) -图中未显示任何电源接线。 -参考制造商的说明,确认组件是否需要单独供电,还是可以通过 CAN 总线供电。 +图中未显示任何电源接线。参考制造商的说明,确认组件是否需要单独供电,还是可以通过 CAN 总线供电。 :::info For more information, see [Cyphal/CAN device interconnection](https://wiki.zubax.com/public/cyphal/CyphalCAN-device-interconnection?pageId=2195476) (kb.zubax.com). -虽然本文是以 Cyphal 协议为基础编写的,但同样适用于 DroneCAN 硬件和任何其他 CAN 设置。 -如需了解更复杂的场景,请参考 [论CAN总线拓扑结构与终端匹配](https://forum.opencyphal.org/t/on-can-bus-topology-and-termination/1685)。 +虽然本文是以 Cyphal 协议为基础编写的,但同样适用于 DroneCAN 硬件和任何其他 CAN 设置。如需了解更复杂的场景,请参考 [论CAN总线拓扑结构与终端匹配](https://forum.opencyphal.org/t/on-can-bus-topology-and-termination/1685)。 ::: ### 连接器 -Pixhawk标准兼容的 CAN 设备使用 4 引脚的 JST-GH 连接器为 CAN。 -在连线接线时,有两个连接器用于输入和输出(飞行控制器除外和一些内置终止的全球导航卫星系统(GNSS)设备除外); 它仅有一个JST-GH连接器)。 +Pixhawk标准兼容的 CAN 设备使用 4 引脚的 JST-GH 连接器为 CAN。在连线接线时,有两个连接器用于输入和输出(飞行控制器除外和一些内置终止的全球导航卫星系统(GNSS)设备除外); 它仅有一个JST-GH连接器)。 -其他(非Pixhawk兼容的)设备可能使用不同的连接器。 -然而,只要设备固件支持DroneCAN 或Cyphal,它就可以使用。 +其他(非Pixhawk兼容的)设备可能使用不同的连接器。然而,只要设备固件支持DroneCAN 或Cyphal,它就可以使用。 ### 冗余 -DroneCAN 和 Cyphal/CAN支持使用第二个(冗余) CAN 接口。 -这是完全可选的,但会增加连接的强度。 +DroneCAN 和 Cyphal/CAN支持使用第二个(冗余) CAN 接口。这是完全可选的,但会增加连接的强度。 Pixhawk 飞行控制器配备 2 个 CAN 接口;如果你的外设同样支持 2 个 CAN 接口,建议将两路均进行接线,以提升系统安全性。 @@ -100,8 +89,7 @@ Note that you can also check the number of supported CAN interfaces for a board CAN 外围设备可以运行专有或开源固件(请检查制造商指南以确认所需的设置)。 -PX4 可以构建在支持的 CAN 硬件上作为开源的 DroneCAN 固件运行。 -更多信息请参考 [PX4 DroneCAN 固件](../dronecan/px4_cannode_fw.md)。 +PX4 可以构建在支持的 CAN 硬件上作为开源的 DroneCAN 固件运行。更多信息请参考 [PX4 DroneCAN 固件](../dronecan/px4_cannode_fw.md)。 ## 支持和配置 diff --git a/docs/zh/companion_computer/ark_jetson_pab_carrier.md b/docs/zh/companion_computer/ark_jetson_pab_carrier.md index 756f20b2a19..508cb456b9c 100644 --- a/docs/zh/companion_computer/ark_jetson_pab_carrier.md +++ b/docs/zh/companion_computer/ark_jetson_pab_carrier.md @@ -7,7 +7,7 @@ The [ARK Jetson Pixhawk Autopilot Bus (PAB) Carrier](https://arkelectron.gitbook ## 购买渠道 - [ARK Jetson PAB Carrier](https://arkelectron.com/product/ark-jetson-pab-carrier/) -- [ARK Jetson Orin NX NDAA Bundle](https://arkelectron.com/product/ark-jetson-orin-nx-ndaa-bundle/) +- [ARK Jetson Orin NX NDAA Bundle](https://arkelectron.com/product/ark-jetson-pab-ndaa-bundle/?attribute_pa_orin-module=orin-nx-16gb) ## 产品规格 @@ -75,7 +75,7 @@ Two helper scripts are available for resetting the flight controller: ## Flashing Guide -If you've purchased the [ARK Jetson Orin NX NDAA Bundle](https://arkelectron.com/product/ark-jetson-orin-nx-ndaa-bundle/), Jetpack 6 (Ubuntu 22.04) and [ARK-OS](https://github.com/ARK-Electronics/ARK-OS) are pre-installed. +If you've purchased the [ARK Jetson Orin NX NDAA Bundle](https://arkelectron.com/product/ark-jetson-pab-ndaa-bundle/?attribute_pa_orin-module=orin-nx-16gb), Jetpack 6 (Ubuntu 22.04) and [ARK-OS](https://github.com/ARK-Electronics/ARK-OS) are pre-installed. ### ARK Jetson Kernel GitHub Repository diff --git a/docs/zh/companion_computer/companion_computer_peripherals.md b/docs/zh/companion_computer/companion_computer_peripherals.md index db6c6e92256..b898898b7e3 100644 --- a/docs/zh/companion_computer/companion_computer_peripherals.md +++ b/docs/zh/companion_computer/companion_computer_peripherals.md @@ -1,7 +1,6 @@ # 机载计算机外设 -本节包含关于机载计算机外设的信息。 -其中既包括可能与机载计算机连接的组件(可能会与PX4交互/访问),也包括将机载计算机与飞行控制器连接起来。 +本节包含关于机载计算机外设的信息。其中既包括可能与机载计算机连接的组件(可能会与PX4交互/访问),也包括将机载计算机与飞行控制器连接起来。 ## Companion/Pixhawk Communication diff --git a/docs/zh/companion_computer/index.md b/docs/zh/companion_computer/index.md index 9ae9da212b3..f1214061363 100644 --- a/docs/zh/companion_computer/index.md +++ b/docs/zh/companion_computer/index.md @@ -8,8 +8,7 @@ Companion computers ("mission computers"), are separate on-vehicle computers tha -飞控在 NuttX 上运行 PX4, 提供核心飞控和安全代码。 -机载计算机通常运行 Linux, 因为这是一个“通用”软件开发的更好平台。 +飞控在 NuttX 上运行 PX4, 提供核心飞控和安全代码。机载计算机通常运行 Linux, 因为这是一个“通用”软件开发的更好平台。 They are connected using a fast serial or Ethernet link, and typically communicate using the [MAVLink protocol](https://mavlink.io/en/) or uXRCE-DDS. Communications with the ground stations and the cloud are usually routed via the companion computer (e.g. using the [MAVLink Router](https://github.com/mavlink-router/mavlink-router)). @@ -25,8 +24,7 @@ The boards support the [Pixhawk Autopilot Bus (PAB)](../flight_controller/pixhaw ## 管理集成系统 -以下集成的机载计算机/飞控系统默认使用受控/自定义版本的飞控和机载计算机软件。 -它们在这里列出,因为它们可以使用 "vanilla" PX4 固件进行更新,以进行测试/快速开发。 +以下集成的机载计算机/飞控系统默认使用受控/自定义版本的飞控和机载计算机软件。它们在这里列出,因为它们可以使用 "vanilla" PX4 固件进行更新,以进行测试/快速开发。 - [Auterion Skynode](../companion_computer/auterion_skynode.md) - [ModalAI VOXL 2](https://docs.modalai.com/voxl-2/) diff --git a/docs/zh/companion_computer/video_streaming_wfb_ng_wifi.md b/docs/zh/companion_computer/video_streaming_wfb_ng_wifi.md index 86982c4b207..d064e717692 100644 --- a/docs/zh/companion_computer/video_streaming_wfb_ng_wifi.md +++ b/docs/zh/companion_computer/video_streaming_wfb_ng_wifi.md @@ -147,7 +147,7 @@ With Alfa AWU036ACH and 20dBi patch antenna on the ground ~20km is possible. :::warning Don't use band that the RC TX operates on! -Or setup RTL properly to avoid model loss. +Or set up Return mode properly to avoid model loss. ::: **Q:** _Is only Raspberry PI supported?_ diff --git a/docs/zh/computer_vision/collision_prevention.md b/docs/zh/computer_vision/collision_prevention.md index 43871f14e66..b4f0cc70d12 100644 --- a/docs/zh/computer_vision/collision_prevention.md +++ b/docs/zh/computer_vision/collision_prevention.md @@ -116,8 +116,7 @@ The _sensor delay_ for distance sensors connected directly to the flight control 对于外部视觉系统,传感器延迟可能高达 0.2秒。 Vehicle _velocity setpoint tracking delay_ can be measured by flying at full speed in [Position mode](../flight_modes_mc/position.md), then commanding a stop. -然后可以从日志中测量实际速度和速度设置值之间的延迟。 -跟踪延迟通常在 0.1 至 0.5秒之间,取决于机身尺寸和调试情况。 +然后可以从日志中测量实际速度和速度设置值之间的延迟。跟踪延迟通常在 0.1 至 0.5秒之间,取决于机身尺寸和调试情况。 :::tip If vehicle speed oscillates as it approaches the obstacle (i.e. it slows down, speeds up, slows down) the delay is set too high. diff --git a/docs/zh/computer_vision/visual_inertial_odometry.md b/docs/zh/computer_vision/visual_inertial_odometry.md index 6bce9b8b731..4ad48f70534 100644 --- a/docs/zh/computer_vision/visual_inertial_odometry.md +++ b/docs/zh/computer_vision/visual_inertial_odometry.md @@ -113,8 +113,7 @@ Perform the following checks to verify that VIO is working properly _before_ you You can check these MAVLink messages with the _QGroundControl_ [MAVLink Inspector](https://docs.qgroundcontrol.com/master/en/qgc-user-guide/analyze_view/mavlink_inspector.html) - Yaw the vehicle until the quaternion of the `ODOMETRY` message is very close to a unit quaternion (w=1, x=y=z=0). - At this point, the body frame is aligned with the reference frame of the external pose system. - - 如果在不使横滚或俯仰的情况下无法使四元数接近单位四元数,则机架可能仍存在俯仰或滚动偏移。 - 这种情况下不要再检查机架坐标系。 + - 如果在不使横滚或俯仰的情况下无法使四元数接近单位四元数,则机架可能仍存在俯仰或滚动偏移。这种情况下不要再检查机架坐标系。 - Once aligned, you can pick the vehicle up from the ground and you should see the position's z coordinate decrease. Moving the vehicle in the forward direction should increase the position's x coordinate. Moving the vehicle to the right should increase the y coordinate. @@ -127,12 +126,9 @@ Perform the following checks to verify that VIO is working properly _before_ you 1. Put the vehicle on the ground and start streaming `ODOMETRY` feedback (as above). 油门杆推到最低并解锁。 - 此时,设置为位置控制模式。 - 如果切换成功,飞控会闪绿灯。 - 绿灯代表:你的外部位置信息已经注入到飞控中,并且位置控制模式已经切换成功。 + 此时,设置为位置控制模式。如果切换成功,飞控会闪绿灯。绿灯代表:你的外部位置信息已经注入到飞控中,并且位置控制模式已经切换成功。 -2. 油门杆放到中间位置(死区),以便无人机保持飞行高度。 - 提高操控杆会增加参考高度,降低操控杆会降低参考高度。 +2. 油门杆放到中间位置(死区),以便无人机保持飞行高度。提高操控杆会增加参考高度,降低操控杆会降低参考高度。 Similarly, the other stick will change the position over the ground. 3. Increase the value of the throttle stick and the vehicle will take off. Move it back to the middle immediately afterwards. @@ -153,8 +149,7 @@ First, make sure MAVROS is able to connect successfully to the flight controller Use the _QGroundControl_ [MAVLink Inspector](https://docs.qgroundcontrol.com/master/en/qgc-user-guide/analyze_view/mavlink_inspector.html) to verify that the velocities in the `ODOMETRY` message coming from MAVROS are aligned to the FRD coordinate system. - **Problem:** I want to use vision position to do loop closing, and also want to run GPS. - - 这确实很困难,因为当他们不同意时,就会混淆 EKF。 - 通过测试,仅使用视觉速度更为可靠(如果您想出一种使该配置可靠的方法,请告诉我们)。 + - 这确实很困难,因为当他们不同意时,就会混淆 EKF。通过测试,仅使用视觉速度更为可靠(如果您想出一种使该配置可靠的方法,请告诉我们)。 ## 开发人员信息 diff --git a/docs/zh/concept/architecture.md b/docs/zh/concept/architecture.md index 0de777c0d02..958617e00f3 100644 --- a/docs/zh/concept/architecture.md +++ b/docs/zh/concept/architecture.md @@ -13,8 +13,7 @@ All PX4 [airframes](../airframes/index.md) share a single codebase (this include ## 顶层软件架构 -下面的架构图对 PX4 的各个积木模块以及各模块之间的联系进行了一个详细的概述。 -图的上半部分包括了中间件模块,而下半部分展示的则是飞行控制栈的组件。 +下面的架构图对 PX4 的各个积木模块以及各模块之间的联系进行了一个详细的概述。图的上半部分包括了中间件模块,而下半部分展示的则是飞行控制栈的组件。 ![PX4 Architecture](../../assets/diagrams/PX4_Architecture.svg) diff --git a/docs/zh/concept/control_allocation.md b/docs/zh/concept/control_allocation.md index cce86609b79..5e006282a92 100644 --- a/docs/zh/concept/control_allocation.md +++ b/docs/zh/concept/control_allocation.md @@ -7,17 +7,14 @@ For PX4 v1.13 documentation see: [Mixing & Actuators](https://docs.px4.io/v1.13/ PX4从核心控制器获取所需的扭矩和推力指令,并将它们转换为控制电机或作动器的驱动指令。 -指令间的转换取决于飞行器的物理构型。 -例如,给“向右转”需要给出一个扭矩指令: +指令间的转换取决于飞行器的物理构型。例如,给“向右转”需要给出一个扭矩指令: - 对于每个副翼都有一个舵机的飞机来说,该指令将会控制一个舵机向高处偏转,另一个向低处偏转。 - 多旋翼将会通过改变所有电机的转速来向右偏航。 -PX4将这个转换逻辑区分开,这个逻辑被称为从姿态/角速率控制器输出的“混控”。 -这样可以确保核心控制器不需要对每个机型构型进行特殊处理,可以大大提高复用性。 +PX4将这个转换逻辑区分开,这个逻辑被称为从姿态/角速率控制器输出的“混控”。这样可以确保核心控制器不需要对每个机型构型进行特殊处理,可以大大提高复用性。 -此外,PX4还将输出函数映射至指定的硬件输出。 -这也意味着任何电机或舵机可以分配给几乎任何物理输出。 +此外,PX4还将输出函数映射至指定的硬件输出。这也意味着任何电机或舵机可以分配给几乎任何物理输出。 diff --git a/docs/zh/concept/events_interface.md b/docs/zh/concept/events_interface.md index 0bcfbe32b23..ec4cebb2bc2 100644 --- a/docs/zh/concept/events_interface.md +++ b/docs/zh/concept/events_interface.md @@ -96,7 +96,7 @@ Explanations and requirements: - Above we specify a separate external and internal log level, which are the levels displayed to GCS users and in the log file, respectively: `{events::Log::Error, events::LogInternal::Info}`. For the majority of cases you can pass a single log level, and this will be used for both external and internal cases. There are cases it makes sense to have two different log levels. - For example an RTL failsafe action: the user should see it as Warning/Error, whereas in the log, it is an expected system response, so it can be set to `Info`. + For example a Return failsafe action: the user should see it as Warning/Error, whereas in the log, it is an expected system response, so it can be set to `Info`. - **Event Message**: - Single-line, short message of the event. diff --git a/docs/zh/concept/system_startup.md b/docs/zh/concept/system_startup.md index bf982a2ae53..75ecadd7fab 100644 --- a/docs/zh/concept/system_startup.md +++ b/docs/zh/concept/system_startup.md @@ -18,8 +18,7 @@ The first executed file is the [init.d/rcS](https://github.com/PX4/PX4-Autopilot On POSIX, the system shell is used as script interpreter (e.g. /bin/sh, being symlinked to dash on Ubuntu). 为了使 PX4 可以在 Posix 中正常运行,需要做到以下几点: -- PX4 的各个模块需要看起来像系统的单个可执行文件。 - 这一点可以通过创建符号链接做到。 +- PX4 的各个模块需要看起来像系统的单个可执行文件。这一点可以通过创建符号链接做到。 For each module a symbolic link `px4- -> px4` is created in the `bin` directory of the build folder. When executed, the binary path is checked (`argv[0]`), and if it is a module (starts with `px4-`), it sends the command to the main PX4 instance (see below). @@ -34,8 +33,7 @@ On POSIX, the system shell is used as script interpreter (e.g. /bin/sh, being sy - Shell 将每个模块作为一个新的 (客户端) 进程进行启动, Each client process needs to communicate with the main instance of PX4 (the server), where the actual modules are running as threads. This is done through a [UNIX socket](https://man7.org/linux/man-pages/man7/unix.7.html). - 服务器侦听一个 socket,然后客户端将连接该 socket 并通过它发送指令。 - 服务器收到客户端的指令后将指令运行的输出结果及返回代码重新发送给客户端。 + 服务器侦听一个 socket,然后客户端将连接该 socket 并通过它发送指令。服务器收到客户端的指令后将指令运行的输出结果及返回代码重新发送给客户端。 - The startup scripts call the module directly, e.g. `commander start`, rather than using the `px4-` prefix. This works via aliases: for each module an alias in the form of `alias =px4-` is created in the file `bin/px4-alias.sh`. @@ -47,8 +45,7 @@ On POSIX, the system shell is used as script interpreter (e.g. /bin/sh, being sy A client selects the instance via `--instance`. The instance is available in the script via `$px4_instance` variable. -当 PX4 在操作系统上处于运行状态时可以从任意终端直接运行各个模块。 -例如: +当 PX4 在操作系统上处于运行状态时可以从任意终端直接运行各个模块。例如: ```sh cd /build/px4_sitl_default/bin @@ -87,8 +84,7 @@ The boot sequence can be debugged by connecting the [system console](../debug/sy The whole boot can be replaced by creating a file `/etc/rc.txt` on the microSD card with a new configuration (nothing in the old configuration will be auto-started, and if the file is empty, nothing at all will be started). -根据默认启动程序来进行定制化是一个比较好地开始。 -文档如下。 +根据默认启动程序来进行定制化是一个比较好地开始。文档如下。 ### 自定义系统的启动文件 diff --git a/docs/zh/config/accelerometer.md b/docs/zh/config/accelerometer.md index a491b794881..85ba052e809 100644 --- a/docs/zh/config/accelerometer.md +++ b/docs/zh/config/accelerometer.md @@ -1,7 +1,6 @@ # 加速度计校准 -加速度计必须在首次使用或飞行控制器方向发生改变时进行校准。 -否则通常无需重新校准(除非在冬季使用时, 飞行控制器出厂时未进行温度校准[thermally calibrated](../advanced_config/sensor_thermal_calibration.md))。 +加速度计必须在首次使用或飞行控制器方向发生改变时进行校准。否则通常无需重新校准(除非在冬季使用时, 飞行控制器出厂时未进行温度校准[thermally calibrated](../advanced_config/sensor_thermal_calibration.md))。 :::info 加速度计校准不良通常会被飞行前检查和拒绝解锁提示所捕获(GQC 的警告信息通常显示为“加速度计零偏过高” 和 “一致性检查失败”)。 diff --git a/docs/zh/config/actuators.md b/docs/zh/config/actuators.md index 7041c93fdb6..3edf2ba1ff8 100644 --- a/docs/zh/config/actuators.md +++ b/docs/zh/config/actuators.md @@ -46,8 +46,7 @@ The UI is customised for the selected airframe: The motor geometry section lets you set the number of motors, the relative position, and other properties of each motor. -多旋翼机架几何设置提供了一个图显示每一个电机的x,y相对位置。 -参见 机架构型参考以更广泛的了解其他机架构型的电机位置。 +多旋翼机架几何设置提供了一个图显示每一个电机的x,y相对位置。参见 机架构型参考以更广泛的了解其他机架构型的电机位置。 For example, `Tilted-by` and `axis` are only relevant for [Tiltrotor VTOL](#motor-geometry-vtol-tiltrotor) and [Standard VTOL](#motor-geometry-standard-vtol) vehicles, respectively. The geometry configuration for multicopter airframes provides a diagram showing the relative x,y positions for each of the motors. diff --git a/docs/zh/config/battery.md b/docs/zh/config/battery.md index c74fef5b70a..51fee6dffcf 100644 --- a/docs/zh/config/battery.md +++ b/docs/zh/config/battery.md @@ -23,8 +23,7 @@ PX4 提供了许多(逐渐变得更有效)可用于估计容量的方法: 3. [Voltage-based Estimation with Current Integration](#current_integration): Fuses the load-compensated voltage-based estimate for the available capacity with a current-based estimate of the charge that has been consumed. 这样的容量估计相当于智能电池的容量估计。 -后面的方法建立在前面的方法之上。 -您使用的方法将取决于机体的电源模块是否可以测量电流。 +后面的方法建立在前面的方法之上。您使用的方法将取决于机体的电源模块是否可以测量电流。 :::info The instructions below refer to battery 1 calibration parameters: `BAT1_*`. @@ -43,8 +42,7 @@ In addition to PX4 configuration discussed here, you should ensure that the ESC' ## Basic Battery Settings (default) {#basic_settings} -基本电池设置将PX4配置为使用默认方法进行容量估算。 -此方法将测得的原始电池电压与“空”和“满”电芯的电池电压范围进行比较(按芯数量缩放)。 +基本电池设置将PX4配置为使用默认方法进行容量估算。此方法将测得的原始电池电压与“空”和“满”电芯的电池电压范围进行比较(按芯数量缩放)。 :::info This approach results in relatively coarse estimations due to fluctuations in the estimated charge as the measured voltage changes under load. diff --git a/docs/zh/config/compass.md b/docs/zh/config/compass.md index 1e6dedeb7fa..c3a7f81ab8b 100644 --- a/docs/zh/config/compass.md +++ b/docs/zh/config/compass.md @@ -67,9 +67,7 @@ The calibration steps are: 4. Click **OK** to start the calibration. -5. 把你的飞机放置在下面显示的某一个方向,并保持静止。 - 随后提示(方向图像变为黄色)在指定方向旋转飞行器。 - 该位置标定完成后,屏幕上的相应图示将变成绿色。 +5. 把你的飞机放置在下面显示的某一个方向,并保持静止。随后提示(方向图像变为黄色)在指定方向旋转飞行器。该位置标定完成后,屏幕上的相应图示将变成绿色。 ![Compass calibration steps on PX4](../../assets/qgc/setup/sensor/sensor_compass_calibrate_px4.png) diff --git a/docs/zh/config/flight_controller_orientation.md b/docs/zh/config/flight_controller_orientation.md index eb96d9ed1d5..305226ffff5 100644 --- a/docs/zh/config/flight_controller_orientation.md +++ b/docs/zh/config/flight_controller_orientation.md @@ -1,7 +1,6 @@ # 飞行控制器/传感器方向 -默认的飞行器(如果具有外部罗盘)应该向上安装在机架上部,箭头朝向飞行器的前方。 -如果板载或外部罗盘被安装在其他方向,您需要在固件中配置。 +默认的飞行器(如果具有外部罗盘)应该向上安装在机架上部,箭头朝向飞行器的前方。如果板载或外部罗盘被安装在其他方向,您需要在固件中配置。 ## 计算朝向 diff --git a/docs/zh/config/radio.md b/docs/zh/config/radio.md index 404246b8ae1..b51c01e2c1b 100644 --- a/docs/zh/config/radio.md +++ b/docs/zh/config/radio.md @@ -11,8 +11,7 @@ If you have multiple controllers and you want to define their priority see [Manu ## 绑定接收机 -在你校准遥控器之前,遥控器的发射机和接收机需要绑定(对频)。 -发射机和接收机对频的方法各有不同(请参照您使用的遥控器的说明书) +在你校准遥控器之前,遥控器的发射机和接收机需要绑定(对频)。发射机和接收机对频的方法各有不同(请参照您使用的遥控器的说明书) 提醒:如果您使用的是 Spektrum 的接收机, 提醒:如果您使用的是 FrSky 的接收机,您可以在发射机上进行绑定(对频),下面是介绍。 @@ -123,8 +122,7 @@ AUX passthrough channels allow you to control arbitrary optional hardware from y To use the AUX passthrough channels: 1. 映射2个遥控器控制来隔离通道。 -2. 如下所示,依次映射这些通道到端口 AUX1 和 AUX2。 - 设置后,保存到自驾仪。 +2. 如下所示,依次映射这些通道到端口 AUX1 和 AUX2。设置后,保存到自驾仪。 ![AUX1 and AUX2 RC passthrough channels](../../assets/qgc/setup/radio/radio_additional_setup_aux_passthrough_channels.jpg) diff --git a/docs/zh/config/safety.md b/docs/zh/config/safety.md index dafc517622b..cf5008cdd0e 100644 --- a/docs/zh/config/safety.md +++ b/docs/zh/config/safety.md @@ -17,11 +17,9 @@ This includes many of the most important failsafe settings (battery, RC loss etc ## 故障保护动作 When a failsafe is triggered, the default behavior (for most failsafes) is to enter Hold for [COM_FAIL_ACT_T](../advanced_config/parameter_reference.md#COM_FAIL_ACT_T) seconds before performing an associated failsafe action. -这使用户有时间注意到正在发生的情况,并在需要时取消故障保护。 -在大多数情况下,可以通过使用 RC或 GCS 切换模式来做到这一点(注意在故障保护保持期间, 移动 RC操纵杆不会触发取消操作)。 +这使用户有时间注意到正在发生的情况,并在需要时取消故障保护。在大多数情况下,可以通过使用 RC或 GCS 切换模式来做到这一点(注意在故障保护保持期间, 移动 RC操纵杆不会触发取消操作)。 -下面的列表显示了所有故障保护动作的集合,按其严重程度升序排列。 -请注意,不同类型的故障保护可能无法支持所有这些操作。 +下面的列表显示了所有故障保护动作的集合,按其严重程度升序排列。请注意,不同类型的故障保护可能无法支持所有这些操作。 | 动作 | 描述 | | ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | @@ -31,7 +29,7 @@ When a failsafe is triggered, the default behavior (for most failsafes) is to en | [Return mode][return] | The vehicle will enter _Return mode_. Return behaviour can be set in the [Return Home Settings](#return-mode-settings) (below). | | Land mode | The vehicle will enter [Land mode (MC)](../flight_modes_mc/land.md) or [Land mode (FW)](../flight_modes_fw/land.md), and land. VTAL 将首先过渡到 MC 模式。 | | Disarm | 马达立即停止。 | -| [Flight termination][flight_term] | Turns off all controllers and sets all PWM outputs to their failsafe values (e.g. [PWM\_MAIN\_FAILn][pwm_main_failn], [PWM\_AUX\_FAILn][pwm_main_failn]). 故障保护输出可用于启动降落伞、起落架或执行其他操作。 对于固定翼飞行器,这可能允许您将机体滑翔至安全位置。 | +| [Flight termination][flight_term] | Turns off all controllers and sets all PWM outputs to their failsafe values (e.g. [PWM\_MAIN\_FAILn][pwm_main_failn], [PWM\_AUX\_FAILn][pwm_main_failn]). 故障保护输出可用于启动降落伞、起落架或执行其他操作。对于固定翼飞行器,这可能允许您将机体滑翔至安全位置。 | [flight_term]: ../advanced_config/flight_termination.md [return]: ../flight_modes/return.md @@ -139,12 +137,12 @@ PX4 and the receiver may also need to be configured in order to _detect RC loss_ Additional (and underlying) parameter settings are shown below. -| Parameter | 设置 | 描述 | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [COM_RC_LOSS_T](../advanced_config/parameter_reference.md#COM_RC_LOSS_T) | Manual Control Loss Timeout | Time after last setpoint received from the selected manual control source after which manual control is considered lost. This must be kept short because the vehicle will continue to fly using the last known stick position until the timeout triggers. | -| [COM_FAIL_ACT_T](../advanced_config/parameter_reference.md#COM_FAIL_ACT_T) | Failsafe Reaction Delay | Delay in seconds between failsafe condition being triggered (`COM_RC_LOSS_T`) and failsafe action (RTL, Land, Hold). In this state the vehicle waits in hold mode for the manual control source to reconnect. This might be set longer for long-range flights so that intermittent connection loss doesn't immediately invoke the failsafe. It can be to zero so that the failsafe triggers immediately. | -| [NAV_RCL_ACT](../advanced_config/parameter_reference.md#NAV_RCL_ACT) | 故障保护动作 | Disabled, Loiter, Return, Land, Disarm, Terminate, Hold mode (no failsafe). | -| [COM_RCL_EXCEPT](../advanced_config/parameter_reference.md#COM_RCL_EXCEPT) | RC Loss Exceptions | Set modes in which manual control loss is ignored. | +| Parameter | 设置 | 描述 | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [COM_RC_LOSS_T](../advanced_config/parameter_reference.md#COM_RC_LOSS_T) | Manual Control Loss Timeout | Time after last setpoint received from the selected manual control source after which manual control is considered lost. This must be kept short because the vehicle will continue to fly using the last known stick position until the timeout triggers. | +| [COM_FAIL_ACT_T](../advanced_config/parameter_reference.md#COM_FAIL_ACT_T) | Failsafe Reaction Delay | Delay in seconds between failsafe condition being triggered (`COM_RC_LOSS_T`) and failsafe action (Return, Land, Hold). In this state the vehicle waits in hold mode for the manual control source to reconnect. This might be set longer for long-range flights so that intermittent connection loss doesn't immediately invoke the failsafe. It can be to zero so that the failsafe triggers immediately. | +| [NAV_RCL_ACT](../advanced_config/parameter_reference.md#NAV_RCL_ACT) | 故障保护动作 | Disabled, Loiter, Return, Land, Disarm, Terminate, Hold mode (no failsafe). | +| [COM_RCL_EXCEPT](../advanced_config/parameter_reference.md#COM_RCL_EXCEPT) | RC Loss Exceptions | Set modes in which manual control loss is ignored. | ### Hold Mode (No Failsafe) @@ -196,8 +194,8 @@ The settings and underlying [geofence parameters](../advanced_config/parameter_r | 设置 | Parameter | 描述 | | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- | | 冲出围栏时的响应动作 | [GF_ACTION](../advanced_config/parameter_reference.md#GF_ACTION) | None, Warning, Hold mode, Return mode, Terminate, Land. | -| 最大半径 | [GF_MAX_HOR_DIST](../advanced_config/parameter_reference.md#GF_MAX_HOR_DIST) | 地理围栏圆柱体的水平半径。 如果为 0,则禁用地理围栏。 | -| 最大高度 | [GF_MAX_VER_DIST](../advanced_config/parameter_reference.md#GF_MAX_VER_DIST) | 地理围栏圆柱体的高度。 如果为 0,则禁用地理围栏。 | +| 最大半径 | [GF_MAX_HOR_DIST](../advanced_config/parameter_reference.md#GF_MAX_HOR_DIST) | 地理围栏圆柱体的水平半径。如果为 0,则禁用地理围栏。 | +| 最大高度 | [GF_MAX_VER_DIST](../advanced_config/parameter_reference.md#GF_MAX_VER_DIST) | 地理围栏圆柱体的高度。如果为 0,则禁用地理围栏。 | :::info Setting `GF_ACTION` to terminate will kill the vehicle on violation of the fence. @@ -407,7 +405,7 @@ The relevant parameters are shown below: | Parameter | 描述 | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [CBRK_FLIGHTTERM](../advanced_config/parameter_reference.md#CBRK_FLIGHTTERM) | 飞行终止断路器。 从 121212(默认)取消设置,以启用由于故障检测器或 FMU 丢失而导致的飞行终止。 | +| [CBRK_FLIGHTTERM](../advanced_config/parameter_reference.md#CBRK_FLIGHTTERM) | 飞行终止断路器。从 121212(默认)取消设置,以启用由于故障检测器或 FMU 丢失而导致的飞行终止。 | | [FD_FAIL_P](../advanced_config/parameter_reference.md#FD_FAIL_P) | 最大允许俯仰角(角度制)。 | | [FD_FAIL_R](../advanced_config/parameter_reference.md#FD_FAIL_R) | 最大允许横滚角(角度制)。 | | [FD_FAIL_P_TTRI](../advanced_config/parameter_reference.md#FD_FAIL_P_TTRI) | Time to exceed [FD_FAIL_P](#FD_FAIL_P) for failure detection (default 0.3s). | diff --git a/docs/zh/config_fw/pid_tuning_guide_fixedwing.md b/docs/zh/config_fw/pid_tuning_guide_fixedwing.md index 8f8181c6f8e..f1860d86d81 100644 --- a/docs/zh/config_fw/pid_tuning_guide_fixedwing.md +++ b/docs/zh/config_fw/pid_tuning_guide_fixedwing.md @@ -1,7 +1,6 @@ # 固定翼角速度/姿态控制器调节指南 -本指南介绍如何手动调整固定翼PID控制器。 -它是为高级用户/专家设计的,因为错误的 PID 调节可能会使您的飞机坠毁。 +本指南介绍如何手动调整固定翼PID控制器。它是为高级用户/专家设计的,因为错误的 PID 调节可能会使您的飞机坠毁。 :::info [Autotune](../config/autotune_fw.md) is recommended for most users, as it is far faster, easier and provides good tuning for most frames. @@ -22,16 +21,13 @@ ## 建立机型基准线 -如果有条件飞手可以手动飞行,最好是通过手动飞行试验确定几个系统核心特性。 -为了做到这一点,飞这些科目。 -在飞行过程中即使你无法及时在纸上记录全部参数,日志文件在供以后调整也将非常有用。 +如果有条件飞手可以手动飞行,最好是通过手动飞行试验确定几个系统核心特性。为了做到这一点,飞这些科目。在飞行过程中即使你无法及时在纸上记录全部参数,日志文件在供以后调整也将非常有用。 :::info All these quantities will be automatically logged. 如果你想在不查看日志的情况下直接调整时才需要使用笔进行记录。 -- 在合适的空速下平飞。 - 注意油门杆位置和空速(例如:70%-> 0.7 油门,15米/秒空速)。 +- 在合适的空速下平飞。注意油门杆位置和空速(例如:70%-> 0.7 油门,15米/秒空速)。 - 以最大油门和足够的空速爬升10-30秒(例如:12米/秒的空速,在30秒内攀升100米)。 - 以零油门和合理的空速来下滑10-30秒(例如:18米/秒的空速,30秒内下降80米)。 - 滚转杆右侧最大,直到滚转角为60度, 然后滚转杆左侧最大,直到滚转角为负60度为止。 @@ -43,8 +39,7 @@ All these quantities will be automatically logged. ## 滚转调参 -先调节滚转通道,然后俯仰通道。 -滚转更安全,因为不准确只会导致运动,而不会导致掉高。 +先调节滚转通道,然后俯仰通道。滚转更安全,因为不准确只会导致运动,而不会导致掉高。 ### 调整前馈增益 @@ -58,14 +53,12 @@ All these quantities will be automatically logged. #### 待调整增益 - [FW_RR_FF](../advanced_config/parameter_reference.md#FW_RR_FF) - start with a value of 0.4. - 增加该参数值 (每次双倍增加) 直到飞机滚转响应特性良好并到达设置值。 - 最后将增益降低20%。 + 增加该参数值 (每次双倍增加) 直到飞机滚转响应特性良好并到达设置值。最后将增益降低20%。 ### 调整角速率增益 - [FW_RR_P](../advanced_config/parameter_reference.md#FW_RR_P) - start with a value of 0.06. - 增加这个值 (每次翻倍) 直到系统开始抖动。 - 然后将增益降低50%。 + 增加这个值 (每次翻倍) 直到系统开始抖动。然后将增益降低50%。 ### 通过积分器增益调整微调偏置 @@ -88,14 +81,12 @@ All these quantities will be automatically logged. #### 待调整增益 - [FW_PR_FF](../advanced_config/parameter_reference.md#FW_PR_FF) - start with a value of 0.4. - 增加该参数值 (每次翻倍) 直到飞机俯仰响应特性良好并到达设置值。 - 最后将增益降低20%。 + 增加该参数值 (每次翻倍) 直到飞机俯仰响应特性良好并到达设置值。最后将增益降低20%。 ### 调整角速率增益 - [FW_PR_P](../advanced_config/parameter_reference.md#FW_PR_P) - start with a value of 0.04. - 增加这个值 (每次翻倍) 直到系统开始抖动。 - 然后将增益降低50%。 + 增加这个值 (每次翻倍) 直到系统开始抖动。然后将增益降低50%。 ### 通过积分器增益调整微调偏置 @@ -104,8 +95,7 @@ All these quantities will be automatically logged. ## 调整外环时间常数 -控制环的整体响应偏软/偏硬可通过时间常数调整。 -预设值0.5秒对常规固定翼是个合适的值,通常不需要调整。 +控制环的整体响应偏软/偏硬可通过时间常数调整。预设值0.5秒对常规固定翼是个合适的值,通常不需要调整。 - [FW_P_TC](../advanced_config/parameter_reference.md#FW_P_TC) - set to a default of 0.5 seconds, increase to make the Pitch response softer, decrease to make the response harder. - [FW_R_TC](../advanced_config/parameter_reference.md#FW_R_TC) - set to a default of 0.5 seconds, increase to make the Roll response softer, decrease to make the response harder. diff --git a/docs/zh/config_fw/position_tuning_guide_fixedwing.md b/docs/zh/config_fw/position_tuning_guide_fixedwing.md index 0b8e836bd35..13c1e62f830 100644 --- a/docs/zh/config_fw/position_tuning_guide_fixedwing.md +++ b/docs/zh/config_fw/position_tuning_guide_fixedwing.md @@ -20,8 +20,7 @@ For a detailed description of the TECS algorithm and the control diagram, see [C A well-tuned attitude controller is required before tuning TECS: [PID Tuning Guide](../config_fw/pid_tuning_guide_fixedwing.md). -调整 TECS 主要是正确地设置机身限制。 -这些限制可以通过如下所述的一系列飞行操作确定的参数来指定。 +调整 TECS 主要是正确地设置机身限制。这些限制可以通过如下所述的一系列飞行操作确定的参数来指定。 Most of the maneuvers required the plane to be flown by a pilot in [Stabilized flight mode](../flight_modes_fw/stabilized.md). :::tip @@ -80,6 +79,4 @@ Furthermore, these two values define the height rate limits commanded by the use All path control parameters are described in [FW NPFG Control (Parameter Reference)](../advanced_config/parameter_reference.md#fw-npfg-control). - [NPFG_PERIOD](../advanced_config/parameter_reference.md#NPFG_PERIOD) - This is the previously called L1 distance and defines the tracking point ahead of the aircraft it's following. - 大多数飞机适用于10-20米的数值范围。 - 调整期间缓慢缩短,直到响应迅速没有振荡。 - 飞机动态特性缓慢的该数值应该增加。 + 大多数飞机适用于10-20米的数值范围。调整期间缓慢缩短,直到响应迅速没有振荡。飞机动态特性缓慢的该数值应该增加。 diff --git a/docs/zh/config_fw/trimming_guide_fixedwing.md b/docs/zh/config_fw/trimming_guide_fixedwing.md index e8e7f0c00b1..d5fb857463f 100644 --- a/docs/zh/config_fw/trimming_guide_fixedwing.md +++ b/docs/zh/config_fw/trimming_guide_fixedwing.md @@ -1,7 +1,6 @@ # 固定翼配平指南 -配平校准是指在配平状态下计算/设置舵面偏度(配平状态包含相对空速、空气密度、攻击角、飞机配置等)。 -一架具有合适配平设置的飞机在配平状态下飞行将自动保持其姿态,不需要飞行员或增稳计算机进行任何的控制操作。 +配平校准是指在配平状态下计算/设置舵面偏度(配平状态包含相对空速、空气密度、攻击角、飞机配置等)。一架具有合适配平设置的飞机在配平状态下飞行将自动保持其姿态,不需要飞行员或增稳计算机进行任何的控制操作。 General aviation, commercial and large unmanned planes trim their control surfaces using [trim tabs](https://en.wikipedia.org/wiki/Trim_tab) while small UAVs simply add an offset to the actuator of the control surface. @@ -10,8 +9,7 @@ The [Advanced Trimming](#advanced-trimming) section introduces parameters that c ## 基础配平 -操作者可通过若干个参数来恰当地配平固定翼飞机。 -以下是这些参数及其使用场景的概述: +操作者可通过若干个参数来恰当地配平固定翼飞机。以下是这些参数及其使用场景的概述: - [RCx_TRIM](../advanced_config/parameter_reference.md#RC1_TRIM) applies trim to the signal received from the RC transmitter. These parameters are set automatically during [RC calibration](../config/radio.md). @@ -39,8 +37,7 @@ You can then trim your remote (with the trim switches) and report the values to ## 高级配平 -在空速增加过程中,会因非对称翼型和使用襟翼而引入俯仰通道低头力矩,因此飞机需要根据测量空速和襟翼位置重新计算配平。 -为此,可以使用以下参数定义一个关于空速的双线性曲线函数和关于襟翼状态的俯仰修正增量函数(参见下图): +在空速增加过程中,会因非对称翼型和使用襟翼而引入俯仰通道低头力矩,因此飞机需要根据测量空速和襟翼位置重新计算配平。为此,可以使用以下参数定义一个关于空速的双线性曲线函数和关于襟翼状态的俯仰修正增量函数(参见下图): - [FW_DTRIM\_\[R/P/Y\]\_\[VMIN/VMAX\]](../advanced_config/parameter_reference.md#FW_DTRIM_R_VMIN) are the roll/pitch/yaw trim value added to `TRIM_ROLL/PITCH/YAW` at min/max airspeed (defined by [FW_AIRSPD_MIN](../advanced_config/parameter_reference.md#FW_AIRSPD_MIN) and [FW_AIRSPD_MAX](../advanced_config/parameter_reference.md#FW_AIRSPD_MAX)). - [CA_SV_CSx_FLAP](../advanced_config/parameter_reference.md#CA_SV_CS0_FLAP) and [CA_SV_CSx_SPOIL](../advanced_config/parameter_reference.md#CA_SV_CS0_SPOIL) are the trimming values that are applied to these control surfaces if the flaps or the spoilers are fully deployed, respectively. diff --git a/docs/zh/config_mc/index.md b/docs/zh/config_mc/index.md index b6da2f20227..2d3432dd85a 100644 --- a/docs/zh/config_mc/index.md +++ b/docs/zh/config_mc/index.md @@ -11,8 +11,7 @@ This topic is the recommended entry point when performing first-time configurati ## 加载固件 The first step is to [load PX4 firmware](../config/firmware.md) onto your [flight controller](../flight_controller/index.md). -这一步最容易通过使用 QGroundControl 完成,它会自动选择适合您特定控制器硬件的固件。 -默认情况下,QGC 会安装最新的稳定版本的 PX4,但如果需要,您可以选择测试版或自定义版本。 +这一步最容易通过使用 QGroundControl 完成,它会自动选择适合您特定控制器硬件的固件。默认情况下,QGC 会安装最新的稳定版本的 PX4,但如果需要,您可以选择测试版或自定义版本。 相关章节: diff --git a/docs/zh/config_mc/mc_trajectory_tuning.md b/docs/zh/config_mc/mc_trajectory_tuning.md index 2bc6b54e56a..496ec5e7ca9 100644 --- a/docs/zh/config_mc/mc_trajectory_tuning.md +++ b/docs/zh/config_mc/mc_trajectory_tuning.md @@ -21,8 +21,7 @@ The input to the P/PID controller is a _desired setpoint_ that the vehicle shoul [PID Tuning](../config_mc/pid_tuning_guide_multicopter.md) ("Lower level tuning") aims to reduce the error between the desired setpoint and the estimate of the vehicle state. The _desired setpoint_ passed to the P/PID controller is itself calculated from a _demanded setpoint_ based on a stick position (in RC modes) or from a mission command. -要求设定值可能会改变得很快(例如,如果用户“一下子”将摇杆从零移动到最大值)。 -如果缓慢调整相应的目标设定值, 飞行器的特性就会更好。 +要求设定值可能会改变得很快(例如,如果用户“一下子”将摇杆从零移动到最大值)。如果缓慢调整相应的目标设定值, 飞行器的特性就会更好。 _Setpoint value tuning_ ("higher level tuning") is used to specify the mapping between the _demanded_ and the _desired_ setpoints - i.e. defining the "ramp" at which the desired setpoint follows the demanded setpoint. diff --git a/docs/zh/config_mc/pid_tuning_guide_multicopter.md b/docs/zh/config_mc/pid_tuning_guide_multicopter.md index 182ad21efa6..a0709e94aa9 100644 --- a/docs/zh/config_mc/pid_tuning_guide_multicopter.md +++ b/docs/zh/config_mc/pid_tuning_guide_multicopter.md @@ -21,8 +21,7 @@ For safety reasons, the default gains are set to low values. - 调整增益时,所有的增益值都应该慢慢增加, 因为增益过大可能会导致危险的振荡! 一般情况下,每次增益值的调整幅度大约在20%到30%,获得最优增益值后,基于最优值再下调5%到10%。 -- 在修改参数之前务必先着陆。 - 慢慢增加油门,观察振荡的现象。 +- 在修改参数之前务必先着陆。慢慢增加油门,观察振荡的现象。 - Tune the vehicle around the hovering thrust point, and use the [thrust curve parameter](#thrust-curve) to account for thrust non-linearities or high-thrust oscillations. - Optionally enable the high-rate logging profile with the [SDLOG_PROFILE](../advanced_config/parameter_reference.md#SDLOG_PROFILE) parameter so you can use the log to evaluate the rate and attitude tracking performance (the option can be disabled afterwards). @@ -78,8 +77,7 @@ The _parallel form_ is the simplest form, and is (hence) commonly used in textbo ##### 标准模式 -这种形式在数学上等同于并行形式。 但主要的优点是(即使似乎有点反直觉)将比例增益的调试与积分、微分增益分离开了。 -这意味着一个新的平台通过使用同样大小/推力 无人机的增益,使它更易于调试,只是简单地调整K增益就可正常飞行。 +这种形式在数学上等同于并行形式。 但主要的优点是(即使似乎有点反直觉)将比例增益的调试与积分、微分增益分离开了。这意味着一个新的平台通过使用同样大小/推力 无人机的增益,使它更易于调试,只是简单地调整K增益就可正常飞行。 ![PID_Standard](../../assets/mc_pid_tuning/PID_algorithm_Standard.png) @@ -173,8 +171,7 @@ A well-tuned vehicle in _Acro mode_ will not tilt randomly towards one side, but #### 日志 -看看日志有助于你看看你调的参咋样。 -下面是一份调得比较好的滚转和偏航角速度的日志。 +看看日志有助于你看看你调的参咋样。下面是一份调得比较好的滚转和偏航角速度的日志。 ![roll rate tracking](../../assets/mc_pid_tuning/roll_rate_tracking.png) ![yaw rate tracking](../../assets/mc_pid_tuning/yaw_rate_tracking.png) @@ -191,13 +188,12 @@ You can see that the vehicle overshoots only by a very small amount: - Pitch control ([MC_PITCH_P](../advanced_config/parameter_reference.md#MC_PITCH_P)) - Yaw control ([MC_YAW_P](../advanced_config/parameter_reference.md#MC_YAW_P)) -姿态角控制环调起来就容易多了。 -其实大多数时候默认值就够了,完全不用调。 +姿态角控制环调起来就容易多了。其实大多数时候默认值就够了,完全不用调。 To tune the attitude controller, fly in _Stabilized mode_ and increase the **P** gains gradually. 如果看到有振荡或者超调,就说明增益调得太高了。 -下面这几个参数也可以调整 这些参数决定了绕三个轴的最大角速度: +下面这几个参数也可以调整这些参数决定了绕三个轴的最大角速度: - Maximum roll rate ([MC_ROLLRATE_MAX](../advanced_config/parameter_reference.md#MC_ROLLRATE_MAX)) - Maximum pitch rate ([MC_PITCHRATE_MAX](../advanced_config/parameter_reference.md#MC_PITCHRATE_MAX)) @@ -205,8 +201,7 @@ To tune the attitude controller, fly in _Stabilized mode_ and increase the **P** ### 推力曲线 -以上的调整都是在悬停油门的基础上的。 -但当你逐渐增大到满油门时,机体可能又开始振荡了。 +以上的调整都是在悬停油门的基础上的。但当你逐渐增大到满油门时,机体可能又开始振荡了。 To counteract that, adjust the **thrust curve** with the [THR_MDL_FAC](../advanced_config/parameter_reference.md#THR_MDL_FAC) parameter. diff --git a/docs/zh/config_mc/racer_setup.md b/docs/zh/config_mc/racer_setup.md index 033bf17a505..ab9acf1e55f 100644 --- a/docs/zh/config_mc/racer_setup.md +++ b/docs/zh/config_mc/racer_setup.md @@ -2,8 +2,7 @@ This page describes how to setup and configure a multicopter racer for optimal performance (in particular for [Acro mode](../flight_modes_mc/acro.md)). -请注意穿越机是经过特殊设计的动力强劲的快速飞行器。 -你应该是有一定经验的使用者,或者让有经验的使用者帮助你。 +请注意穿越机是经过特殊设计的动力强劲的快速飞行器。你应该是有一定经验的使用者,或者让有经验的使用者帮助你。 :::tip Many things described here can also be applied to improve the flight performance of other types of multicopters. @@ -28,13 +27,10 @@ If the board has an internal magnetometer, it should not be used (small racers a 但是增加GPS也有一些好处,尤其是对于初学者。 -- 你可以让飞机进入定位状态,飞行器将会待在一个地方。 - 当你失去方向或者需要刹车时候,这会是有用的。 - 它通常也可以被用来安全降落。 +- 你可以让飞机进入定位状态,飞行器将会待在一个地方。当你失去方向或者需要刹车时候,这会是有用的。它通常也可以被用来安全降落。 - [Return mode](../flight_modes_mc/return.md) can be used, either on a switch or as RC loss/low battery failsafe. - 当发生事故时,你将有飞机最后的位置,方便寻找飞机。 -- 飞行记录将包含飞行路线追踪,这意味着你可以进行航行回顾(3D 模式)。 - 这可以帮助你改善特技飞行技巧。 +- 飞行记录将包含飞行路线追踪,这意味着你可以进行航行回顾(3D 模式)。这可以帮助你改善特技飞行技巧。 :::info During aggressive acrobatic maneuvers the GPS can lose its position fix for a short time. @@ -57,9 +53,7 @@ Make sure to use **balanced props**. ### 重心 -确保重心尽可能靠近推力中心。 -左右平衡通常不是问题,但前后平衡可能是一个问题。 -您可以移动电池直到重心配置正确后再机架上标记它,这样您就可以始终正确放置电池。 +确保重心尽可能靠近推力中心。左右平衡通常不是问题,但前后平衡可能是一个问题。您可以移动电池直到重心配置正确后再机架上标记它,这样您就可以始终正确放置电池。 :::info The integral term can account for an imbalanced setup, and a custom mixer can do that even better. @@ -146,6 +140,7 @@ Now do a second round of PID tuning, this time as tight as possible, and also tu :::tip You can use the approach described in [Basic MC PID tuning](../config_mc/pid_tuning_guide_multicopter_basic.md) to tune the frame, but you will need to use the [Advanced Multicopter PID Tuning Guide (Advanced/Detailed)](../config_mc/pid_tuning_guide_multicopter.md#thrust-curve) to understand how to tune the thrust curve. +::: ### 飞行模式 diff --git a/docs/zh/contribute/git_examples.md b/docs/zh/contribute/git_examples.md index ac02dfdefb1..93b91914cab 100644 --- a/docs/zh/contribute/git_examples.md +++ b/docs/zh/contribute/git_examples.md @@ -280,7 +280,7 @@ git checkout ### 强制推送到分叉存储库 -做完第一个 PR 后, 来自 PX4 社区的人将回顾你的更改。 在大多数情况下, 这意味着您必须根据评审来修复本地分支。 After changing the files locally, the feature branch needs to be rebased again with the most recent upstream/main. 但是, 在重新建立基础后, 不再可能将特征分支直接推送到分叉存储库, 而是需要使用强制推送: +做完第一个 PR 后, 来自 PX4 社区的人将回顾你的更改。在大多数情况下, 这意味着您必须根据评审来修复本地分支。 After changing the files locally, the feature branch needs to be rebased again with the most recent upstream/main. 但是, 在重新建立基础后, 不再可能将特征分支直接推送到分叉存储库, 而是需要使用强制推送: ```sh git push --force-with-lease origin diff --git a/docs/zh/data_links/index.md b/docs/zh/data_links/index.md index 03154f03ce4..fbec13017f7 100644 --- a/docs/zh/data_links/index.md +++ b/docs/zh/data_links/index.md @@ -1,7 +1,6 @@ # 数据链路 -数据链路是从飞控到地面站(到遥控系统),从地面站发送指令到机体的无线电评到,用于机体遥测通信(位置,速度,电池状态等)。 -这些链路通常使用不同的无线电来创建,这些无线电用于手动遥控机体。 +数据链路是从飞控到地面站(到遥控系统),从地面站发送指令到机体的无线电评到,用于机体遥测通信(位置,速度,电池状态等)。这些链路通常使用不同的无线电来创建,这些无线电用于手动遥控机体。 PX4 使用 [MAVLink](https://mavlink.io/en/) 协议在无线电频道上传送串行数据。 本节提供关于您可以使用的各种无线电系统的信息,以及如何配置它们与 PX4 一起使用。 diff --git a/docs/zh/data_links/telemetry.md b/docs/zh/data_links/telemetry.md index b3f287215fd..f3d4a82ca79 100644 --- a/docs/zh/data_links/telemetry.md +++ b/docs/zh/data_links/telemetry.md @@ -10,8 +10,7 @@ This includes radios that use the _SiK Radio_ firmware and _3DR WiFi Telemetry R ## 已支持的无线数传 -PX4支持通过数传端口将一个基于 MAVLink 的数传连接到Pixhawk飞控。 -只需要一个支持MAVLink的数传和一个兼容UART电平/连接器的端口,无需更多。 +PX4支持通过数传端口将一个基于 MAVLink 的数传连接到Pixhawk飞控。只需要一个支持MAVLink的数传和一个兼容UART电平/连接器的端口,无需更多。 Telemetry systems that communicate using some other protocol will need more extensive integration, potentially covering both software (e.g. device drivers) and hardware (connectors etc.). While this has been done for specific cases (e.g. [FrSky Telemetry](../peripherals/frsky_telemetry.md) enables sending vehicle status to an RC controller via an FrSky receiver) providing general advice is difficult. diff --git a/docs/zh/debug/debug_values.md b/docs/zh/debug/debug_values.md index 05692ef0c75..d93e88c7dcc 100644 --- a/docs/zh/debug/debug_values.md +++ b/docs/zh/debug/debug_values.md @@ -5,9 +5,7 @@ This is where the generic `NAMED_VALUE_FLOAT`, `DEBUG` and `DEBUG_VECT` packets ## 在 MAVLink 调试消息和 uORB 主题之间进行映射 -MAVLink调试消息转换为/自 uORB 主题。 -为了发送或接收 MAVLink 调试消息,您必须分别发布或订阅相应的主题。 -下面是一个表,其中总结了 MAVLink 调试消息和 uORB 主题之间的映射: +MAVLink调试消息转换为/自 uORB 主题。为了发送或接收 MAVLink 调试消息,您必须分别发布或订阅相应的主题。下面是一个表,其中总结了 MAVLink 调试消息和 uORB 主题之间的映射: | MAVLink 消息 | uORB topic | | ----------------------------------------------------------- | --------------------------------------------------------- | @@ -24,8 +22,7 @@ This tutorial shows how to send the MAVLink message `NAMED_VALUE_FLOAT` using th - [Debug Tutorial Code](https://github.com/PX4/PX4-Autopilot/blob/main/src/examples/px4_mavlink_debug/px4_mavlink_debug.cpp) - [Enable the tutorial app](https://github.com/PX4/PX4-Autopilot/blob/main/boards/px4/fmu-v5/default.px4board) by ensuring the MAVLink debug app (**CONFIG_EXAMPLES_PX4_MAVLINK_DEBUG**) is in the config of your board and set to 'y'. -设置调试发布所需的只是此代码段。 -首先添加头文件: +设置调试发布所需的只是此代码段。首先添加头文件: ```C #include @@ -33,8 +30,7 @@ This tutorial shows how to send the MAVLink message `NAMED_VALUE_FLOAT` using th #include ``` -然后广播调试值主题(一个针对不同发布名称的广播就足够了)。 -把这个放在你的主循环前面: +然后广播调试值主题(一个针对不同发布名称的广播就足够了)。把这个放在你的主循环前面: ```C /* advertise debug value */ diff --git a/docs/zh/debug/failure_injection.md b/docs/zh/debug/failure_injection.md index 93a0f23ed42..051bc7f01b4 100644 --- a/docs/zh/debug/failure_injection.md +++ b/docs/zh/debug/failure_injection.md @@ -14,21 +14,21 @@ What differs is whether a _consumer_ applies the failure, and that depends on th The table lists the failure types that actually take effect per environment: `off`, `stuck`, `wrong` (`ok` is not listed, but clears an active injection on all environments). A `—` means the module still accepts the command, but no consumer applies it in that environment. -| Component | [Gazebo] (gz) | [SIH] | `simulator_mavlink` (Gazebo Classic/JMAVSim) | 硬件 | -| ----------------- | ----------------------- | ----------------------- | --------------------------------------------------------------- | ----------------------- | -| `gyro` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | -| `accel` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | -| `mag` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | -| `baro` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | -| `distance_sensor` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | -| `gps` | `off`, `stuck`, `wrong` | `off`, `stuck`, `wrong` | `off`, `stuck`, `wrong` | `off`, `stuck`, `wrong` | -| `airspeed` | `off`, `stuck`, `wrong` | — | `off`, `wrong` | — | -| `vio` | — | — | `off` | — | -| `battery` | `off`, `wrong` | `off`, `wrong` | `off`, `wrong` | `off`, `wrong` | -| `traffic` | `off` | `off` | `off` | `off` | -| `motor` | `off`, `wrong` | `off`, `wrong` | `off`, `wrong` | `off`, `wrong` | -| `esc` | `off`, `wrong` | `off`, `wrong` | `off`, `wrong` | `off`, `wrong` | -| `can` | — | — | — | `off` | +| Component | [Gazebo] (gz) | [SIH] | `simulator_mavlink` (Gazebo Classic) | 硬件 | +| ----------------- | ----------------------- | ----------------------- | ------------------------------------------------------- | ----------------------- | +| `gyro` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | +| `accel` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | +| `mag` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | +| `baro` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | +| `distance_sensor` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | +| `gps` | `off`, `stuck`, `wrong` | `off`, `stuck`, `wrong` | `off`, `stuck`, `wrong` | `off`, `stuck`, `wrong` | +| `airspeed` | `off`, `stuck`, `wrong` | — | `off`, `wrong` | — | +| `vio` | — | — | `off` | — | +| `battery` | `off`, `wrong` | `off`, `wrong` | `off`, `wrong` | `off`, `wrong` | +| `traffic` | `off` | `off` | `off` | `off` | +| `motor` | `off`, `wrong` | `off`, `wrong` | `off`, `wrong` | `off`, `wrong` | +| `esc` | `off`, `wrong` | `off`, `wrong` | `off`, `wrong` | `off`, `wrong` | +| `can` | — | — | — | `off` | [SIH]: ../sim_sih/index.md [Gazebo]: ../sim_gazebo_gz/index.md diff --git a/docs/zh/debug/faq.md b/docs/zh/debug/faq.md index 93569734cd4..732f3c3a788 100644 --- a/docs/zh/debug/faq.md +++ b/docs/zh/debug/faq.md @@ -4,9 +4,7 @@ ### 闪存溢出 -可以加载到主板上的代码量受到其具有的闪存量的限制。 -当添加其他模块或代码时,添加可能会超过闪存。 -这将导致 "闪存溢出"。 The upstream version will always build, but depending on what a developer adds it might overflow locally. +可以加载到主板上的代码量受到其具有的闪存量的限制。当添加其他模块或代码时,添加可能会超过闪存。这将导致 "闪存溢出"。 The upstream version will always build, but depending on what a developer adds it might overflow locally. ```sh region `flash' overflowed by 12456 bytes diff --git a/docs/zh/debug/profiling.md b/docs/zh/debug/profiling.md index d22d2de32bc..9815cc665b7 100644 --- a/docs/zh/debug/profiling.md +++ b/docs/zh/debug/profiling.md @@ -5,8 +5,7 @@ This is an implementation of a known method originally invented by [Mark Callagh ## 方法 -PMSP 是一种 shell 脚本,它通过定期中断固件的执行来运行,便对当前堆栈跟踪进行采样。 -采样的堆栈跟踪将追加到文本文件中。 +PMSP 是一种 shell 脚本,它通过定期中断固件的执行来运行,便对当前堆栈跟踪进行采样。采样的堆栈跟踪将追加到文本文件中。 Once sampling is finished (which normally takes about an hour or more), the collected stack traces are _folded_. The result of _folding_ is another text file that contains the same stack traces, except that all similar stack traces (i.e. those that were obtained at the same point in the program) are joined together, and the number of their occurrences is recorded. The folded stacks are then fed into the visualization script, for which purpose we employ [FlameGraph - an open source stack trace visualizer](https://www.brendangregg.com/flamegraphs.html). @@ -15,8 +14,7 @@ The folded stacks are then fed into the visualization script, for which purpose ### 系统必备组件 -探查器的基本用法可通过生成系统使用。 -例如,下面的命令生成和探查出 px4_fmu-v4pro 目标的10000个样本(提取 FlameGraph 并根据需要将其添加到路径中)。 +探查器的基本用法可通过生成系统使用。例如,下面的命令生成和探查出 px4_fmu-v4pro 目标的10000个样本(提取 FlameGraph 并根据需要将其添加到路径中)。 You will then need a [debug probe](../debug/swd_debug.md#debug-probes) (such as the Zubax BugFace BF1), to run the GDB server and interact with the board. ### Determine the Debugger Device @@ -62,27 +60,21 @@ A screenshot of an example output is provided below (note that it is not interac ![FlameGraph Example](../../assets/debug/flamegraph-example.png) -PMSP 使用 GDB 收集堆栈跟踪。 -目前,它使用 arm-none-eabi-gdb,今后可能会添加其他工具链。 +PMSP 使用 GDB 收集堆栈跟踪。目前,它使用 arm-none-eabi-gdb,今后可能会添加其他工具链。 ## 可能的问题 -为了能够映射内存地址到符号,脚本需要被当前运行的文件中提及。 -这个是在 --elf=&lt;file&gt; 的选项帮助下完成的,该选项需要一个指向当前执行ELF位置的路径来执行(相对于储存库的root)。 +为了能够映射内存地址到符号,脚本需要被当前运行的文件中提及。这个是在 --elf=&lt;file&gt; 的选项帮助下完成的,该选项需要一个指向当前执行ELF位置的路径来执行(相对于储存库的root)。 -- 如果 GDB 出现故障,脚本可能无法检测到该问题,并继续运行。 - 在这种情况下,显然不会产生可用的堆栈。 +- 如果 GDB 出现故障,脚本可能无法检测到该问题,并继续运行。在这种情况下,显然不会产生可用的堆栈。 In order to avoid that, the user should periodically check the file `/tmp/pmpn-gdberr.log`, which contains the stderr output of the most recent invocation of GDB. 将来,应修改脚本以在安静模式下调用 GDB,在安静模式下,它将通过其退出代码指示问题。 -- 有时 GDB 一直运行,同时采样堆栈跟踪。 - 在此失败期间,目标将无限期停止。 +- 有时 GDB 一直运行,同时采样堆栈跟踪。在此失败期间,目标将无限期停止。 The solution is to manually abort the script and re-launch it again with the `--append` option. 将来,应修改脚本以对每次 GDB 调用强制执行超时。 -- 不支持多线程环境。 - 这不会影响单个核心嵌入式目标,因为它们总是在一个线程中执行,但这一限制使探查器与许多其他应用程序不兼容。 - 将来,应修改堆栈文件夹以支持每个示例的多个堆栈跟踪。 +- 不支持多线程环境。这不会影响单个核心嵌入式目标,因为它们总是在一个线程中执行,但这一限制使探查器与许多其他应用程序不兼容。将来,应修改堆栈文件夹以支持每个示例的多个堆栈跟踪。 ## 实现 diff --git a/docs/zh/debug/simulation_debugging.md b/docs/zh/debug/simulation_debugging.md index f99ac6c37f7..fa24b10f01d 100644 --- a/docs/zh/debug/simulation_debugging.md +++ b/docs/zh/debug/simulation_debugging.md @@ -7,8 +7,8 @@ The Clang address sanitizer can help to find alignment (bus) errors and other memory faults like segmentation faults. The command below sets the right compile options. 下面的命令设置了正确的编译选项。 ```sh -make clean # 仅需在常规编译后,第一次运行 address sanitizer 时使用 -PX4_ASAN=1 make px4_sitl jmavsim +make clean # only required on first address sanitizer run after a normal build +PX4_ASAN=1 make px4_sitl_sih sihsim_quadx ``` ## Valgrind @@ -26,8 +26,7 @@ sudo apt-get install valgrind SITL can be launched with and without debugger attached and with either jMAVSim or Gazebo as simulation backend. This results in the start options below: ```sh -make px4_sitl_default # 通过 cmake 配置 -make -C build/px4_sitl_default jmavsim___gdb +make px4_sitl_default gazebo-classic___valgrind ``` ## Launch Gazebo Classic SITL Without Debugger @@ -37,7 +36,7 @@ By default SITL is launched without a debugger attached when using any simulator ```sh make px4_sitl_default gz make px4_sitl_default gazebo-classic -make px4_sitl_default jmavsim +make px4_sitl_sih sihsim_quadx ``` For Gazebo Classic (only) you can also start the simulator with a debugger attached. diff --git a/docs/zh/debug/system_wide_replay.md b/docs/zh/debug/system_wide_replay.md index 114aabd10db..a4661c9c893 100644 --- a/docs/zh/debug/system_wide_replay.md +++ b/docs/zh/debug/system_wide_replay.md @@ -63,7 +63,7 @@ For an example, see [SensorCombined.msg](https://github.com/PX4/PX4-Autopilot/bl - Start the replay: ```sh - make px4_sitl_default jmavsim + make px4_sitl_default none_iris ``` This will automatically open the log file, apply the parameters and start the replay. diff --git a/docs/zh/dev_log/ulog_file_format.md b/docs/zh/dev_log/ulog_file_format.md index 78e1f559cda..84b2433a2c3 100644 --- a/docs/zh/dev_log/ulog_file_format.md +++ b/docs/zh/dev_log/ulog_file_format.md @@ -132,8 +132,7 @@ struct ulog_message_flag_bits_s { If a parser finds any of these bits set that isn't specified, it must refuse to parse the log. - `appended_offsets`: File offset (0-based) for appended data. - 如果没有附加数据,则所有偏移量必须为零。 - 这可以用于消息中途暂停的情况下可靠的添加数据。 + 如果没有附加数据,则所有偏移量必须为零。这可以用于消息中途暂停的情况下可靠的添加数据。 For example, crash dumps. 附加数据的过程应该做到: diff --git a/docs/zh/dev_setup/building_px4.md b/docs/zh/dev_setup/building_px4.md index 4f5351ff07c..af5643624c0 100644 --- a/docs/zh/dev_setup/building_px4.md +++ b/docs/zh/dev_setup/building_px4.md @@ -2,12 +2,10 @@ 无论对于模拟器还是硬件目标设备,PX4固件可以在控制台或者IDE中从源码构建 -若要使用[模拟器](../simulation/index.md),或需要修改PX4并创建自定义构建,则必须自行构建PX4。 -如果您只想在实际硬件上试试 PX4,那么可以使用 QGroundControl[烧录预构建的二进制文件](../config/firmware.md)(无需跟着下面的指导)。 +若要使用[模拟器](../simulation/index.md),或需要修改PX4并创建自定义构建,则必须自行构建PX4。如果您只想在实际硬件上试试 PX4,那么可以使用 QGroundControl[烧录预构建的二进制文件](../config/firmware.md)(无需跟着下面的指导)。 :::info -在跟着这些指导之前,你必须先为主机操作系统和目标硬件安装 [开发者工具链](../dev_setup/dev_env.md)。 -如果您在跟着这些步骤操作后有任何问题,请参阅下面的 [故障排除](#troubleshooting)。 +在跟着这些指导之前,你必须先为主机操作系统和目标硬件安装 [开发者工具链](../dev_setup/dev_env.md)。如果您在跟着这些步骤操作后有任何问题,请参阅下面的 [故障排除](#troubleshooting)。 ::: ## 下载 PX4 源代码 @@ -23,15 +21,13 @@ git clone https://github.com/PX4/PX4-Autopilot.git --recursive 注意,您可能在[安装开发工具链](../dev_setup/dev_env.md)时已经完成了这项操作 :::info -你只需要执行它就能够得到最新的代码。 -如果需要,您也可以[获取特定版本的源代码](../contribute/git_examples.md#get-a-specific-release)。 +你只需要执行它就能够得到最新的代码。如果需要,您也可以[获取特定版本的源代码](../contribute/git_examples.md#get-a-specific-release)。 [[GIT 示例](../contribute/git_examples.md) 提供了更多的信息,用于发布版本并对 PX4 作出贡献。 ::: ## 初次构建(使用模拟器) -首先我们要用控制台环境来构建一个模拟器目标 -这使我们能够在转移到真正的硬件和 IDE 之前验证系统设置。 +首先我们要用控制台环境来构建一个模拟器目标这使我们能够在转移到真正的硬件和 IDE 之前验证系统设置。 导航到 **PX4-Autopilot** 目录并使用以下命令启动 [Gazebo SITL](../sim_gazebo_gz/index.md): @@ -44,8 +40,7 @@ make px4_sitl gz_x500 ![PX4 控制台](../../assets/toolchain/console_gazebo.png) :::info -您可能需要在继续之前启动 _QGroundControl_ ,因为默认的 PX4 配置需要在起飞前进行地面控制连接。 -可以[从这里下载](https://docs.qgroundcontrol.com/master/en/qgc-user-guide/getting_started/download_and_install.html)。 +您可能需要在继续之前启动 _QGroundControl_ ,因为默认的 PX4 配置需要在起飞前进行地面控制连接。可以[从这里下载](https://docs.qgroundcontrol.com/master/en/qgc-user-guide/getting_started/download_and_install.html)。 ::: 可以通过键入以下命令(如上方控制台中所示)来控制飞行器。 @@ -60,9 +55,7 @@ pxh> commander takeoff 无人机可以通过输入 `Commander land` 来着陆,整个模拟可以通过 **CTRL+C** (或输入 `shutdown` )来停止。 -与地面站一起飞模拟器更接近飞机的实际运行。 -在飞机飞行时(Takeoff飞行模式),单击地图上的某个位置并启用滑块。 -这将重新定位飞机。 +与地面站一起飞模拟器更接近飞机的实际运行。在飞机飞行时(Takeoff飞行模式),单击地图上的某个位置并启用滑块。这将重新定位飞机。 ![QGroundControl GoTo](../../assets/toolchain/qgc_goto.jpg) @@ -96,12 +89,10 @@ From the PX4-Autopilot directory: [954/954] Creating /home/youruser/src/PX4-Autopilot/build/px4_fmu-v4_default/px4_fmu-v4_default.px4 ``` -构建目标 `px4_fmu-v4` 的第一部分表示目标飞行控制器固件的硬件。 -后缀(此处为`_default`)表示固件的_配置_,例如支持或省略特定功能。 +构建目标 `px4_fmu-v4` 的第一部分表示目标飞行控制器固件的硬件。后缀(此处为`_default`)表示固件的_配置_,例如支持或省略特定功能。 :::info -`_default` 后缀是可选的。 -例如,`make px4_fmu-v5` 和 `px4_fmu-v5_default` 都会生成相同的固件。 +`_default` 后缀是可选的。例如,`make px4_fmu-v5` 和 `px4_fmu-v5_default` 都会生成相同的固件。 ::: 以下列表显示了[Pixhawk标准](../flight_controller/autopilot_pixhawk_standard.md)飞行控制板的构建命令: @@ -156,8 +147,7 @@ From the PX4-Autopilot directory: ### 将固件烧录到飞控板 -在 make 命令后添加 `upload`,通过USB将编译后的二进制文件上传至 autopilot 硬件。 -例如 +在 make 命令后添加 `upload`,通过USB将编译后的二进制文件上传至 autopilot 硬件。例如 ```sh make px4_fmu-v4_default upload @@ -175,8 +165,7 @@ Rebooting. ``` :::tip -在 WSL2 上开发时不支持此操作。 -参见[ Windows 开发环境 (WSL2-基于) > 烧录主板](../dev_setup/dev_env_windows_wsl.md#flash-a-flight-control-board)。 +在 WSL2 上开发时不支持此操作。参见[ Windows 开发环境 (WSL2-基于) > 烧录主板](../dev_setup/dev_env_windows_wsl.md#flash-a-flight-control-board)。 ::: ## 其他飞控板 @@ -191,15 +180,13 @@ make list_config_targets ## 用图形界面 IDE 编译 -[VSCode](../dev_setup/vscode.md是官方支持 (且推荐) 的 用于 PX4 开发的 IDE。 -它很容易设置,可以用于编译模拟和硬件环境的 PX4。 +[VSCode](../dev_setup/vscode.md是官方支持 (且推荐) 的 用于 PX4 开发的 IDE。它很容易设置,可以用于编译模拟和硬件环境的 PX4。 ## 故障处理 ### 常规构建错误 -许多构建问题是由不匹配的子模块或未完全清理的构建环境引起的。 -更新子模块并进行 `distclean` 可以修复这些类型的错误: +许多构建问题是由不匹配的子模块或未完全清理的构建环境引起的。更新子模块并进行 `distclean` 可以修复这些类型的错误: ```sh git submodule update --recursive @@ -208,14 +195,12 @@ make distclean ### 闪存溢出了 XXX 字节 -`region 'flash' overflowed by XXXX bytes` 错误表明固件对目标硬件平台太大了。 -这对于`make px4_fmu-v2_default` 构建是常见的,它的 flash 大小被限制在 1MB。 +`region 'flash' overflowed by XXXX bytes` 错误表明固件对目标硬件平台太大了。这对于`make px4_fmu-v2_default` 构建是常见的,它的 flash 大小被限制在 1MB。 如果您正在构建_vanilla_master 分支,最可能的原因是使用不支持的 GCC版本。 In this case, install the `gcc-arm-none-eabi` package from the current Ubuntu LTS as described in the [Developer Toolchain](../dev_setup/dev_env.md) instructions. -如果在构建自己的分支,您可能已将固件大小增加到超过1MB的限制。 -在这种情况下,您需要从构建中删除您不需要的任何驱动程序/模块。 +如果在构建自己的分支,您可能已将固件大小增加到超过1MB的限制。在这种情况下,您需要从构建中删除您不需要的任何驱动程序/模块。 ### macOS:打开文件过多错误 @@ -247,8 +232,7 @@ To apply it to every new terminal, add the `ulimit` line to `~/.zshrc` as descri ### macOS Catalina:运行cmake时出现问题 -对于 macOS Catalina 10.15.1 ,在尝试使用 _cmake _ 构建模拟器时可能会遇到问题。 -如果您在这个平台上遇到构建问题,请尝试在终端中运行以下命令: +对于 macOS Catalina 10.15.1 ,在尝试使用 _cmake _ 构建模拟器时可能会遇到问题。如果您在这个平台上遇到构建问题,请尝试在终端中运行以下命令: ```sh xcode-select --install @@ -303,38 +287,32 @@ make list_config_targets **VIEWER_MODEL_DEBUGER_WORLD:** -- **VIEWER:** 这是启动和连接的模拟器 ("查看器") : `gz`, `gzebo`, `jmavsim`, `none` +- **VIEWER:** This is the simulator ("viewer") to launch and connect: `gz`, `gazebo`, `none` :::tip - `none` 可以用于启动PX4并等待模拟器(jmavsim, Gazebo, Gazebo Classic, 或其他模拟器)。 + `none` can be used if you want to launch PX4 and wait for a simulator (Gazebo, Gazebo Classic, or some other simulator). 例如,`make px4_sitl none_iris` 在没有模拟器的情况下启动 PX4 (但使用 iris 机架)。 ::: -- MODEL:要使用的 载具 模型(例如 iris (default)、rover、tailsitter 等),该模型将由模拟器加载。 - 环境变量 `PX4_SIM_MODEL` 将被设置为选中的模型,然后在[启动脚本](../simulation/index.md#startup-scripts)中使用以选择适当的参数。 +- MODEL:要使用的 载具 模型(例如 iris (default)、rover、tailsitter 等),该模型将由模拟器加载。环境变量 `PX4_SIM_MODEL` 将被设置为选中的模型,然后在[启动脚本](../simulation/index.md#startup-scripts)中使用以选择适当的参数。 - **DEBUGER:** 调试器使用: `none` (_default_), `ide`, `gdb`, `lldb`, `ddd`, `valgrind`, `callgrind`. 更多信息请参阅[模拟调试](../debug/simulation_debugging.md)。 - **WORLD**: (仅限Gazebo Classic). - 设置加载的世界([PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/worlds](https://github.com/PX4/PX4-SITL_gazebo-classic/tree/main/worlds))。 - 默认为 [empty.world](https://github.com/PX4/PX4-SITL_gazebo-classic/blob/main/worlds/empty.world)。 - 欲了解更多信息,请参阅[Gazebo Classic > 加载特定世界](../sim_gazebo_classic/index.md#loading-a-specific-world)。 + 设置加载的世界([PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/worlds](https://github.com/PX4/PX4-SITL_gazebo-classic/tree/main/worlds))。默认为 [empty.world](https://github.com/PX4/PX4-SITL_gazebo-classic/blob/main/worlds/empty.world)。欲了解更多信息,请参阅[Gazebo Classic > 加载特定世界](../sim_gazebo_classic/index.md#loading-a-specific-world)。 ::: info -- `CONFIGURATION_TARGET`和`VIEWER_MODEBUGER`中的大多数值都有默认值,因此是可选的。 - 例如,`gazebo-classic`等于`gazebo-classic_iris`或`gazebo-classic_iris_none`。 -- 如果要在其他两个设置之间指定默认值,可以使用三个下划线。 - 例如,`gazebo-classic___gdb`相当于`gazebo-classic_iris_gdb`。 +- `CONFIGURATION_TARGET`和`VIEWER_MODEBUGER`中的大多数值都有默认值,因此是可选的。例如,`gazebo-classic`等于`gazebo-classic_iris`或`gazebo-classic_iris_none`。 +- 如果要在其他两个设置之间指定默认值,可以使用三个下划线。例如,`gazebo-classic___gdb`相当于`gazebo-classic_iris_gdb`。 - 你可以使用 "none" 值为 "VIEWER_MODEBUGER" 来启动 PX4 并等待模拟器。 - 例如,使用 `make px4_sitl_default none` 和 jMAVSim 使用 `./Tools/simulation/jmavsim/jmavsim_run.sh -l` 启动 PX4。 + For example start PX4 using `make px4_sitl_default none` and then start your simulator. ::: -`VENDOR_MODEL_VARIANT`选项映射为 [/boards](https://github.com/PX4/PX4-Autopilot/tree/main/boards) 目录下的 PX4 源树中的特殊_px4board_ 配置文件。 -具体而言,`VENDOR_MODEL_VARIANT` 映射到配置文件 **boards/VENDOR/MODEL/VARIANT.px4board** +`VENDOR_MODEL_VARIANT`选项映射为 [/boards](https://github.com/PX4/PX4-Autopilot/tree/main/boards) 目录下的 PX4 源树中的特殊_px4board_ 配置文件。具体而言,`VENDOR_MODEL_VARIANT` 映射到配置文件 **boards/VENDOR/MODEL/VARIANT.px4board** (例如 `px4_fmu-v5_default` 对应 [boards/px4/fmu-v5/default.px4board](https://github.com/PX4/PX4-Autopilot/blob/main/boards/px4/fmu-v5/default.px4board))。 其他 make 目标在相关章节中讨论: diff --git a/docs/zh/dev_setup/dev_env_linux_arch.md b/docs/zh/dev_setup/dev_env_linux_arch.md index acf060dc5ae..f42808679d6 100644 --- a/docs/zh/dev_setup/dev_env_linux_arch.md +++ b/docs/zh/dev_setup/dev_env_linux_arch.md @@ -9,7 +9,7 @@ See [Toolchain Installation](../dev_setup/dev_env.md) for information about the The PX4-Autopilot repository provides a convenient script to set your Arch installation up for PX4 development: [Tools/setup/arch.sh](https://github.com/PX4/PX4-Autopilot/blob/main/Tools/setup/arch.sh). -The script installs (by default) all tools to build PX4 for NuttX targets and run simulation with [JMAVSim](../sim_jmavsim/index.md). +The script installs (by default) all tools to build PX4 for NuttX targets and run simulation with [SIH](../sim_sih/index.md). You can additionally install the [Gazebo Classic](../sim_gazebo_classic/index.md) simulator by specifying the command line argument: `--gazebo`. ![Gazebo on Arch](../../assets/simulation/gazebo_classic/arch-gazebo.png) @@ -47,4 +47,4 @@ The script takes the following optional parameters: - `--no-nuttx`: Do not install the NuttX/Pixhawk toolchain (i.e. if only using simulation). -- `--no-sim-tools`: Do not install jMAVSim/Gazebo (i.e. if only targeting Pixhawk/NuttX targets) +- `--no-sim-tools`: Do not install the simulation dependencies (i.e. if only targeting Pixhawk/NuttX targets) diff --git a/docs/zh/dev_setup/dev_env_linux_ubuntu.md b/docs/zh/dev_setup/dev_env_linux_ubuntu.md index b43aaacaa80..b4870d8485f 100644 --- a/docs/zh/dev_setup/dev_env_linux_ubuntu.md +++ b/docs/zh/dev_setup/dev_env_linux_ubuntu.md @@ -1,6 +1,6 @@ # Ubuntu LTS/Debian Linux 的开发环境 -The following instructions use a bash script to set up the PX4 development environment on the [Ubuntu Linux LTS](https://wiki.ubuntu.com/LTS) versions supported by PX4: Ubuntu 24.04 (Nimble Numbat) and Ubuntu 22.04 (Jammy Jellyfish). +The following instructions use a bash script to set up the PX4 development environment on the [Ubuntu Linux LTS](https://ubuntu.com/about/release-cycle) versions supported by PX4: Ubuntu 24.04 (Nimble Numbat) and Ubuntu 22.04 (Jammy Jellyfish). The environment includes: diff --git a/docs/zh/dev_setup/dev_env_mac.md b/docs/zh/dev_setup/dev_env_mac.md index 090eec7c1eb..00e6b321b3a 100644 --- a/docs/zh/dev_setup/dev_env_mac.md +++ b/docs/zh/dev_setup/dev_env_mac.md @@ -80,7 +80,7 @@ To build for [other targets](../dev_setup/dev_env.md#supported-targets) you will ::: info The script installs from third-party Homebrew taps and marks them as trusted (`brew trust`) on Homebrew 6.0 and later, which refuses to load formulae from untrusted taps. - With `--sim-tools` it will prompt for your password, since the XQuartz installer and the JDK link into `/Library/Java/JavaVirtualMachines` need `sudo`. + With `--sim-tools` it will prompt for your password. ::: @@ -88,6 +88,12 @@ To build for [other targets](../dev_setup/dev_env.md#supported-targets) you will The `--sim-tools` flag installs Gazebo and the libraries PX4's simulation modules build against. +Gazebo does not come from Homebrew. +The script installs it from a locked [conda-forge](https://conda-forge.org/) environment, using [pixi](https://pixi.sh), into `Tools/setup/macos/.pixi`. +The lock file pins every package, so the install does not change when Homebrew updates its own Gazebo dependencies. +The build and the `make px4_sitl gz_*` targets find it on their own, like the `.venv`. +Activating `.venv` also puts it on your `PATH`, which you only need to run `gz` commands directly. + If you skipped `--sim-tools` during initial setup and want to add simulation later, re-run the setup script with the flag (it is safe to run repeatedly): ```sh @@ -111,7 +117,7 @@ arm-none-eabi-gcc --version cmake --version ninja --version -# Gazebo (if --sim-tools was used) +# Gazebo (if --sim-tools was used, with .venv activated) gz sim --versions ``` diff --git a/docs/zh/dev_setup/dev_env_windows_cygwin.md b/docs/zh/dev_setup/dev_env_windows_cygwin.md index d124220fa3e..d21138af57d 100644 --- a/docs/zh/dev_setup/dev_env_windows_cygwin.md +++ b/docs/zh/dev_setup/dev_env_windows_cygwin.md @@ -10,11 +10,10 @@ The [Windows WSL2-Based Development Environment](../dev_setup/dev_env_windows_ws See [Toolchain Installation](../dev_setup/dev_env.md) for information about the environments and tools supported by the core development team. ::: -该工具链非常轻便,而且容易安装和使用。 -根据本文的指示构建的开发环境可以用编译: +该工具链非常轻便,而且容易安装和使用。根据本文的指示构建的开发环境可以用编译: - 基于 NuttX 的硬件 (Pixhawk等) -- [jMAVSim Simulation](../sim_jmavsim/index.md) +- jMAVSim simulation (removed from PX4, see the note in [Getting Started](#getting-started)) @@ -73,6 +72,12 @@ The toolchain uses a specially configured console window (started by running the 4. For example, to run JMAVSim: + ::: info + jMAVSim has been removed from PX4, so this example only works with PX4 versions that still include it. + Current PX4 uses [SIH](../sim_sih/index.md) with the [Hawkeye](../sim_hawkeye/index.md) visualizer instead. + +::: + ```sh # Navigate to PX4-Autopilot repo cd Firmware diff --git a/docs/zh/dev_setup/dev_env_windows_vm.md b/docs/zh/dev_setup/dev_env_windows_vm.md index e7bd0d10c6d..4fce2712f42 100644 --- a/docs/zh/dev_setup/dev_env_windows_vm.md +++ b/docs/zh/dev_setup/dev_env_windows_vm.md @@ -13,7 +13,7 @@ After setting up the virtual machine, the installation and setup of PX4 within t While using a VM is a very easy way to set up and test an environment for building firmware, users should be aware: 1. 固件的编译速度比原生 Linux 要更慢一些。 -2. The JMAVSim simulation, frame rate be much slower than on native Linux. +2. Simulation frame rates will be much slower than on native Linux. 虚拟机运行资源不足可能导致特定情况下无人机坠毁。 3. 可以安装 Gazebo 和 ROS,但运行速度非常慢。 @@ -41,7 +41,7 @@ VMWare performance is acceptable for basic usage (building Firmware) but not for 5. Enable 3D acceleration in the VM's settings: **VM > Settings > Hardware > Display > Accelerate 3D graphics** ::: info - This option is required to properly run 3D simulation environments like jMAVSim and Gazebo Classic. + This option is required to properly run 3D simulation environments like Gazebo and Gazebo Classic. We recommend this is done before installing Linux in the virtual environment. ::: diff --git a/docs/zh/dev_setup/sitl_container_builds.md b/docs/zh/dev_setup/sitl_container_builds.md index 1efde29934a..7c4180fb4af 100644 --- a/docs/zh/dev_setup/sitl_container_builds.md +++ b/docs/zh/dev_setup/sitl_container_builds.md @@ -140,7 +140,7 @@ GIT_COMMON_DIR=$(git rev-parse --path-format=absolute --git-common-dir) docker run --rm -it \ -v "$SOURCE:$SOURCE" -v "$GIT_COMMON_DIR:$GIT_COMMON_DIR" -w "$SOURCE" \ -e GIT_CONFIG_COUNT=1 -e GIT_CONFIG_KEY_0=safe.directory \ - -e "GIT_CONFIG_VALUE_0=$SOURCE" px4-dev-ros2:local bash + -e "GIT_CONFIG_VALUE_0=*" px4-dev-ros2:local bash ``` The same absolute mounts support both ordinary checkouts and git worktrees. @@ -196,6 +196,24 @@ Already installed Ubuntu/ROS Python versions are constrained during installation The SIH image does not acquire Gazebo or the NuttX toolchain. Installing the complete source-build toolset increases cold image-build time and size; existing native architecture and incremental cache boundaries remain in use. +## Testing A PX4 Checkout With ROS and Gazebo + +The `ghcr.io/px4/px4-dev-ros2-gazebo` image extends `ghcr.io/px4/px4-dev-ros2` by calling `Tools/setup/ubuntu.sh --no-nuttx` and therefore installing Gz Harmonic. +This allows to test PX4 changes in Gazebo. +To build the image locally and the start the container to build PX4, run + +```sh +bash Tools/packaging/containers/prepare_context.sh +ROS_DISTRO=jazzy docker buildx bake -f Tools/packaging/containers/docker-bake.hcl ros2-gazebo-dev \ + --set ros2-gazebo-dev.tags=px4-dev-ros2-gazebo:local --load +SOURCE=$(pwd -P) +GIT_COMMON_DIR=$(git rev-parse --path-format=absolute --git-common-dir) +docker run --rm -it \ + -v "$SOURCE:$SOURCE" -v "$GIT_COMMON_DIR:$GIT_COMMON_DIR" -w "$SOURCE" \ + -e GIT_CONFIG_COUNT=1 -e GIT_CONFIG_KEY_0=safe.directory \ + -e "GIT_CONFIG_VALUE_0=*" px4-dev-ros2-gazebo:local bash +``` + ## Container SBOMs The publishing workflow enables BuildKit's standard SBOM attestations for both runtime and ROS images. diff --git a/docs/zh/development/development.md b/docs/zh/development/development.md index 3ab6e307584..13123b2ccf4 100644 --- a/docs/zh/development/development.md +++ b/docs/zh/development/development.md @@ -3,8 +3,7 @@ 本节解释如何支持新型载具及其变体,修改飞行算法。 添加新模式,整合新的硬件,并与飞行控制器外的 PX4 通信。 :::tip -本节针对软件开发者和(新)硬件集成器。 -如果要构建现有的机身或者PX4已有的,可以跳过此章节。 +本节针对软件开发者和(新)硬件集成器。如果要构建现有的机身或者PX4已有的,可以跳过此章节。 ::: 它解释了如何: diff --git a/docs/zh/dronecan/ark_dist.md b/docs/zh/dronecan/ark_dist.md index 4802469018c..7b3734d6154 100644 --- a/docs/zh/dronecan/ark_dist.md +++ b/docs/zh/dronecan/ark_dist.md @@ -75,7 +75,6 @@ Set the following parameters in _QGroundControl_: - Enable [UAVCAN_ENABLE](../advanced_config/parameter_reference.md#UAVCAN_ENABLE) to 2 for dynamic node allocation. - Enable [UAVCAN_SUB_RNG](../advanced_config/parameter_reference.md#UAVCAN_SUB_RNG). -- Set [EKF2_RNG_A_HMAX](../advanced_config/parameter_reference.md#EKF2_RNG_A_HMAX) to `30`. - Set [EKF2_RNG_QLTY_T](../advanced_config/parameter_reference.md#EKF2_RNG_QLTY_T) to `0.2`. - Set [UAVCAN_RNG_MIN](../advanced_config/parameter_reference.md#UAVCAN_RNG_MIN) to `0.08`. - Set [UAVCAN_RNG_MAX](../advanced_config/parameter_reference.md#UAVCAN_RNG_MAX) to `30`. @@ -90,7 +89,6 @@ If connecting via a UART set the following parameters in _QGroundControl_: - Set [MAV_X_FORWARD](../advanced_config/parameter_reference.md#MAV_0_FORWARD) to `0` (off). - Set [MAV_X_MODE](../advanced_config/parameter_reference.md#MAV_0_MODE) to `7` or `13` to (Minimal or Low Bandwidth) to reduce memory usage. - Set `SER_XXX_BAUD` to `115200`, where `XXX` is specific to the port you are using (such as [SER_GPS2_BAUD](../advanced_config/parameter_reference.md#SER_GPS2_BAUD)). -- Set [EKF2_RNG_A_HMAX](../advanced_config/parameter_reference.md#EKF2_RNG_A_HMAX) to `30`. - Set [EKF2_RNG_QLTY_T](../advanced_config/parameter_reference.md#EKF2_RNG_QLTY_T) to `0.2`. ## 另见 diff --git a/docs/zh/dronecan/ark_dist_mr.md b/docs/zh/dronecan/ark_dist_mr.md index 8408b486c0d..8e15ad86f96 100644 --- a/docs/zh/dronecan/ark_dist_mr.md +++ b/docs/zh/dronecan/ark_dist_mr.md @@ -74,7 +74,6 @@ Set the following parameters in _QGroundControl_: - Enable [UAVCAN_ENABLE](../advanced_config/parameter_reference.md#UAVCAN_ENABLE) to 2 for dynamic node allocation. - Enable [UAVCAN_SUB_RNG](../advanced_config/parameter_reference.md#UAVCAN_SUB_RNG). -- Set [EKF2_RNG_A_HMAX](../advanced_config/parameter_reference.md#EKF2_RNG_A_HMAX) to `50`. - Set [EKF2_RNG_QLTY_T](../advanced_config/parameter_reference.md#EKF2_RNG_QLTY_T) to `0.2`. - Set [UAVCAN_RNG_MIN](../advanced_config/parameter_reference.md#UAVCAN_RNG_MIN) to `0.08`. - Set [UAVCAN_RNG_MAX](../advanced_config/parameter_reference.md#UAVCAN_RNG_MAX) to `50`. @@ -89,7 +88,6 @@ If connecting via a UART set the following parameters in _QGroundControl_: - Set [MAV_X_FORWARD](../advanced_config/parameter_reference.md#MAV_0_FORWARD) to `0` (off). - Set [MAV_X_MODE](../advanced_config/parameter_reference.md#MAV_0_MODE) to `7` or `13` to (Minimal or Low Bandwidth) to reduce memory usage. - Set `SER_XXX_BAUD` to `115200`, where `XXX` is specific to the port you are using (such as [SER_GPS2_BAUD](../advanced_config/parameter_reference.md#SER_GPS2_BAUD)). -- Set [EKF2_RNG_A_HMAX](../advanced_config/parameter_reference.md#EKF2_RNG_A_HMAX) to `50`. - Set [EKF2_RNG_QLTY_T](../advanced_config/parameter_reference.md#EKF2_RNG_QLTY_T) to `0.2`. ## 另见 diff --git a/docs/zh/dronecan/ark_flow.md b/docs/zh/dronecan/ark_flow.md index 27149dfe74c..1da71f2957d 100644 --- a/docs/zh/dronecan/ark_flow.md +++ b/docs/zh/dronecan/ark_flow.md @@ -95,7 +95,6 @@ Set the following parameters in _QGroundControl_: - Enable [UAVCAN_SUB_FLOW](../advanced_config/parameter_reference.md#UAVCAN_SUB_FLOW). - Enable [UAVCAN_SUB_RNG](../advanced_config/parameter_reference.md#UAVCAN_SUB_RNG). - Set [EKF2_RNG_CTRL](../advanced_config/parameter_reference.md#EKF2_RNG_CTRL) to `1`. -- Set [EKF2_RNG_A_HMAX](../advanced_config/parameter_reference.md#EKF2_RNG_A_HMAX) to `10`. - Set [EKF2_RNG_QLTY_T](../advanced_config/parameter_reference.md#EKF2_RNG_QLTY_T) to `0.2`. - Set [UAVCAN_RNG_MIN](../advanced_config/parameter_reference.md#UAVCAN_RNG_MIN) to `0.08`. - Set [UAVCAN_RNG_MAX](../advanced_config/parameter_reference.md#UAVCAN_RNG_MAX) to `30`. diff --git a/docs/zh/dronecan/ark_flow_mr.md b/docs/zh/dronecan/ark_flow_mr.md index 79a7b3d5a0c..b312488b0d8 100644 --- a/docs/zh/dronecan/ark_flow_mr.md +++ b/docs/zh/dronecan/ark_flow_mr.md @@ -92,7 +92,6 @@ Set the following parameters in _QGroundControl_: - Enable [UAVCAN_SUB_FLOW](../advanced_config/parameter_reference.md#UAVCAN_SUB_FLOW). - Enable [UAVCAN_SUB_RNG](../advanced_config/parameter_reference.md#UAVCAN_SUB_RNG). - Set [EKF2_RNG_CTRL](../advanced_config/parameter_reference.md#EKF2_RNG_CTRL) to `1`. -- Set [EKF2_RNG_A_HMAX](../advanced_config/parameter_reference.md#EKF2_RNG_A_HMAX) to `10`. - Set [EKF2_RNG_QLTY_T](../advanced_config/parameter_reference.md#EKF2_RNG_QLTY_T) to `0.2`. - Set [UAVCAN_RNG_MIN](../advanced_config/parameter_reference.md#UAVCAN_RNG_MIN) to `0.08`. - Set [UAVCAN_RNG_MAX](../advanced_config/parameter_reference.md#UAVCAN_RNG_MAX) to `50`. diff --git a/docs/zh/dronecan/holybro_m8n_gps.md b/docs/zh/dronecan/holybro_m8n_gps.md index e446ab3d76f..48bf9b41fa7 100644 --- a/docs/zh/dronecan/holybro_m8n_gps.md +++ b/docs/zh/dronecan/holybro_m8n_gps.md @@ -3,8 +3,7 @@ Holybro DroneCAN GPS有一个UBLOX M8N 模块,BMM150指南针,三色LED指示器。 The GPS module uses the [DroneCAN](index.md) protocol for communication. -DroneCAN连接比串行连接更抗电磁干扰,从而更加可靠。 -此外,使用DroneCAN意味着GPS和指南针不占用任何飞控串口(不同/附加的CAN设备可以通过CAN分离板连接到同一CAN总线。 +DroneCAN连接比串行连接更抗电磁干扰,从而更加可靠。此外,使用DroneCAN意味着GPS和指南针不占用任何飞控串口(不同/附加的CAN设备可以通过CAN分离板连接到同一CAN总线。 diff --git a/docs/zh/dronecan/smartmicro_t132.md b/docs/zh/dronecan/smartmicro_t132.md index e8feec4e6c6..26e1afd2e90 100644 --- a/docs/zh/dronecan/smartmicro_t132.md +++ b/docs/zh/dronecan/smartmicro_t132.md @@ -73,7 +73,6 @@ Future firmware update is possible with proprietary Smartmicro software via CAN - In _QGroundControl_ set the parameter [UAVCAN_ENABLE](../advanced_config/parameter_reference.md#UAVCAN_ENABLE) to `2` for dynamic node allocation. - Confirm that [UAVCAN_BITRATE](../advanced_config/parameter_reference.md#UAVCAN_BITRATE) is set to 1000000 (1 Mbit/s). - Enable [UAVCAN_SUB_RNG](../advanced_config/parameter_reference.md#UAVCAN_SUB_RNG). -- Set [EKF2_RNG_A_HMAX](../advanced_config/parameter_reference.md#EKF2_RNG_A_HMAX) to `175`. - Set [EKF2_RNG_QLTY_T](../advanced_config/parameter_reference.md#EKF2_RNG_QLTY_T) to `0.2`. - Set [UAVCAN_RNG_MIN](../advanced_config/parameter_reference.md#UAVCAN_RNG_MIN) to `1`. - Set [UAVCAN_RNG_MAX](../advanced_config/parameter_reference.md#UAVCAN_RNG_MAX) to `175`. diff --git a/docs/zh/flight_controller/agam_v6xrt.md b/docs/zh/flight_controller/agam_v6xrt.md index 8052357c584..c5ba16bff64 100644 --- a/docs/zh/flight_controller/agam_v6xrt.md +++ b/docs/zh/flight_controller/agam_v6xrt.md @@ -49,13 +49,13 @@ See [Agam's IMU triple redundancy notes](https://agamrobotics.gitbook.io/docs/au - 64MB external Octal SPI flash - On-board sensors — Agam Autopilot v6X-RT ships in two sensor-set variants (Sensor Set 1 and Sensor Set 3, per [Pixhawk Standards](https://github.com/pixhawk/Pixhawk-Standards/blob/master/DS-020%20Pixhawk%20Autopilot%20v6X-RT%20Standard.pdf)): - Sensor Set 1: - - 2x [InvenSense ICM-42688-P IMU](https://www.invensense.tdk.com/products/motion-tracking/6-axis/icm-42688-p/) - - [Bosch BMI088 IMU](https://www.bosch-sensortec.com/products/motion-sensors/imus/bmi088/) + - 2x [InvenSense ICM-42688-P IMU](https://www.invensense.tdk.com/en-us/products/6-axis/icm-42688-p) + - [Bosch BMI088 IMU](https://www.bosch-sensortec.com/en/products/motion-sensors/imus/bmi088/) - [Bosch BMM150 Magnetometer](https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bmm150-ds001.pdf) - 2x [Bosch BMP388 Barometer](https://www.bosch-sensortec.com/en/products/environmental-sensors/pressure-sensors/bmp390/) - Sensor Set 3: - 2x [TDK InvenSense ICM-45686 IMU](https://www.invensense.tdk.com/en-us/products/6-axis/icm-45686) - - [Bosch BMI088 IMU](https://www.bosch-sensortec.com/products/motion-sensors/imus/bmi088/) + - [Bosch BMI088 IMU](https://www.bosch-sensortec.com/en/products/motion-sensors/imus/bmi088/) - [Bosch BMM350 Magnetometer](https://www.bosch-sensortec.com/en/products/motion-sensors/magnetometers/bmm350) - 2x [Bosch BMP388 Barometer](https://www.bosch-sensortec.com/en/products/environmental-sensors/pressure-sensors/bmp390/) diff --git a/docs/zh/flight_controller/ark_v6xrt.md b/docs/zh/flight_controller/ark_v6xrt.md index 642e66e613d..974f58812c6 100644 --- a/docs/zh/flight_controller/ark_v6xrt.md +++ b/docs/zh/flight_controller/ark_v6xrt.md @@ -36,7 +36,7 @@ Order from [ARK Electronics](https://arkelectron.com/product/arkv6xrt) (US). - **Code store:** no internal flash. Code executes in place from a 64 MB external octal NOR on FlexSPI1, of which PX4 uses the first 4 MB. - **IO processor:** PX4IO v2, on carriers that fit one. - **Sensors** - - **IMU:** [InvenSense ICM-45686](https://invensense.tdk.com/products/motion-tracking/6-axis/icm-45686/) (SPI1), [InvenSense IIM-20670](https://invensense.tdk.com/products/motion-tracking/6-axis/iim-20670/) (SPI2), [ST LSM6DSV80X](https://www.st.com/en/mems-and-sensors/lsm6dsv80x.html) (SPI3) + - **IMU:** [InvenSense ICM-45686](https://www.invensense.tdk.com/en-us/products/6-axis/icm-45686) (SPI1), [InvenSense IIM-20670](https://www.invensense.tdk.com/en-us/products/motion-tracking/6-axis/iim-20670) (SPI2), [ST LSM6DSV80X](https://www.st.com/en/mems-and-sensors/lsm6dsv80x.html) (SPI3) - **Barometer:** [Bosch BMP390](https://www.bosch-sensortec.com/en/products/environmental-sensors/pressure-sensors/bmp390/) (I2C2) - **Magnetometer:** [ST IIS2MDC](https://www.st.com/en/mems-and-sensors/iis2mdc.html) (I2C3) - **Heater:** closed loop on the ICM-45686 die temperature diff --git a/docs/zh/flight_controller/autopilot_manufacturer_supported.md b/docs/zh/flight_controller/autopilot_manufacturer_supported.md index d0c3614469f..df08b5df385 100644 --- a/docs/zh/flight_controller/autopilot_manufacturer_supported.md +++ b/docs/zh/flight_controller/autopilot_manufacturer_supported.md @@ -56,4 +56,5 @@ The boards in this category are: - [ThePeach FCC-K1](../flight_controller/thepeach_k1.md) - [ThePeach FCC-R1](../flight_controller/thepeach_r1.md) - [X-MAV AP-H743-R1](../flight_controller/x-mav_ap-h743r1.md) +- [ZenFC H743](../flight_controller/zenfc_h743.md) - [SIYI-UniFC-6-PICO](../flight_controller/siyi-unifc-6-pico.md) diff --git a/docs/zh/flight_controller/beaglebone_blue.md b/docs/zh/flight_controller/beaglebone_blue.md index ce46300ce1b..c7b4aa1e0a2 100644 --- a/docs/zh/flight_controller/beaglebone_blue.md +++ b/docs/zh/flight_controller/beaglebone_blue.md @@ -311,8 +311,7 @@ UARTs on BeagleBone Blue can only work with non-inverted 3.3V level signal. For a quadcopter with GPS and an SBUS receiver, here are typical connections: -1. 将电机 1,2,3 和 4 的电调连接到伺服输出的通道 1,2,3和4 分别在 BeagleBone Blue 上。 - 如果您的电调连接器包含电源输出引脚,将其移除,不要将其连接到伺服通道的电源输出引脚在 BeagleBone Blue 上。 +1. 将电机 1,2,3 和 4 的电调连接到伺服输出的通道 1,2,3和4 分别在 BeagleBone Blue 上。如果您的电调连接器包含电源输出引脚,将其移除,不要将其连接到伺服通道的电源输出引脚在 BeagleBone Blue 上。 2. Connect the above mentioned converted SBUS signal to the dsm2 port if you have the matching connector for dsm2, otherwise connect it to any other available UART port and change the corresponding port in **/home/debian/px4/px4.config** accordingly. 3. 将 GPS 模块的信号连接到 BeagleBone Blue 上的 GPS 端口。 Note that the signal pins of the GPS port on the BeagleBone Blue are only 3.3V tolerant, so choose your GPS module accordingly. diff --git a/docs/zh/flight_controller/corvon_743v1.md b/docs/zh/flight_controller/corvon_743v1.md index 327da1725e5..bff52f934a3 100644 --- a/docs/zh/flight_controller/corvon_743v1.md +++ b/docs/zh/flight_controller/corvon_743v1.md @@ -40,7 +40,7 @@ This flight controller is [manufacturer supported](../flight_controller/autopilo ## 购买渠道 -Order from [CORVON](https://corvon.tech). +Order from [CORVON](https://www.corvon.tech/en). ## Physical / Mechanical diff --git a/docs/zh/flight_controller/corvon_743v2.md b/docs/zh/flight_controller/corvon_743v2.md index 37e7726a204..b815d9812ca 100644 --- a/docs/zh/flight_controller/corvon_743v2.md +++ b/docs/zh/flight_controller/corvon_743v2.md @@ -4,7 +4,7 @@ :::warning PX4 does not manufacture this (or any) autopilot. -Contact the [manufacturer](https://corvon.tech) for hardware support or compliance issues. +Contact the [manufacturer](https://www.corvon.tech/en) for hardware support or compliance issues. ::: The _CORVON 743v2_ is a flight controller designed by Feikong Technology Co., Ltd under the CORVON brand. @@ -40,7 +40,7 @@ This flight controller is [manufacturer supported](../flight_controller/autopilo ## 购买渠道 -Order from [CORVON](https://corvon.tech). +Order from [CORVON](https://www.corvon.tech/en). ## Physical / Mechanical diff --git a/docs/zh/flight_controller/corvon_v5.md b/docs/zh/flight_controller/corvon_v5.md index dd3fb678f8f..af3d3dc6522 100644 --- a/docs/zh/flight_controller/corvon_v5.md +++ b/docs/zh/flight_controller/corvon_v5.md @@ -4,7 +4,7 @@ :::warning PX4 does not manufacture this (or any) autopilot. -Contact the [manufacturer](https://corvon.tech) for hardware support or compliance issues. +Contact the [manufacturer](https://www.corvon.tech/en) for hardware support or compliance issues. ::: The CORVON V5 is based on the Pixhawk FMUv5 design standard and runs PX4 on NuttX. @@ -54,7 +54,7 @@ This flight controller is [manufacturer supported](autopilot_manufacturer_suppor ## Where to Buy {#store} -- [CORVON Store](https://corvon.tech) +- [CORVON Store](https://www.corvon.tech/en) ## Connectors and Interfaces @@ -190,4 +190,4 @@ The complete set of supported configurations can be seen in the [Airframes Refer ## 更多信息 -- [Corvon Tech](https://corvon.tech) +- [Corvon Tech](https://www.corvon.tech/en) diff --git a/docs/zh/flight_controller/cuav_nora.md b/docs/zh/flight_controller/cuav_nora.md index 278f0a987bc..92bf508314c 100644 --- a/docs/zh/flight_controller/cuav_nora.md +++ b/docs/zh/flight_controller/cuav_nora.md @@ -5,7 +5,7 @@ PX4 does not manufacture this (or any) autopilot. Contact the [manufacturer](https://www.cuav.net) for hardware support or compliance issues. ::: -The [Nora](https://doc.cuav.net/controller/x7/en/nora-plus.html)® flight controller is a high-performance autopilot. +The [Nora](https://doc.cuav.net/en/controller/nora-plus/nora-plus.html)® flight controller is a high-performance autopilot. It is an ideal choice for industrial drones and large-scale heavy-duty drones. It is mainly supplied to commercial manufacturers. @@ -31,7 +31,7 @@ This flight controller is [manufacturer supported](../flight_controller/autopilo - High performance processor :::tip -The manufacturer [CUAV Docs](https://doc.cuav.net/controller/x7/en/nora-plus.html) are the canonical reference for Nora. +The manufacturer [CUAV Docs](https://doc.cuav.net/en/controller/nora-plus/nora-plus.html) are the canonical reference for Nora. They should be used by preference as they contain the most complete and up to date information. ::: @@ -83,7 +83,7 @@ The remaining 6 PWM ports are still being adapted (so it is not compatible with ## Connections (Wiring) -[CUAV nora Wiring Quickstart](https://doc.cuav.net/controller/x7/en/quick-start/quick-start-nora.html) +[CUAV nora Wiring Quickstart](https://doc.cuav.net/en/controller/nora-plus/quick-start-nora.html) ## Size and Pinouts @@ -171,6 +171,6 @@ The complete set of supported configurations can be seen in the [Airframes Refer ## 更多信息 -- [Quick start](https://doc.cuav.net/controller/x7/en/quick-start/quick-start-nora.html) +- [Quick start](https://doc.cuav.net/en/controller/nora-plus/quick-start-nora.html) - [CUAV docs](https://doc.cuav.net/) - [nora schematic](https://github.com/cuav/hardware/tree/master/X7_Autopilot) diff --git a/docs/zh/flight_controller/nwblue_pro-h757.md b/docs/zh/flight_controller/nwblue_pro-h757.md index 91400a9bd1e..e0b71eb3483 100644 --- a/docs/zh/flight_controller/nwblue_pro-h757.md +++ b/docs/zh/flight_controller/nwblue_pro-h757.md @@ -6,7 +6,7 @@ PX4 does not manufacture this (or any) autopilot. Contact the manufacturer for hardware support or compliance issues. ::: -The _NWBlue Pro H757_ is a 36 x 36 mm FPV flight controller built around a [CubePilot CubeNode H757](https://docs.cubepilot.org/user-guides/cubenode/pin-descriptions) module carrying an STM32H757 microcontroller. +The _NWBlue Pro H757_ is a 36 x 36 mm FPV flight controller built around a [CubePilot CubeNode H757](https://docs.cubepilot.org/cubenode/pin-descriptions) module carrying an STM32H757 microcontroller. ![NWBlue Pro H757](../../assets/flight_controller/nwblue_pro-h757/nwblue_pro-h757.png) @@ -23,7 +23,7 @@ Order from [NWBlue](https://nwblue.com/products/pro-h757-fpv-flight-controller) - **Processor** - **Main FMU processor:** STM32H757 (32-bit Arm® Cortex®-M7 at 480 MHz, 2 MB Flash, 1 MB RAM), on a CubePilot CubeNode module - **Sensors** - - **IMU:** [InvenSense ICM-45686](https://invensense.tdk.com/products/motion-tracking/6-axis/icm-45686/) (SPI3, inside the CubeNode module) + - **IMU:** [InvenSense ICM-45686](https://www.invensense.tdk.com/en-us/products/6-axis/icm-45686) (SPI3, inside the CubeNode module) - **Barometer:** [Infineon DPS368](https://www.infineon.com/part/DPS368) (SPI3) - **Magnetometer:** [ST IIS2MDC](https://www.st.com/en/mems-and-sensors/iis2mdc.html) (I2C3, internal) - **Interfaces** diff --git a/docs/zh/flight_controller/raspberry_pi_pilotpi_rpios.md b/docs/zh/flight_controller/raspberry_pi_pilotpi_rpios.md index 02e283d7197..18ea3daabf6 100644 --- a/docs/zh/flight_controller/raspberry_pi_pilotpi_rpios.md +++ b/docs/zh/flight_controller/raspberry_pi_pilotpi_rpios.md @@ -67,8 +67,7 @@ Append `isolcpus=2` after the last word. console=tty1 root=PARTUUID=xxxxxxxx-xx rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait isolcpus=2 ``` -这告诉 Linux 内核不要在 CPU 核心2 上调度任何进程。 -我们将在稍后手动在该核心运行 PX4。 +这告诉 Linux 内核不要在 CPU 核心2 上调度任何进程。我们将在稍后手动在该核心运行 PX4。 Reboot and SSH onto your RPi. diff --git a/docs/zh/flight_controller/zenfc_h743.md b/docs/zh/flight_controller/zenfc_h743.md new file mode 100644 index 00000000000..b54bb61a2cf --- /dev/null +++ b/docs/zh/flight_controller/zenfc_h743.md @@ -0,0 +1,151 @@ +# ZenFC H743 + + + + + +:::warning +PX4 does not manufacture this (or any) autopilot. +Contact the [manufacturer](https://www.zenithratech.com/contact) for hardware support or compliance issues. +::: + +The _ZenFC H743_ is a flight controller designed by Zenithra Tech. +It is built around the STM32H743 processor with dual Bosch BMI088 IMUs for sensor redundancy, an onboard barometer, and an integrated OSD. + +![ZenFC H743 Flight Controller](../../assets/flight_controller/zenfc_h743/zenfc_h743.png) + +:::info +This flight controller is [manufacturer supported](../flight_controller/autopilot_manufacturer_supported.md). +::: + +## 主要特性 + +- **MCU:** + - STM32H743VIT6 (32-bit Arm® Cortex®-M7, 480 MHz) +- **IMU:** + - 2x Bosch BMI088 (accel + gyro, independent SPI buses for redundancy) +- **Barometer:** + - Bosch BMP388 +- **OSD:** + - Onboard AT7456E OSD chip +- **Interfaces:** + - 7x UARTs + - 1x CAN + - 2x external I2C (I2C1 with GPS connector and dedicated I2C2 connector) + - 8x PWM outputs (Dshot supported) + - microSD card slot + - 1x USB Type-C +- **Power:** + - 2x ADC (V_BAT & current sense) + - Battery Input range - 2S-6S + - BEC Outputs + - 9V 3A cont. + - 5V 3A cont. + +## 尺寸 + +- **Mounting:** 30.5 mm x 30.5 mm /Φ4mm hole +- **Dimensions:** 35mm x 35mm x 8mm +- **Weight:** 9g + +![ZenFC H743 Dimensions](../../assets/flight_controller/zenfc_h743/zenfc_h743_dimensions.png) + +## 购买渠道 + +Order from [Zenithra Tech](https://www.zenithratech.com/solutions/components). + +## Flight Controller Layout + +![ZenFC H743 Layout Front](../../assets/flight_controller/zenfc_h743/zenfc_h743_layout_front.png) + +![ZenFC H743 Layout Back](../../assets/flight_controller/zenfc_h743/zenfc_h743_layout_back.png) + +## 串口映射 + +| UART | 设备 | PX4 Port | +| ------ | ---------- | -------- | +| USART1 | /dev/ttyS0 | GPS1 | +| USART2 | /dev/ttyS1 | TEL3 | +| USART3 | /dev/ttyS2 | TEL4 | +| UART5 | /dev/ttyS3 | TEL1 | +| USART6 | /dev/ttyS4 | RC | +| UART7 | /dev/ttyS5 | TEL2 | +| UART8 | /dev/ttyS6 | UART6 | + +## Connectors & Pinout + +Board uses JST SH connectors for all interfaces. + +![ZenFC H743 Pinouts Front](../../assets/flight_controller/zenfc_h743/zenfc_h743_pinouts_front.png) + +![ZenFC H743 Pinouts Back](../../assets/flight_controller/zenfc_h743/zenfc_h743_pinouts_back.png) + +**Note** - SBus pin on DJI O3/O4 port is internally connected to RX6 (`RCIN`). + +### PWM Outputs + +The 8 outputs are in 3 groups: + +- Outputs 1-4 in group1 +- Outputs 5-6 in group2 +- Outputs 7-8 in group3 + +**Note**: + +- All outputs support PWM and [DShot](../peripherals/dshot.md) protocol. + Outputs 1-6 and 8 support "bidirectional DShot" (or "BDShot") telemetry. +- Outputs 1-4 default to DShot300 ([PWM_MAIN_TIM0](../advanced_config/parameter_reference.md#PWM_MAIN_TIM0) = `-4`); outputs 5-6 and 7-8 default to PWM at 400 Hz. +- Each group's protocol can be changed independently using the corresponding `PWM_MAIN_TIMx` parameter, including to [Bidirectional DShot](../peripherals/dshot.md#bidirectional-dshot-telemetry) (BDShot) for ESC telemetry. + +### 调试接口 + +This board does not configure a dedicated UART as a system console. +Use the [MAVLink Shell](../debug/mavlink_shell.md) over USB for console/NSH access using QGroundControl. + +**SWD** + +The board features a [**4-pin SWD Debug**](../debug/swd_debug.md) interface (3V3 / SWCLK / SWDIO / GND) for hardware debugging. + +## 遥控器 + +A [Radio Control (RC) system](../getting_started/rc_transmitter_receiver.md) is required if you want to manually control your vehicle (PX4 does not require a radio system for autonomous flight modes). +See [Radio Control modules](../modules/modules_driver_radio_control.md) for the list of supported protocols. + +RC input is mapped to **USART6** (`/dev/ttyS4`, `RC` port). +The port supports both single-wire inverted SBUS and full-duplex protocols with telemetry return (such as CRSF), and the receiver protocol is auto-detected by default ([RC_INPUT_PROTO](../advanced_config/parameter_reference.md#RC_INPUT_PROTO) = `-1`). + +## PX4 配置 + +In addition to the [basic configuration](../config/index.md), the following +parameter is important: + +| Parameter | 设置 | +| -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | +| [SYS_HAS_MAG](../advanced_config/parameter_reference.md#SYS_HAS_MAG) | Disabled by default since the board has no internal magnetometer. Enable it if you attach an external mag. | + +## 编译固件 + +To [build PX4](../dev_setup/building_px4.md) for this target: + +```sh +make zenfc_h743_default +``` + +## Installing PX4 Firmware + +The firmware can be installed in any of the normal ways: + +- Build and upload the source: + + ```sh + make zenfc_h743_default upload + ``` + +- [Load the firmware](../config/firmware.md) using _QGroundControl_. + You can use either pre-built firmware or your own custom firmware. + +The board uses the standard PX4 bootloader, so it follows the same generic LED indications as most other boards (Red = Bootloader/Error, Blue = Active/Activity, Green = Powered). + +## 更多信息 + +- [Zenithra Tech](https://www.zenithratech.com/contact) diff --git a/docs/zh/flight_modes/index.md b/docs/zh/flight_modes/index.md index e2df98c40b6..7d82cf468a9 100644 --- a/docs/zh/flight_modes/index.md +++ b/docs/zh/flight_modes/index.md @@ -10,6 +10,5 @@ Flight modes provide autopilot support to make it easier to manually fly the veh - [Drive Modes (Rover)](../flight_modes_rover/index.md) :::info -本节中的模式子主题包含所有机体共有的信息,但可能与正常/默认设置无关。 -一般来说,你应该首先看到特定机体的章节,并在关联导航到这些通用的章节。 +本节中的模式子主题包含所有机体共有的信息,但可能与正常/默认设置无关。一般来说,你应该首先看到特定机体的章节,并在关联导航到这些通用的章节。 ::: diff --git a/docs/zh/flight_modes/offboard.md b/docs/zh/flight_modes/offboard.md index 89b63820cd5..21012351040 100644 --- a/docs/zh/flight_modes/offboard.md +++ b/docs/zh/flight_modes/offboard.md @@ -209,8 +209,7 @@ The "highest" setpoint that is provided will be used within the PX4 rover module 这个层次结构有提供有效控制输入的明确规则: - Provide a position setpoint **or** -- “左”上的设置点之一(速度 **或** 节点) **和** “右”上的设置点之一(态度、速率 **或** 节点)。 - 所有“左”和“右”设置点的组合都是有效的。 +- “左”上的设置点之一(速度 **或** 节点) **和** “右”上的设置点之一(态度、速率 **或** 节点)。所有“左”和“右”设置点的组合都是有效的。 The following are all valid setpoint combinations and their respective control flags that must be set through [OffboardControlMode](../msg_docs/OffboardControlMode.md) (set all others to _false_). Additionally, for some combinations we require certain setpoints to be published with `NAN` values so that the setpoints of interest are not overridden by the rover module (due to the hierarchy above). diff --git a/docs/zh/flight_modes/return.md b/docs/zh/flight_modes/return.md index 3fcbc06bd11..76b992cc254 100644 --- a/docs/zh/flight_modes/return.md +++ b/docs/zh/flight_modes/return.md @@ -228,7 +228,7 @@ Things like path tracking error, wind and other disturbances may cause temporary It is therefore very important to consider this possibility and especially to review the geofence breach action (e.g. [GF_ACTION](../advanced_config/parameter_reference.md#GF_ACTION)). ::: -### RTL-types with Geofence-Awareness +### Return Types with Geofence Awareness The following table shows which return types currently support geofence awareness: @@ -321,7 +321,7 @@ For this reason fixed-wing vehicles are configured to use [Mission landing/reall ## 参数 -The RTL parameters are listed in [Parameter Reference > Return Mode](../advanced_config/parameter_reference.md#return-mode) (and summarised below). +The Return parameters are listed in [Parameter Reference > Return Mode](../advanced_config/parameter_reference.md#return-mode) (and summarised below). | Parameter | 描述 | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -330,10 +330,10 @@ The RTL parameters are listed in [Parameter Reference > Return Mode](../advanced | [RTL_DESCEND_ALT](../advanced_config/parameter_reference.md#RTL_DESCEND_ALT) | Altitude above the destination used for the final descent before landing or loitering (default: 30m). | | [RTL_LAND_DELAY](../advanced_config/parameter_reference.md#RTL_LAND_DELAY) | Time to wait at `RTL_DESCEND_ALT` before landing (default: 0.5s) - by default this period is short so that the vehicle will simply slow and then land immediately. If set to -1 the system will loiter at `RTL_DESCEND_ALT` rather than landing. 延迟能够使你为起落架的展开部署配置时间(自动触发)。 | | [RTL_MIN_DIST](../advanced_config/parameter_reference.md#RTL_MIN_DIST) | Within this distance from the return destination, the return altitude is calculated from the "cone" rather than directly from `RTL_RETURN_ALT`. | -| [RTL_CONE_ANG](../advanced_config/parameter_reference.md#RTL_CONE_ANG) | 圆锥半角决定无人机的 RTL 返航高度。 Values (in degrees): `0`, `25`, `45`, `65`, `80`, `90`. Note that `0` is "no cone" (always return at `RTL_RETURN_ALT` or higher), while `90` indicates an almost vertical cone, so the vehicle generally returns at its current altitude when close to the destination. The return altitude may still be constrained to avoid flying too low while approaching the destination. | -| [RTL_APPR_FORCE](../advanced_config/parameter_reference.md#RTL_APPR_FORCE) | [VTOL FW only] If set, home or rally-point RTL destinations are only considered when a valid VTOL approach loiter is defined for that landing location. Mission landing patterns are unaffected. | +| [RTL_CONE_ANG](../advanced_config/parameter_reference.md#RTL_CONE_ANG) | Half-angle of the cone that defines the vehicle return altitude. Values (in degrees): `0`, `25`, `45`, `65`, `80`, `90`. Note that `0` is "no cone" (always return at `RTL_RETURN_ALT` or higher), while `90` indicates an almost vertical cone, so the vehicle generally returns at its current altitude when close to the destination. The return altitude may still be constrained to avoid flying too low while approaching the destination. | +| [RTL_APPR_FORCE](../advanced_config/parameter_reference.md#RTL_APPR_FORCE) | [VTOL FW only] If set, home or rally-point return destinations are only considered when a valid VTOL approach loiter is defined for that landing location. Mission landing patterns are unaffected. | | [MAN_OVERRIDE_SPD](../advanced_config/parameter_reference.md#MAN_OVERRIDE_SPD) | Speed (normalized stick travel per second) above which moving the sticks controlling a multicopter (or VTOL in hover) gives control back to the pilot by switching to [Position mode](../flight_modes_mc/position.md) (or Altitude mode if position is unavailable). At the default 1 a half-stick movement in ~0.5 s triggers it; lower is more sensitive. A stick held statically has zero speed and will not trigger. Set to -1 to disable. | | [RTL_LOITER_RAD](../advanced_config/parameter_reference.md#RTL_LOITER_RAD) | [Fixed-wing Only] The radius of the loiter circle (at [RTL_LAND_DELAY](#RTL_LAND_DELAY)). | | [MIS_TKO_LAND_REQ](../advanced_config/parameter_reference.md#MIS_TKO_LAND_REQ) | Specify whether a mission landing or takeoff pattern is _required_. Generally fixed-wing vehicles set this to require a landing pattern but VTOL do not. | -| [RTL_TIME_FACTOR](../advanced_config/parameter_reference.md#RTL_TIME_FACTOR) | RTL time estimate safety factor. | -| [RTL_TIME_MARGIN](../advanced_config/parameter_reference.RTL_TIME_MARGIN) | RTL time estimate safety margin. | +| [RTL_TIME_FACTOR](../advanced_config/parameter_reference.md#RTL_TIME_FACTOR) | Return time estimate safety factor. | +| [RTL_TIME_MARGIN](../advanced_config/parameter_reference.md#RTL_TIME_MARGIN) | Return time estimate safety margin. | diff --git a/docs/zh/flight_modes_fw/altitude.md b/docs/zh/flight_modes_fw/altitude.md index 64f888ce2de..bb8ff594dbd 100644 --- a/docs/zh/flight_modes_fw/altitude.md +++ b/docs/zh/flight_modes_fw/altitude.md @@ -38,8 +38,7 @@ Airspeed is also stabilized if an airspeed sensor is present. - 俯仰摇杆控制高度。 - 如果空速传感器已连接,油门杆控制飞机速度。 Without an airspeed sensor the vehicle will fly level at trim throttle ([FW_THR_TRIM](../advanced_config/parameter_reference.md#FW_THR_TRIM)), increasing or decreasing throttle as needed to climb or descend. - 横滚摇杆控制横滚角度。 Autopilot will maintain [coordinated flight](https://en.wikipedia.org/wiki/Coordinated_flight). - - 偏航摇杆操纵会驱动方向舵(指令将被加到自动驾驶仪计算的指令中以维持 协调飞行)。 - 这和稳定模式一样。 + - 偏航摇杆操纵会驱动方向舵(指令将被加到自动驾驶仪计算的指令中以维持 协调飞行)。这和稳定模式一样。 - Manual control input is required (such as RC control, joystick). - An altitude measurement source is required (usually barometer or GPS) @@ -62,9 +61,9 @@ The following requirements must be met to arm in this mode, or to switch to this | Parameter | 描述 | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | -| [FW_AIRSPD_MIN](../advanced_config/parameter_reference.md#FW_AIRSPD_MIN) | 最小空速/油门。 默认:10 m/s。 | -| [FW_AIRSPD_MAX](../advanced_config/parameter_reference.md#FW_AIRSPD_MAX) | 最大空速/油门。 默认:20 m/s。 | -| [FW_AIRSPD_TRIM](../advanced_config/parameter_reference.md#FW_AIRSPD_TRIM) | 巡航速度。 默认:15 m/s。 | +| [FW_AIRSPD_MIN](../advanced_config/parameter_reference.md#FW_AIRSPD_MIN) | 最小空速/油门。默认:10 m/s。 | +| [FW_AIRSPD_MAX](../advanced_config/parameter_reference.md#FW_AIRSPD_MAX) | 最大空速/油门。默认:20 m/s。 | +| [FW_AIRSPD_TRIM](../advanced_config/parameter_reference.md#FW_AIRSPD_TRIM) | 巡航速度。默认:15 m/s。 | | [FW_MAN_P_MAX](../advanced_config/parameter_reference.md#FW_MAN_P_MAX) | 在高度稳定模式下手动控制的最大俯仰角。 Default: 45 degrees. | | [FW_MAN_R_MAX](../advanced_config/parameter_reference.md#FW_MAN_R_MAX) | 在高度稳定模式下手动控制的最大滚转角。 Default: 45 degrees. | | [FW_T_CLMB_R_SP](../advanced_config/parameter_reference.md#FW_T_CLMB_R_SP) | Max climb rate setpoint. 默认:3m/s。 | diff --git a/docs/zh/flight_modes_fw/cruise.md b/docs/zh/flight_modes_fw/cruise.md index d633db9c583..9346592b212 100644 --- a/docs/zh/flight_modes_fw/cruise.md +++ b/docs/zh/flight_modes_fw/cruise.md @@ -32,8 +32,7 @@ Airspeed is also stabilized if an airspeed sensor is present. - 俯仰摇杆控制高度。 - 如果空速传感器已连接,油门杆控制飞机速度。 Without an airspeed sensor the vehicle will fly level at trim throttle ([FW_THR_TRIM](../advanced_config/parameter_reference.md#FW_THR_TRIM)), increasing or decreasing throttle as needed to climb or descend. - 横滚摇杆控制横滚角度。 Autopilot will maintain [coordinated flight](https://en.wikipedia.org/wiki/Coordinated_flight). - - 偏航摇杆操纵会驱动方向舵(指令将被加到自动驾驶仪计算的指令中以维持 协调飞行)。 - 这和稳定模式一样。 + - 偏航摇杆操纵会驱动方向舵(指令将被加到自动驾驶仪计算的指令中以维持 协调飞行)。这和稳定模式一样。 - Manual control input is required (such as RC control, joystick). - An altitude measurement source is required (usually barometer or GPS) @@ -57,9 +56,9 @@ The following requirements must be met to arm in this mode, or to switch to this | Parameter | 描述 | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| [FW_AIRSPD_MIN](../advanced_config/parameter_reference.md#FW_AIRSPD_MIN) | 最小空速/油门。 默认:10 m/s。 | -| [FW_AIRSPD_MAX](../advanced_config/parameter_reference.md#FW_AIRSPD_MAX) | 最大空速/油门。 默认:20 m/s。 | -| [FW_AIRSPD_TRIM](../advanced_config/parameter_reference.md#FW_AIRSPD_TRIM) | 巡航速度。 默认:15 m/s。 | +| [FW_AIRSPD_MIN](../advanced_config/parameter_reference.md#FW_AIRSPD_MIN) | 最小空速/油门。默认:10 m/s。 | +| [FW_AIRSPD_MAX](../advanced_config/parameter_reference.md#FW_AIRSPD_MAX) | 最大空速/油门。默认:20 m/s。 | +| [FW_AIRSPD_TRIM](../advanced_config/parameter_reference.md#FW_AIRSPD_TRIM) | 巡航速度。默认:15 m/s。 | | [FW_MAN_P_MAX](../advanced_config/parameter_reference.md#FW_MAN_P_MAX) | 在高度稳定模式下手动控制的最大俯仰角。 Default: 45 degrees. | | [FW_MAN_R_MAX](../advanced_config/parameter_reference.md#FW_MAN_R_MAX) | 在高度稳定模式下手动控制的最大滚转角。 Default: 45 degrees. | | [FW_T_CLMB_R_SP](../advanced_config/parameter_reference.md#FW_T_CLMB_R_SP) | Max climb rate setpoint. 默认:3m/s。 | diff --git a/docs/zh/flight_modes_fw/manual.md b/docs/zh/flight_modes_fw/manual.md index 91457484f9f..2312eedbb28 100644 --- a/docs/zh/flight_modes_fw/manual.md +++ b/docs/zh/flight_modes_fw/manual.md @@ -10,15 +10,14 @@ This is the hardest mode to fly, because nothing is stabilised. Unlike [Acro Mode](../flight_modes_fw/acro.md), if the roll-pitch stick is centered the vehicle will not automatically stop rotating around the axis — the pilot actually has to move the stick to apply force in the other direction. :::info -这是唯一忽略 FMU(命令通过安全协处理器发送) 的飞行模式。 -该模式提供了一个安全机制,允许在 FMU 固件故障时通过遥控器完全控制油门,升降舵,副翼和方向舵。 +这是唯一忽略 FMU(命令通过安全协处理器发送) 的飞行模式。该模式提供了一个安全机制,允许在 FMU 固件故障时通过遥控器完全控制油门,升降舵,副翼和方向舵。 ::: ## 技术描述 RC mode where stick input is sent directly to control allocation (for "fully" manual control). -这是唯一忽略 FMU(命令通过安全协处理器发送) 的飞行模式。 该模式提供了一个安全机制,允许在 FMU 固件故障时通过遥控器完全控制油门,升降舵,副翼和方向舵。 +这是唯一忽略 FMU(命令通过安全协处理器发送) 的飞行模式。该模式提供了一个安全机制,允许在 FMU 固件故障时通过遥控器完全控制油门,升降舵,副翼和方向舵。 @@ -32,8 +31,8 @@ The following requirements must be met to arm in this mode, or to switch to this ## 参数 -| Parameter | 描述 | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -| [FW_MAN_P_SC](../advanced_config/parameter_reference.md#FW_MAN_P_SC) | 手动俯仰控制比例。 在完全手动模式下应用于所需俯仰舵机指令的比例因子。 此参数允许调整控制舵偏的偏转。 默认:1.0 | -| [FW_MAN_R_SC](../advanced_config/parameter_reference.md#FW_MAN_R_SC) | 手动滚转控制比例。 在完全手动模式下应用于所需横滚舵机指令的比例因子。 此参数允许调整控制舵偏的偏转。 默认:1.0 | -| [FW_MAN_Y_SC](../advanced_config/parameter_reference.md#FW_MAN_Y_SC) | 手动偏航控制比例。 在完全手动模式下应用于所需偏航舵机指令的比例因子。 此参数允许调整控制舵偏的偏转。 默认:1.0 | +| Parameter | 描述 | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| [FW_MAN_P_SC](../advanced_config/parameter_reference.md#FW_MAN_P_SC) | 手动俯仰控制比例。在完全手动模式下应用于所需俯仰舵机指令的比例因子。此参数允许调整控制舵偏的偏转。默认:1.0 | +| [FW_MAN_R_SC](../advanced_config/parameter_reference.md#FW_MAN_R_SC) | 手动滚转控制比例。在完全手动模式下应用于所需横滚舵机指令的比例因子。此参数允许调整控制舵偏的偏转。默认:1.0 | +| [FW_MAN_Y_SC](../advanced_config/parameter_reference.md#FW_MAN_Y_SC) | 手动偏航控制比例。在完全手动模式下应用于所需偏航舵机指令的比例因子。此参数允许调整控制舵偏的偏转。默认:1.0 | diff --git a/docs/zh/flight_modes_fw/mission.md b/docs/zh/flight_modes_fw/mission.md index 07519428874..b84210712e3 100644 --- a/docs/zh/flight_modes_fw/mission.md +++ b/docs/zh/flight_modes_fw/mission.md @@ -104,7 +104,7 @@ A subset of the most important checks are listed below: - Any mission item conflicts with a plan or safety geofence - More than one land start mission item defined ([MAV_CMD_DO_LAND_START](https://mavlink.io/en/messages/common.html#MAV_CMD_DO_LAND_START)) - A fixed-wing landing has an infeasible slope angle ([FW_LND_ANG](#FW_LND_ANG)) -- Land start item (`MAV_CMD_DO_LAND_START`) appears in mission before an RTL item ([MAV_CMD_NAV_RETURN_TO_LAUNCH](https://mavlink.io/en/messages/common.html#MAV_CMD_NAV_RETURN_TO_LAUNCH)) +- Land start item (`MAV_CMD_DO_LAND_START`) appears in mission before an RTL ("Return") item ([MAV_CMD_NAV_RETURN_TO_LAUNCH](https://mavlink.io/en/messages/common.html#MAV_CMD_NAV_RETURN_TO_LAUNCH)) - Missing takeoff and/or land item when these are configured as a requirement ([MIS_TKO_LAND_REQ](#MIS_TKO_LAND_REQ)) Additionally there is a check if the first waypoint is too far from the Home position ([MIS_DIST_1WP](#MIS_DIST_1WP)). diff --git a/docs/zh/flight_modes_fw/return.md b/docs/zh/flight_modes_fw/return.md index f5e4acfe9f5..09b5004f2b1 100644 --- a/docs/zh/flight_modes_fw/return.md +++ b/docs/zh/flight_modes_fw/return.md @@ -65,7 +65,7 @@ The following requirements must be met to arm in this mode, or to switch to this ## 参数 -The RTL parameters are listed in [Parameter Reference > Return Mode](../advanced_config/parameter_reference.md#return-mode). +The Return parameters are listed in [Parameter Reference > Return Mode](../advanced_config/parameter_reference.md#return-mode). If using a mission landing, only the [RTL_RETURN_ALT](#RTL_RETURN_ALT) and [RTL_DESCEND_ALT](#RTL_DESCEND_ALT) are relevant. The others are relevant if the destination is a rally point or the home location. diff --git a/docs/zh/flight_modes_fw/stabilized.md b/docs/zh/flight_modes_fw/stabilized.md index 3f50bb3361f..406be6103eb 100644 --- a/docs/zh/flight_modes_fw/stabilized.md +++ b/docs/zh/flight_modes_fw/stabilized.md @@ -12,8 +12,7 @@ It is much easier to fly than [Manual mode](../flight_modes_fw/manual.md) becaus The vehicle climbs/descends based on pitch and throttle input and performs a [coordinated turn](https://en.wikipedia.org/wiki/Coordinated_flight) if the roll stick is non-zero. 横滚和俯仰是角度控制的(不能上下滚动或循环)。 -如果油门降至 0%(电机停止),飞机将滑行。 -为了执行转弯,必须在整个操纵过程中保持命令,因为如果释放横滚摇杆,则飞机将停止转动并自行调平(对于俯仰和偏航命令也是如此)。 +如果油门降至 0%(电机停止),飞机将滑行。为了执行转弯,必须在整个操纵过程中保持命令,因为如果释放横滚摇杆,则飞机将停止转动并自行调平(对于俯仰和偏航命令也是如此)。 The yaw stick can be used to increase/reduce the yaw rate of the vehicle in turns. If left at center the controller does the turn coordination by itself, meaning that it will apply the necessary yaw rate for the current roll angle to perform a smooth turn. @@ -29,12 +28,10 @@ The vehicle course and altitude are not maintained, and can drift due to wind. - Centered Roll/Pitch/Yaw sticks (inside deadband) put vehicle into straight and level flight. The vehicle course and altitude are not maintained, and can drift due to wind. -- 横滚摇杆控制横滚角度。 - 自动驾驶仪将保持 协调飞行。 +- 横滚摇杆控制横滚角度。自动驾驶仪将保持 协调飞行。 - Pitch stick controls pitch angle around the defined offset [FW_PSP_OFF](../advanced_config/parameter_reference.md#FW_PSP_OFF) - Throttle stick controls throttle directly. -- 偏航摇杆操纵会驱动方向舵(指令将被加到自动驾驶仪计算的指令中以维持 协调飞行)。 - 这和稳定模式一样。 +- 偏航摇杆操纵会驱动方向舵(指令将被加到自动驾驶仪计算的指令中以维持 协调飞行)。这和稳定模式一样。 - Manual control input is required (such as RC control, joystick). diff --git a/docs/zh/flight_modes_mc/altitude.md b/docs/zh/flight_modes_mc/altitude.md index e35c4601388..c15c5e8a415 100644 --- a/docs/zh/flight_modes_mc/altitude.md +++ b/docs/zh/flight_modes_mc/altitude.md @@ -5,8 +5,7 @@ _Altitude mode_ is a _relatively_ easy-to-fly RC mode in which roll and pitch sticks control vehicle movement in the left-right and forward-back directions (relative to the "front" of the vehicle), yaw stick controls rate of rotation over the horizontal plane, and throttle controls speed of ascent-descent. When the sticks are released/centered the vehicle will level and maintain the current _altitude_. -如果在水平面上运动,飞机将继持续运动直到任何动量被风阻力消散。 -如果刮风,飞机会向风的方向漂移。 +如果在水平面上运动,飞机将继持续运动直到任何动量被风阻力消散。如果刮风,飞机会向风的方向漂移。 :::tip _Altitude mode_ is the safest non-GPS manual mode for new fliers. It is just like [Stabilized](../flight_modes_mc/manual_stabilized.md) mode but additionally locks the vehicle altitude when the sticks are released. @@ -58,6 +57,6 @@ The following requirements must be met to arm in this mode, or to switch to this | Parameter | 描述 | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [MPC_Z_VEL_MAX_UP](../advanced_config/parameter_reference.md#MPC_Z_VEL_MAX_UP) | 最大垂直上升速度。 默认:3m/s。 | -| [MPC_Z_VEL_MAX_DN](../advanced_config/parameter_reference.md#MPC_Z_VEL_MAX_DN) | 最大垂直下降速度。 默认:1m/s。 | +| [MPC_Z_VEL_MAX_UP](../advanced_config/parameter_reference.md#MPC_Z_VEL_MAX_UP) | 最大垂直上升速度。默认:3m/s。 | +| [MPC_Z_VEL_MAX_DN](../advanced_config/parameter_reference.md#MPC_Z_VEL_MAX_DN) | 最大垂直下降速度。默认:1m/s。 | | `MPC_XXXX` | 大多数 MPC_xxx参数会影响此模式下的飞行行为(至少在某种程度上)。 For example, [MPC_THR_HOVER](../advanced_config/parameter_reference.md#MPC_THR_HOVER) defines the thrust at which a vehicle will hover. | diff --git a/docs/zh/flight_modes_mc/land.md b/docs/zh/flight_modes_mc/land.md index a4eb673876b..ff7ae01730b 100644 --- a/docs/zh/flight_modes_mc/land.md +++ b/docs/zh/flight_modes_mc/land.md @@ -47,8 +47,8 @@ Land mode behaviour can be configured using the parameters below. | Parameter | 描述 | | ----------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [MPC_LAND_SPEED](../advanced_config/parameter_reference.md#MPC_LAND_SPEED) | 着陆过程中的下降速率。 鉴于地面情况未知,这个值应该设得相当小。 | -| [COM_DISARM_LAND](../advanced_config/parameter_reference.md#COM_DISARM_LAND) | 降落后自动上锁的超时时间,以秒为单位。 如果设定为 -1,无人机将不会在着陆时上锁。 | +| [MPC_LAND_SPEED](../advanced_config/parameter_reference.md#MPC_LAND_SPEED) | 着陆过程中的下降速率。鉴于地面情况未知,这个值应该设得相当小。 | +| [COM_DISARM_LAND](../advanced_config/parameter_reference.md#COM_DISARM_LAND) | 降落后自动上锁的超时时间,以秒为单位。如果设定为 -1,无人机将不会在着陆时上锁。 | | [MAN_OVERRIDE_SPD](../advanced_config/parameter_reference.md#MAN_OVERRIDE_SPD) | Speed (normalized stick travel per second) above which moving the sticks controlling a multicopter (or VTOL in hover) gives control back to the pilot by switching to [Position mode](../flight_modes_mc/position.md) (or Altitude mode if position is unavailable). At the default value of 1 a half-stick movement in ~0.5 s triggers it; lower is more sensitive. A stick held statically has zero speed and will not trigger. Set to -1 to disable. | | [MPC_AUTO_NUDGING](../advanced_config/parameter_reference.md#MPC_AUTO_NUDGING) | Bitmask enabling stick nudging in Auto modes (multicopter). Bit 0 (yaw nudging) lets the yaw stick nudge heading during landing. Bit 1 (land nudging) additionally lets the pitch/roll sticks move the vehicle horizontally (within [MPC_LAND_RADIUS](../advanced_config/parameter_reference.md#MPC_LAND_RADIUS)), the throttle stick amend the descent speed, and the yaw stick rotate the heading. Requires stick override to be disabled ([MAN_OVERRIDE_SPD](#MAN_OVERRIDE_SPD) = -1). | diff --git a/docs/zh/flight_modes_mc/manual_stabilized.md b/docs/zh/flight_modes_mc/manual_stabilized.md index 2fc70572538..60f7c879d1a 100644 --- a/docs/zh/flight_modes_mc/manual_stabilized.md +++ b/docs/zh/flight_modes_mc/manual_stabilized.md @@ -12,8 +12,7 @@ These modes behave identically in flight, but have different arming requirements When sticks are outside the centre, the roll and pitch sticks control the _angle_ of the vehicle (attitude) around the respective axes, the yaw stick controls the rate of rotation above the horizontal plane, and the throttle controls altitude/speed. -一旦释放摇杆,它们将会返回中心停顿区。 -一旦横滚和俯仰摇杆居中,多旋翼无人机将平稳并停止运动。 +一旦释放摇杆,它们将会返回中心停顿区。一旦横滚和俯仰摇杆居中,多旋翼无人机将平稳并停止运动。 The vehicle will then hover in place/maintain altitude - provided it is properly balanced, throttle is set appropriately (see [below](#parameters)), and no external forces are applied (e.g. wind). 飞行器将朝着任何风的方向漂移,您必须控制油门以保持高度。 @@ -29,8 +28,7 @@ RC mode where centered sticks level vehicle. 飞手的输入通过横滚和俯仰角度以及偏航角速率指令传递给自驾仪。 Throttle is rescaled (see [below](#parameters)) and passed directly to control allocation. -自动驾驶仪控制着飞机的姿态角,这意味着当 RC 摇杆居中时自驾仪调整飞机的滚转和俯仰角为零(从而实现飞机姿态的改平)。 -自动驾驶仪不能补偿由于风(或其他来源)引起的漂移。 +自动驾驶仪控制着飞机的姿态角,这意味着当 RC 摇杆居中时自驾仪调整飞机的滚转和俯仰角为零(从而实现飞机姿态的改平)。自动驾驶仪不能补偿由于风(或其他来源)引起的漂移。 - Centered sticks: - Roll/Pitch sticks level vehicle. diff --git a/docs/zh/flight_modes_mc/position.md b/docs/zh/flight_modes_mc/position.md index ccc92b2fc4f..71a118137ec 100644 --- a/docs/zh/flight_modes_mc/position.md +++ b/docs/zh/flight_modes_mc/position.md @@ -40,8 +40,7 @@ While very rare on a well calibrated vehicle, sometimes there may be problems wi ## 技术总结 -遥控模式下,横滚、俯仰、油门 (RPT) 杆控制相应轴/方向的运动。 -摇杆居中使机体水平并将其保持在固定的高度和位置并抗风。 +遥控模式下,横滚、俯仰、油门 (RPT) 杆控制相应轴/方向的运动。摇杆居中使机体水平并将其保持在固定的高度和位置并抗风。 - Centered roll, pitch, throttle sticks (within RC deadzone [MAN_DEADZONE](#MAN_DEADZONE)) hold x, y, z position steady against any disturbance like wind. - 外部中心: @@ -76,9 +75,9 @@ All the parameters in the [Multicopter Position Control](../advanced_config/para | Parameter | 描述 | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [MAN_DEADZONE](../advanced_config/parameter_reference.md#MAN_DEADZONE) | 启用位置保持的摇杆死区。 默认值:0.1(摇杆全行程的 10%)。 | -| [MPC_Z_VEL_MAX_UP](../advanced_config/parameter_reference.md#MPC_Z_VEL_MAX_UP) | 最大垂直上升速度。 默认:3m/s。 | -| [MPC_Z_VEL_MAX_DN](../advanced_config/parameter_reference.md#MPC_Z_VEL_MAX_DN) | 最大垂直下降速度。 默认:1m/s。 | +| [MAN_DEADZONE](../advanced_config/parameter_reference.md#MAN_DEADZONE) | 启用位置保持的摇杆死区。默认值:0.1(摇杆全行程的 10%)。 | +| [MPC_Z_VEL_MAX_UP](../advanced_config/parameter_reference.md#MPC_Z_VEL_MAX_UP) | 最大垂直上升速度。默认:3m/s。 | +| [MPC_Z_VEL_MAX_DN](../advanced_config/parameter_reference.md#MPC_Z_VEL_MAX_DN) | 最大垂直下降速度。默认:1m/s。 | | [MPC_LAND_ALT1](../advanced_config/parameter_reference.md#MPC_LAND_ALT1) | 触发第一阶段降速的高度。 Below this altitude descending velocity gets limited to a value between [MPC_Z_VEL_MAX_DN](#MPC_Z_VEL_MAX_DN) (or `MPC_Z_V_AUTO_DN`) and [MPC_LAND_SPEED](#MPC_LAND_SPEED). Value needs to be higher than [MPC_LAND_ALT2](#MPC_LAND_ALT2). Default 10m. | | [MPC_LAND_ALT2](../advanced_config/parameter_reference.md#MPC_LAND_ALT2) | 触发第二阶段降速的高度。 Below this altitude descending velocity gets limited to [`MPC_LAND_SPEED`](#MPC_LAND_SPEED). Value needs to be lower than "MPC_LAND_ALT1". Default 5m. | | `MPC_XXXX` | 大多数 MPC_xxx参数会影响此模式下的飞行行为(至少在某种程度上)。 For example, [MPC_THR_HOVER](../advanced_config/parameter_reference.md#MPC_THR_HOVER) defines the thrust at which a vehicle will hover. | diff --git a/docs/zh/flight_modes_mc/return.md b/docs/zh/flight_modes_mc/return.md index 9d119b26a52..2b8ccce11bc 100644 --- a/docs/zh/flight_modes_mc/return.md +++ b/docs/zh/flight_modes_mc/return.md @@ -73,7 +73,7 @@ For more information on this return type see [Home/Rally Point Return Type (RTL_ ## 参数 -The RTL parameters are listed in [Parameter Reference > Return Mode](../advanced_config/parameter_reference.md#return-mode). +The Return parameters are listed in [Parameter Reference > Return Mode](../advanced_config/parameter_reference.md#return-mode). The parameters that are relevant to multicopter (assuming the [RTL_TYPE](../advanced_config/parameter_reference.md#RTL_TYPE) is set to 0) are listed below. @@ -83,7 +83,7 @@ The parameters that are relevant to multicopter (assuming the [RTL_TYPE](../adva | [RTL_DESCEND_ALT](../advanced_config/parameter_reference.md#RTL_DESCEND_ALT) | Altitude above the destination used for the final descent before landing or loitering (default: 30m). | | [RTL_LAND_DELAY](../advanced_config/parameter_reference.md#RTL_LAND_DELAY) | Time to hover at `RTL_DESCEND_ALT` before landing (default: 0.5s) - by default this period is short so that the vehicle will simply slow and then land immediately. If set to -1 the system will loiter at `RTL_DESCEND_ALT` rather than landing. 延迟能够使你为起落架的展开部署配置时间(自动触发)。 | | [RTL_MIN_DIST](../advanced_config/parameter_reference.md#RTL_MIN_DIST) | Within this distance from the home position, the return altitude is calculated from the "cone" rather than directly from `RTL_RETURN_ALT`. | -| [RTL_CONE_ANG](../advanced_config/parameter_reference.md#RTL_CONE_ANG) | 圆锥半角决定无人机的 RTL 返航高度。 Values (in degrees): `0`, `25`, `45`, `65`, `80`, `90`. Note that `0` is "no cone" (always return at `RTL_RETURN_ALT` or higher), while `90` indicates an almost vertical cone, so the vehicle generally returns at its current altitude when close to the destination. The return altitude may still be constrained to avoid flying too low while approaching the destination. | +| [RTL_CONE_ANG](../advanced_config/parameter_reference.md#RTL_CONE_ANG) | Half-angle of the cone that defines the vehicle return altitude. Values (in degrees): `0`, `25`, `45`, `65`, `80`, `90`. Note that `0` is "no cone" (always return at `RTL_RETURN_ALT` or higher), while `90` indicates an almost vertical cone, so the vehicle generally returns at its current altitude when close to the destination. The return altitude may still be constrained to avoid flying too low while approaching the destination. | | [MAN_OVERRIDE_SPD](../advanced_config/parameter_reference.md#MAN_OVERRIDE_SPD) | Speed (normalized stick travel per second) above which moving the sticks controlling a multicopter (or VTOL in hover) gives control back to the pilot by switching to [Position mode](../flight_modes_mc/position.md) (or Altitude mode if position is unavailable). At the default value of 1 a half-stick movement in ~0.5 s triggers it; lower is more sensitive. A stick held statically has zero speed and will not trigger. Set to -1 to disable. | ## 另见 diff --git a/docs/zh/flight_modes_rover/index.md b/docs/zh/flight_modes_rover/index.md index 567fb204603..c2fdedb2bbd 100644 --- a/docs/zh/flight_modes_rover/index.md +++ b/docs/zh/flight_modes_rover/index.md @@ -12,12 +12,13 @@ Selecting any other mode than those listed below will either stop the rover or c ## Manual Modes -| 模式 | 描述 | -| --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [Manual](manual.md#manual-mode) | No autopilot support. User is responsible for keeping the rover on the desired course and maintaining speed and rate of turn. | -| [Acro](manual.md#acro-mode) | + Maintains the yaw rate (feels more like driving a car than manual mode).
+ Allows maximum yaw rate to be limited (protects against roll over). | -| [Stabilized](manual.md#stabilized-mode) | + Maintains the yaw (significantly better at holding a straight line). | -| [Position](manual.md#position-mode) | + Maintains the course (best mode for driving a straight line).
+ Maintains speed against disturbances, e.g. when driving up a hill.
+ Allows maximum speed to be limited. | +| 模式 | 描述 | +| ----------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [Manual](manual.md#manual-mode) | No autopilot support. User is responsible for keeping the rover on the desired course and maintaining speed and rate of turn. | +| [Acro](manual.md#acro-mode) | + Maintains the yaw rate (feels more like driving a car than manual mode).
+ Allows maximum yaw rate to be limited (protects against roll over). | +| [Stabilized](manual.md#stabilized-mode) | + Maintains the yaw (significantly better at holding a straight line). | +| [Position](manual.md#position-mode) | + Maintains the course (best mode for driving a straight line).
+ Maintains speed against disturbances, e.g. when driving up a hill.
+ Allows maximum speed to be limited. | +| [Manual Parking](manual.md#manual-parking-mode) | Reduced throttle for precise maneuvering in tight spaces. Differential and mecanum rovers are driven tank-style, using one stick per side. Ackermann vehicles are controlled in the same way as they are in manual mode, but with reduced throttle. | ## Auto Modes diff --git a/docs/zh/flight_modes_rover/manual.md b/docs/zh/flight_modes_rover/manual.md index 2f0cecdf04c..39ac99b2524 100644 --- a/docs/zh/flight_modes_rover/manual.md +++ b/docs/zh/flight_modes_rover/manual.md @@ -14,22 +14,24 @@ The sticks provide the same "high level" control effects over direction and rate The manual modes provide progressively increasing levels of autopilot support for maintaining a course, speed, and rate of turn, compensating for external factors such as slopes or uneven terrain. -| 模式 | 描述 | -| --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [Manual](manual.md#manual-mode) | No autopilot support. User is responsible for keeping the rover on the desired course and maintaining speed and rate of turn. | -| [Acro](manual.md#acro-mode) | + Maintains the yaw rate (feels more like driving a car than manual mode).
+ Allows maximum yaw rate to be limited (protects against roll over). | -| [Stabilized](manual.md#stabilized-mode) | + Maintains the yaw (significantly better at holding a straight line). | -| [Position](manual.md#position-mode) | + Maintains the course (best mode for driving a straight line).
+ Maintains speed against disturbances, e.g. when driving up a hill.
+ Allows maximum speed to be limited. | +| 模式 | 描述 | +| ----------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [Manual](manual.md#manual-mode) | No autopilot support. User is responsible for keeping the rover on the desired course and maintaining speed and rate of turn. | +| [Acro](manual.md#acro-mode) | + Maintains the yaw rate (feels more like driving a car than manual mode).
+ Allows maximum yaw rate to be limited (protects against roll over). | +| [Stabilized](manual.md#stabilized-mode) | + Maintains the yaw (significantly better at holding a straight line). | +| [Position](manual.md#position-mode) | + Maintains the course (best mode for driving a straight line).
+ Maintains speed against disturbances, e.g. when driving up a hill.
+ Allows maximum speed to be limited. | +| [Manual Parking](manual.md#manual-parking-mode) | Reduced throttle for precise maneuvering in tight spaces. Differential and mecanum rovers are driven tank-style, using one stick per side. Ackermann vehicles are controlled in the same way as they are in manual mode, but with reduced throttle. | :::details Overview mode mapping to control effect -| 模式 | Speed | Turning | Required measurements | -| ------------------------------ | ---------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| [Manual](#manual-mode) | Directly map stick input to motor command. | Directly map stick input to steering angle/speed difference. | None. | -| [Acro](#acro-mode) | Directly map stick input to motor command. | Stick input creates a yaw rate setpoint for the control system to regulate. | yaw rate. | -| [Stabilized](#stabilized-mode) | Directly map stick input to motor commands. | Stick input creates a yaw rate setpoint for the control system to regulate. If this setpoint is zero (stick is centered) the control system will maintain the current yaw (heading) of the rover. | Yaw rate and yaw. | -| [Position](#position-mode) | Stick input creates a speed setpoint for the control system to regulate. | Stick input creates a yaw rate setpoint for the control system to regulate. If this setpoint is zero (stick is centered) the control system will keep the rover driving in a straight line. | yaw rate, yaw, speed and global position (GPS). | +| 模式 | Speed | Turning | Required measurements | +| -------------------------------------- | ---------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| [Manual](#manual-mode) | Directly map stick input to motor command. | Directly map stick input to steering angle/speed difference. | None. | +| [Acro](#acro-mode) | Directly map stick input to motor command. | Stick input creates a yaw rate setpoint for the control system to regulate. | yaw rate. | +| [Stabilized](#stabilized-mode) | Directly map stick input to motor commands. | Stick input creates a yaw rate setpoint for the control system to regulate. If this setpoint is zero (stick is centered) the control system will maintain the current yaw (heading) of the rover. | Yaw rate and yaw. | +| [Position](#position-mode) | Stick input creates a speed setpoint for the control system to regulate. | Stick input creates a yaw rate setpoint for the control system to regulate. If this setpoint is zero (stick is centered) the control system will keep the rover driving in a straight line. | yaw rate, yaw, speed and global position (GPS). | +| [Manual Parking](#manual-parking-mode) | Directly map scaled down stick input to motor command. | Ackermann: Directly map stick input to steering angle. Differential/Mecanum: Each stick directly maps to the motor command of one side of the rover. | None. | ::: @@ -98,3 +100,23 @@ This offers the highest amount of disturbance rejection, which leads to the best | Mecanum | Stick position sets a forward/back speed setpoint. The vehicle attempts to maintain this speed on slopes etc. | Create a yaw rate setpoint for the control system to regulate. If this input is zero the control system will maintain the course of the rover. | Stick position sets a left/right speed setpoint. The vehicle attempts to maintain this speed on slopes etc. | For the configuration/tuning of this mode see [Velocity tuning](../config_rover/velocity_tuning.md). + +## Manual Parking Mode + +This mode is intended for precisely maneuvering the rover in tight spaces, e.g. when parking it. +Like [Manual mode](#manual-mode) the stick inputs are directly mapped to motor commands without any autopilot support, but the throttle is scaled down to [RO_PARK_THR_MAX](../advanced_config/parameter_reference.md#RO_PARK_THR_MAX). + +Differential and mecanum rovers are driven tank-style in this mode: the left stick drives the motor(s) on the left side and the right stick drives the motor(s) on the right side of the rover. +Pushing both sticks in the same direction drives straight, pushing them in opposite directions turns the rover on the spot, and holding one stick centered pivots the rover around that side. + +Ackermann vehicles are controlled in the same way as they are in manual mode, but with reduced throttle. + +| Rover Type | Left stick up/down | Right stick up/down | Right stick left/right | +| ------------ | -------------------------------------------------------------- | ---------------------------------------------------------- | ----------------------------------------------------------------------- | +| Ackermann | Drive the rover forwards/backwards (slowly) | - | Move the steering angle to the left/right. | +| Differential | Drive the left motor forwards/backwards. | Drive the right motor forwards/backwards. | - | +| Mecanum | Drive the left motors forwards/backwards. | Drive the right motors forwards/backwards. | Drive the rover left/right (slowly). | + +:::info +This mode has to be assigned to a flight mode switch (see [Flight Mode Configuration](../config/flight_mode.md)) or selected via the ground station. +::: diff --git a/docs/zh/flight_modes_vtol/return.md b/docs/zh/flight_modes_vtol/return.md index 54b89ab2eed..28b36135cd1 100644 --- a/docs/zh/flight_modes_vtol/return.md +++ b/docs/zh/flight_modes_vtol/return.md @@ -80,7 +80,7 @@ When uploading VTOL approach loiters through MAVLink, [upload them as rally/safe The `MAV_CMD_NAV_RALLY_POINT` item must come first, followed by one or more `MAV_CMD_NAV_LOITER_TO_ALT` items that define the approach loiters for that rally point. The next `MAV_CMD_NAV_RALLY_POINT` starts a new landing-location block. -For each `MAV_CMD_NAV_LOITER_TO_ALT` item, `x/y/z` define the loiter center and approach altitude, and `param2` defines the loiter radius used by RTL. +For each `MAV_CMD_NAV_LOITER_TO_ALT` item, `x/y/z` define the loiter center and approach altitude, and `param2` defines the loiter radius used by Return mode. If `param2` is unset or zero, PX4 falls back to [RTL_LOITER_RAD](#RTL_LOITER_RAD). For example, a rally upload with one rally point and two possible approach loiters would use: @@ -104,20 +104,20 @@ If returning as a multicopter: ## 参数 -The RTL parameters are listed in [Parameter Reference > Return Mode](../advanced_config/parameter_reference.md#return-mode). +The Return parameters are listed in [Parameter Reference > Return Mode](../advanced_config/parameter_reference.md#return-mode). If using a mission landing, only the [RTL_RETURN_ALT](#RTL_RETURN_ALT) and [RTL_DESCEND_ALT](#RTL_DESCEND_ALT) are relevant. The others are relevant if the destination is a rally point or the home location. -| Parameter | 描述 | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [RTL_TYPE](../advanced_config/parameter_reference.md#RTL_TYPE) | Return type. | -| [RTL_APPR_FORCE](../advanced_config/parameter_reference.md#RTL_APPR_FORCE) | [VTOL FW only] If set, PX4 only considers home or rally-point RTL destinations when a valid VTOL approach loiter is defined for that landing location. Mission landing patterns are unaffected. | -| [RTL_RETURN_ALT](../advanced_config/parameter_reference.md#RTL_RETURN_ALT) | Return altitude in meters (default: 60m)If already above this value the vehicle will return at its current altitude. | -| [RTL_CONE_ANG](../advanced_config/parameter_reference.md#RTL_CONE_ANG) | 圆锥半角决定无人机的 RTL 返航高度。 数值(度数):0、25、45、65、80、90。 Note that 0 is "no cone" (always return at `RTL_RETURN_ALT` or higher), while 90 indicates that the vehicle must return at the current altitude or `RTL_DESCEND_ALT` (whichever is higher). | -| [RTL_DESCEND_ALT](../advanced_config/parameter_reference.md#RTL_DESCEND_ALT) | 最小返航高度和无人机从较高的返航高度到减速或者停止的初始下降高度(默认: 30米)。 | -| [RTL_LAND_DELAY](../advanced_config/parameter_reference.md#RTL_LAND_DELAY) | Time to hover at `RTL_DESCEND_ALT` before landing (default: 0.5s) -by default this period is short so that the vehicle will simply slow and then land immediately. If set to -1 the system will loiter at `RTL_DESCEND_ALT` rather than landing. 延迟能够使你为起落架的展开部署配置时间(自动触发)。 | -| [RTL_LOITER_RAD](../advanced_config/parameter_reference.md#RTL_LOITER_RAD) | [Fixed-wing Only] The radius of the loiter circle (at [RTL_LAND_DELAY](#RTL_LAND_DELAY). | -| [MIS_TKO_LAND_REQ](../advanced_config/parameter_reference.md#MIS_TKO_LAND_REQ) | Specify whether a mission landing or takeoff pattern is _required_. Generally fixed-wing vehicles set this to require a landing pattern but VTOL do not. | +| Parameter | 描述 | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| [RTL_TYPE](../advanced_config/parameter_reference.md#RTL_TYPE) | Return type. | +| [RTL_APPR_FORCE](../advanced_config/parameter_reference.md#RTL_APPR_FORCE) | [VTOL FW only] If set, PX4 only considers home or rally-point return destinations when a valid VTOL approach loiter is defined for that landing location. Mission landing patterns are unaffected. | +| [RTL_RETURN_ALT](../advanced_config/parameter_reference.md#RTL_RETURN_ALT) | Return altitude in meters (default: 60m)If already above this value the vehicle will return at its current altitude. | +| [RTL_CONE_ANG](../advanced_config/parameter_reference.md#RTL_CONE_ANG) | Half-angle of the cone that defines the vehicle return altitude. 数值(度数):0、25、45、65、80、90。 Note that 0 is "no cone" (always return at `RTL_RETURN_ALT` or higher), while 90 indicates that the vehicle must return at the current altitude or `RTL_DESCEND_ALT` (whichever is higher). | +| [RTL_DESCEND_ALT](../advanced_config/parameter_reference.md#RTL_DESCEND_ALT) | 最小返航高度和无人机从较高的返航高度到减速或者停止的初始下降高度(默认: 30米)。 | +| [RTL_LAND_DELAY](../advanced_config/parameter_reference.md#RTL_LAND_DELAY) | Time to hover at `RTL_DESCEND_ALT` before landing (default: 0.5s) -by default this period is short so that the vehicle will simply slow and then land immediately. If set to -1 the system will loiter at `RTL_DESCEND_ALT` rather than landing. 延迟能够使你为起落架的展开部署配置时间(自动触发)。 | +| [RTL_LOITER_RAD](../advanced_config/parameter_reference.md#RTL_LOITER_RAD) | [Fixed-wing Only] The radius of the loiter circle (at [RTL_LAND_DELAY](#RTL_LAND_DELAY). | +| [MIS_TKO_LAND_REQ](../advanced_config/parameter_reference.md#MIS_TKO_LAND_REQ) | Specify whether a mission landing or takeoff pattern is _required_. Generally fixed-wing vehicles set this to require a landing pattern but VTOL do not. | ## 另见 diff --git a/docs/zh/flight_stack/controller_diagrams.md b/docs/zh/flight_stack/controller_diagrams.md index aa6bb00e1b2..8b8b7e39d85 100644 --- a/docs/zh/flight_stack/controller_diagrams.md +++ b/docs/zh/flight_stack/controller_diagrams.md @@ -16,8 +16,7 @@ The diagrams use the standard [PX4 notation](../contribute/notation.md) (and eac - 这是一个标准的级联控制架构。 - 控制器采用P和PID控制的组合方式。 - Estimates come from [EKF2](../advanced_config/tuning_the_ecl_ekf.md). -- 在某些模式下,外环(位置回路) 可能会被绕过 (在图中表示为外环之后增加一个多路开关)。 - 只有在位置保持模式或某轴无速度请求时,位置回路才会发挥作用。 +- 在某些模式下,外环(位置回路) 可能会被绕过 (在图中表示为外环之后增加一个多路开关)。只有在位置保持模式或某轴无速度请求时,位置回路才会发挥作用。 ### 多旋翼角速率控制器 @@ -64,7 +63,7 @@ Implementation details can be found in `PositionControl.cpp` and `ControlMath.cp ![MC Velocity Control Diagram](../../assets/diagrams/mc_velocity_diagram.png) -- 采用PID控制器来稳定速度。 该控制器输出的命令是加速度。 +- 采用PID控制器来稳定速度。该控制器输出的命令是加速度。 - 积分器包括了一个采用钳制方法的反复位饱和措施。 - The commanded acceleration is NOT saturated - a saturation will be applied to the converted thrust setpoints in combination with the maximum tilt angle. - Horizontal gains set via parameter `MPC_XY_VEL_P_ACC`, `MPC_XY_VEL_I_ACC` and `MPC_XY_VEL_D_ACC`. @@ -107,18 +106,10 @@ A poor tracking of airspeed and altitude is often caused by a poor tracking of t Make sure to tune the attitude controller before attempting to tune TECS. ::: -同时控制飞机的空速和高度不是一件简单的事。 -增加飞行器的俯仰角会导致高度上升,同时也会导致空速下降。 -推力(通过油门控制)增加整个飞机的总能量。 -因此,俯仰角和油门两个输入量都会对空速和高度产生影响,从而使控制问题变得难了。 +同时控制飞机的空速和高度不是一件简单的事。增加飞行器的俯仰角会导致高度上升,同时也会导致空速下降。推力(通过油门控制)增加整个飞机的总能量。因此,俯仰角和油门两个输入量都会对空速和高度产生影响,从而使控制问题变得难了。 TECS offers a solution by representing the problem in terms of energies rather than the original setpoints. -一架飞行器的总能量是飞行器动能和势能之和。 推力(通过油门控制)可以增加飞机的总能量。 一个给定的总能量状态可以通过势能和动能的任意组合来实现。 -换句话说,飞行器在高海拔以低空速飞行和在低海拔以高空速飞行时的总能量是等价的。 我们称这种情况叫做比能量平衡,它是根据当前高度和真实空速设定值计算的。 -可以通过控制俯仰角来控制飞行器的比能量平衡。 -俯仰角增加将动能转变为势能,俯仰角减少则情况相反。 -这样,通过将初始空速和海拔设定值转化为能量大小(空速和海拔存在耦合,而能量大小可以独立控制),就可以把控制问题解耦。 -我们利用油门调节飞行器的特定总能量,利用俯仰角来维持势能(高度)和动能(真空速)的特定平衡点。 +一架飞行器的总能量是飞行器动能和势能之和。推力(通过油门控制)可以增加飞机的总能量。一个给定的总能量状态可以通过势能和动能的任意组合来实现。换句话说,飞行器在高海拔以低空速飞行和在低海拔以高空速飞行时的总能量是等价的。我们称这种情况叫做比能量平衡,它是根据当前高度和真实空速设定值计算的。可以通过控制俯仰角来控制飞行器的比能量平衡。俯仰角增加将动能转变为势能,俯仰角减少则情况相反。这样,通过将初始空速和海拔设定值转化为能量大小(空速和海拔存在耦合,而能量大小可以独立控制),就可以把控制问题解耦。我们利用油门调节飞行器的特定总能量,利用俯仰角来维持势能(高度)和动能(真空速)的特定平衡点。 #### 总能量控制回路 @@ -144,8 +135,7 @@ $$\dot{E_T} = m V_T \dot{V_T} + m g \dot{h}$$ $$\dot{E} = \frac{\dot{E_T}}{mgV_T} = \frac{\dot{V_T}}{g} + \frac{\dot{h}}{V_T} = \frac{\dot{V_T}}{g} + sin(\gamma)$$ -其中$\gamma{}$是飞行器纵平面的速度角。 -当$\gamma{}$很小时,我们可以近似认为sin($\gamma{}$)=$\gamma{}$,所以可以得到下式: +其中$\gamma{}$是飞行器纵平面的速度角。当$\gamma{}$很小时,我们可以近似认为sin($\gamma{}$)=$\gamma{}$,所以可以得到下式: $$\dot{E} \approx \frac{\dot{V_T}}{g} + \gamma$$ @@ -153,14 +143,13 @@ $$\dot{E} \approx \frac{\dot{V_T}}{g} + \gamma$$ $$T - D = mg(\frac{\dot{V_T}}{g} + sin(\gamma)) \approx mg(\frac{\dot{V_T}}{g} + \gamma)$$ -这里面的 T 和 D 分别是飞行器的推力和受到的阻力。 -在水平飞行中,推力和阻力应该相等,所以推力的变化会导致下面式子: +这里面的 T 和 D 分别是飞行器的推力和受到的阻力。在水平飞行中,推力和阻力应该相等,所以推力的变化会导致下面式子: $$\Delta T = mg(\frac{\dot{V_T}}{g} + \gamma)$$ 正如可以看到的,$\Delta T{}$ 成正比 $\dot{E}{}$,因此推力设置值应该用于控制总能量。 -另一方面,对升降舵的控制是能量守恒的,因此用来交换动力能源,反之亦然。控制升降舵可以将势能转换为动能,反之亦然。 为此,特定的能量平衡变化率定义为: +另一方面,对升降舵的控制是能量守恒的,因此用来交换动力能源,反之亦然。控制升降舵可以将势能转换为动能,反之亦然。为此,特定的能量平衡变化率定义为: $$\dot{B} = \gamma - \frac{\dot{V_T}}{g}$$ @@ -207,9 +196,7 @@ $$ -姿态控制器采用级联环路的方法工作。 -外环计算姿态设定值和估计值的误差,并将误差乘上一个增益(比例控制器),产生角速率设定值。 -内环计算角速率误差,并采用(比例+积分)控制器产生一个所需要的角加速度。 +姿态控制器采用级联环路的方法工作。外环计算姿态设定值和估计值的误差,并将误差乘上一个增益(比例控制器),产生角速率设定值。内环计算角速率误差,并采用(比例+积分)控制器产生一个所需要的角加速度。 The angular position of the control effectors (ailerons, elevators, rudders, ...) is then computed using this desired angular acceleration and a priori knowledge of the system through control allocation (also known as mixing). 此外,由于控制面在高速时更有效,而在低速时效率较低,因此根据巡航速度调整的控制器使用空速测量值进行缩放(如果使用这样的传感器)。 @@ -218,9 +205,7 @@ The angular position of the control effectors (ailerons, elevators, rudders, ... If no airspeed sensor is used then gain scheduling for the FW attitude controller is disabled (it's open loop); no correction is/can be made in TECS using airspeed feedback. ::: -前馈增益用于补偿空气动力阻尼。 -基本上,绕机体轴的两个主要力矩分量分别来自:控制翼面 (副翼,水平尾翼,垂直尾翼 - 驱动机体转动) 和 空气动力阻尼 (与机体角速率成正比 - 阻止机体转动) 。 -为了保持恒定的角速率, 可以在角速率回路中使用前馈来补偿这种气动阻尼。 +前馈增益用于补偿空气动力阻尼。基本上,绕机体轴的两个主要力矩分量分别来自:控制翼面 (副翼,水平尾翼,垂直尾翼 - 驱动机体转动) 和 空气动力阻尼 (与机体角速率成正比 - 阻止机体转动) 。为了保持恒定的角速率, 可以在角速率回路中使用前馈来补偿这种气动阻尼。 ### Turn coordination diff --git a/docs/zh/flying/first_flight_guidelines.md b/docs/zh/flying/first_flight_guidelines.md index 40fa9920a51..b65072dceea 100644 --- a/docs/zh/flying/first_flight_guidelines.md +++ b/docs/zh/flying/first_flight_guidelines.md @@ -10,8 +10,7 @@ Familiarise yourself with the flight regulations in your area. ## 选择合适的地点 -为您的第一次飞行选择正确的位置至关重要。 -要注意的主要事项是: +为您的第一次飞行选择正确的位置至关重要。要注意的主要事项是: - 确保空间是开放的。 There should be no high trees, hills or buildings nearby, because those will impair the GNSS reception. @@ -24,13 +23,11 @@ Familiarise yourself with the flight regulations in your area. ## 带上专业人士 -带上有经验的人进行第一次飞行。 -让他们帮助您完成飞行前检查,并让他们在出现问题时进行干预! +带上有经验的人进行第一次飞行。让他们帮助您完成飞行前检查,并让他们在出现问题时进行干预! ## 计划飞行 -起飞前规划好航线。 -确保您知道整条路线以及机体将在何处/如何降落。 +起飞前规划好航线。确保您知道整条路线以及机体将在何处/如何降落。 ## 减少损失 diff --git a/docs/zh/flying/geofence.md b/docs/zh/flying/geofence.md index 28f29608ce9..994422f4486 100644 --- a/docs/zh/flying/geofence.md +++ b/docs/zh/flying/geofence.md @@ -1,7 +1,6 @@ # 地理围栏 -围栏是一个虚拟边界,用于定义机体可以在哪些地方行驶。 -围栏可用于防止机体飞出遥控器的范围,或进入不安全或受限制的空域。 +围栏是一个虚拟边界,用于定义机体可以在哪些地方行驶。围栏可用于防止机体飞出遥控器的范围,或进入不安全或受限制的空域。 PX4提供了两个独立的机制来指定围栏: @@ -42,8 +41,7 @@ Geofence planning is fully documented in [Plan View > GeoFence](https://docs.qgr 4. 在地图上调整围栏的形状和位置。 - 围栏中心的圆点可以用来调整围栏的位置。 - 边界上的圆点可以用来调整半径。 - - 角(顶点)上的圆点可以用来改变多边形的形状。 - 点击线段中间可以在两个顶点中添加新的顶点。 + - 角(顶点)上的圆点可以用来改变多边形的形状。点击线段中间可以在两个顶点中添加新的顶点。 5. 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). 6. 可添加任意数量的围栏 7. Once finished, click on the **Upload** button (top right) to send the fence (along with rally points and mission) to the vehicle. diff --git a/docs/zh/flying/missions.md b/docs/zh/flying/missions.md index 286e8062479..dc4508f4ea8 100644 --- a/docs/zh/flying/missions.md +++ b/docs/zh/flying/missions.md @@ -31,8 +31,7 @@ For more information see the [QGroundControl User Guide](https://docs.qgroundcon PX4进行了一些基本的健全性检查确定任务是否可行。 For example, whether the mission is close enough to the vehicle, if the mission will conflict with a geofence, or if a mission landing pattern is required but is not present. -检查是在任务上传上传或者任务运行之前立即运行。 -如果检查失败,将通知用户不能启动任务。 +检查是在任务上传上传或者任务运行之前立即运行。如果检查失败,将通知用户不能启动任务。 For more detail on the checks and possible actions, see: [Mission Mode (FW) > Mission Feasibility Checks](../flight_modes_fw/mission.md#mission-feasibility-checks) and [Mission Mode (MC) > Mission Feasibility Checks](../flight_modes_mc/mission.md#mission-feasibility-checks). @@ -72,7 +71,6 @@ For more information see: [Package Delivery Mission](../flying/package_delivery_ ## 飞行任务 -任务上传后,切换到飞行视图。 -任务将显示为一条航线,这样可以方便跟踪(在此视图中无法修改)。 +任务上传后,切换到飞行视图。任务将显示为一条航线,这样可以方便跟踪(在此视图中无法修改)。 ![flying-mission](../../assets/flying/flying_mission.jpg) diff --git a/docs/zh/flying/package_delivery_mission.md b/docs/zh/flying/package_delivery_mission.md index 847b4c92e40..57901446bdb 100644 --- a/docs/zh/flying/package_delivery_mission.md +++ b/docs/zh/flying/package_delivery_mission.md @@ -24,7 +24,7 @@ Whether or not you `Land` depends on whether the package can safely be deployed Since a gripper cannot lower packages safely, multicopter and VTOL vehicles will often land to deploy packages when using a gripper. After the deployment device [indicates completion](#package-release-feedback), the vehicle will proceed to the next waypoint. -Note that if landed, the next mission item after deployment should be another `Waypoint` or a `Takeoff` mission item ([it must not be a `RETURN`](#rtl-waypoint-for-package-delivery-with-landing).) +Note that if landed, the next mission item after deployment should be another `Waypoint` or a `Takeoff` mission item ([it must not be a `RETURN`](#return-waypoint-for-package-delivery-with-landing).) ## Creating a Package Delivery Mission @@ -76,12 +76,12 @@ Note how the altitude graph shows the `Land` item. ### 备注 -#### RTL Waypoint for Package Delivery with Landing +#### Return Waypoint for Package Delivery with Landing Do not plan a mission with a delivery like this: `LAND` > `GRIPPER` > `RETURN TO LAUNCH`. -For safety reasons "Return To Launch" is disabled when vehicle is landed ([related issue](https://github.com/PX4/PX4-Autopilot/pull/20044)). -So if you land, release the cargo, then have an RTL waypoint, the vehicle will idle at the landing coordinate. +For safety reasons Return mode is disabled when the vehicle is landed ([related issue](https://github.com/PX4/PX4-Autopilot/pull/20044)). +So if you land, release the cargo, then have a `Return` (`MAV_CMD_NAV_RETURN_TO_LAUNCH`) mission item, the vehicle will idle at the landing coordinate. #### Manual Control of Gripper in Missions diff --git a/docs/zh/flying/pre_flight_checks.md b/docs/zh/flying/pre_flight_checks.md index 8aa4ba4ec5d..67133070d7d 100644 --- a/docs/zh/flying/pre_flight_checks.md +++ b/docs/zh/flying/pre_flight_checks.md @@ -114,13 +114,13 @@ It should only be attempted if you have data showing it will improve the perform #### PREFLIGHT FAIL: EKF INTERNAL CHECKS -- 如果水平 GPS 速度、偏航角、垂直 GPS 速度或者垂直位置传感器(气压计默认情况下可以使测距仪或 GPS ,如果使用非标准参数)其中之一新息过多,会产生此错误消息。 新息指的是惯性导航计算预测值与传感器测量值之间的差异。 +- 如果水平 GPS 速度、偏航角、垂直 GPS 速度或者垂直位置传感器(气压计默认情况下可以使测距仪或 GPS ,如果使用非标准参数)其中之一新息过多,会产生此错误消息。新息指的是惯性导航计算预测值与传感器测量值之间的差异。 - 用户应检查日志文件中新息级别以确定原因。 These can be found under the `ekf2_innovations` message. 常见问题 / 解决方案包括: - - IMU 启动时漂移。 可以通过重启自驾仪来解决。 可能需要 IMU 加速度计和陀螺仪校准。 - - 相邻磁干扰在飞行器运动中。 通过等待或者重新上电解决。 - - 磁力计校准不良在飞行器运动中。。 通过重新校准解决。 - - 启动时的初始冲击或快速移动导致惯性导航失败。 通过重新启动飞行器并在前 5 秒内最大限度地减少移动来解决此问题。 + - IMU 启动时漂移。可以通过重启自驾仪来解决。可能需要 IMU 加速度计和陀螺仪校准。 + - 相邻磁干扰在飞行器运动中。通过等待或者重新上电解决。 + - 磁力计校准不良在飞行器运动中。。通过重新校准解决。 + - 启动时的初始冲击或快速移动导致惯性导航失败。通过重新启动飞行器并在前 5 秒内最大限度地减少移动来解决此问题。 ## 其他参数 diff --git a/docs/zh/getting_started/led_meanings.md b/docs/zh/getting_started/led_meanings.md index b57d584b9f2..f8427f158a4 100644 --- a/docs/zh/getting_started/led_meanings.md +++ b/docs/zh/getting_started/led_meanings.md @@ -27,17 +27,13 @@ In the event of an error (blinking red), or if the vehicle can't achieve GPS loc ![LED meanings](../../assets/flight_controller/pixhawk_led_meanings.gif) - **[Solid Blue] Armed, No GPS Lock:** Indicates vehicle has been armed and has no position lock from a GPS unit. - 当飞行器已经解锁,PX4会解锁对电机的控制,允许你操纵无人机飞行。 - 像往常一样,在解锁时要小心,因为大型螺旋桨在高速旋转时可能很危险。 - 飞行器在这种模式下无法执行引导任务。 + 当飞行器已经解锁,PX4会解锁对电机的控制,允许你操纵无人机飞行。像往常一样,在解锁时要小心,因为大型螺旋桨在高速旋转时可能很危险。飞行器在这种模式下无法执行引导任务。 - **[Pulsing Blue] Disarmed, No GPS Lock:** Similar to above, but your vehicle is disarmed. 这意味着你将不能控制电机,但是其他子系统正在工作。 - **[Solid Green] Armed, GPS Lock:** Indicates vehicle has been armed and has a valid position lock from a GPS unit. - 当飞行器已经解锁,PX4会解锁对电机的控制,允许你操纵无人机飞行。 - 像往常一样,在解锁时要小心,因为大型螺旋桨在高速旋转时可能很危险。 - 在这种模式下,飞行器可以执行引导任务。 + 当飞行器已经解锁,PX4会解锁对电机的控制,允许你操纵无人机飞行。像往常一样,在解锁时要小心,因为大型螺旋桨在高速旋转时可能很危险。在这种模式下,飞行器可以执行引导任务。 - **[Pulsing Green] Disarmed, GPS Lock:** Similar to above, but your vehicle is disarmed. 这意味着你讲无法控制电机,但是其他子系统包括GPS位置锁正在工作。 @@ -51,8 +47,7 @@ In the event of an error (blinking red), or if the vehicle can't achieve GPS loc this flight. - **[Blinking Red] Error / Setup Required:** Indicates that your autopilot needs to be configured or calibrated before flying. - 将飞行器连接到地面站以找出问题所在。 - 如果您已经完成设置过程,飞行器仍然闪烁红色,这表明还有其他错误。 + 将飞行器连接到地面站以找出问题所在。如果您已经完成设置过程,飞行器仍然闪烁红色,这表明还有其他错误。 @@ -63,8 +58,7 @@ Three _Status LEDs_ provide status for the FMU SoC, and three more provide statu ![Pixhawk 4](../../assets/flight_controller/pixhawk4/pixhawk4_status_leds.jpg) -从上电开始,FMU和PX4IO的CPU首先运行引导程序(BL) 然后运行程序(APP)。 -下表显示了Bootloader 和 APP 如何使用 LED 指示状态。 +从上电开始,FMU和PX4IO的CPU首先运行引导程序(BL) 然后运行程序(APP)。下表显示了Bootloader 和 APP 如何使用 LED 指示状态。 | 颜色 | 标签 | 引导加载程序使用 | APP使用 | | ------ | ---------------------------------- | --------------- | ------- | diff --git a/docs/zh/getting_started/px4_basic_concepts.md b/docs/zh/getting_started/px4_basic_concepts.md index bb9dcbc5351..65343bde84d 100644 --- a/docs/zh/getting_started/px4_basic_concepts.md +++ b/docs/zh/getting_started/px4_basic_concepts.md @@ -2,8 +2,7 @@ 这个话题提供了一次关于无人机的基本介绍,并使用了PX4(它主要针对新手用户,但也是对经验较丰富的用户的良好介绍)。 -如果你已经熟悉了基本概念,你可以转到 [基本组装](../assembly/index.md) 以了解如何连接特定的自驾仪硬件。 -要加载固件并使用 _QGC 地面站_ 设置机体,请查看 [基本配置](../config/index.md)。 +如果你已经熟悉了基本概念,你可以转到 [基本组装](../assembly/index.md) 以了解如何连接特定的自驾仪硬件。要加载固件并使用 _QGC 地面站_ 设置机体,请查看 [基本配置](../config/index.md)。 ## 无人机是什么? @@ -260,8 +259,7 @@ The maximum supported SD card size on Pixhawk boards is 32GB. The _SanDisk Extreme U3 32GB_ and _Samsung EVO Plus 32_ are [highly recommended](../dev_log/logging.md#sd-cards). ::: -尽管如此,SD卡也只是可选的。 -不包含 SD 卡槽的飞行控制器可以: +尽管如此,SD卡也只是可选的。不包含 SD 卡槽的飞行控制器可以: - Disable notification beeps are disabled using the parameter [CBRK_BUZZER](../advanced_config/parameter_reference.md#CBRK_BUZZER). - [Stream logs](../dev_log/logging.md#log-streaming) to another component (companion). diff --git a/docs/zh/getting_started/rc_transmitter_receiver.md b/docs/zh/getting_started/rc_transmitter_receiver.md index 354345420cb..8b7f5592cd7 100644 --- a/docs/zh/getting_started/rc_transmitter_receiver.md +++ b/docs/zh/getting_started/rc_transmitter_receiver.md @@ -23,8 +23,7 @@ On _telemetry-enabled_ RC systems, the remote control unit can also receive and ![Taranis X9D Transmitter](../../assets/hardware/transmitters/frsky_taranis_x9d_transmitter.jpg) The ground based RC controller contains a radio module that is bound to, and communicates with, a (compatible) radio module on the vehicle. -飞机上的单元连接到飞控上。 -自驾仪根据当前飞机的飞行模式和飞机状态来发送命令,正确驱动电机和伺服器。 +飞机上的单元连接到飞控上。自驾仪根据当前飞机的飞行模式和飞机状态来发送命令,正确驱动电机和伺服器。 @@ -33,11 +32,9 @@ The ground- and vehicle- based radio modules are referred to as the transmitter The RC controller and it's included radio module are commonly referred to as a "transmitter". ::: -遥控系统的一个重要质量指标是它支持多少个通道。 -通道的数量决定了远程控制单元上多少个物理控制器可以用来发送命令来控制无人机(比如多少开关、转盘、控制摇杆可以用)。 +遥控系统的一个重要质量指标是它支持多少个通道。通道的数量决定了远程控制单元上多少个物理控制器可以用来发送命令来控制无人机(比如多少开关、转盘、控制摇杆可以用)。 -一个飞行器最少支持4个通道(横滚、俯仰、偏航、油门)。 -地面车辆最少需要两个通道(转向和油门)。 An 8 or 16 channel transmitter provides additional channels that can be used to control other mechanisms or activate different [flight modes](../flight_modes/index.md) provided by the autopilot. +一个飞行器最少支持4个通道(横滚、俯仰、偏航、油门)。地面车辆最少需要两个通道(转向和油门)。 An 8 or 16 channel transmitter provides additional channels that can be used to control other mechanisms or activate different [flight modes](../flight_modes/index.md) provided by the autopilot. ## Types of Remote Controllers @@ -50,8 +47,7 @@ The most popular _form_ of remote control unit for UAVs is shown below. ![RC Basic Commands](../../assets/flying/rc_basic_commands.png) -摇杆、开关等有许多可能的布局。 -最常用的布局被给予了特定的“模式”号。 _Mode 1_ and _Mode 2_ (shown below) differ only in the placement of the throttle. +摇杆、开关等有许多可能的布局。最常用的布局被给予了特定的“模式”号。 _Mode 1_ and _Mode 2_ (shown below) differ only in the placement of the throttle. ![Mode1-Mode2](../../assets/concepts/mode1_mode2.png) @@ -61,8 +57,7 @@ The choice of mode is largely one of taste (_Mode 2_ is more popular). ## 地面设备的远程控制单元 -一个 UGV/车辆最少需要两个发射机通道来发送转向和速度指令。 -常见的发射机使用一个滚轮和扳机、两个单自由度的摇杆、或一个双自由度的摇杆来发射这些指令。 +一个 UGV/车辆最少需要两个发射机通道来发送转向和速度指令。常见的发射机使用一个滚轮和扳机、两个单自由度的摇杆、或一个双自由度的摇杆来发射这些指令。 当然你也可以使用更多的通道/控制机构,其他有趣的激励器和飞行模式也非常有用。 @@ -159,8 +154,7 @@ If you are using a _Spektrum_ receiver, you can put it into bind mode using _QGr - Output a low throttle value (you can [configure PX4 to detect this](../config/radio.md#rc-loss-detection)). - 输出最后收到的信号 (PX4 无法处理此情况!) -首选一个当RC断开时无输出的接收机,然后才是低油门的接收机。 -可能需要配置接收器(请参阅手册)。 +首选一个当RC断开时无输出的接收机,然后才是低油门的接收机。可能需要配置接收器(请参阅手册)。 For more information see [Radio Control Setup > RC Loss Detection](../config/radio.md#rc-loss-detection). diff --git a/docs/zh/getting_started/vehicle_status.md b/docs/zh/getting_started/vehicle_status.md index b2b37ec6300..08e5acbede6 100644 --- a/docs/zh/getting_started/vehicle_status.md +++ b/docs/zh/getting_started/vehicle_status.md @@ -1,7 +1,6 @@ # 飞行状态通知 -PX4提供基于机载视觉(LED)和声音(蜂鸣器)的高级飞行状态和飞行准备提示。 -例如,这些提示表明飞行器是否正确校准,是否有SD卡,是否有位置锁定,是否可以安全起飞,是否解锁,是否可以起飞等。 +PX4提供基于机载视觉(LED)和声音(蜂鸣器)的高级飞行状态和飞行准备提示。例如,这些提示表明飞行器是否正确校准,是否有SD卡,是否有位置锁定,是否可以安全起飞,是否解锁,是否可以起飞等。 此外,PX4 还在 QGroundControl 中提供了更精细的飞行准备信息。 diff --git a/docs/zh/gps_compass/index.md b/docs/zh/gps_compass/index.md index fd8bcd49a40..c754a29b93c 100644 --- a/docs/zh/gps_compass/index.md +++ b/docs/zh/gps_compass/index.md @@ -19,8 +19,7 @@ PX4 also supports [Real Time Kinematic (RTK)](../gps_compass/rtk_gps.md) and **P 任何运行在PX4的元件应通过u-blox、MTK Ashtech 或 Emlid 协议或UAVCAN进行通信。 -下表包括了一些无RTK的GPS模块(其中大部分也有指南针)。 -下面的设备PX4开发团队测试过了,或者是在PX4社区中受欢迎的。 +下表包括了一些无RTK的GPS模块(其中大部分也有指南针)。下面的设备PX4开发团队测试过了,或者是在PX4社区中受欢迎的。 | 设备 | GPS | 罗盘 | [CAN](../dronecan/index.md) | Buzzer / SafeSw / LED | 备注 | | :----------------------------------------------------------- | :---------: | :-----------------------: | :-------------------------: | :-------------------: | :---------------------------------------------------------- | diff --git a/docs/zh/gps_compass/rtk_gps_cuav_c-rtk-9ps.md b/docs/zh/gps_compass/rtk_gps_cuav_c-rtk-9ps.md index 4cf582fa7c7..f7a6a0198d3 100644 --- a/docs/zh/gps_compass/rtk_gps_cuav_c-rtk-9ps.md +++ b/docs/zh/gps_compass/rtk_gps_cuav_c-rtk-9ps.md @@ -64,4 +64,4 @@ RTK setup and use on PX4 via _QGroundControl_ is largely plug and play (see [RTK ## More information -[CUAV docs](https://doc.cuav.net/gps/c-rtk-series/en/c-rtk-9ps/) +[CUAV docs](https://doc.cuav.net/en/gnss/c-rtk-series/c-rtk-9ps/) diff --git a/docs/zh/gps_compass/rtk_gps_cuav_c-rtk.md b/docs/zh/gps_compass/rtk_gps_cuav_c-rtk.md index 2c6fa09e58d..522cca3d6b5 100644 --- a/docs/zh/gps_compass/rtk_gps_cuav_c-rtk.md +++ b/docs/zh/gps_compass/rtk_gps_cuav_c-rtk.md @@ -1,7 +1,7 @@ # CUAV C-RTK The [CUAV C-RTK GPS receiver](https://www.cuav.net/en/c-rtk-9ps-en/) is an [RTK GPS module](../gps_compass/rtk_gps.md) for the mass market. -一个完整的RTK 系统由至少两个 c-rtk 模块 组成(一个用于基站, 另外一个作为移动站用于飞机上)。 使用RTK,PX4控制器可以获取到它的位置,并且这个位置的精度可以达到厘米级的精度,这比普通GPS提供的位置更加精确。 +一个完整的RTK 系统由至少两个 c-rtk 模块 组成(一个用于基站, 另外一个作为移动站用于飞机上)。使用RTK,PX4控制器可以获取到它的位置,并且这个位置的精度可以达到厘米级的精度,这比普通GPS提供的位置更加精确。 diff --git a/docs/zh/gps_compass/rtk_gps_cuav_c-rtk2.md b/docs/zh/gps_compass/rtk_gps_cuav_c-rtk2.md index 34c81ff106d..8b392e5fbdc 100644 --- a/docs/zh/gps_compass/rtk_gps_cuav_c-rtk2.md +++ b/docs/zh/gps_compass/rtk_gps_cuav_c-rtk2.md @@ -98,7 +98,7 @@ In addition to surveying/mapping, it is suitable for many other use-cases, inclu ## 配置 -[CUAV Docs](https://doc.cuav.net/gps/c-rtk2/en/quick-start-c-rtk2.html) +[CUAV Docs](https://doc.cuav.net/en/gnss/c-rtk-series/c-rtk2/quick-start-c-rtk2.html) ## 针脚定义 @@ -110,4 +110,4 @@ In addition to surveying/mapping, it is suitable for many other use-cases, inclu ## More information -[CUAV Docs](https://doc.cuav.net/gps/c-rtk-series/en/c-rtk-9ps/) +[CUAV Docs](https://doc.cuav.net/en/gnss/c-rtk-series/c-rtk-9ps/) diff --git a/docs/zh/hardware/porting_guide.md b/docs/zh/hardware/porting_guide.md index 58a59d7c85e..01eaa221bf3 100644 --- a/docs/zh/hardware/porting_guide.md +++ b/docs/zh/hardware/porting_guide.md @@ -4,8 +4,7 @@ ## PX4 架构 -PX4 由两个主要层组成: 基于主机操作系统(NuttX、Linux 或任何其他 POSIX 平台如 Mac OS)的[板级支持与中间件层](../middleware/index.md),以及应用程序(位于[src/modules](https://github.com/PX4/PX4-Autopilot/tree/main/src/modules)目录下的飞行栈)。 -更多信息请参阅[PX4架构概述](../concept/architecture.md)。 +PX4 由两个主要层组成: 基于主机操作系统(NuttX、Linux 或任何其他 POSIX 平台如 Mac OS)的[板级支持与中间件层](../middleware/index.md),以及应用程序(位于[src/modules](https://github.com/PX4/PX4-Autopilot/tree/main/src/modules)目录下的飞行栈)。更多信息请参阅[PX4架构概述](../concept/architecture.md)。 本指南仅关注主机操作系统和中间件,因为 应用层/飞行控制栈 可以在任何目标平台上运行。 @@ -19,8 +18,7 @@ PX4 由两个主要层组成: 基于主机操作系统(NuttX、Linux 或任 - 构建配置:[/boards/px4/fmu-v5/default.px4board](https://github.com/PX4/PX4-Autopilot/blob/main/boards/px4/fmu-v5/default.px4board)。 - 板卡专用初始化文件:[/boards/px4/fmu-v5/init/rc.board_defaults](https://github.com/PX4/PX4-Autopilot/blob/main/boards/px4/fmu-v5/init/rc.board_defaults) - 如果在主板目录下找到位于**init/rc.board**的文件,则该主板专用的初始化文件会自动包含在启动脚本中。 - - 该文件用于启动仅存在于特定主板上的传感器 (和其他东西)。 - 它也可用于设置电路板的默认参数、UART映射以及任何其他特殊情况。 + - 该文件用于启动仅存在于特定主板上的传感器 (和其他东西)。它也可用于设置电路板的默认参数、UART映射以及任何其他特殊情况。 - 对于FMUv5,您可以看到所有Pixhawk 4传感器均已启动,同时它还设置了更大的LOGGER_BUF缓冲区。 ## 主机操作系统配置 @@ -33,8 +31,7 @@ PX4 由两个主要层组成: 基于主机操作系统(NuttX、Linux 或任 ### Linux -基于 Linux 的飞控板不包含任何 操作系统和内核的配置。 -这些功能已由该开发板可用的Linux镜像提供(该镜像需开箱即支持惯性传感器)。 +基于 Linux 的飞控板不包含任何 操作系统和内核的配置。这些功能已由该开发板可用的Linux镜像提供(该镜像需开箱即支持惯性传感器)。 - [boards/px4/raspberrypi/default.px4board](https://github.com/PX4/PX4-Autopilot/blob/main/boards/px4/raspberrypi/default.px4board) - RPi 交叉编译。 @@ -50,10 +47,7 @@ PX4 由两个主要层组成: 基于主机操作系统(NuttX、Linux 或任 ## RC UART 接线建议 -通常建议通过独立的RX和TX引脚将RC连接至微控制器。但若RX和TX引脚连接在一起,则必须将UART置于单线模式以避免竞争冲突。此操作需通过板级配置文件和清单文件实现。示例可参考px4fmu-v5。 -如果 RX 和 TX 连在了一起,那么 UART 需要设置为单线模式以防止出现争用。 -这可以用过对飞控板的配置文件和 manifest 文件进行更改来实现。 -一个例子是 [px4fmu-v5](https://github.com/PX4/PX4-Autopilot/blob/main/boards/px4/fmu-v5/src/manifest.c)。 +通常建议通过独立的RX和TX引脚将RC连接至微控制器。但若RX和TX引脚连接在一起,则必须将UART置于单线模式以避免竞争冲突。此操作需通过板级配置文件和清单文件实现。示例可参考px4fmu-v5。如果 RX 和 TX 连在了一起,那么 UART 需要设置为单线模式以防止出现争用。这可以用过对飞控板的配置文件和 manifest 文件进行更改来实现。一个例子是 [px4fmu-v5](https://github.com/PX4/PX4-Autopilot/blob/main/boards/px4/fmu-v5/src/manifest.c)。 ## Getting Your Board Supported diff --git a/docs/zh/hardware/porting_guide_nuttx.md b/docs/zh/hardware/porting_guide_nuttx.md index dbdf5c54b65..bef7146534c 100644 --- a/docs/zh/hardware/porting_guide_nuttx.md +++ b/docs/zh/hardware/porting_guide_nuttx.md @@ -18,23 +18,28 @@ The following example uses FMUv5 as it is a recent [reference configuration](../ ## NuttX Menuconfig Setup -To modify the NuttX OS configuration, you can use [menuconfig](https://bitbucket.org/patacongo/nuttx/src/master/) using the PX4 shortcuts: +To modify the NuttX OS configuration, you can use [menuconfig](https://nuttx.apache.org/docs/latest/quickstart/configuring.html) using the PX4 shortcuts: ```sh make px4_fmu-v5_default menuconfig make px4_fmu-v5_default qconfig ``` -For fresh installs of PX4 onto Ubuntu using [ubuntu.sh](https://github.com/PX4/PX4-Autopilot/blob/main/Tools/setup/ubuntu.sh) you will also need to install _kconfig_ tools from [NuttX tools](https://bitbucket.org/nuttx/tools/src/master/). +The _kconfig_ tools used by these targets (`kconfig-mconf` and `kconfig-qconf`) are installed by the standard [Ubuntu](../dev_setup/dev_env_linux_ubuntu.md) and [macOS](../dev_setup/dev_env_mac.md) development environment setup, and are included in the [px4-dev-nuttx](https://hub.docker.com/r/px4io/px4-dev-nuttx/) docker container. -:::info + + + To run `qconfig` you may need to install additional Qt dependencies. diff --git a/docs/zh/hardware/reference_design.md b/docs/zh/hardware/reference_design.md index 4d3f19a0a6f..6f0d9966e9d 100644 --- a/docs/zh/hardware/reference_design.md +++ b/docs/zh/hardware/reference_design.md @@ -4,9 +4,9 @@ The PX4 reference design is the [Pixhawk series](../flight_controller/pixhawk_se ## 二进制兼容性 -所有按照特定设计制造的主板预计与二进制兼容(即可以运行相同的固件)。 从2018年起,我们将提供一个二进制兼容性测试套件,使我们能够验证兼容性。 +所有按照特定设计制造的主板预计与二进制兼容(即可以运行相同的固件)。从2018年起,我们将提供一个二进制兼容性测试套件,使我们能够验证兼容性。 -第1-3代 FMU 设计用于开源硬件,但到了第4-5代只提供 pin 输出引脚和供电规格(原理图由个人开发者生成)。 为了可以更好的确保兼容性,FMUv6 及更新的版本重新提供完整的设计模型。 +第1-3代 FMU 设计用于开源硬件,但到了第4-5代只提供 pin 输出引脚和供电规格(原理图由个人开发者生成)。为了可以更好的确保兼容性,FMUv6 及更新的版本重新提供完整的设计模型。 diff --git a/docs/zh/hardware/serial_port_mapping.md b/docs/zh/hardware/serial_port_mapping.md index e5ffa8552b8..bd2e085a766 100644 --- a/docs/zh/hardware/serial_port_mapping.md +++ b/docs/zh/hardware/serial_port_mapping.md @@ -2,20 +2,17 @@ 本主题说明如何确定USART/UART串行端口(下称串口)设备名称(例如“ttyS0”)与飞行控制器上对应端口(如`TELEM1`、`TELEM2`、`GPS1`、`RC SBUS`、`调试控制台(Debug console)`)之间的映射关系。 -这份说明用于在飞行控制器文档中生成串行端口映射表。 -例如: [Pixhawk 4 > Serial Port Mapping](../flight_controller/pixhawk4.md#serial-port-mapping)。 +这份说明用于在飞行控制器文档中生成串行端口映射表。例如: [Pixhawk 4 > Serial Port Mapping](../flight_controller/pixhawk4.md#serial-port-mapping)。 :::info -每个端口分配的功能不必与名称匹配(大多数情况下),并通过[串行端口配置](../peripherals/serial_configuration.md)。 -通常情况下端口功能是与名称相匹配的,因此标记为`GPS1`的端口可直接连接GPS设备。 +每个端口分配的功能不必与名称匹配(大多数情况下),并通过[串行端口配置](../peripherals/serial_configuration.md)。通常情况下端口功能是与名称相匹配的,因此标记为`GPS1`的端口可直接连接GPS设备。 ::: ## NuttX 在 STMxxyyy 上 -本节将展示如何通过检查板载配置文件,获取在 STMxxyyy 架构上构建 NuttX 所需的映射信息。 -该说明使用 FMUv5,但同样可扩展至其他FMU版本/NuttX开发板。 +本节将展示如何通过检查板载配置文件,获取在 STMxxyyy 架构上构建 NuttX 所需的映射信息。该说明使用 FMUv5,但同样可扩展至其他FMU版本/NuttX开发板。 ### @@ -48,13 +45,11 @@ CONFIG_BOARD_SERIAL_TEL4="/dev/ttyS3" ### nsh/defconfig -_nsh/defconfig_ 允许您确定哪些端口被定义,它们是 UART 还是 USART,以及 USART/UART 与设备之间的映射关系。 -您还可以确定用于该功能的端口[串口/调试控制台](../debug/system_console.md)。 +_nsh/defconfig_ 允许您确定哪些端口被定义,它们是 UART 还是 USART,以及 USART/UART 与设备之间的映射关系。您还可以确定用于该功能的端口[串口/调试控制台](../debug/system_console.md)。 打开板载的 defconfig 配置文件,例如:[/boards/px4/fmu-v5/nuttx-config/nsh/defconfig](https://github.com/PX4/PX4-Autopilot/blob/main/boards/px4/fmu-v5/nuttx-config/nsh/defconfig#L215-L221) -搜索文本“ART”,直到找到类似以下格式的条目:`CONFIG_STM32xx_USARTn=y`(其中`xx`表示处理器类型,`n`表示端口号)。 -例如: +搜索文本“ART”,直到找到类似以下格式的条目:`CONFIG_STM32xx_USARTn=y`(其中`xx`表示处理器类型,`n`表示端口号)。例如: ``` CONFIG_STM32F7_UART4=y @@ -68,8 +63,7 @@ CONFIG_STM32F7_USART6=y 这些条目会告知您哪些端口已被定义,以及它们属于UART还是USART。 -复制上方段落,按“n”进行数字排序。 -同时递增设备编号 _ttyS**n**_(从零开始计数),以获取设备到串行端口的映射关系。 +复制上方段落,按“n”进行数字排序。同时递增设备编号 _ttyS**n**_(从零开始计数),以获取设备到串行端口的映射关系。 ``` ttyS0 CONFIG_STM32F7_USART1=y @@ -81,8 +75,7 @@ ttyS5 CONFIG_STM32F7_UART7=y ttyS6 CONFIG_STM32F7_UART8=y ``` -要获取调试控制台映射,我们需在[defconfig file](https://github.com/PX4/PX4-Autopilot/blob/main/boards/px4/fmu-v5/nuttx-config/nsh/defconfig#L212) 搜索 `SERIAL_CONSOLE`。 -下面我们看到控制台位于UART7: +要获取调试控制台映射,我们需在[defconfig file](https://github.com/PX4/PX4-Autopilot/blob/main/boards/px4/fmu-v5/nuttx-config/nsh/defconfig#L212) 搜索 `SERIAL_CONSOLE`。下面我们看到控制台位于UART7: ``` CONFIG_UART7_SERIAL_CONSOLE=y diff --git a/docs/zh/index.md b/docs/zh/index.md index 2e4a410f4e9..fbe02b9630c 100644 --- a/docs/zh/index.md +++ b/docs/zh/index.md @@ -13,8 +13,7 @@ PX4 is an open-source autopilot for drones and autonomous vehicles. It runs on m :::warning -本指南适用于_development_ version of PX4 (`main` 分支)。 -使用 **版本** 选择器查找当前的 _稳定_ 版本。 +本指南适用于_development_ version of PX4 (`main` 分支)。使用 **版本** 选择器查找当前的 _稳定_ 版本。 自稳定版本发布以来的已记录变更,收录在不断更新的(releases/main.md ) 中。 ::: @@ -53,6 +52,11 @@ The [Hardware Selection & Setup](hardware/drone_parts.md) section covers flight Read [Operations](config/operations.md) to understand safety features and failsafe behavior before your first flight. Then see [Basic Flying (Multicopter)](flying/basic_flying_mc.md) or the equivalent for your frame type. +## Security + +Securing a deployment is the integrator's responsibility — PX4 ships with every control interface unauthenticated, unsigned, and unencrypted! +The [Security](security/index.md) section collects the hardening documentation, and links to the [security policy](https://github.com/PX4/PX4-Autopilot/blob/main/SECURITY.md) for reporting a vulnerability. + ## 技术支持 Get help on the [discussion forums](https://discuss.px4.io/) or [Discord](https://discord.com/invite/dronecode). See the [Support](contribute/support.md) page for diagnosing problems, reporting bugs, and joining the [weekly dev call](contribute/dev_call.md). @@ -69,14 +73,11 @@ See the [Contributing](contribute/index.md) section for code, [documentation](co ## 许可证 -PX4 代码可依据宽松的 [BSD 3-clause license](https://opensource.org/license/BSD-3-Clause) 免费使用和修改。 -此文档已使用 [CC BY 4.0]授权。(https://creativecommons.org/licenses/by/4.0/)。 -详情见: [Licences](contribute/licenses.md)。 +PX4 代码可依据宽松的 [BSD 3-clause license](https://opensource.org/license/BSD-3-Clause) 免费使用和修改。此文档已使用 [CC BY 4.0]授权。(https://creativecommons.org/licenses/by/4.0/)。详情见: [Licences](contribute/licenses.md)。 ## 日历和活动 -_Dronecode 日历_ 展示了面向平台用户和开发者的重要社区活动。 -选择以下链接将其显示在您所在的时区日历中(并将其添加到您自己的日历中): +_Dronecode 日历_ 展示了面向平台用户和开发者的重要社区活动。选择以下链接将其显示在您所在的时区日历中(并将其添加到您自己的日历中): - [Switzerland – Zurich](https://calendar.google.com/calendar/embed?src=linuxfoundation.org_g21tvam24m7pm7jhev01bvlqh8%40group.calendar.google.com&ctz=Europe%2FZurich) - [Pacific Time – Tijuana](https://calendar.google.com/calendar/embed?src=linuxfoundation.org_g21tvam24m7pm7jhev01bvlqh8%40group.calendar.google.com&ctz=America%2FTijuana) diff --git a/docs/zh/mavlink/security_hardening.md b/docs/zh/mavlink/security_hardening.md index 4e40edc40cb..059ce7b0074 100644 --- a/docs/zh/mavlink/security_hardening.md +++ b/docs/zh/mavlink/security_hardening.md @@ -3,16 +3,24 @@ MAVLink is an open communication protocol designed for lightweight, low-latency communication between drones and ground stations. -By default, all MAVLink messages are unauthenticated. -This is intentional for development and testing, but **production deployments must enable [message signing](message_signing.md)** to prevent unauthorized access. +By default, all MAVLink messages are unauthenticated and unencrypted. +This is intentional for development and testing, but **production deployments must secure the link** to prevent unauthorized access. + +There are two ways to do that, and they are not exclusive: + +- **Secure the link below MAVLink**, using a radio configured with link-layer security, a VPN, etc. + Configured with authenticated encryption, this uses standard, reviewed cryptography and gives confidentiality and authentication for all traffic on the link, not only MAVLink. + It is outside PX4's scope and depends on your radio and network stack. +- **Enable [MAVLink message signing](message_signing.md)**, which authenticates MAVLink frames without encrypting them. + This is the mechanism PX4 itself ships, and it is described in this guide. :::warning -Without message signing enabled, any device that can send MAVLink messages to the vehicle (via radio, network, or serial) can execute any command, including shell access, file operations, parameter changes, mission uploads, arming, and flight termination. +On an unsecured link, any device that can send MAVLink messages to the vehicle (via radio, network, or serial) can execute any command, including shell access, file operations, parameter changes, mission uploads, arming, and flight termination. ::: ## What Is at Risk -When MAVLink signing is not enabled, an attacker within communication range can: +On an unsecured link, an attacker within communication range can: | Capability | MAVLink mechanism | | ------------------------------------------- | ------------------------------------------------ | @@ -27,13 +35,15 @@ When MAVLink signing is not enabled, an attacker within communication range can: | Reboot the vehicle | `MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN` | All of these are standard MAVLink capabilities used by ground control stations. -Without signing, there is no distinction between a legitimate GCS and an unauthorized sender. +Until the link is secured, there is no distinction between a legitimate GCS and an unauthorized sender. ## Hardening Checklist -### 1. Enable Message Signing +### 1. Secure the Link -Message signing provides cryptographic authentication for all MAVLink communication. +If the link is carried over an encrypted radio, a VPN or IPsec, that covers authentication and confidentiality for everything on it, and the rest of this step is optional. + +Otherwise, use message signing, which provides cryptographic authentication for all MAVLink communication. See [Message Signing](message_signing.md) for full details. Steps: @@ -50,6 +60,14 @@ Signing changes are rejected while the vehicle is armed. Signing can also be disabled by physically removing the key file from the SD card. ::: +:::warning +Provision the key before the vehicle is used on an untrusted link, not after. + +Until a key is provisioned there is nothing to authenticate against, so any peer that can reach a link can provision one. +Only _changing_ a key requires a signed message; setting the first one cannot, because no key exists yet. +A key installed by someone else locks out the legitimate ground station, and the recovery is to remove the key file from the SD card. +::: + ### 2. Secure Physical Access - **SD card**: The signing key is stored at `/mavlink/mavlink-signing-key.bin`. @@ -67,6 +85,7 @@ If your threat model includes physical access, secure the SD card slot and debug ### 3. Secure Network Links +- Prefer an encrypted transport where one is available: an encrypted radio link, a VPN, etc. - Do not expose MAVLink UDP/TCP ports to untrusted networks or the internet. - Place MAVLink communication links behind firewalls or VPNs. - Segment MAVLink networks from business or public networks. @@ -77,6 +96,8 @@ If your threat model includes physical access, secure the SD card slot and debug - **No encryption**: Message signing provides authentication and integrity, but messages are sent in plaintext. An eavesdropper can read telemetry and commands but cannot forge them. +- **Unaudited implementation**: + The signing protocol was audited when it was drafted, but PX4's implementation of it has not been. - **Allowlisted messages**: A small set of [safety-critical messages](message_signing.md#unsigned-message-allowlist) (`HEARTBEAT`, `RADIO_STATUS`, `ADSB_VEHICLE`, `COLLISION`) are always accepted unsigned on all links. An attacker could spoof these specific messages. diff --git a/docs/zh/middleware/dds_topics.md b/docs/zh/middleware/dds_topics.md index 2abadcdd09d..6a5080b9964 100644 --- a/docs/zh/middleware/dds_topics.md +++ b/docs/zh/middleware/dds_topics.md @@ -157,6 +157,7 @@ See messages - [EstimatorStatus](../msg_docs/EstimatorStatus.md) - [Event](../msg_docs/Event.md) - [EventV0](../msg_docs/EventV0.md) +- [ExternalGimbalManagerStatus](../msg_docs/ExternalGimbalManagerStatus.md) - [FailureDetectorStatus](../msg_docs/FailureDetectorStatus.md) - [FailureInjection](../msg_docs/FailureInjection.md) - [FiducialMarkerPosReport](../msg_docs/FiducialMarkerPosReport.md) @@ -181,6 +182,7 @@ See messages - [GimbalManagerInformation](../msg_docs/GimbalManagerInformation.md) - [GimbalManagerSetAttitude](../msg_docs/GimbalManagerSetAttitude.md) - [GimbalManagerSetManualControl](../msg_docs/GimbalManagerSetManualControl.md) +- [GimbalManagerSetPitchyaw](../msg_docs/GimbalManagerSetPitchyaw.md) - [GimbalManagerStatus](../msg_docs/GimbalManagerStatus.md) - [GpioConfig](../msg_docs/GpioConfig.md) - [GpioIn](../msg_docs/GpioIn.md) diff --git a/docs/zh/middleware/uxrce_dds.md b/docs/zh/middleware/uxrce_dds.md index a096479f298..81de1b0a906 100644 --- a/docs/zh/middleware/uxrce_dds.md +++ b/docs/zh/middleware/uxrce_dds.md @@ -26,6 +26,14 @@ In order for PX4 uORB topics to be shared on the DDS network you will need _uXRC The PX4 [uxrce_dds_client](../modules/modules_system.md#uxrce-dds-client) publishes to/from a defined set of uORB topics to the global DDS data space. +:::warning +The DDS transport is unauthenticated and reaches uORB directly, so the DDS network must be kept isolated. +Connect the flight controller to the companion over serial or a dedicated Ethernet cable, not over a shared or wireless network. +A direct cable is not enough on its own: the agent republishes into the DDS network on the companion, so also keep that local, for example with [UXRCE_DDS_PTCFG](../advanced_config/parameter_reference.md#UXRCE_DDS_PTCFG) set to localhost and `ROS_AUTOMATIC_DISCOVERY_RANGE=LOCALHOST` (`ROS_LOCALHOST_ONLY=1` on Humble). +If the data has to leave the companion, securing it is up to the integrator. +See [Security](../security/index.md) for more. +::: + The [eProsima Micro XRCE-DDS _Agent_](https://github.com/eProsima/Micro-XRCE-DDS-Agent) runs on the companion computer and acts as a proxy for the client in the DDS/ROS 2 network. The agent itself has no dependency on client-side code and can be built and/or installed independent of PX4 or ROS, as long as version compatibility is ensured. @@ -465,12 +473,10 @@ While most releases should support a very similar set of messages, to be certain Note that ROS 2/DDS needs to have the _same_ message definitions that were used to create the uXRCE-DDS client module in the PX4 Firmware in order to interpret the messages. The message definitions are stored in the ROS 2 interface package [PX4/px4_msgs](https://github.com/PX4/px4_msgs), and they are automatically synchronized by CI on the `main` and release branches. -需要注意的是,PX4 源代码中的所有消息均存在于该代码仓库中,但只有在dds_topics.yaml文件中列出的消息,才会作为 ROS 2 话题可用。 -因此 +需要注意的是,PX4 源代码中的所有消息均存在于该代码仓库中,但只有在dds_topics.yaml文件中列出的消息,才会作为 ROS 2 话题可用。因此 - 如果您正在使用 PX4 的主要版本或发布版本,您可以通过克隆接口包[PX4/px4_msgs](https://github.com/PX4/px4_msgs)获得消息定义。 -- 如果您要创建或修改 uORB 消息,必须从 PX4 源代码树中手动更新工作空间中的消息。 - 一般来说,这意味着您将更新 [dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml),克隆接口包。 然后手动同步,将新的/修改的消息定义从 [PX4-Autopilot/msg](https://github.com/PX4/PX4-Autopilot/tree/main/msg)复制到它的 `msg` 文件夹。 +- 如果您要创建或修改 uORB 消息,必须从 PX4 源代码树中手动更新工作空间中的消息。一般来说,这意味着您将更新 [dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml),克隆接口包。 然后手动同步,将新的/修改的消息定义从 [PX4-Autopilot/msg](https://github.com/PX4/PX4-Autopilot/tree/main/msg)复制到它的 `msg` 文件夹。 Assuming that PX4-Autopilot is in your home directory `~`, while `px4_msgs` is in `~/ros2_px4_ws/src/`, then the command might be: ```sh @@ -491,8 +497,7 @@ The message definitions are stored in the ROS 2 interface package [PX4/px4_msgs] Custom topic and service namespaces can be applied at build time (changing [dds_topics.yaml](../middleware/dds_topics.md)), at runtime, or through a parameter (which is useful for multi vehicle operations): -- 一种可能性是在从命令行启动[uxrce_dds_client](../modules/modules_system.md#uxrce-dds-client)时使用 "-n" 选项。 - 这种技术既可用于模拟,也可用于实际机体。 +- 一种可能性是在从命令行启动[uxrce_dds_client](../modules/modules_system.md#uxrce-dds-client)时使用 "-n" 选项。这种技术既可用于模拟,也可用于实际机体。 - 在开始模拟前,可以通过设置环境变量 `PX4_UXRCE_DDS_NS`来提供自定义命名空间 (仅限) :::info diff --git a/docs/zh/middleware/zenoh.md b/docs/zh/middleware/zenoh.md index 1dfd46b2bbc..7a272a613f2 100644 --- a/docs/zh/middleware/zenoh.md +++ b/docs/zh/middleware/zenoh.md @@ -20,6 +20,14 @@ The Zenoh-based middleware consists of a client running on PX4 and a Zenoh route The router acts as a broker and discovery service, enabling PX4 to publish and subscribe to topics in the global Zenoh data space. This allows seamless integration with ROS 2 nodes using [`rmw_zenoh`](https://github.com/ros2/rmw_zenoh), and supports flexible deployment across distributed systems. +:::warning +The Zenoh transport is unauthenticated and reaches uORB directly, so the Zenoh network must be kept isolated. +Connect the flight controller to the companion over a dedicated Ethernet cable, not over a shared or wireless network. +A direct cable is not enough on its own: the router republishes into the Zenoh network, so the router must also not be reachable from other networks. +If the data has to leave the companion, securing it is up to the integrator. +See [Security](../security/index.md) for more. +::: + ![Architecture PX4 Zenoh-Pico with ROS 2](../../assets/middleware/zenoh/architecture-px4-zenoh.svg) The client is the _PX4 Zenoh-Pico Node_ referred to above, which is implemented in the [PX4 `zenoh` module](../modules/modules_driver.md#zenoh). diff --git a/docs/zh/modules/hello_sky.md b/docs/zh/modules/hello_sky.md index d5f2354db18..9d97e13e250 100644 --- a/docs/zh/modules/hello_sky.md +++ b/docs/zh/modules/hello_sky.md @@ -1,7 +1,6 @@ # 搭建你的第一个应用(Hello Shy) -本文主要说明如何创建并运行你的第一个板载应用程序。 -它涵盖了 PX4 应用程序开发所需的所有基本概念和 API。 +本文主要说明如何创建并运行你的第一个板载应用程序。它涵盖了 PX4 应用程序开发所需的所有基本概念和 API。 :::info For simplicity, more advanced features like start/stop functionality and command-line arguments are omitted. @@ -185,8 +184,7 @@ This consists of a single _C_ file and a _cmake_ definition (which tells the too ## 编译应用程序/固件 -应用程序的编写至此完成。 -为了运行它,您首先需要确保它是作为 PX4 的一部分构建的。 +应用程序的编写至此完成。为了运行它,您首先需要确保它是作为 PX4 的一部分构建的。 Applications are added to the build/firmware in the appropriate board-level _px4board_ file for your target: - PX4 SITL (Simulator): [PX4-Autopilot/boards/px4/sitl/default.px4board](https://github.com/PX4/PX4-Autopilot/blob/main/boards/px4/sitl/default.px4board) diff --git a/docs/zh/modules/module_template.md b/docs/zh/modules/module_template.md index d310bed2a7e..79c14446e37 100644 --- a/docs/zh/modules/module_template.md +++ b/docs/zh/modules/module_template.md @@ -18,8 +18,7 @@ PX4-Autopilot contains a template for writing a new application (module) that ru 工作队列任务应用程序与普通(任务)应用程序相同。 除了它需要指定它是一个工作队列任务,并在初始化期间运行调度它本身。 -示例显示了如何操作。 -总结: +示例显示了如何操作。总结: 1. Specify the dependency on the work queue library in the cmake definition file ([CMakeLists.txt](https://github.com/PX4/PX4-Autopilot/blob/main/src/examples/work_item/CMakeLists.txt)): diff --git a/docs/zh/modules/modules_controller.md b/docs/zh/modules/modules_controller.md index 2bc57500e9a..3723a16695f 100644 --- a/docs/zh/modules/modules_controller.md +++ b/docs/zh/modules/modules_controller.md @@ -267,7 +267,7 @@ Source: [modules/navigator](https://github.com/PX4/PX4-Autopilot/tree/main/src/m ### 描述 Module that is responsible for autonomous flight modes. This includes missions (read from dataman), -takeoff and RTL. +takeoff and Return. It is also responsible for geofence violation checking. ### 实现 diff --git a/docs/zh/modules/modules_estimator.md b/docs/zh/modules/modules_estimator.md index 16012c9a02d..de9947335b5 100644 --- a/docs/zh/modules/modules_estimator.md +++ b/docs/zh/modules/modules_estimator.md @@ -52,7 +52,7 @@ Source: [modules/ekf2](https://github.com/PX4/PX4-Autopilot/tree/main/src/module ### 描述 -基于扩展卡尔曼滤波器的姿态和位置估计器。 该模块同时应用于多旋翼和固定翼飞机。 +基于扩展卡尔曼滤波器的姿态和位置估计器。该模块同时应用于多旋翼和固定翼飞机。 The documentation can be found on the [ECL/EKF Overview & Tuning](../advanced_config/tuning_the_ecl_ekf.md) page. diff --git a/docs/zh/modules/modules_simulation.md b/docs/zh/modules/modules_simulation.md index 6051db28c3f..207ccfb7188 100644 --- a/docs/zh/modules/modules_simulation.md +++ b/docs/zh/modules/modules_simulation.md @@ -16,10 +16,7 @@ signals given by the control allocation module. ### 实现 -模拟器运用矩阵代数方法实现了运动方程。 -姿态采用四元数表示。 -积分计算采用前向欧拉法。 -为避免堆栈溢出,大部分变量在 .hpp 文件中声明为全局变量。 +模拟器运用矩阵代数方法实现了运动方程。姿态采用四元数表示。积分计算采用前向欧拉法。为避免堆栈溢出,大部分变量在 .hpp 文件中声明为全局变量。 ### Usage {#simulator_sih_usage} diff --git a/docs/zh/modules/modules_system.md b/docs/zh/modules/modules_system.md index ee8841bb065..a8694786618 100644 --- a/docs/zh/modules/modules_system.md +++ b/docs/zh/modules/modules_system.md @@ -155,9 +155,9 @@ commander [arguments...] transition VTOL transition mode Change flight mode - manual|acro|offboard|stabilized|altctl|posctl|altitude_cruise|position:slow - |auto:mission|auto:loiter|auto:course|auto:rtl|auto:takeoff|aut - o:land|auto:precland|ext1 Flight mode + manual|acro|offboard|stabilized|altctl|posctl|altitude_cruise|manual_parkin + g|position:slow|auto:mission|auto:loiter|auto:course|auto:rtl|a + uto:takeoff|auto:land|auto:precland|ext1 Flight mode pair @@ -411,54 +411,15 @@ Source: [modules/internal_combustion_engine_control](https://github.com/PX4/PX4- ### 描述 -The module controls internal combustion engine (ICE) features including: -ignition (on/off), throttle and choke level, starter engine delay, and user request. +Controls a spark-ignition internal combustion engine (ICE): ignition, throttle, choke and +electric starter motor. A state machine sequences the start attempts, restarts the engine if +it stops in flight, and runs a closed-loop idle RPM governor. -### Enabling +The module is not in the default builds, and is only started at boot if +[ICE_EN](../advanced_config/parameter_reference.md#ICE_EN) is set. -This feature is not enabled by default needs to be configured in the -build target for your board together with the rpm capture driver: - -``` -CONFIG_MODULES_INTERNAL_COMBUSTION_ENGINE_CONTROL=y -CONFIG_DRIVERS_RPM_CAPTURE=y -``` - -Additionally, to enable the module: - -- Set [ICE_EN](../advanced_config/parameter_reference.md#ICE_EN) - to true and adjust the other `ICE_` module parameters according to your needs. -- Set [RPM_CAP_ENABLE](../advanced_config/parameter_reference.md#RPM_CAP_ENABLE) to true. - -The module outputs control signals for ignition, throttle, and choke, -and takes inputs from an RPM sensor. -These must be mapped to AUX outputs/inputs in the [Actuator configuration](../config/actuators.md), -similar to the setup shown below. - -![Actuator setup for ICE](../../assets/hardware/ice/ice_actuator_setup.png) - -### 实现 - -The ICE is implemented with a (4) state machine: - -![Architecture](../../assets/hardware/ice/ice_control_state_machine.png) - -The state machine: - -- Checks if [Rpm.msg](../msg_docs/Rpm.md) is updated to know if the engine is running -- Allows for user inputs from: - - Manual control AUX - - Arming state in [VehicleStatus.msg](../msg_docs/VehicleStatus.md) -- In the state "Stopped" the throttle is set to NAN, which by definition will set the - throttle output to the disarmed value configured for the specific output. - -The module publishes [InternalCombustionEngineControl.msg](../msg_docs/InternalCombustionEngineControl.md). - -The architecture is as shown below: - -![Architecture](../../assets/hardware/ice/ice_control_diagram.png) - - +See [Internal Combustion Engines](../actuators/internal_combustion_engine.md) for the firmware +and hardware setup, actuator configuration, start sequence timing and idle governor tuning. ### Usage {#internal_combustion_engine_control_usage} diff --git a/docs/zh/msg_docs/ArmingCheckReply.md b/docs/zh/msg_docs/ArmingCheckReply.md index 4f93d5000bb..60e7d8d407a 100644 --- a/docs/zh/msg_docs/ArmingCheckReply.md +++ b/docs/zh/msg_docs/ArmingCheckReply.md @@ -37,7 +37,7 @@ The message is not used by internal/FMU components, as their mode requirements a | mode_req_global_position | `bool` | | | Requires a global position estimate | | mode_req_global_position_relaxed | `bool` | | | Requires a relaxed global position estimate | | mode_req_mission | `bool` | | | Requires an uploaded mission | -| mode_req_home_position | `bool` | | | Requires a home position (such as RTL/Return mode) | +| mode_req_home_position | `bool` | | | Requires a home position (such as Return mode) | | mode_req_prevent_arming | `bool` | | | Prevent arming (such as in Land mode) | | mode_req_manual_control | `bool` | | | Requires a manual controller | @@ -104,7 +104,7 @@ bool mode_req_local_position_relaxed # Requires a more relaxed global position e bool mode_req_global_position # Requires a global position estimate bool mode_req_global_position_relaxed # Requires a relaxed global position estimate bool mode_req_mission # Requires an uploaded mission -bool mode_req_home_position # Requires a home position (such as RTL/Return mode) +bool mode_req_home_position # Requires a home position (such as Return mode) bool mode_req_prevent_arming # Prevent arming (such as in Land mode) bool mode_req_manual_control # Requires a manual controller diff --git a/docs/zh/msg_docs/ExternalGimbalManagerStatus.md b/docs/zh/msg_docs/ExternalGimbalManagerStatus.md new file mode 100644 index 00000000000..12d4df77b3e --- /dev/null +++ b/docs/zh/msg_docs/ExternalGimbalManagerStatus.md @@ -0,0 +1,56 @@ +--- +pageClass: is-wide-page +--- + +# ExternalGimbalManagerStatus (UORB message) + +External gimbal manager status. + +Status of a gimbal manager running on another component (not us), decoded from +an incoming GIMBAL_MANAGER_STATUS message. Used to track which component +currently controls an external gimbal manager. + +**TOPICS:** external_gimbal_manager_status + +## Fields + +| 参数名 | 类型 | Unit [Frame] | Range/Enum | 描述 | +| ----------------------------------------------------------------------------------------------------------- | -------- | ---------------------------------------------------------------- | ---------- | ------------------------------------------- | +| timestamp | `uint64` | us | | Time since system start | +| manager_sysid | `uint8` | | | System id of the external gimbal manager | +| manager_compid | `uint8` | | | Component id of the external gimbal manager | +| flags | `uint32` | | | | +| gimbal_device_id | `uint8` | | | | +| primary_control_sysid | `uint8` | | | | +| primary_control_compid | `uint8` | | | | +| secondary_control_sysid | `uint8` | | | | +| secondary_control_compid | `uint8` | | | | + +## Source Message + +[Source file (GitHub)](https://github.com/PX4/PX4-Autopilot/blob/main/msg/ExternalGimbalManagerStatus.msg) + +:::details +Click here to see original file + +```c +# External gimbal manager status +# +# Status of a gimbal manager running on another component (not us), decoded from +# an incoming GIMBAL_MANAGER_STATUS message. Used to track which component +# currently controls an external gimbal manager. + +uint64 timestamp # [us] Time since system start + +uint8 manager_sysid # [-] System id of the external gimbal manager +uint8 manager_compid # [-] Component id of the external gimbal manager + +uint32 flags # [-] +uint8 gimbal_device_id +uint8 primary_control_sysid +uint8 primary_control_compid +uint8 secondary_control_sysid +uint8 secondary_control_compid +``` + +::: diff --git a/docs/zh/msg_docs/GimbalManagerSetPitchyaw.md b/docs/zh/msg_docs/GimbalManagerSetPitchyaw.md new file mode 100644 index 00000000000..600597d3b51 --- /dev/null +++ b/docs/zh/msg_docs/GimbalManagerSetPitchyaw.md @@ -0,0 +1,70 @@ +--- +pageClass: is-wide-page +--- + +# GimbalManagerSetPitchyaw (UORB message) + +Gimbal manager pitch/yaw setpoint. + +This is sent by PX4 (acting as a gimbal manager client) to an +external gimbal manager). Streamed out as GIMBAL_MANAGER_SET_PITCHYAW. + +**TOPICS:** gimbal_manager_set_pitchyaw + +## Fields + +| 参数名 | 类型 | Unit [Frame] | Range/Enum | 描述 | +| ------------------------------------------------------------------------------------------- | --------- | ---------------------------------------------------------------- | --------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ | +| timestamp | `uint64` | us | | Time since system start | +| target_system | `uint8` | | | System id of the external gimbal manager | +| target_component | `uint8` | | | Component id of the external gimbal manager | +| gimbal_device_id | `uint8` | | | Gimbal device to address (0 for all) | +| flags | `uint32` | | [GIMBAL_MANAGER_FLAGS](#GIMBAL_MANAGER_FLAGS) | GIMBAL_MANAGER_FLAGS bitmask | +| pitch | `float32` | rad | | pitch angle (Invalid: NaN to ignore) | +| yaw | `float32` | rad | | yaw angle (Invalid: NaN to ignore) | +| pitch_rate | `float32` | rad/s | | Pitch angular rate (Invalid: NaN to ignore) | +| yaw_rate | `float32` | rad/s | | Yaw angular rate (Invalid: NaN to ignore) | + +## Enums + +### GIMBAL_MANAGER_FLAGS {#GIMBAL_MANAGER_FLAGS} + +Used in field(s): [flags](#fld_flags) + +| 参数名 | 类型 | 值 | 描述 | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -- | -- | +| GIMBAL_MANAGER_FLAGS_PITCH_LOCK | `uint32` | 8 | | +| GIMBAL_MANAGER_FLAGS_YAW_LOCK | `uint32` | 16 | | +| GIMBAL_MANAGER_FLAGS_YAW_IN_EARTH_FRAME | `uint32` | 64 | | + +## Source Message + +[Source file (GitHub)](https://github.com/PX4/PX4-Autopilot/blob/main/msg/GimbalManagerSetPitchyaw.msg) + +:::details +Click here to see original file + +```c +# Gimbal manager pitch/yaw setpoint +# +# This is sent by PX4 (acting as a gimbal manager client) to an +# external gimbal manager). Streamed out as GIMBAL_MANAGER_SET_PITCHYAW. + +uint64 timestamp # [us] Time since system start + +uint8 target_system # [-] System id of the external gimbal manager +uint8 target_component # [-] Component id of the external gimbal manager +uint8 gimbal_device_id # [-] Gimbal device to address (0 for all) + +uint32 flags # [@enum GIMBAL_MANAGER_FLAGS] GIMBAL_MANAGER_FLAGS bitmask +uint32 GIMBAL_MANAGER_FLAGS_PITCH_LOCK = 8 +uint32 GIMBAL_MANAGER_FLAGS_YAW_LOCK = 16 +uint32 GIMBAL_MANAGER_FLAGS_YAW_IN_EARTH_FRAME = 64 + +float32 pitch # [rad] [@invalid NaN to ignore] pitch angle +float32 yaw # [rad] [@invalid NaN to ignore] yaw angle +float32 pitch_rate # [rad/s] [@invalid NaN to ignore] Pitch angular rate +float32 yaw_rate # [rad/s] [@invalid NaN to ignore] Yaw angular rate +``` + +::: diff --git a/docs/zh/msg_docs/InternalCombustionEngineControl.md b/docs/zh/msg_docs/InternalCombustionEngineControl.md index 9c02b489f57..b2583943142 100644 --- a/docs/zh/msg_docs/InternalCombustionEngineControl.md +++ b/docs/zh/msg_docs/InternalCombustionEngineControl.md @@ -4,18 +4,26 @@ pageClass: is-wide-page # InternalCombustionEngineControl (UORB message) +Internal combustion engine (ICE) actuator setpoints. + +Published by the `internal_combustion_engine_control` module, which runs the engine +start/stop state machine and the idle RPM governor. +The mixer maps these setpoints onto the IC Engine output functions (ignition, +throttle, choke, starter), which are assigned to the flight controller outputs. +The resulting state machine state is reported in `InternalCombustionEngineStatus`. + **TOPICS:** internal_combustion_engine_control ## Fields -| 参数名 | 类型 | Unit [Frame] | Range/Enum | 描述 | -| ------------------------------------------------------------------------------------------------------- | --------- | ---------------------------------------------------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| timestamp | `uint64` | | | time since system start (microseconds) | -| ignition_on | `bool` | | | activate/deactivate ignition (spark plug) | -| throttle_control | `float32` | | | setpoint for throttle actuator, with slew rate if enabled, idles with 0 [norm] [@range 0,1] [@uncontrolled NAN to stop motor] | -| choke_control | `float32` | | | setpoint for choke actuator, 1: fully closed [norm] [@range 0,1] | -| starter_engine_control | `float32` | | | setpoint for (electric) starter motor [norm] [@range 0,1] | -| user_request | `uint8` | | | user intent for the ICE being on/off | +| 参数名 | 类型 | Unit [Frame] | Range/Enum | 描述 | +| -------------------------------------------------------------------------------------------------------------------------- | --------- | ---------------------------------------------------------------- | --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| timestamp | `uint64` | us | | Time since system start | +| ignition_on | `bool` | | | Activate/deactivate the ignition (spark plug) | +| throttle_control | `float32` | norm | [0 : 1] | Throttle actuator setpoint, rate limited by `ICE_THR_SLEW`. 0 is closed throttle (Invalid: NaN Stops the engine: output goes to its disarmed value) | +| choke_control | `float32` | norm | [0 : 1] | Choke actuator setpoint, 1 is fully closed | +| starter_engine_control | `float32` | norm | [0 : 1] | (Electric) starter motor setpoint | +| user_request_motor_on | `bool` | | | User intent for the engine to be running, from the source selected by `ICE_ON_SOURCE` | ## Source Message @@ -25,14 +33,22 @@ pageClass: is-wide-page Click here to see original file ```c -uint64 timestamp # time since system start (microseconds) +# Internal combustion engine (ICE) actuator setpoints +# +# Published by the `internal_combustion_engine_control` module, which runs the engine +# start/stop state machine and the idle RPM governor. +# The mixer maps these setpoints onto the IC Engine output functions (ignition, +# throttle, choke, starter), which are assigned to the flight controller outputs. +# The resulting state machine state is reported in `InternalCombustionEngineStatus`. -bool ignition_on # activate/deactivate ignition (spark plug) -float32 throttle_control # setpoint for throttle actuator, with slew rate if enabled, idles with 0 [norm] [@range 0,1] [@uncontrolled NAN to stop motor] -float32 choke_control # setpoint for choke actuator, 1: fully closed [norm] [@range 0,1] -float32 starter_engine_control # setpoint for (electric) starter motor [norm] [@range 0,1] +uint64 timestamp # [us] Time since system start -uint8 user_request # user intent for the ICE being on/off +bool ignition_on # Activate/deactivate the ignition (spark plug) +float32 throttle_control # [norm] [@range 0, 1] [@invalid NaN Stops the engine: output goes to its disarmed value] Throttle actuator setpoint, rate limited by `ICE_THR_SLEW`. 0 is closed throttle +float32 choke_control # [norm] [@range 0, 1] Choke actuator setpoint, 1 is fully closed +float32 starter_engine_control # [norm] [@range 0, 1] (Electric) starter motor setpoint + +bool user_request_motor_on # User intent for the engine to be running, from the source selected by `ICE_ON_SOURCE` ``` ::: diff --git a/docs/zh/msg_docs/ManualControlSwitches.md b/docs/zh/msg_docs/ManualControlSwitches.md index 4aef11c7175..aa43fb10f41 100644 --- a/docs/zh/msg_docs/ManualControlSwitches.md +++ b/docs/zh/msg_docs/ManualControlSwitches.md @@ -14,7 +14,7 @@ pageClass: is-wide-page | timestamp_sample | `uint64` | | | the timestamp of the raw data (microseconds) | | mode_slot | `uint8` | | | the slot a specific model selector is in | | arm_switch | `uint8` | | | arm/disarm switch: _DISARMED_, ARMED | -| return_switch | `uint8` | | | return to launch 2 position switch (mandatory): _NORMAL_, RTL | +| return_switch | `uint8` | | | Return mode 2 position switch (mandatory): _NORMAL_, RETURN | | loiter_switch | `uint8` | | | loiter 2 position switch (optional): _MISSION_, LOITER | | offboard_switch | `uint8` | | | offboard 2 position switch (optional): _NORMAL_, OFFBOARD | | kill_switch | `uint8` | | | throttle kill: _NORMAL_, KILL | @@ -73,7 +73,7 @@ uint8 MODE_SLOT_NUM = 6 # number of slots uint8 mode_slot # the slot a specific model selector is in uint8 arm_switch # arm/disarm switch: _DISARMED_, ARMED -uint8 return_switch # return to launch 2 position switch (mandatory): _NORMAL_, RTL +uint8 return_switch # Return mode 2 position switch (mandatory): _NORMAL_, RETURN uint8 loiter_switch # loiter 2 position switch (optional): _MISSION_, LOITER uint8 offboard_switch # offboard 2 position switch (optional): _NORMAL_, OFFBOARD uint8 kill_switch # throttle kill: _NORMAL_, KILL diff --git a/docs/zh/msg_docs/RtlStatus.md b/docs/zh/msg_docs/RtlStatus.md index 96af91ed9cb..835028ee199 100644 --- a/docs/zh/msg_docs/RtlStatus.md +++ b/docs/zh/msg_docs/RtlStatus.md @@ -8,14 +8,14 @@ pageClass: is-wide-page ## Fields -| 参数名 | 类型 | Unit [Frame] | Range/Enum | 描述 | -| ----------------------------------------------------------------------------------------------------- | -------- | ---------------------------------------------------------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| timestamp | `uint64` | | | time since system start (microseconds) | -| safe_points_id | `uint32` | | | unique ID of active set of safe_point_items | -| is_evaluation_pending | `bool` | | | flag if the RTL point needs reevaluation (e.g. new safe points available, but need loading). | -| has_vtol_approach | `bool` | | | flag if approaches are defined for current RTL_TYPE parameter setting | -| rtl_type | `uint8` | | | Type of RTL chosen | -| safe_point_index | `uint8` | | | index of the chosen safe point, UINT8_MAX if no rally point was chosen | +| 参数名 | 类型 | Unit [Frame] | Range/Enum | 描述 | +| ----------------------------------------------------------------------------------------------------- | -------- | ---------------------------------------------------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| timestamp | `uint64` | | | time since system start (microseconds) | +| safe_points_id | `uint32` | | | unique ID of active set of safe_point_items | +| is_evaluation_pending | `bool` | | | flag if the return point needs reevaluation (e.g. new safe points available, but need loading). | +| has_vtol_approach | `bool` | | | flag if approaches are defined for current RTL_TYPE parameter setting | +| rtl_type | `uint8` | | | Selected Return type | +| safe_point_index | `uint8` | | | index of the chosen safe point, UINT8_MAX if no rally point was chosen | ## Constants @@ -38,11 +38,11 @@ Click here to see original file uint64 timestamp # time since system start (microseconds) uint32 safe_points_id # unique ID of active set of safe_point_items -bool is_evaluation_pending # flag if the RTL point needs reevaluation (e.g. new safe points available, but need loading). +bool is_evaluation_pending # flag if the return point needs reevaluation (e.g. new safe points available, but need loading). bool has_vtol_approach # flag if approaches are defined for current RTL_TYPE parameter setting -uint8 rtl_type # Type of RTL chosen +uint8 rtl_type # Selected Return type uint8 safe_point_index # index of the chosen safe point, UINT8_MAX if no rally point was chosen uint8 RTL_STATUS_TYPE_NONE=0 # pending if evaluation can't pe performed currently e.g. when it is still loading the safe points diff --git a/docs/zh/msg_docs/RtlTimeEstimate.md b/docs/zh/msg_docs/RtlTimeEstimate.md index 4c6f08d911e..12b49da2744 100644 --- a/docs/zh/msg_docs/RtlTimeEstimate.md +++ b/docs/zh/msg_docs/RtlTimeEstimate.md @@ -12,7 +12,7 @@ pageClass: is-wide-page | ----------------------------------------------------------------------------------------------- | --------- | ---------------------------------------------------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------- | | timestamp | `uint64` | | | time since system start (microseconds) | | valid | `bool` | | | Flag indicating whether the time estiamtes are valid | -| time_estimate | `float32` | s | | Estimated time for RTL | +| time_estimate | `float32` | s | | Estimated time for Return | | safe_time_estimate | `float32` | s | | Same as time_estimate, but with safety factor and safety margin included (factor\*t + margin) | ## Source Message @@ -26,7 +26,7 @@ Click here to see original file uint64 timestamp # time since system start (microseconds) bool valid # Flag indicating whether the time estiamtes are valid -float32 time_estimate # [s] Estimated time for RTL +float32 time_estimate # [s] Estimated time for Return float32 safe_time_estimate # [s] Same as time_estimate, but with safety factor and safety margin included (factor*t + margin) ``` diff --git a/docs/zh/msg_docs/VehicleStatus.md b/docs/zh/msg_docs/VehicleStatus.md index 1b21d131ad8..2659b41b83d 100644 --- a/docs/zh/msg_docs/VehicleStatus.md +++ b/docs/zh/msg_docs/VehicleStatus.md @@ -10,49 +10,49 @@ Encodes the system state of the vehicle published by commander. ## Fields -| 参数名 | 类型 | Unit [Frame] | Range/Enum | 描述 | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ---------------------------------------------------------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| timestamp | `uint64` | | | time since system start (microseconds) | -| armed_time | `uint64` | | | Arming timestamp (microseconds) | -| takeoff_time | `uint64` | | | Takeoff timestamp (microseconds) | -| arming_state | `uint8` | | | | -| latest_arming_reason | `uint8` | | | | -| latest_disarming_reason | `uint8` | | | | -| nav_state_timestamp | `uint64` | | | time when current nav_state activated | -| nav_state_user_intention | `uint8` | | | Mode that the user selected (might be different from nav_state in a failsafe situation) | -| nav_state | `uint8` | | | Currently active mode | -| executor_in_charge | `uint8` | | | Current mode executor in charge (0=Autopilot) | -| nav_state_display | `uint8` | | | User-visible nav state sent via MAVLink (executor state if active, otherwise nav_state) | -| accepts_offboard_setpoints | `bool` | | | True if the current mode accepts offboard trajectory setpoints via MAVLink | -| valid_nav_states_mask | `uint32` | | | Bitmask for all valid nav_state values | -| can_set_nav_states_mask | `uint32` | | | Bitmask for all modes that a user can select | -| hil_state | `uint8` | | | | -| vehicle_type | `uint8` | | | | -| failsafe | `bool` | | | true if system is in failsafe state (e.g.:RTL, Hover, Terminate, ...) | -| failsafe_and_user_took_over | `bool` | | | true if system is in failsafe state but the user took over control | -| failsafe_defer_state | `uint8` | | | one of FAILSAFE_DEFER_STATE_\* | -| gcs_connection_lost | `bool` | | | datalink to GCS lost | -| gcs_connection_lost_counter | `uint8` | | | counts unique GCS connection lost events | -| high_latency_data_link_lost | `bool` | | | Set to true if the high latency data link (eg. RockBlock Iridium 9603 telemetry module) is lost | -| is_vtol | `bool` | | | True if the system is VTOL capable | -| is_vtol_tailsitter | `bool` | | | True if the system performs a 90° pitch down rotation during transition from MC to FW | -| in_transition_mode | `bool` | | | True if VTOL is doing a transition | -| in_transition_to_fw | `bool` | | | True if VTOL is doing a transition from MC to FW | -| system_type | `uint8` | | | system type, contains mavlink MAV_TYPE | -| system_id | `uint8` | | | system id, contains MAVLink's system ID field | -| component_id | `uint8` | | | subsystem / component id, contains MAVLink's component ID field | -| safety_button_available | `bool` | | | Set to true if a safety button is connected | -| safety_off | `bool` | | | Set to true if safety is off | -| power_input_valid | `bool` | | | set if input power is valid | -| usb_connected | `bool` | | | set to true (never cleared) once telemetry received from usb link | -| open_drone_id_system_present | `bool` | | | | -| open_drone_id_system_healthy | `bool` | | | | -| parachute_system_present | `bool` | | | | -| parachute_system_healthy | `bool` | | | | -| traffic_avoidance_system_present | `bool` | | | | -| rc_calibration_in_progress | `bool` | | | | -| calibration_enabled | `bool` | | | | -| pre_flight_checks_pass | `bool` | | | true if all checks necessary to arm pass | +| 参数名 | 类型 | Unit [Frame] | Range/Enum | 描述 | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ---------------------------------------------------------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| timestamp | `uint64` | | | time since system start (microseconds) | +| armed_time | `uint64` | | | Arming timestamp (microseconds) | +| takeoff_time | `uint64` | | | Takeoff timestamp (microseconds) | +| arming_state | `uint8` | | | | +| latest_arming_reason | `uint8` | | | | +| latest_disarming_reason | `uint8` | | | | +| nav_state_timestamp | `uint64` | | | time when current nav_state activated | +| nav_state_user_intention | `uint8` | | | Mode that the user selected (might be different from nav_state in a failsafe situation) | +| nav_state | `uint8` | | | Currently active mode | +| executor_in_charge | `uint8` | | | Current mode executor in charge (0=Autopilot) | +| nav_state_display | `uint8` | | | User-visible nav state sent via MAVLink (executor state if active, otherwise nav_state) | +| accepts_offboard_setpoints | `bool` | | | True if the current mode accepts offboard trajectory setpoints via MAVLink | +| valid_nav_states_mask | `uint32` | | | Bitmask for all valid nav_state values | +| can_set_nav_states_mask | `uint32` | | | Bitmask for all modes that a user can select | +| hil_state | `uint8` | | | | +| vehicle_type | `uint8` | | | | +| failsafe | `bool` | | | true if system is in failsafe state (e.g. Return, Hover, Terminate, ...) | +| failsafe_and_user_took_over | `bool` | | | true if system is in failsafe state but the user took over control | +| failsafe_defer_state | `uint8` | | | one of FAILSAFE_DEFER_STATE_\* | +| gcs_connection_lost | `bool` | | | datalink to GCS lost | +| gcs_connection_lost_counter | `uint8` | | | counts unique GCS connection lost events | +| high_latency_data_link_lost | `bool` | | | Set to true if the high latency data link (eg. RockBlock Iridium 9603 telemetry module) is lost | +| is_vtol | `bool` | | | True if the system is VTOL capable | +| is_vtol_tailsitter | `bool` | | | True if the system performs a 90° pitch down rotation during transition from MC to FW | +| in_transition_mode | `bool` | | | True if VTOL is doing a transition | +| in_transition_to_fw | `bool` | | | True if VTOL is doing a transition from MC to FW | +| system_type | `uint8` | | | system type, contains mavlink MAV_TYPE | +| system_id | `uint8` | | | system id, contains MAVLink's system ID field | +| component_id | `uint8` | | | subsystem / component id, contains MAVLink's component ID field | +| safety_button_available | `bool` | | | Set to true if a safety button is connected | +| safety_off | `bool` | | | Set to true if safety is off | +| power_input_valid | `bool` | | | set if input power is valid | +| usb_connected | `bool` | | | set to true (never cleared) once telemetry received from usb link | +| open_drone_id_system_present | `bool` | | | | +| open_drone_id_system_healthy | `bool` | | | | +| parachute_system_present | `bool` | | | | +| parachute_system_healthy | `bool` | | | | +| traffic_avoidance_system_present | `bool` | | | | +| rc_calibration_in_progress | `bool` | | | | +| calibration_enabled | `bool` | | | | +| pre_flight_checks_pass | `bool` | | | true if all checks necessary to arm pass | ## Constants @@ -76,11 +76,11 @@ Encodes the system state of the vehicle published by commander. | NAVIGATION_STATE_POSCTL | `uint8` | 2 | Position control mode | | NAVIGATION_STATE_AUTO_MISSION | `uint8` | 3 | Auto mission mode | | NAVIGATION_STATE_AUTO_LOITER | `uint8` | 4 | Auto loiter mode | -| NAVIGATION_STATE_AUTO_RTL | `uint8` | 5 | Auto return to launch mode | +| NAVIGATION_STATE_AUTO_RTL | `uint8` | 5 | Return mode | | NAVIGATION_STATE_POSITION_SLOW | `uint8` | 6 | | | NAVIGATION_STATE_GUIDED_COURSE | `uint8` | 7 | Guided Course mode (FW: maintain course/alt/speed) | | NAVIGATION_STATE_ALTITUDE_CRUISE | `uint8` | 8 | Altitude with Cruise mode | -| NAVIGATION_STATE_FREE3 | `uint8` | 9 | | +| NAVIGATION_STATE_MANUAL_PARKING | `uint8` | 9 | Manual Parking mode | | NAVIGATION_STATE_ACRO | `uint8` | 10 | Acro mode | | NAVIGATION_STATE_FREE2 | `uint8` | 11 | | | NAVIGATION_STATE_DESCEND | `uint8` | 12 | Descend mode (no position control) | @@ -157,11 +157,11 @@ uint8 NAVIGATION_STATE_ALTCTL = 1 # Altitude control mode uint8 NAVIGATION_STATE_POSCTL = 2 # Position control mode uint8 NAVIGATION_STATE_AUTO_MISSION = 3 # Auto mission mode uint8 NAVIGATION_STATE_AUTO_LOITER = 4 # Auto loiter mode -uint8 NAVIGATION_STATE_AUTO_RTL = 5 # Auto return to launch mode +uint8 NAVIGATION_STATE_AUTO_RTL = 5 # Return mode uint8 NAVIGATION_STATE_POSITION_SLOW = 6 uint8 NAVIGATION_STATE_GUIDED_COURSE = 7 # Guided Course mode (FW: maintain course/alt/speed) uint8 NAVIGATION_STATE_ALTITUDE_CRUISE = 8 # Altitude with Cruise mode -uint8 NAVIGATION_STATE_FREE3 = 9 +uint8 NAVIGATION_STATE_MANUAL_PARKING = 9 # Manual Parking mode uint8 NAVIGATION_STATE_ACRO = 10 # Acro mode uint8 NAVIGATION_STATE_FREE2 = 11 uint8 NAVIGATION_STATE_DESCEND = 12 # Descend mode (no position control) @@ -208,7 +208,7 @@ uint8 FAILSAFE_DEFER_STATE_DISABLED = 0 uint8 FAILSAFE_DEFER_STATE_ENABLED = 1 uint8 FAILSAFE_DEFER_STATE_WOULD_FAILSAFE = 2 # Failsafes deferred, but would trigger a failsafe -bool failsafe # true if system is in failsafe state (e.g.:RTL, Hover, Terminate, ...) +bool failsafe # true if system is in failsafe state (e.g. Return, Hover, Terminate, ...) bool failsafe_and_user_took_over # true if system is in failsafe state but the user took over control uint8 failsafe_defer_state # one of FAILSAFE_DEFER_STATE_* diff --git a/docs/zh/msg_docs/index.md b/docs/zh/msg_docs/index.md index 71c127505c8..ec8b2fb5e00 100644 --- a/docs/zh/msg_docs/index.md +++ b/docs/zh/msg_docs/index.md @@ -132,6 +132,7 @@ Graphs showing how these are used [can be found here](../middleware/uorb_graph.m - [EstimatorStates](EstimatorStates.md) - [EstimatorStatus](EstimatorStatus.md) - [EstimatorStatusFlags](EstimatorStatusFlags.md) +- [ExternalGimbalManagerStatus](ExternalGimbalManagerStatus.md) — External gimbal manager status. - [FailsafeFlags](FailsafeFlags.md) — Input flags for the failsafe state machine set by the arming & health checks. - [FailureDetectorStatus](FailureDetectorStatus.md) - [FailureInjection](FailureInjection.md) — Failure injection configuration. @@ -158,6 +159,7 @@ Graphs showing how these are used [can be found here](../middleware/uorb_graph.m - [GimbalManagerInformation](GimbalManagerInformation.md) - [GimbalManagerSetAttitude](GimbalManagerSetAttitude.md) - [GimbalManagerSetManualControl](GimbalManagerSetManualControl.md) +- [GimbalManagerSetPitchyaw](GimbalManagerSetPitchyaw.md) — Gimbal manager pitch/yaw setpoint. - [GimbalManagerStatus](GimbalManagerStatus.md) - [GpioConfig](GpioConfig.md) — GPIO configuration. - [GpioIn](GpioIn.md) — GPIO mask and state. @@ -169,7 +171,7 @@ Graphs showing how these are used [can be found here](../middleware/uorb_graph.m - [HeaterStatus](HeaterStatus.md) - [HoverThrustEstimate](HoverThrustEstimate.md) - [InputRc](InputRc.md) -- [InternalCombustionEngineControl](InternalCombustionEngineControl.md) +- [InternalCombustionEngineControl](InternalCombustionEngineControl.md) — Internal combustion engine (ICE) actuator setpoints. - [InternalCombustionEngineStatus](InternalCombustionEngineStatus.md) - [IridiumsbdStatus](IridiumsbdStatus.md) - [IrlockReport](IrlockReport.md) — IRLOCK_REPORT message data. diff --git a/docs/zh/peripherals/dshot.md b/docs/zh/peripherals/dshot.md index 0a3c36ace39..5d5c08f7fc6 100644 --- a/docs/zh/peripherals/dshot.md +++ b/docs/zh/peripherals/dshot.md @@ -43,8 +43,7 @@ Enable DShot for your required outputs in the [Actuator Configuration](../config DShot comes with different speed options: _DShot150_, _DShot300_, and _DShot600_ where the number indicates the speed in kilo-bits/second. 您应该将参数设置为您的电调支持的最高速度(根据其说明书)。 -然后连接电池并解锁无人机。 -电调应该初始化,电机应该按照正确的方向转动。 +然后连接电池并解锁无人机。电调应该初始化,电机应该按照正确的方向转动。 - If the motors do not spin in the correct direction (for the [selected airframe](../airframes/airframe_reference.md)) you can reverse them in the UI using the **Set Spin Direction** option (this option appears after you select DShot and assign motors). diff --git a/docs/zh/peripherals/frsky_telemetry.md b/docs/zh/peripherals/frsky_telemetry.md index d31a86e59e4..91394b4df2c 100644 --- a/docs/zh/peripherals/frsky_telemetry.md +++ b/docs/zh/peripherals/frsky_telemetry.md @@ -128,7 +128,7 @@ S-Port receivers transmit the following messages from PX4 (from [here](https://g - **VFAS:** Actual battery voltage value (Voltage FrSky Ampere Sensor). - **VSpd:** Vertical speed (cm/s). - **Tmp1:** [Flight mode](../flight_modes/index.md#flight-modes), sent as an integer: 18 - Manual, 23 - Altitude, 22 - Position, 27 - Mission, 26 - Hold, 28 - Return, 19 - Acro, 24 0 Offboard, 20 - Stabilized, 25 - Takeoff, 29 - Land, 30 - Follow Me. -- **Tmp2:** GPS information. 最右边的数字是 gps 定位类型 (0 = 无, 2 = 2d, 3 = 3d)。 其他数字是卫星的数量。 +- **Tmp2:** GPS information. 最右边的数字是 gps 定位类型 (0 = 无, 2 = 2d, 3 = 3d)。其他数字是卫星的数量。 :::info The following "standard" S-Port messages are not supported by PX4: **ASpd**, **A4**. diff --git a/docs/zh/releases/main.md b/docs/zh/releases/main.md index 7f835c9c3dd..a009d5378fd 100644 --- a/docs/zh/releases/main.md +++ b/docs/zh/releases/main.md @@ -31,6 +31,8 @@ Please continue reading for [upgrade instructions](#upgrade-guide). ## Upgrade Guide - `COM_ARM_TRAFF` has been replaced by `COM_TRAFF_AVOID`. The old value 3 ("enforce for mission modes only") is migrated to `COM_TRAFF_AVOID=2`, which blocks arming in all modes, not just mission modes. If you relied on being able to arm manually with traffic detected, set `COM_TRAFF_AVOID=1` (warning only) instead. +- `PCA9685_SCHD_HZ` has been removed. `PCA9685_PWM_FREQ` now sets both the PWM frequency of the PCA9685 and the rate at which values are pushed to it; if you had `PCA9685_SCHD_HZ` set to a non-default value, set `PCA9685_PWM_FREQ` to it after upgrading. Frequencies above 400 Hz (previously only usable in duty-cycle mode) are no longer supported. +- **jMAVSim has been removed.** `make px4_sitl jmavsim` and the `10017_jmavsim_iris` airframe (`SYS_AUTOSTART=10017`) no longer exist, and the setup scripts no longer install Java or `ant`. Use [SIH](../sim_sih/index.md) with the [Hawkeye](../sim_hawkeye/index.md) visualizer instead (`make px4_sitl_sih sihsim_quadx`), or [Gazebo](../sim_gazebo_gz/index.md). - **Re-check motor failure handling on hexarotors.** [CA_FAILURE_MODE](../advanced_config/parameter_reference.md#CA_FAILURE_MODE) = `1` now also stops the motor opposite the failed one on a hexarotor (previously only the failed motor was removed from the allocation). Other airframes are unaffected, and `CA_FAILURE_MODE=0` (the default) is unchanged. See [Motor Failure Recovery](../config/motor_failure_recovery.md). ([PX4-Autopilot#28078](https://github.com/PX4/PX4-Autopilot/pull/28078)) ## Other changes @@ -43,7 +45,8 @@ Please continue reading for [upgrade instructions](#upgrade-guide). ### Common -- TBD +- The unit and functional test suite builds, links and runs on macOS (`make tests`), and `px4_poll()` timeouts on macOS wait for their full duration instead of returning at once. The blended GPS timestamp is accumulated in double and rounded once instead of truncating each weighted term. ([PX4-Autopilot#28516](https://github.com/PX4/PX4-Autopilot/pull/28516)) +- The AlphaFilter library takes its sample interval and time constant in microseconds, and the float seconds overloads are removed, so a value in the wrong unit no longer compiles. Out-of-tree code that constructs the filter with seconds needs updating. ([PX4-Autopilot#28421](https://github.com/PX4/PX4-Autopilot/pull/28421)) ### Control @@ -74,7 +77,8 @@ Please continue reading for [upgrade instructions](#upgrade-guide). ### 仿真 -- TBD +- jMAVSim has been removed in favour of [SIH](../sim_sih/index.md) with the [Hawkeye](../sim_hawkeye/index.md) visualizer. See the [Upgrade Guide](#upgrade-guide). +- Gazebo: the GNSS failure injection commands (`failure gps off`, `stuck` and `wrong`) now apply to the NavSat data published by the gz bridge, consistent with the other simulator paths. ([PX4-Autopilot#28398](https://github.com/PX4/PX4-Autopilot/pull/28398)) ### Debug & Logging @@ -86,7 +90,7 @@ Please continue reading for [upgrade instructions](#upgrade-guide). ### uXRCE-DDS / Zenoh / ROS 2 -- TBD +- (uXRCE-DDS): SITL multi vehicle automatic namespace prefix is now `uav_{px4_instance}` and it is aligned with the behaviour of `UXRCE_DDS_NS_IDX`. ([PX4-Autopilot#28338](https://github.com/PX4/PX4-Autopilot/pull/28338)) ### MAVLink diff --git a/docs/zh/ros/external_position_estimation.md b/docs/zh/ros/external_position_estimation.md index cf7bc58d290..58804759c4e 100644 --- a/docs/zh/ros/external_position_estimation.md +++ b/docs/zh/ros/external_position_estimation.md @@ -1,6 +1,6 @@ # 利用视觉或运动捕捉系统进行位置估计 -可视惯性测距(VIO)和运动捕捉(MOCAP)系统允许载具在全局位置源不可用或不可靠时(例如在室内,或在桥下飞行时)导航。 等等…… +可视惯性测距(VIO)和运动捕捉(MOCAP)系统允许载具在全局位置源不可用或不可靠时(例如在室内,或在桥下飞行时)导航。等等…… Both VIO and MoCap determine a vehicle's _pose_ (position and attitude) from "visual" information. 它们之间的主要区别是框架透视图: @@ -319,9 +319,7 @@ If those steps are consistent, you can try your first flight. Put the robot on the ground and start streaming MoCap feedback. Lower your left (throttle) stick and arm the motors. -此时,设置为位置控制模式。 -如果切换成功,飞控会闪绿灯。 -绿灯代表:你的外部位置信息已经注入到飞控中,并且位置控制模式已经切换成功。 +此时,设置为位置控制模式。如果切换成功,飞控会闪绿灯。绿灯代表:你的外部位置信息已经注入到飞控中,并且位置控制模式已经切换成功。 Put your left stick at the middle, this is the dead zone. With this stick value, the robot maintains its altitude; diff --git a/docs/zh/ros/mavros_custom_messages.md b/docs/zh/ros/mavros_custom_messages.md index bac8795292a..01baf572e10 100644 --- a/docs/zh/ros/mavros_custom_messages.md +++ b/docs/zh/ros/mavros_custom_messages.md @@ -327,10 +327,10 @@ MODULES make px4_fmu-v5_default upload ``` - - to build for SITL execute the following command in the root of the PX4-Autopilot directory (using jmavsim simulation): + - to build for SITL execute the following command in the root of the PX4-Autopilot directory (using SIH simulation): ```sh - make px4_sitl jmavsim + make px4_sitl_sih sihsim_quadx ``` ## 构建 diff --git a/docs/zh/ros/mavros_offboard_cpp.md b/docs/zh/ros/mavros_offboard_cpp.md index 53290f58778..2d79de52b3a 100644 --- a/docs/zh/ros/mavros_offboard_cpp.md +++ b/docs/zh/ros/mavros_offboard_cpp.md @@ -142,8 +142,7 @@ ros::ServiceClient arming_client = nh.serviceClient("m ros::ServiceClient set_mode_client = nh.serviceClient("mavros/set_mode"); ``` -我们构建了一个发布者来发布本地位置指令并请求客户端进行加解锁状态及控制模式的切换。 -请注意,对于您自己的系统,"mavros" 前缀可能不同,取决于节点启动文件中指定的名称。 +我们构建了一个发布者来发布本地位置指令并请求客户端进行加解锁状态及控制模式的切换。请注意,对于您自己的系统,"mavros" 前缀可能不同,取决于节点启动文件中指定的名称。 ```cpp //the setpoint publishing rate MUST be faster than 2Hz @@ -163,8 +162,7 @@ while(ros::ok() && !current_state.connected){ } ``` -在发布任何消息之前,我们需要等待飞控和MAVROS建立连接。 -在收到心跳包之后,代码便会跳出这个循环。 +在发布任何消息之前,我们需要等待飞控和MAVROS建立连接。在收到心跳包之后,代码便会跳出这个循环。 ```cpp geometry_msgs::PoseStamped pose; @@ -227,8 +225,7 @@ while(ros::ok()){ 该代码的其余部分完全是自解释性的。 We attempt to switch to _Offboard_ mode, after which we arm the quad to allow it to fly. -我们每隔五秒去调用一次该服务,避免飞控被大量的请求阻塞。 -在同一个循环中,我们按照指定的频率持续发送期望点设定值信息给飞控。 +我们每隔五秒去调用一次该服务,避免飞控被大量的请求阻塞。在同一个循环中,我们按照指定的频率持续发送期望点设定值信息给飞控。 :::tip This code has been simplified to the bare minimum for illustration purposes. diff --git a/docs/zh/ros/mavros_offboard_python.md b/docs/zh/ros/mavros_offboard_python.md index 51dbedd6f80..09da29a7f03 100644 --- a/docs/zh/ros/mavros_offboard_python.md +++ b/docs/zh/ros/mavros_offboard_python.md @@ -174,8 +174,7 @@ def state_cb(msg): current_state = msg ``` -我们构建了一个发布者来发布本地位置指令并请求客户端进行加解锁状态及控制模式的切换。 -请注意,对于您自己的系统,"mavros" 前缀可能不同,取决于节点启动文件中指定的名称。 +我们构建了一个发布者来发布本地位置指令并请求客户端进行加解锁状态及控制模式的切换。请注意,对于您自己的系统,"mavros" 前缀可能不同,取决于节点启动文件中指定的名称。 ```py state_sub = rospy.Subscriber("mavros/state", State, callback = state_cb) @@ -201,8 +200,7 @@ Here we set the publishing rate appropriately: rate = rospy.Rate(20) ``` -在发布任何消息之前,我们需要等待飞控和MAVROS建立连接。 -在收到心跳包之后,代码便会跳出这个循环。 +在发布任何消息之前,我们需要等待飞控和MAVROS建立连接。在收到心跳包之后,代码便会跳出这个循环。 ```py # Wait for Flight Controller connection diff --git a/docs/zh/ros/offboard_control.md b/docs/zh/ros/offboard_control.md index c0b4565acb0..bededd76c93 100644 --- a/docs/zh/ros/offboard_control.md +++ b/docs/zh/ros/offboard_control.md @@ -67,8 +67,7 @@ graph TD; ### On-board processor and wifi link to ROS (**_Recommended_**) -部署在飞行器上的小型计算机除了通过 UART - USB 适配器连接到自动驾驶仪外,同时还可通过WiFi连接至运行 ROS 的地面站。 -这可以是上述配备了WiFi适配器的任一计算机。 +部署在飞行器上的小型计算机除了通过 UART - USB 适配器连接到自动驾驶仪外,同时还可通过WiFi连接至运行 ROS 的地面站。这可以是上述配备了WiFi适配器的任一计算机。 [![Mermaid graph: ROS](https://mermaid.ink/img/eyJjb2RlIjoiZ3JhcGggVERcbiAgc3ViZ3JhcGggR3JvdW5kICBTdGF0aW9uXG4gIGduZFtST1MgRW5hYmxlZCBDb21wdXRlcl0gLS0tIHFnY1txR3JvdW5kQ29udHJvbF1cbiAgZW5kXG4gIGduZCAtLU1BVkxpbmsvVURQLS0-IHdbV2lGaV07XG4gIHFnYyAtLU1BVkxpbmstLT4gdztcbiAgc3ViZ3JhcGggVmVoaWNsZVxuICBjb21wW0NvbXBhbmlvbiBDb21wdXRlcl0gLS1NQVZMaW5rLS0-IHVhcnRbVUFSVCBBZGFwdGVyXVxuICB1YXJ0IC0tLSBBdXRvcGlsb3RcbiAgZW5kXG4gIHcgLS0tIGNvbXAiLCJtZXJtYWlkIjp7InRoZW1lIjoiZGVmYXVsdCJ9LCJ1cGRhdGVFZGl0b3IiOmZhbHNlfQ)](https://mermaid-js.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoiZ3JhcGggVERcbiAgc3ViZ3JhcGggR3JvdW5kICBTdGF0aW9uXG4gIGduZFtST1MgRW5hYmxlZCBDb21wdXRlcl0gLS0tIHFnY1txR3JvdW5kQ29udHJvbF1cbiAgZW5kXG4gIGduZCAtLU1BVkxpbmsvVURQLS0-IHdbV2lGaV07XG4gIHFnYyAtLU1BVkxpbmstLT4gdztcbiAgc3ViZ3JhcGggVmVoaWNsZVxuICBjb21wW0NvbXBhbmlvbiBDb21wdXRlcl0gLS1NQVZMaW5rLS0-IHVhcnRbVUFSVCBBZGFwdGVyXVxuICB1YXJ0IC0tLSBBdXRvcGlsb3RcbiAgZW5kXG4gIHcgLS0tIGNvbXAiLCJtZXJtYWlkIjp7InRoZW1lIjoiZGVmYXVsdCJ9LCJ1cGRhdGVFZGl0b3IiOmZhbHNlfQ) diff --git a/docs/zh/ros/raspberrypi_installation.md b/docs/zh/ros/raspberrypi_installation.md index c5e4b381105..0f548198102 100644 --- a/docs/zh/ros/raspberrypi_installation.md +++ b/docs/zh/ros/raspberrypi_installation.md @@ -9,7 +9,7 @@ ## 安装 -Follow [this guide](https://wiki.ros.org/ROSberryPi/Installing%20ROS%20Indigo%20on%20Raspberry%20Pi) for the actual installation of ROS Indigo. 注意:安装 "ROS-Comm" 变体。 桌面变体太臃肿了。 +Follow [this guide](https://wiki.ros.org/ROSberryPi/Installing%20ROS%20Indigo%20on%20Raspberry%20Pi) for the actual installation of ROS Indigo. 注意:安装 "ROS-Comm" 变体。桌面变体太臃肿了。 ### 安装程序包时出错 diff --git a/docs/zh/ros2/index.md b/docs/zh/ros2/index.md index a3990c420d3..a54814cbc24 100644 --- a/docs/zh/ros2/index.md +++ b/docs/zh/ros2/index.md @@ -6,15 +6,12 @@ 小提示 PX4 开发团队强烈建议您使用此 ROS 版本,或将现有系统迁移至此 ROS 版本! -这是最新版本的 [ROS](https://www.ros.org/)(机器人操作系统)。 -它在 ROS “1” 的基础上进行了显著改进,尤其能够实现与 PX4 更深度、更低延迟的集成。 +这是最新版本的 [ROS](https://www.ros.org/)(机器人操作系统)。它在 ROS “1” 的基础上进行了显著改进,尤其能够实现与 PX4 更深度、更低延迟的集成。 ::: -ROS的优势在于拥有活跃的开发者生态系统 —— 该生态系统致力于解决各类常见的机器人技术问题,同时还能调用其他为 Linux 系统编写的软件库。 -例如,它可以用于 [计算机试图](../computer_vision/index.md) 解决问题。 +ROS的优势在于拥有活跃的开发者生态系统 —— 该生态系统致力于解决各类常见的机器人技术问题,同时还能调用其他为 Linux 系统编写的软件库。例如,它可以用于 [计算机试图](../computer_vision/index.md) 解决问题。 -ROS 2 能够实现与 PX4 极深度的集成,你可以在 ROS 2 中创建飞行模式,这些模式与 PX4 内部原生飞行模式毫无区别;同时还能以高速率直接读取和写入 PX4 内部的 uORB 主题。 -(尤其)建议在以下场景中使用:从伴飞计算机进行控制与通信(且低延迟至关重要时)、需借助 Linux 系统的现有库时,或编写新的高级飞行模式时。 +ROS 2 能够实现与 PX4 极深度的集成,你可以在 ROS 2 中创建飞行模式,这些模式与 PX4 内部原生飞行模式毫无区别;同时还能以高速率直接读取和写入 PX4 内部的 uORB 主题。(尤其)建议在以下场景中使用:从伴飞计算机进行控制与通信(且低延迟至关重要时)、需借助 Linux 系统的现有库时,或编写新的高级飞行模式时。 Communication between ROS 2 and PX4 can leverage two independent middlewares: diff --git a/docs/zh/ros2/multi_vehicle.md b/docs/zh/ros2/multi_vehicle.md index 96bc4a1ceed..c5dde4686ee 100644 --- a/docs/zh/ros2/multi_vehicle.md +++ b/docs/zh/ros2/multi_vehicle.md @@ -1,19 +1,17 @@ # 使用 ROS 2 的多载具模拟 -[XRCE-DDS](../middleware/uxrce_dds.md)支持多个客户端通过 UDP 协议连接到同一个代理。 -这在模拟中特别有用,因为只有一个代理需要启动。 +[XRCE-DDS](../middleware/uxrce_dds.md)支持多个客户端通过 UDP 协议连接到同一个代理。这在模拟中特别有用,因为只有一个代理需要启动。 ## 设置和要求 唯一的要求是 -- 能够在不依赖 ROS 2 的情况下,使用所需的仿真器([Gazebo](../sim_gazebo_gz/multi_vehicle_simulation.md), [Gazebo Classic](../sim_gazebo_classic/multi_vehicle_simulation.md#multiple-vehicle-with-gazebo-classic), [FlightGear](../sim_flightgear/multi_vehicle.md) and [JMAVSim](../sim_jmavsim/multi_vehicle.md))运行多载具模拟 [multi-vehicle simulation](../simulation/multi-vehicle-simulation.md) 。 +- To be able to run [multi-vehicle simulation](../simulation/multi-vehicle-simulation.md) without ROS 2 with the desired simulator ([Gazebo](../sim_gazebo_gz/multi_vehicle_simulation.md), [Gazebo Classic](../sim_gazebo_classic/multi_vehicle_simulation.md#multiple-vehicle-with-gazebo-classic), [FlightGear](../sim_flightgear/multi_vehicle.md) and [SIH](../sim_sih/index.md#multi-vehicle-simulation)). - 能够在单一载具模拟中使用 [ROS 2](../ros2/user_guide.md) ## 工作原理 -在模拟中,每个 PX4 实例都会获得一个唯一的`px4_instance`编号,编号从`0`开始。 -该值用于为 [UXRCE_DDS_KEY](../advanced_config/parameter_reference.md#UXRCE_DDS_KEY)分配一个唯一值: +在模拟中,每个 PX4 实例都会获得一个唯一的`px4_instance`编号,编号从`0`开始。该值用于为 [UXRCE_DDS_KEY](../advanced_config/parameter_reference.md#UXRCE_DDS_KEY)分配一个唯一值: ```sh 参数设置UXRCE_DDS_KEY $((px4_instance+1)) @@ -23,18 +21,17 @@ 通过这种方式, `UXRCE_DDS_KEY` 将始终与 [MAV_SYS_ID] 保持一致(../advanced_config/parameter_reference.md#MAV_SYS_ID) ::: -此外,当 `px4_instance` 大于 0 时,会添加一个格式为 `px4_$px4_instance` 的唯一 ROS 2[namespace prefix](../middleware/uxrce_dds.md#customizing-the-namespace): +Moreover, when `px4_instance` is greater than zero, a unique ROS 2 [namespace prefix](../middleware/uxrce_dds.md#customizing-the-namespace) in the form `uav_$px4_instance` is added: ```sh -uxrce_dds_ns="-n px4_$px4_instance" +uxrce_dds_ns="-n uav_$px4_instance" ``` :::info 环境变量`PX4_UXRCE_DDS_NS` 若已设置,将覆盖上文所述的命名空间行为。 ::: -第一个实例(`px4_instance=0`)没有额外的命名空间,此举是为了与真实载具上 xrce-dds 客户端的默认行为保持一致。 -这种不匹配可以通过手动使用 `PX4_UXRCE_DDS_NS` 来修复,或者通过从索引 `1` 中添加车辆而不是 `0` (这是Gazebo Classic的 [sitl_multiple_run.sh](https://github.com/PX4/PX4-Autopilot/blob/main/Tools/simulation/gazebo-classic/sitl_multiple_run.sh) 的默认行为)。 +第一个实例(`px4_instance=0`)没有额外的命名空间,此举是为了与真实载具上 xrce-dds 客户端的默认行为保持一致。这种不匹配可以通过手动使用 `PX4_UXRCE_DDS_NS` 来修复,或者通过从索引 `1` 中添加车辆而不是 `0` (这是Gazebo Classic的 [sitl_multiple_run.sh](https://github.com/PX4/PX4-Autopilot/blob/main/Tools/simulation/gazebo-classic/sitl_multiple_run.sh) 的默认行为)。 模拟中的默认客户端配置概述如下: @@ -42,14 +39,12 @@ uxrce_dds_ns="-n px4_$px4_instance" | ------------------ | -------------- | ---------------- | --------------------- | | not provided | 0 | `px4_instance+1` | none | | provided | 0 | `px4_instance+1` | `PX4_UXRCE_DDS_NS` | -| not provided | > 0 | `px4_instance+1` | `px4_${px4_instance}` | +| not provided | > 0 | `px4_instance+1` | `uav_${px4_instance}` | | provided | > 0 | `px4_instance+1` | `PX4_UXRCE_DDS_NS` | ## Adjusting `VehicleCommand` routing fields -PX4 只在他们的 `target_system` 字段为 0`(路由通信) 或与`MAV_SYS_ID` 一致时,才接受[VehicleCommand](../msg_docs/VehicleCommand.md)。 -在所有其他情况下,信息都被忽视。 -因此,当 ROS 2 节点需向 PX4 发送`VehicleCommand`消息时,必须确保消息中填写了合适的`target_system\`字段值。 +PX4 只在他们的 `target_system` 字段为 0`(路由通信) 或与`MAV_SYS_ID` 一致时,才接受[VehicleCommand](../msg_docs/VehicleCommand.md)。在所有其他情况下,信息都被忽视。因此,当 ROS 2 节点需向 PX4 发送`VehicleCommand`消息时,必须确保消息中填写了合适的`target_system\`字段值。 例如,若你想向 `px4_instance=2` 的第三台飞行器发送指令,则需要在所有`VehicleCommand`消息中设置 `target_system=3`。 diff --git a/docs/zh/ros2/offboard_control.md b/docs/zh/ros2/offboard_control.md index 438793fff48..153ab974c8f 100644 --- a/docs/zh/ros2/offboard_control.md +++ b/docs/zh/ros2/offboard_control.md @@ -2,8 +2,7 @@ 以下的 C++ 示例展示了如何在[offboard mode](../flight_modes/offboard.md) 中从 ROS 2 节点进行多轴位置控制。 -示例将首先发送设置点、进入offboard模式、解锁、起飞至5米,并悬停等待。 -虽然简单,但它显示了如何使用offboard控制以及如何向无人机发送指令。 +示例将首先发送设置点、进入offboard模式、解锁、起飞至5米,并悬停等待。虽然简单,但它显示了如何使用offboard控制以及如何向无人机发送指令。 该内容已在搭载 ROS 2 Foxy 与 PX4 v1.14 的 Ubuntu 20.04 系统上完成测试。 @@ -16,8 +15,7 @@ _Offboard_ control is dangerous. ROS 与 PX4 存在若干不同的预设(假设),尤其是在 [frame conventions](../ros/external_position_estimation.md#reference-frames-and-ros) 当主题发布或订阅时,坐标系类型之间没有隐含转换! -这个例子按照 PX4 的预期在NED坐标系下发布位置。 -若要订阅来自在不同框架内发布的节点的数据(例如ENU, 这是ROS/ROS 2中的标准参考框架),使用[frame_transforms](https://github.com/PX4/px4_ros_com/blob/main/src/lib/frame_transforms.cpp)库中的辅助函数。 +这个例子按照 PX4 的预期在NED坐标系下发布位置。若要订阅来自在不同框架内发布的节点的数据(例如ENU, 这是ROS/ROS 2中的标准参考框架),使用[frame_transforms](https://github.com/PX4/px4_ros_com/blob/main/src/lib/frame_transforms.cpp)库中的辅助函数。 ::: ## 小试身手 @@ -27,8 +25,7 @@ ROS 与 PX4 存在若干不同的预设(假设),尤其是在 [frame conven After that we can follow a similar set of steps to those in [ROS 2 User Guide > Running an example (optional)](../ros2/user_guide.md#running-an-example-optional) to run the example. :::tip -运行 ROS 2 节点前,请确保 QGC已连接到 PX4。 -之所以需要这样做,是因为默认情况下,若未连接地面控制站(QGC)或已建立的RC连接,飞行器无法解锁(这一机制可确保始终存在重新获得手动控制权的途径)。 +运行 ROS 2 节点前,请确保 QGC已连接到 PX4。之所以需要这样做,是因为默认情况下,若未连接地面控制站(QGC)或已建立的RC连接,飞行器无法解锁(这一机制可确保始终存在重新获得手动控制权的途径)。 ::: 构建并运行示例: @@ -105,9 +102,7 @@ After that we can follow a similar set of steps to those in [ROS 2 User Guide > PX4 默认情况下将此示例中使用的所有消息以ROS为话题发布(详见 [dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml))。 ::: -PX4 要求,飞行器需先持续接收 OffboardControlMode(离板控制模式)消息,之后才能在离板模式下解锁(arm),或在飞行过程中切换至离板模式。 -此外,若 OffboardControlMode(离板控制模式)消息的数据流速率降至约 2Hz 以下,PX4 将会退出离板模式。 -该行为在ROS 2 节点的主循环中实现的,如下所示: +PX4 要求,飞行器需先持续接收 OffboardControlMode(离板控制模式)消息,之后才能在离板模式下解锁(arm),或在飞行过程中切换至离板模式。此外,若 OffboardControlMode(离板控制模式)消息的数据流速率降至约 2Hz 以下,PX4 将会退出离板模式。该行为在ROS 2 节点的主循环中实现的,如下所示: ```cpp auto timer_callback = [this]() -> void { @@ -132,16 +127,12 @@ auto timer_callback = [this]() -> void { timer_ = this->create_wall_timer(100ms, timer_callback); ``` -循环运行在一个100毫秒计时器。 -在最初的 10 个循环中,它会调用 `publish_offboard_control_mode()` 和 `publish_trajectory_setpoint()` 这两个函数,向 PX4 发送 OffboardControlMode[OffboardControlMode](../msg_docs/OffboardControlMode.md) 和 [TrajectorySetpoint](../msg_docs/TrajectorySetpoint.md) 消息。 +循环运行在一个100毫秒计时器。在最初的 10 个循环中,它会调用 `publish_offboard_control_mode()` 和 `publish_trajectory_setpoint()` 这两个函数,向 PX4 发送 OffboardControlMode[OffboardControlMode](../msg_docs/OffboardControlMode.md) 和 [TrajectorySetpoint](../msg_docs/TrajectorySetpoint.md) 消息。 OffboardControlMode消息会持续发送,以便 PX4 切换到离板模式后允许解锁;而 TrajectorySetpoint消息会被忽略(直到载具处于离板模式) -10 个循环后,会调用 publish_vehicle_command() 函数切换至离板模式,并调用 arm() 函数对载具进行解锁。 -在载具解锁并和切换模式后,它将开始跟踪位置设定值。 -在每个周期内仍然发送设定值,确保载具不会切换出offboard模式。 +10 个循环后,会调用 publish_vehicle_command() 函数切换至离板模式,并调用 arm() 函数对载具进行解锁。在载具解锁并和切换模式后,它将开始跟踪位置设定值。在每个周期内仍然发送设定值,确保载具不会切换出offboard模式。 -publish_offboard_control_mode() 和 publish_trajectory_setpoint() 这两个方法的实现代码如下所示。 -这些方法会分别发布到 PX4 的 [OffboardControlMode](../msg_docs/OffboardControlMode.md和 [TrajectorySetpoint](../msg_docs/TrajectorySetpoint.md) 消息。 +publish_offboard_control_mode() 和 publish_trajectory_setpoint() 这两个方法的实现代码如下所示。这些方法会分别发布到 PX4 的 [OffboardControlMode](../msg_docs/OffboardControlMode.md和 [TrajectorySetpoint](../msg_docs/TrajectorySetpoint.md) 消息。 The `OffboardControlMode` is required in order to inform PX4 of the _type_ of offboard control being used. 此处我们仅使用位置控制,因此将 `position` 字段设为`true`,而所有其他字段均设为 `false`。 @@ -166,8 +157,7 @@ Power } ``` -`TrattorySettpoint` 提供了位置设定点。 -在这种情况下,`x`、`y`、`z`和`yaw`字段的值是硬编码为特定数值的。 但它们可以根据算法动态更新,甚至可以通过订阅回调函数来从另一个节点进行更新。 +`TrattorySettpoint` 提供了位置设定点。在这种情况下,`x`、`y`、`z`和`yaw`字段的值是硬编码为特定数值的。 但它们可以根据算法动态更新,甚至可以通过订阅回调函数来从另一个节点进行更新。 ```cpp /** @@ -185,9 +175,7 @@ void OffboardControl::publish_trajectory_setpoint() } ``` -`publish_vehicle_command()` 将带有命令的 [VehicleCommand](../msg_docs/VehicleCommand.md)消息发送给载具。 -我们使用上面的方法将模式切换为 offboard 模式,同时也在 arm() 函数中用它来对载具进行解锁。 -我们在此示例中不调用 `disarm()` ,但它也用于执行此功能。 +`publish_vehicle_command()` 将带有命令的 [VehicleCommand](../msg_docs/VehicleCommand.md)消息发送给载具。我们使用上面的方法将模式切换为 offboard 模式,同时也在 arm() 函数中用它来对载具进行解锁。我们在此示例中不调用 `disarm()` ,但它也用于执行此功能。 ```cpp /** @@ -213,8 +201,7 @@ void OffboardControl::publish_vehicle_command(uint16_t command, float param1, fl ``` :::info -[VehicleCommand](../msg_docs/VehicleCommand.md) 是命令PX4的最简单和最高效的方式之一。 通过订阅 [VehicleCommandAck](../msg_docs/VehicleCommandAck.md),您也可以确认设置特定命令是否成功。 -参数字段和 指令字段对应于 [MAVLink commands](https://mavlink.io/en/messages/common.html#mav_commands)以及他们的参数值 +[VehicleCommand](../msg_docs/VehicleCommand.md) 是命令PX4的最简单和最高效的方式之一。 通过订阅 [VehicleCommandAck](../msg_docs/VehicleCommandAck.md),您也可以确认设置特定命令是否成功。参数字段和 指令字段对应于 [MAVLink commands](https://mavlink.io/en/messages/common.html#mav_commands)以及他们的参数值 ::: ## 另见 diff --git a/docs/zh/ros2/px4_ros2_control_interface.md b/docs/zh/ros2/px4_ros2_control_interface.md index ef915975318..be2a6bdca24 100644 --- a/docs/zh/ros2/px4_ros2_control_interface.md +++ b/docs/zh/ros2/px4_ros2_control_interface.md @@ -6,25 +6,20 @@ Experimental 在撰写本文时,PX4 ROS 2 控制接口的部分内容仍处于实验阶段,因此可能会发生变动: -- ROS 2 模式中用于定义模式的架构及核心接口在很大程度上已趋于稳定,且会在CI中进行测试 - 相比当前状态下的离板模式,该代码库具有显著优势 -- 仅有少数几种设定点类型已趋于稳定。(其余设定点类型仍在开发中) - 您可能需要使用内部的 PX4 主题,这些主题可能不会随着时间的推移而保持与后方兼容。 +- ROS 2 模式中用于定义模式的架构及核心接口在很大程度上已趋于稳定,且会在CI中进行测试相比当前状态下的离板模式,该代码库具有显著优势 +- 仅有少数几种设定点类型已趋于稳定。(其余设定点类型仍在开发中)您可能需要使用内部的 PX4 主题,这些主题可能不会随着时间的推移而保持与后方兼容。 - 该 API没有完整的文档 ::: The [PX4 ROS 2 Interface Library](../ros2/px4_ros2_interface_lib.md) is a C++ library (with Python bindings) that simplifies controlling PX4 from ROS 2. -开发者可使用该库创建并动态注册以 ROS 2 编写的模式。 -这些模式会动态注册到 PX4 中,并且对于地面站或其他外部系统而言,它们看起来就像是 PX4 的一部分。 +开发者可使用该库创建并动态注册以 ROS 2 编写的模式。这些模式会动态注册到 PX4 中,并且对于地面站或其他外部系统而言,它们看起来就像是 PX4 的一部分。 They can even replace the default modes in PX4 with enhanced ROS 2 versions, falling back to the original version if the ROS 2 mode fails. -该库还提供了用于发送不同类型设定点的类,其涵盖范围从高层级的导航任务一直到直接的执行器控制。 -这些类对 PX4 所使用的内部设定点进行了抽象处理,因此可用于为未来的 PX4 和 ROS 版本提供统一的 ROS 2 接口。 +该库还提供了用于发送不同类型设定点的类,其涵盖范围从高层级的导航任务一直到直接的执行器控制。这些类对 PX4 所使用的内部设定点进行了抽象处理,因此可用于为未来的 PX4 和 ROS 版本提供统一的 ROS 2 接口。 -PX4 ROS 2 模式相较于 PX4 内部模式,更易于实现和维护,并且在处理能力与既有代码库资源方面,能为开发者提供更丰富的支持。 -除非该模式属于安全关键型、对时序有严格要求或需要极高的更新速率,或者你的飞行器没有搭载伴随计算机,否则你应优先[考虑使用 PX4 ROS 2 模式,而非 PX4 内部模式](../concept/flight_modes.md#internal-vs-external-modes)。 +PX4 ROS 2 模式相较于 PX4 内部模式,更易于实现和维护,并且在处理能力与既有代码库资源方面,能为开发者提供更丰富的支持。除非该模式属于安全关键型、对时序有严格要求或需要极高的更新速率,或者你的飞行器没有搭载伴随计算机,否则你应优先[考虑使用 PX4 ROS 2 模式,而非 PX4 内部模式](../concept/flight_modes.md#internal-vs-external-modes)。 :::tip If you want to use Python, check out the [examples in the repository](https://github.com/Auterion/px4-ros2-interface-lib/tree/main/examples/python). @@ -49,8 +44,7 @@ You are welcome to add and contribute missing classes. 使用接口库定义的模式具有以下特性: - 模式是一种组件,它可以向载具发送设定值以控制其运动(例如速度指令或直接执行器指令)。 -- 模式在激活状态下会选择一种设定值类型并发送该设定值。 - 它能够在多种设定值类型之间进行切换。 +- 模式在激活状态下会选择一种设定值类型并发送该设定值。它能够在多种设定值类型之间进行切换。 - 一种模式无法激活其他模式,其必须由以下对象激活:用户(通过RC/GCS)、处于故障保护状态下的飞控、mode executor_,或其他某种外部系统。 - 具有一个由GCS显示的名称。 - 可配置其模式要求(例如,要求具备有效的位置估算值) @@ -60,17 +54,12 @@ You are welcome to add and contribute missing classes. #### 模式执行器 模式执行器是用于调度模式的可选组件。 -例如,用于自定义有效载荷投放或测绘模式的模式执行器,可能会先触发起飞,随后切换至该自定义模式,待模式完成后再触发RTL。 +For example, the mode executor for a custom payload delivery or survey mode might first trigger a take-off, then switch to the custom mode, and when that completes trigger a Return. 具体而言,它具有以下特性: -- 模式执行器是一种可选组件,其层级比模式高一级。 - 它是一种状态机,能够激活模式并等待模式完成。 -- 它仅能在负责状态下执行此操作。 - 为此,一个执行器恰好拥有一个_owned mode_(且一个模式最多只能被一个执行器拥有)。 - 该模式可作为执行器的激活触发条件:当用户选择此模式时,其所属的执行器会被激活,进而能够选择任意模式。 - 它会一直处于管控状态,直至用户(通过遥控器或从地面控制站)切换模式,或故障保护机制触发模式切换。 - 若故障保护状态解除,执行器将重新激活。 +- 模式执行器是一种可选组件,其层级比模式高一级。它是一种状态机,能够激活模式并等待模式完成。 +- 它仅能在负责状态下执行此操作。为此,一个执行器恰好拥有一个_owned mode_(且一个模式最多只能被一个执行器拥有)。该模式可作为执行器的激活触发条件:当用户选择此模式时,其所属的执行器会被激活,进而能够选择任意模式。它会一直处于管控状态,直至用户(通过遥控器或从地面控制站)切换模式,或故障保护机制触发模式切换。若故障保护状态解除,执行器将重新激活。 - 这允许多个执行器共存。 - 执行器无法激活其他执行器。 - 在该库中,模式执行器始终需结合自定义模式来实现。 @@ -78,8 +67,7 @@ You are welcome to add and contribute missing classes. ::: info - 这些定义确保用户可在任意时刻通过RC或GCS发送模式切换指令,从而夺回对自定义模式或执行器的控制权。 -- 模式执行器对用户而言是透明的。 - 它通过所属模式被间接选择并激活,因此该模式应相应地命名。 +- 模式执行器对用户而言是透明的。它通过所属模式被间接选择并激活,因此该模式应相应地命名。 ::: @@ -92,15 +80,13 @@ You are welcome to add and contribute missing classes. - _Disabling auto-disarm_. 这允许着陆,然后再次起飞(例如释放有效载荷)。 - _Ability to defer non-essential failsafes_. - 这使得执行器能够执行某项操作,且不会被非关键故障保护中断。 - 例如,忽略低电量故障保护(机制),以便绞车操作能够完成。 + 这使得执行器能够执行某项操作,且不会被非关键故障保护中断。例如,忽略低电量故障保护(机制),以便绞车操作能够完成。 ### 与离板控制的比较 上述概念提供了一些优点,而不是传统的[离板控制](../ros/offboard_control.md): -- 多个节点或应用程序可以共存,甚至能同时运行。 - 但在特定时刻,仅能有一个节点对载具进行控制,且该节点的定义是明确的。 +- 多个节点或应用程序可以共存,甚至能同时运行。但在特定时刻,仅能有一个节点对载具进行控制,且该节点的定义是明确的。 - 模式具有独特的名称,并且可在GCS中显示 / 选择。 - 模式与故障保护状态机及解锁检查功能相集成。 - 可发送的设定值类型定义明确。 @@ -120,8 +106,7 @@ You are welcome to add and contribute missing classes. ``` 提示信息 - 为确保兼容性,请使用 PX4、px4_msgs(PX4 消息包)及该库的最新 main 分支。 - 另请参阅 [here](https://github.com/Auterion/px4-ros2-interface-lib#compatibility-with-px4) + 为确保兼容性,请使用 PX4、px4_msgs(PX4 消息包)及该库的最新 main 分支。另请参阅 [here](https://github.com/Auterion/px4-ros2-interface-lib#compatibility-with-px4) ::: @@ -194,8 +179,7 @@ You are welcome to add and contribute missing classes. ![QGC Modes](../../assets/middleware/ros2/px4_ros2_interface_lib/qgc_modes.png) -10. 选择该模式,确保你拥有手动控制源(物理或虚拟操纵杆),并为载具解锁 - 然后模式将激活,它将打印以下输出: +10. 选择该模式,确保你拥有手动控制源(物理或虚拟操纵杆),并为载具解锁然后模式将激活,它将打印以下输出: ```sh [DEBUG] [example_mode_manual]: 模式“我的手动模式” 已激活 @@ -205,8 +189,7 @@ You are welcome to add and contribute missing classes. ## 如何使用代码库 -以下各节介绍该库提供的特定功能。 -此外,任何其他PX4主题都可以订阅或发布。 +以下各节介绍该库提供的特定功能。此外,任何其他PX4主题都可以订阅或发布。 ### 模式类定义 @@ -255,14 +238,11 @@ private: ``` - `[1]`: 首先创建一个从 [`px4_ros2::ModeBase`](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1ModeBase.html)继承的类。 -- `[2]`: 在构造函数中,我们传递模式名称。 这也使我们能够配置一些其他内容,例如替换飞行控制器的内置模式。 -- `[3]`:我们在此处创建后续想要使用的所有对象。 - 这可以是 RC 输入、设置点类型(s)或遥测数据。 `*this` 作为`Context`传递给每个对象,将对象与模式联系起来。 -- `[4]`:每当该模式处于激活状态时,此方法会定期被调用(更新频率取决于设定值类型)。 - 我们可以在这里开展工作并产生一个新的设定点。 +- `[2]`: 在构造函数中,我们传递模式名称。这也使我们能够配置一些其他内容,例如替换飞行控制器的内置模式。 +- `[3]`:我们在此处创建后续想要使用的所有对象。这可以是 RC 输入、设置点类型(s)或遥测数据。 `*this` 作为`Context`传递给每个对象,将对象与模式联系起来。 +- `[4]`:每当该模式处于激活状态时,此方法会定期被调用(更新频率取决于设定值类型)。我们可以在这里开展工作并产生一个新的设定点。 -创建此模式的实例后, `mode->doRegister()` 必须被调用,在飞行控制器中进行实际注册,如果失败则返回 `false` 。 -如果使用模式执行器,`doRegister()`必须调用模式执行器而不是模式。 +创建此模式的实例后, `mode->doRegister()` 必须被调用,在飞行控制器中进行实际注册,如果失败则返回 `false` 。如果使用模式执行器,`doRegister()`必须调用模式执行器而不是模式。 ### 模式执行器类定义 @@ -336,17 +316,13 @@ private: - `[1]`: 首先创建一个继承 [`px4_ros2::ModeExecutorBase`](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1ModeExecutorBase.html)。 - `[2]`: 构造函数采用与执行器相关联的自定义模式,并传递给`ModeExecutorBase`的构造函数。 - `[3]`: 我们为想要运行的状态定义一个枚举。 -- `[4]`: `onActivate` 在执行器激活时被调用。 此时,我们可以开始遍历这些状态了。 - 你是如何操作的,在这个示例中使用 `runState` 方法来执行下一个状态。 -- `[5]`: 在切换到状态时,我们会调用 `ModeExecutorBase` 中的异步方法来启动所需的模式:`run`, `eff`、`rtl`、“等等”。 - 这些方法被传递了一个被要求完成的函数; 回调提供一个 `Result` 参数,告诉您操作是否成功。 - 回调运行下一个成功状态。 +- `[4]`: `onActivate` 在执行器激活时被调用。此时,我们可以开始遍历这些状态了。你是如何操作的,在这个示例中使用 `runState` 方法来执行下一个状态。 +- `[5]`: 在切换到状态时,我们会调用 `ModeExecutorBase` 中的异步方法来启动所需的模式:`run`, `eff`、`rtl`、“等等”。这些方法被传递了一个被要求完成的函数; 回调提供一个 `Result` 参数,告诉您操作是否成功。回调运行下一个成功状态。 - `[6]`: 我们使用 `scheduleMode()` 方法来启动执行者"拥有模式", 遵循与其他状态处理器相同的模式。 ### 设置点类型 -模式可选择其用于控制载具的设定值类型。 -所用类型还界定了与不同类型载具的兼容性。 +模式可选择其用于控制载具的设定值类型。所用类型还界定了与不同类型载具的兼容性。 以下章节提供了支持的设置点类型列表: @@ -371,8 +347,7 @@ private: 当前,此设定点类型仅支持多旋翼飞行器。 ::: -可通过[`px4_ros2::MulticopterGotoSetpointType`](https://github.com/Auterion/px4-ros2-interface-lib/blob/main/px4_ros2_cpp/include/px4_ros2/control/setpoint_types/multicopter/goto.hpp) 设定点类型,对位置设定点以及(可选的)航向设定点进行平滑控制。 -设定点类型会被传输至飞控主模块(FMU),该模块基于采用时间最优、最大加加速度轨迹构建的位置及航向平滑器。 +可通过[`px4_ros2::MulticopterGotoSetpointType`](https://github.com/Auterion/px4-ros2-interface-lib/blob/main/px4_ros2_cpp/include/px4_ros2/control/setpoint_types/multicopter/goto.hpp) 设定点类型,对位置设定点以及(可选的)航向设定点进行平滑控制。设定点类型会被传输至飞控主模块(FMU),该模块基于采用时间最优、最大加加速度轨迹构建的位置及航向平滑器。 还有一个 [`px4_ros2::MulticopterGotoGlobalSetpointType`](https://github.com/Auterion/px4-ros2-interface-lib/blob/main/px4_ros2_cpp/include/px4_ros2/control/setpoint_types/multicopter/goto.hpp), 该类支持在全局坐标系下发送设定点。 @@ -383,8 +358,7 @@ const Eigen::Vector3f target_position_m{-10.F, 0.F, 3.F}; _goto_setpoint->update(target_position_m); ``` -在这种情况下,航向将保持不受控制的状态。 -若要额外控制航向,可将其指定为第二个输入参数: +在这种情况下,航向将保持不受控制的状态。若要额外控制航向,可将其指定为第二个输入参数: ```cpp const Eigen:::Vector3f target_position_m{-10.F, 0.F, 3.F}; @@ -394,9 +368,7 @@ _goto_setpoint->update( heading_rad); ``` -“前往设定值”(go-to setpoint)的一项额外功能是,可对底层平滑控制器的速度限制进行动态控制(即对最大水平和平动速度、最大垂直平动速度以及航向速率进行动态控制)。 -若如上文所述未指定(该参数),则平滑控制器将默认采用设备的默认最大值(通常设定为其物理极限值) -平滑控制器仅会降低速度限制,绝不会提高速度限制。 +“前往设定值”(go-to setpoint)的一项额外功能是,可对底层平滑控制器的速度限制进行动态控制(即对最大水平和平动速度、最大垂直平动速度以及航向速率进行动态控制)。若如上文所述未指定(该参数),则平滑控制器将默认采用设备的默认最大值(通常设定为其物理极限值)平滑控制器仅会降低速度限制,绝不会提高速度限制。 ```cpp _goto_setpoint->update( @@ -426,13 +398,11 @@ _goto_setpoint->update( 此设定值类型支持固定翼飞行器,以及处于固定翼模式下的垂直起降飞行器(VTOL)。 ::: -使用[`px4_ros2::FwLateralLongitudinalSetpointType`](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1FwLateralLongitudinalSetpointType.html)直接控制固定翼飞行器的横向与纵向动力学特性,即分别控制其侧向运动(转弯 / 倾斜)和前向 / 垂直运动(加速及爬升 / 下降)。 -这个设置点被传输到 PX4 [_FwLateralLongitudinalControl_ module](../modules/modules_controller.md#fw-lat-lon-control),该模块会对横向与纵向输入进行解耦处理,同时确保不超出飞行器的各项限制范围。 +使用[`px4_ros2::FwLateralLongitudinalSetpointType`](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1FwLateralLongitudinalSetpointType.html)直接控制固定翼飞行器的横向与纵向动力学特性,即分别控制其侧向运动(转弯 / 倾斜)和前向 / 垂直运动(加速及爬升 / 下降)。这个设置点被传输到 PX4 [_FwLateralLongitudinalControl_ module](../modules/modules_controller.md#fw-lat-lon-control),该模块会对横向与纵向输入进行解耦处理,同时确保不超出飞行器的各项限制范围。 为了控制载具,必须提供至少一个横向**和**一个纵向设定值: -1. 在纵向输入中:必须至少有一个 “高度”(altitude)或 “高度速率”(height_rate)为有限值,才能实现垂直运动控制。 - 若二者均设为 NAN,则载具将保持当前高度。 +1. 在纵向输入中:必须至少有一个 “高度”(altitude)或 “高度速率”(height_rate)为有限值,才能实现垂直运动控制。若二者均设为 NAN,则载具将保持当前高度。 2. 在横向输入中:“航线角”(course)、“空速方向”(airspeed_direction)或 “横向加速度”(lateral_acceleration)这三者中,至少有一个必须为有限值。 关于可控参数的详细说明,请参考消息定义([FixedWingLateralSetpoint](../msg_docs/FixedWingLateralSetpoint.md) 和 [FixedWingLongitudinalSetpoint](../msg_docs/FixedWingLongitudinalSetpoint.md))。 @@ -449,9 +419,7 @@ const float course = 0.F; // due North _fw_later_longitudinal_setpoint->updateWAltitude(altyde_msl, course); ``` -PX4 会利用这些设定值计算出横滚角(roll angle)、俯仰角(pitch angle)和油门(throttle)设定值,并将其发送至底层控制器。 -需注意,使用此方法时,预期的指令飞行会相对平缓 / 不激进。 -此操作按如下方式执行: +PX4 会利用这些设定值计算出横滚角(roll angle)、俯仰角(pitch angle)和油门(throttle)设定值,并将其发送至底层控制器。需注意,使用此方法时,预期的指令飞行会相对平缓 / 不激进。此操作按如下方式执行: - 横向控制输出: @@ -491,13 +459,10 @@ _fw_lateral_longitudinal_setpoint->updateWithAltitude(altitude_msl, ##### 使用设定值结构体实现完全控制 -为实现充分的灵活性,你可以创建并传递一个[`FwLateralLongitudinalSetpoint` ](https://auterion.github.io/px4-ros2-interface-lib/structpx4__ros2_1_1FwLateralLongitudinalSetpoint.html) 结构体。 -每个字段都使用 `std::optional` 模板。 +为实现充分的灵活性,你可以创建并传递一个[`FwLateralLongitudinalSetpoint` ](https://auterion.github.io/px4-ros2-interface-lib/structpx4__ros2_1_1FwLateralLongitudinalSetpoint.html) 结构体。每个字段都使用 `std::optional` 模板。 :::tip -若同时设置了航线角(course)和空速方向(airspeed direction),则空速方向优先,航线角不进行控制。 -若航线角或空速方向中任意一个为有限值,则横向加速度会被视为前馈。 -若同时设置了高度和高度速率,则高度速率优先,高度不进行控制。 +若同时设置了航线角(course)和空速方向(airspeed direction),则空速方向优先,航线角不进行控制。若航线角或空速方向中任意一个为有限值,则横向加速度会被视为前馈。若同时设置了高度和高度速率,则高度速率优先,高度不进行控制。 ::: ```cpp @@ -519,8 +484,7 @@ _fw_lateral_longitudinal_sett->upate(settpoint_ ##### 高级配置(可选) -你还可以传递一个[`FwControlConfiguration`](https://auterion.github.io/px4-ros2-interface-lib/structpx4__ros2_1_1FwControlConfiguration.html)结构体以及设定值,以覆盖默认的控制器设置和约束条件,例如俯仰角限制、油门限制以及目标下降 / 爬升速率。 -这是针对高级用户的: +你还可以传递一个[`FwControlConfiguration`](https://auterion.github.io/px4-ros2-interface-lib/structpx4__ros2_1_1FwControlConfiguration.html)结构体以及设定值,以覆盖默认的控制器设置和约束条件,例如俯仰角限制、油门限制以及目标下降 / 爬升速率。这是针对高级用户的: ```cpp px4_ros2::FwLateralLongitudinalSetpoint setpoint_s; @@ -539,22 +503,16 @@ config_s.withThrottleLimits(0.4F, 0.6F); _fw_lateral_longitudinal_setpoint->update(setpoint_s, config_s); ``` -所有配置字段都定义为 `std::optional`。 -未设置的值将默认采用 PX4 的配置。 -更多关于配置选项的信息,请参阅 [LateralControlConfiguration](../msg_docs/LateralControlConfiguration.md)和 [FixedWingLongitudinalConfiguration](../msg_docs/LongitudinalControlConfiguration.md)。 +所有配置字段都定义为 `std::optional`。未设置的值将默认采用 PX4 的配置。更多关于配置选项的信息,请参阅 [LateralControlConfiguration](../msg_docs/LateralControlConfiguration.md)和 [FixedWingLongitudinalConfiguration](../msg_docs/LongitudinalControlConfiguration.md)。 :::info -为保障安全,PX4 会自动将配置值限制在飞行器的约束范围内。 -例如,油门覆盖值会被限制在 [`FW_THR_MIN`](../advanced_config/parameter_reference.md#FW_THR_MIN) +为保障安全,PX4 会自动将配置值限制在飞行器的约束范围内。例如,油门覆盖值会被限制在 [`FW_THR_MIN`](../advanced_config/parameter_reference.md#FW_THR_MIN) 和[`FW_THR_MAX`](../advanced_config/parameter_reference.md#FW_THR_MAX)之间。 ::: #### 直接执行器控制设定点(DirectActuatorsSetpointType) -可以使用 [px4_ros2::DirectActuatorsSetpointType](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1DirectActuatorsSetpointType.html) 设置点类型直接控制执行器。 -电机和舵机可独立设置。 -请注意,该分配(设置 / 指派)具有载具和配置特定性。 -例如,要控制一架四旋翼飞行器,你需要根据其 [输出配置] (../concept/control_allocation.md)来设置前 4 个电机。 +可以使用 [px4_ros2::DirectActuatorsSetpointType](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1DirectActuatorsSetpointType.html) 设置点类型直接控制执行器。电机和舵机可独立设置。请注意,该分配(设置 / 指派)具有载具和配置特定性。例如,要控制一架四旋翼飞行器,你需要根据其 [输出配置] (../concept/control_allocation.md)来设置前 4 个电机。 :::info 若你想控制的执行器并非用于控制飞行器的运动(例如,而是用于控制有效载荷舵机),请参阅 [below](#controlling-an-independent-actuator-servo)。 @@ -569,11 +527,10 @@ _fw_lateral_longitudinal_setpoint->update(setpoint_s, config_s); ![Rover Control Structure](../../assets/middleware/ros2/px4_ros2_interface_lib/rover_control_structure.svg) :::info -所提供的“highest”设定值将被用于 PX4 机器人模块中,以生成低于该值的设定值(并对其进行覆盖!)。 -这个层次结构有提供有效控制输入的明确规则: +所提供的“highest”设定值将被用于 PX4 机器人模块中,以生成低于该值的设定值(并对其进行覆盖!)。这个层次结构有提供有效控制输入的明确规则: - 提供一个位置集点,**or** -- “左”上的设置点之一(速度 **或** 节点) **和** “右”上的设置点之一(态度、速率 **或** 节点)。 所有“左”和“右”设置点的组合都是有效的。 +- “左”上的设置点之一(速度 **或** 节点) **和** “右”上的设置点之一(态度、速率 **或** 节点)。所有“左”和“右”设置点的组合都是有效的。 为了便于使用,我们以新的 SettpointType 的形式揭示这些有效的组合。 ::: @@ -600,15 +557,14 @@ _fw_lateral_longitudinal_setpoint->update(setpoint_s, config_s); 要在外部飞行模式下控制VTOL,需确保根据当前飞行配置返回正确的设定值类型: -- 多旋翼模式:使用与多旋翼控制兼容的设定值类型。 例如:要么[`MulticopterGotoSetpointType`](#go-to-setpoint-multicoptergotosetpointtype)要么[`TrajectorySetpointType`](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1TrajectorySetpointType.html)。 +- 多旋翼模式:使用与多旋翼控制兼容的设定值类型。例如:要么[`MulticopterGotoSetpointType`](#go-to-setpoint-multicoptergotosetpointtype)要么[`TrajectorySetpointType`](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1TrajectorySetpointType.html)。 - Fixed-wing mode: Use the [`FwLateralLongitudinalSetpointType`](#fw-lateral-longitudinal-setpoint). 只要VTOL在整个外部模式期间始终处于多旋翼模式或固定翼模式中的任意一种,就无需额外处理。 如果您想要在您的外部模式中命令一个 VTAL 过渡,您需要使用 [VTOL API](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1VTOL.html)。 VTAL API具备下达转换指令和查询载具当前状态的功能。 -谨慎使用此 API ! -通过外部下达转换指令时,用户需部分负责确保(飞行器)运行平稳且安全;这与机上转换(例如通过遥控器开关实现)不同,在机上转换模式下,整个过程由 PX4 全权处理。 +谨慎使用此 API !通过外部下达转换指令时,用户需部分负责确保(飞行器)运行平稳且安全;这与机上转换(例如通过遥控器开关实现)不同,在机上转换模式下,整个过程由 PX4 全权处理。 1. 确保你的模式可调用 TrajectorySetpointType(轨迹设定值类型)和 FwLateralLongitudinalSetpointType(固定翼横纵向设定值类型)这两种设定值类型。 2. 在您模式的构造函数中创建 `px4_ros2::VTOL` 的实例。 @@ -631,8 +587,7 @@ _fw_lateral_longitudinal_setpoint->update(setpoint_s, config_s); _fw_lateral_longitudinal_setpoint->updateWithAltitude(NAN, course_sp) ``` - 这将确保转换过程在 PX4 系统内部得到妥善处理。 - 你可以选择性地将一个减速度设定值传递给 computeAccelerationSetpointDuringTransition(),以便在反向转换过程中使用。 + 这将确保转换过程在 PX4 系统内部得到妥善处理。你可以选择性地将一个减速度设定值传递给 computeAccelerationSetpointDuringTransition(),以便在反向转换过程中使用。 要查询载具的当前状态,可在 px4_ros2::VTOL 对象上调用 getCurrentState() 方法。 @@ -644,8 +599,7 @@ _fw_lateral_longitudinal_setpoint->update(setpoint_s, config_s); 1. [Configure the output](../payloads/generic_actuator_control.md#generic-actuator-control-with-mavlink). 2. 在您的模式的构造函数中创建一个实例[px4_ros2::PeripheralActorControls](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1PeripheralActuatorControls.html)。 -3. 调用`set()` 方法以控制执行器 - 此操作可独立于任何活跃的设定点执行。 +3. 调用`set()` 方法以控制执行器此操作可独立于任何活跃的设定点执行。 ### 数传 @@ -670,15 +624,12 @@ _vehicle_local_position->positionXYValid(); ``` :::info -这些主题围绕内部的 PX4 主题提供了一个包装程序,使代码库能够在内部主题发生变化时保持兼容性。 -检查 [px4_ros2/odometry](https://github.com/Auterion/px4-ros2-interface-lib/tree/main/px4_ros2_cpp/include/px4_ros2/odometry) 新主题,当然你也可以使用任何由 PX4 发布的 ROS 2 主题。 +这些主题围绕内部的 PX4 主题提供了一个包装程序,使代码库能够在内部主题发生变化时保持兼容性。检查 [px4_ros2/odometry](https://github.com/Auterion/px4-ros2-interface-lib/tree/main/px4_ros2_cpp/include/px4_ros2/odometry) 新主题,当然你也可以使用任何由 PX4 发布的 ROS 2 主题。 ::: ### 故障保护与模式要求 -每种模式都有一组需求标志。 -这些(需求标志)通常会根据模式语境下所使用的对象自动设置。 -例如,当通过以下代码添加手动控制输入时,手动控制的需求标志会被设置: +每种模式都有一组需求标志。这些(需求标志)通常会根据模式语境下所使用的对象自动设置。例如,当通过以下代码添加手动控制输入时,手动控制的需求标志会被设置: ```cpp _manual_control_input = std::make_shared(*this); @@ -688,9 +639,7 @@ _manual_control_input = std::make_shared(*this); - 在选定模式时不允许进行解锁操作 - 当已处于武装状态时,该模式无法被选择。 -- 当载具已解锁且该模式被选中时,相关的故障保护机制会被触发(例如,针对手动控制需求的遥控器信号丢失故障保护)。 - 检查 [safety page] (../config/safety.md) 如何配置故障安全行为。 - 当某模式已被选中,且该模式发生崩溃或失去响应时,也会触发故障保护机制。 +- 当载具已解锁且该模式被选中时,相关的故障保护机制会被触发(例如,针对手动控制需求的遥控器信号丢失故障保护)。检查 [safety page] (../config/safety.md) 如何配置故障安全行为。当某模式已被选中,且该模式发生崩溃或失去响应时,也会触发故障保护机制。 这是手动控制标志对应的流程图: @@ -698,8 +647,7 @@ _manual_control_input = std::make_shared(*this); -在模式注册后,可以手动更新任意模式要求。 -例如,要将返航点(home position)添加为一项要求: +在模式注册后,可以手动更新任意模式要求。例如,要将返航点(home position)添加为一项要求: ```cpp modeRequirements().home_position = true; @@ -716,9 +664,7 @@ modeRequirements().home_position = true; ### 将模式指派给 RC 切换或操纵动作 -外部模式可以被分配给[RC switches](../config/flight_mode.md) 或操纵杆动作。 -当将模式分配给RC开关时,你需要知道其索引(因为参数元数据中不包含动态模式名称)。 -在模式运行期间,使用 'commander status'(指令状态)来获取该信息。 +外部模式可以被分配给[RC switches](../config/flight_mode.md) 或操纵杆动作。当将模式分配给RC开关时,你需要知道其索引(因为参数元数据中不包含动态模式名称)。在模式运行期间,使用 'commander status'(指令状态)来获取该信息。 例如: @@ -731,14 +677,13 @@ modeRequirements().home_position = true; ![QGC Modes](../../assets/middleware/ros2/px4_ros2_interface_lib/qgc_mode_assignment.png) :::info -PX4通过存储模式名称的散列确保指定模式始终分配到同一索引。 -这使它独立于多个外部模式下的启动订购。 +PX4通过存储模式名称的散列确保指定模式始终分配到同一索引。这使它独立于多个外部模式下的启动订购。 ::: ### 替换内部模式 -外部模式可替换现有的内部模式,例如[Return](../flight_modes/return.md) mode (RTL). -这样做,每当选择RTL(通过用户或故障安全情况),就使用外部模式而不是内部模式。 +An external mode can replace an existing internal mode, such as [Return](../flight_modes/return.md) mode. +By doing so, whenever it gets selected (through the user or a failsafe situation), the external mode is used instead of the internal one. 当外部模式失去响应或发生崩溃时,内部模式仅用作备用模式。 替换模式可在' ModeBase '构造函数的设置中进行配置: diff --git a/docs/zh/ros2/px4_ros2_interface_lib.md b/docs/zh/ros2/px4_ros2_interface_lib.md index ef5428c52e1..1b032aac21d 100644 --- a/docs/zh/ros2/px4_ros2_interface_lib.md +++ b/docs/zh/ros2/px4_ros2_interface_lib.md @@ -15,8 +15,7 @@ The [PX4 ROS 2 Interface Library](https://github.com/Auterion/px4-ros2-interface 该库为开发者提供了两个高级接口。 -1. [Control Interface](./px4_ros2_control_interface.md) 允许开发者创建并动态注册使用 ROS2 编写的模式。 - 它为发送不同类型的设置点提供了课程,涵盖范围从高级导航任务一直到直接执行器控制。 +1. [Control Interface](./px4_ros2_control_interface.md) 允许开发者创建并动态注册使用 ROS2 编写的模式。它为发送不同类型的设置点提供了课程,涵盖范围从高级导航任务一直到直接执行器控制。 2. [导航界面](./px4_ros2_navigation_interface.md) 允许从ROS 2应用程序(如VIO系统)向PX4发送车辆位置估计数。 3. [Waypoint Missions](./px4_ros2_waypoint_missions.md) 允许航点飞行任务完全在ROS2中运行。 @@ -34,8 +33,7 @@ The [PX4 ROS 2 Interface Library](https://github.com/Auterion/px4-ros2-interface ``` 提示信息 - 为确保兼容性,请使用 PX4、px4_msgs(PX4 消息包)及该库的最新 main 分支。 - 另请参阅 [here](https://github.com/Auterion/px4-ros2-interface-lib#compatibility-with-px4) + 为确保兼容性,请使用 PX4、px4_msgs(PX4 消息包)及该库的最新 main 分支。另请参阅 [here](https://github.com/Auterion/px4-ros2-interface-lib#compatibility-with-px4) ::: @@ -53,7 +51,6 @@ The [PX4 ROS 2 Interface Library](https://github.com/Auterion/px4-ros2-interface ## ROS集成测试 -向 PX4 提交拉取请求(pull request)时,持续集成(CI)会运行该库的集成测试 -这些测试用于验证模式注册、故障保护(failsafes)和模式替换功能是否按预期工作。 +向 PX4 提交拉取请求(pull request)时,持续集成(CI)会运行该库的集成测试这些测试用于验证模式注册、故障保护(failsafes)和模式替换功能是否按预期工作。 For more information see [PX4 ROS 2 Interface Library Integration Testing](../test_and_ci/integration_testing_px4_ros2_interface.md). diff --git a/docs/zh/ros2/px4_ros2_msg_translation_node.md b/docs/zh/ros2/px4_ros2_msg_translation_node.md index 5d7afe8aa7b..fa08d6ad77c 100644 --- a/docs/zh/ros2/px4_ros2_msg_translation_node.md +++ b/docs/zh/ros2/px4_ros2_msg_translation_node.md @@ -8,17 +8,14 @@ 由于引入了[消息版本](../middleware/uorb.md#message-versioning),将消息从一个定义版本翻译成另一个定义版本是可能的。 -翻译节点可以访问之前由 PX4 定义的所有消息版本。 -它积极观察了光盘系统的数据空间,监测出版物。 通过[uXRCE-DDS桥](../middleware/uxrce_dds.md)或外空委2应用源于PX4的订阅和服务。 -必要时,它会将消息转换到应用程序和PX4预期的当前版本,确保兼容性。 +翻译节点可以访问之前由 PX4 定义的所有消息版本。它积极观察了光盘系统的数据空间,监测出版物。 通过[uXRCE-DDS桥](../middleware/uxrce_dds.md)或外空委2应用源于PX4的订阅和服务。必要时,它会将消息转换到应用程序和PX4预期的当前版本,确保兼容性。 ![概述ROS 2消息转换节点] (../../assets/middleware/ros2/px4_ros2_interface_lib/translation_node.svg) -支持不同版本的同一消息在交战规则2域内共存, 出版、订阅和服务的ROS 2主题名称包括各自的信息版本的后缀。 -这个命名协议的形式为`_v`。 +支持不同版本的同一消息在交战规则2域内共存, 出版、订阅和服务的ROS 2主题名称包括各自的信息版本的后缀。这个命名协议的形式为`_v`。 ## 用法 @@ -59,8 +56,7 @@ [INFO] [1734525720.729594413] [translation_node]: 注册的服务和版本: ``` -在正在运行翻译节点时,任何同时运行旨在与 PX4 通信的 ROS 2 应用程序都可以这样做。 只要它使用节点承认的消息版本。 -翻译节点如果遇到未知的主题版本,将打印警告。 +在正在运行翻译节点时,任何同时运行旨在与 PX4 通信的 ROS 2 应用程序都可以这样做。 只要它使用节点承认的消息版本。翻译节点如果遇到未知的主题版本,将打印警告。 :::info 在 PX4 修改消息定义和/或翻译节点代码后, 您需要从点2重新运行以上步骤来相应更新您的ROS工作区。 @@ -68,8 +64,7 @@ ### 在ROS 应用中 -开发与 PX4 通信的 ROS 2 应用程序时,不必知道正在使用的消息的特定版本。 -消息版本可以以如以下方式一般添加到主题名称中: +开发与 PX4 通信的 ROS 2 应用程序时,不必知道正在使用的消息的特定版本。消息版本可以以如以下方式一般添加到主题名称中: :::: tabs @@ -191,20 +186,14 @@ class MinimalPubSub(Node): ### 定义 -**消息** 定义了用于通信的数据格式,无论是主题还是服务。 -因此,消息可以是 ".msg" 文件定义的 _topic_ 消息,也可以是 ".srv" 文件定义的 _service_ 消息。 +**消息** 定义了用于通信的数据格式,无论是主题还是服务。因此,消息可以是 ".msg" 文件定义的 _topic_ 消息,也可以是 ".srv" 文件定义的 _service_ 消息。 -**版本信息** 是指跟踪更改的消息,每次变更都会导致版本号递增,且定义的历史状态会被保存下来。 -每个消息的最新版本都存储在 `msg/versioned/` 中,用于主题(或`srv/versioned` 用于服务), 所有旧版本都存储在`msg/px4_msgs_old/msg/`(或`msg/px4_msgs_old/srv/`)中。 +**版本信息** 是指跟踪更改的消息,每次变更都会导致版本号递增,且定义的历史状态会被保存下来。每个消息的最新版本都存储在 `msg/versioned/` 中,用于主题(或`srv/versioned` 用于服务), 所有旧版本都存储在`msg/px4_msgs_old/msg/`(或`msg/px4_msgs_old/srv/`)中。 -**版本翻译**定义了一个或多个消息定义的内容在不同版本之间的双向映射。 -每个翻译以单独的 .h 头文件形式存储在 msg/translation_node/translations/ 目录下。 -消息翻译可以是 _direct_或 _generic_。 +**版本翻译**定义了一个或多个消息定义的内容在不同版本之间的双向映射。每个翻译以单独的 .h 头文件形式存储在 msg/translation_node/translations/ 目录下。消息翻译可以是 _direct_或 _generic_。 -- **直接翻译** 定义一个双向映射其两个版本之间消息的内容。 - 这是更简单的情况,在可能的情况下应优先选择。 -- **通用翻译** 定义了双向映射`n`输入消息的内容到不同版本的`m`输出消息。 - 这可用于合并或拆分消息,也可用于将某个字段从一个消息迁移至另一个消息。 +- **直接翻译** 定义一个双向映射其两个版本之间消息的内容。这是更简单的情况,在可能的情况下应优先选择。 +- **通用翻译** 定义了双向映射`n`输入消息的内容到不同版本的`m`输出消息。这可用于合并或拆分消息,也可用于将某个字段从一个消息迁移至另一个消息。 ### File Structure @@ -314,8 +303,7 @@ PX4-Autopilot 更新版本的 `.msg` 主题消息文件 (或`.srv` 服务消息文件) 并进行必要的更改。 - 第一次递增`MESSAGE_VERSION`字段。 - 然后更新促使版本变更的消息字段。 + 第一次递增`MESSAGE_VERSION`字段。然后更新促使版本变更的消息字段。 例如,更新 `msg/versioned/vehicleAttitde.msg` 从: @@ -399,52 +387,35 @@ PX4-Autopilot #include "translation_vehicle_attitude_v4.h" ``` -请注意,在上述示例中以及在大多数情况下,步骤 4 仅要求开发者针对此次定义变更创建一个直接转换。 -这是因为更改只涉及一个消息。 -在更复杂的分割、合并和/或移动定义的情况下,必须创建一个通用转化。 +请注意,在上述示例中以及在大多数情况下,步骤 4 仅要求开发者针对此次定义变更创建一个直接转换。这是因为更改只涉及一个消息。在更复杂的分割、合并和/或移动定义的情况下,必须创建一个通用转化。 -例如,当一个字段从一个消息移动到另一个消息时。 应增加一个单一通用翻译,两个较旧的信息版本作为输入,两个较新的版本作为输出。 -这就确保了在向前或向后翻译时不会丢失信息。 +例如,当一个字段从一个消息移动到另一个消息时。 应增加一个单一通用翻译,两个较旧的信息版本作为输入,两个较新的版本作为输出。这就确保了在向前或向后翻译时不会丢失信息。 这正是 [Generic Topic Message Translation Template](https://github.com/PX4/PX4-Autopilot/blob/main/msg/translation_node/translations/example_translation_multi_v2.h) 所显示的方法。 只省略`fromOlder()` 和 `toOlder()` 方法中的字段的代码。 :::warning -如果嵌套消息定义发生了变化,包括该消息在内的所有消息也需要版本更新。 -例如,如果消息 [PositionSetpointTriplet](../msg_docs/PositionSetpointTriplet.md)有版本,将会出现这种情况。 -这一点对于服务而言尤为重要,因为服务更有可能引用其他消息定义。 +如果嵌套消息定义发生了变化,包括该消息在内的所有消息也需要版本更新。例如,如果消息 [PositionSetpointTriplet](../msg_docs/PositionSetpointTriplet.md)有版本,将会出现这种情况。这一点对于服务而言尤为重要,因为服务更有可能引用其他消息定义。 ::: ## 实现细节 -转换节点动态监测主题和服务。 -然后视需要举例说明出版物和订阅者的对应情况。 -例如,如果主题第1版有外部发行商,第2版则有订阅商。 +转换节点动态监测主题和服务。然后视需要举例说明出版物和订阅者的对应情况。例如,如果主题第1版有外部发行商,第2版则有订阅商。 -在内部,它保存一份所有已知主题和版本管束的图表(即图节点)。 -该图通过消息转换实现连接。 -由于任意的消息转换可以注册,图可以有周期和从一个节点到另一个节点的多个路径。 -因此,在主题更新中,图形使用最短路径算法。 -当从一个节点移动到另一个节点时,消息翻译方法将与当前主题数据调用。 -如果节点包含实例化发布器 (因为它先前检测到外部订阅者),数据将被发布。 -这样,本专题任何版本的多个订阅者都可以用正确的数据更新数据。 +在内部,它保存一份所有已知主题和版本管束的图表(即图节点)。该图通过消息转换实现连接。由于任意的消息转换可以注册,图可以有周期和从一个节点到另一个节点的多个路径。因此,在主题更新中,图形使用最短路径算法。当从一个节点移动到另一个节点时,消息翻译方法将与当前主题数据调用。如果节点包含实例化发布器 (因为它先前检测到外部订阅者),数据将被发布。这样,本专题任何版本的多个订阅者都可以用正确的数据更新数据。 对于有多个输入主题的转化,转化将在所有输入消息都可用后继续。 ## 局限 -- 服务消息的转化不适用于 ROS Humble,而是适用于ROSJazzy。 - 这是因为当前的实现取决于尚未在ROS人类中提供的服务 API 。 - 完全支持主题信息转化。 +- 服务消息的转化不适用于 ROS Humble,而是适用于ROSJazzy。这是因为当前的实现取决于尚未在ROS人类中提供的服务 API 。完全支持主题信息转化。 - 服务消息只支持线性历史记录,即没有消息拆分或合并。 -- 两个不同版本的同一主题的出版商和订户目前都不是由转化节点处理的,会引发无限的循环出版物。 - 这是指下列有问题的配置: +- 两个不同版本的同一主题的出版商和订户目前都不是由转化节点处理的,会引发无限的循环出版物。这是指下列有问题的配置: ``` app 1: pub topic_v1, sub topic_v1 app 2: pub topic_v2, sub topic_v2 ``` - 实际上,这种配置不大可能发生,因为与金融监督单位共享的外空系统专题是指向的(例如)。 `/fmu/out/vehicle_status` 或 `/fmu/in/tracjectory_setpoint` ,因此应用通常不会同时发布和订阅相同的主题。 - 如果需要,可以扩展翻译节点来处理这个卷轴。 + 实际上,这种配置不大可能发生,因为与金融监督单位共享的外空系统专题是指向的(例如)。 `/fmu/out/vehicle_status` 或 `/fmu/in/tracjectory_setpoint` ,因此应用通常不会同时发布和订阅相同的主题。如果需要,可以扩展翻译节点来处理这个卷轴。 需要原始文件:https://docs.google.com/document/d/18_RxV1eEjt4haaa5QkFZAlIAJNv9w5HED2aUEiG7PVQ/edit?usp=sharing diff --git a/docs/zh/ros2/px4_ros2_navigation_interface.md b/docs/zh/ros2/px4_ros2_navigation_interface.md index a18fa818214..11249728809 100644 --- a/docs/zh/ros2/px4_ros2_navigation_interface.md +++ b/docs/zh/ros2/px4_ros2_navigation_interface.md @@ -7,9 +7,7 @@ Experimental 在撰写本文时,PX4 ROS 2 接口库的部分内容仍处于试验阶段,因此可能会发生变动。 ::: -[PX4 ROS 2 Interface Library](../ros2/px4_ros2_interface_lib.md) 中的导航接口,支持开发者直接从 ROS 2 应用(如视觉惯性里程计系统或地图匹配系统)向 PX4 发送位置测量数据。 -该接口提供了对 PX4 和 uORB 消息框架的抽象层,并对通过该接口发送的请求状态估计更新引入了一些合理性检查。 -这些测量数据随后会被融合到扩展EKF中,其处理方式与 PX4 内部生成的测量数据完全一致。 +[PX4 ROS 2 Interface Library](../ros2/px4_ros2_interface_lib.md) 中的导航接口,支持开发者直接从 ROS 2 应用(如视觉惯性里程计系统或地图匹配系统)向 PX4 发送位置测量数据。该接口提供了对 PX4 和 uORB 消息框架的抽象层,并对通过该接口发送的请求状态估计更新引入了一些合理性检查。这些测量数据随后会被融合到扩展EKF中,其处理方式与 PX4 内部生成的测量数据完全一致。 库提供两个类,[`LocalPositionMeasurementInterface`](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1LocalPositionMeasurementInterface.html) 和 [`GlobalPositionMeasureInterface`](https://auterion.github.io/px4-ros2-interface-lib/classpx4__ros2_1_1GlobalPositionMeasurementInterface.html) 它都会暴露出一个类似的 "update" 方法来提供一个本地位置或全球位置更新到 PX4。 `update`方法需要一个位置测量`struct`(`LocalPositionMeasure`](https://auterion.github.io/px4-ros2-interface-lib/structpx4__ros2_1_1LocalPositionMeasurement.html)或[\`GlobalPositionMeasure\`](https://auterion.github.io/px4-ros2-interface-lib/structpx4__ros2_1_1GlobalPositionMeasurement.html)],开发者可以在其中填入自己生成的位置测量数据。 @@ -28,8 +26,7 @@ Experimental ``` 提示信息 - 为确保兼容性,请使用 PX4、px4_msgs(PX4 消息包)及该库的最新 main 分支。 - 另请参阅 [here](https://github.com/Auterion/px4-ros2-interface-lib#compatibility-with-px4) + 为确保兼容性,请使用 PX4、px4_msgs(PX4 消息包)及该库的最新 main 分支。另请参阅 [here](https://github.com/Auterion/px4-ros2-interface-lib#compatibility-with-px4) ::: @@ -101,8 +98,7 @@ Experimental ## 如何使用代码库 -要发送位置测量数据,你需要用所测量的值填充位置结构体。 -然后以此结构调用接口的更新功能作为参数。 +要发送位置测量数据,你需要用所测量的值填充位置结构体。然后以此结构调用接口的更新功能作为参数。 For a basic example of how to use this interface, check out the [examples](https://github.com/Auterion/px4-ros2-interface-lib/tree/main/examples/cpp/navigation) in the `Auterion/px4-ros2-interface-lib` repository, such as [examples/cpp/navigation/local_navigation](https://github.com/Auterion/px4-ros2-interface-lib/blob/main/examples/cpp/navigation/local_navigation/include/local_navigation.hpp) or [examples/cpp/navigation/global_navigation](https://github.com/Auterion/px4-ros2-interface-lib/blob/main/examples/cpp/navigation/global_navigation/include/global_navigation.hpp). @@ -303,5 +299,4 @@ private: ## 接口的多个实例 -使用同一接口的多个实例(例如,多个局部接口实例)发送估计更新时,会将所有更新消息发送到同一个主题,从而导致串扰。 -这不应影响计量并入EKF,但不同的计量来源将无法区分。 +使用同一接口的多个实例(例如,多个局部接口实例)发送估计更新时,会将所有更新消息发送到同一个主题,从而导致串扰。这不应影响计量并入EKF,但不同的计量来源将无法区分。 diff --git a/docs/zh/ros2/px4_ros2_waypoint_missions.md b/docs/zh/ros2/px4_ros2_waypoint_missions.md index d82fc2d543e..6ffb52dc654 100644 --- a/docs/zh/ros2/px4_ros2_waypoint_missions.md +++ b/docs/zh/ros2/px4_ros2_waypoint_missions.md @@ -11,7 +11,7 @@ They completely bypass the existing PX4 mission mode and waypoint logic, and can ::: ROS 2 waypoint missions are effectively special PX4 ROS 2 custom modes that are run based on the content of a [JSON mission definition](#mission-definition). -Mission definitions can contain actions that reference existing PX4 modes, such as Takeoff mode or RTL, and can also be extended with arbitrary custom actions written in ROS. +Mission definitions can contain actions that reference existing PX4 modes, such as Takeoff or Return mode, and can also be extended with arbitrary custom actions written in ROS. A [mode executor](px4_ros2_control_interface.md#mode-executor) is used to schedule the modes. Mission definitions can be hard coded in the custom mission mode (either in code or statically loaded from a JSON string), or directly generated within the application. @@ -69,13 +69,13 @@ They are identified by a name, and any number of these can be registered with th A custom action is then run whenever a mission item with matching name is executed, and any extra arguments from the JSON definition are passed as arguments (for example an altitude for a takeoff action). Actions can call other actions, run any mode (PX4 or external by its ID), run a trajectory, or run any other external action before deciding when to continue the mission. -There is a set of default actions, for example for RTL, Land, etc. +There is a set of default actions, for example for Return, Land, etc. These simply trigger the corresponding PX4 mode. They can be disabled or replaced with custom implementations. There are also some special actions (which can be replaced as well): - `OnFailure`: this is called in case of a failure, e.g. a mode switch failed, a non-existing action is called (by another action) or by an explicit call to `MissionExecutor::abort()`. - The default is to run RTL, with fallback to Land. + The default is to run Return, with fallback to Land. - `OnResume`: this is called when resuming a mission (either from the ground or in-air). It handles a number of cases: - when called with an argument `action="storeState"`: this can be used to store the current position when the mission is deactivated, so it can be resumed from the same position. diff --git a/docs/zh/ros2/user_guide.md b/docs/zh/ros2/user_guide.md index a45589b8cb9..26328a49094 100644 --- a/docs/zh/ros2/user_guide.md +++ b/docs/zh/ros2/user_guide.md @@ -28,25 +28,18 @@ The [uXRCE-DDS](../middleware/uxrce_dds.md) communications middleware is a large -uXRCE-DDS 中间件由两部分组成:一部分是运行在 PX4 上的客户端,另一部分是运行在机载计算机上的代理;二者之间通过串口、UDP、TCP或自定义链路进行双向数据交换。 -代理充当客户端的代理角色,以便在全局 DDS 数据空间中发布和订阅主题。 +uXRCE-DDS 中间件由两部分组成:一部分是运行在 PX4 上的客户端,另一部分是运行在机载计算机上的代理;二者之间通过串口、UDP、TCP或自定义链路进行双向数据交换。代理充当客户端的代理角色,以便在全局 DDS 数据空间中发布和订阅主题。 -PX4 [uxrce_dds_client](../modules/modules_system.md#uxrce-dds-client) 是在构建时生成,并且默认包含在 PX4 固件中。 -它包含“通用”XRCE-DDS客户端代码和它用来发布到来自uORB主题的 PX4 特定转换代码。 -生成到客户端中的 uORB 消息子集在 [dds_topics.yaml](../middleware/dds_topics.md)中说明。 -生成器使用源代码树中的 uORB 消息定义:[PX4-Autopilot/msg](https://github.com/PX4/PX4-Autopilot/tree/main/msg) 用于生成发送 ROS 2 消息的代码。 +PX4 [uxrce_dds_client](../modules/modules_system.md#uxrce-dds-client) 是在构建时生成,并且默认包含在 PX4 固件中。它包含“通用”XRCE-DDS客户端代码和它用来发布到来自uORB主题的 PX4 特定转换代码。生成到客户端中的 uORB 消息子集在 [dds_topics.yaml](../middleware/dds_topics.md)中说明。生成器使用源代码树中的 uORB 消息定义:[PX4-Autopilot/msg](https://github.com/PX4/PX4-Autopilot/tree/main/msg) 用于生成发送 ROS 2 消息的代码。 -ROS 2 应用程序需要在一个工作空间中构建,该工作空间需包含与 PX4 固件中创建 uXRCE-DDS 客户端模块时所用完全相同的消息定义。 -您可以通过克隆接口包[PX4/px4_msgs](https://github.com/PX4/px4_msgs)将这些内容纳入您的 ROS 2 工作空间(repo 中的范围与不同的 PX4 版本的消息相对应)。 +ROS 2 应用程序需要在一个工作空间中构建,该工作空间需包含与 PX4 固件中创建 uXRCE-DDS 客户端模块时所用完全相同的消息定义。您可以通过克隆接口包[PX4/px4_msgs](https://github.com/PX4/px4_msgs)将这些内容纳入您的 ROS 2 工作空间(repo 中的范围与不同的 PX4 版本的消息相对应)。 Starting from PX4 v1.16, in which [message versioning](../middleware/uorb.md#message-versioning) was introduced, ROS 2 applications may use a different version of message definitions than those used to build PX4. 这需要[ROS 2 Message Translation Node](../ros2/px4_ros2_msg_translation_node.md)运行ROS 2 消息转换节点,以确保消息能够正确转换和交互。 -需要注意的是,微型XRCE-DDS _agent_ 本身并不依赖客户端代码。 -它可以从 [source](https://github.com/eProsima/Micro-XRCE-DDS-Agent) 中单独构建,或者作为ROS构建的一部分,或者作为snap包安装。 +需要注意的是,微型XRCE-DDS _agent_ 本身并不依赖客户端代码。它可以从 [source](https://github.com/eProsima/Micro-XRCE-DDS-Agent) 中单独构建,或者作为ROS构建的一部分,或者作为snap包安装。 -在使用 ROS 2 时,您通常需要同时启动客户端和代理。 -需要注意的是,uXRCE-DDS 客户端默认已内置到固件中,但除仿真器构建版本外,不会自动启动。 +在使用 ROS 2 时,您通常需要同时启动客户端和代理。需要注意的是,uXRCE-DDS 客户端默认已内置到固件中,但除仿真器构建版本外,不会自动启动。 See [uXRCE-DDS > Version selection](../middleware/uxrce_dds.md#version-selection) to check which Micro XRCE-DDS version to use for your ROS 2 distribution. @@ -87,8 +80,7 @@ If you're working on Ubuntu 22.04 you can use ROS 2 "Humble" LTS instead. 若要使用该仿真器,你需要安装 PX4 开发工具链。 :::info -唯一依赖于ROS2的 PX4 是一组信息定义,它从[px4_msgs](https://github.com/PX4/px4_msgs)获取。 -您只需要安装 PX4 当您需要模拟器时(如我们在本指南中所做的那样), 或者如果您正在创建一个发布自定义uORB主题的构建。 +唯一依赖于ROS2的 PX4 是一组信息定义,它从[px4_msgs](https://github.com/PX4/px4_msgs)获取。您只需要安装 PX4 当您需要模拟器时(如我们在本指南中所做的那样), 或者如果您正在创建一个发布自定义uORB主题的构建。 ::: 通过以下方式在 Ubuntu 上配置一个 PX4 开发环境: @@ -101,8 +93,7 @@ cd PX4-Autopilot/ make px4_sitl ``` -请注意,上述命令将为您的Ubuntu版本安装推荐的模拟器。 -如果您想要安装 PX4,但保留您现有的模拟器安装,请使用 "--no-sim-tools" 标志运行 `ubuntu.sh`。 +请注意,上述命令将为您的Ubuntu版本安装推荐的模拟器。如果您想要安装 PX4,但保留您现有的模拟器安装,请使用 "--no-sim-tools" 标志运行 `ubuntu.sh`。 欲了解更多信息和故障排除,请参阅:[Ubuntu 开发环境](../dev_setup/dev_env_linux_ubuntu.md) 和 [下载 PX4 源](../dev_setup/building_px4.md)。 @@ -304,8 +295,7 @@ Below we show how to build the agent inside the ROS 2 workspace `~/ros2_px4_ws` 代理现已启动,但在我们启动 PX4(下一步) 之前,你不会看到太多。 :::info -你可以让代理在这个终端中保持运行状态! -需注意,每个连接通道仅允许运行一个代理 +你可以让代理在这个终端中保持运行状态!需注意,每个连接通道仅允许运行一个代理 ::: ##### Start the DDS Client @@ -324,8 +314,7 @@ PX4 仿真器会自动启动 uXRCE-DDS 客户端,并连接到本地主机上 代理和客户端现已运行并二者应已建立连接。 -PX4 终端会显示 [NuttShell/PX4 System Console](../debug/system_console.md) 系统控制台 的输出内容,该输出会在 PX4 启动和运行过程中实时呈现。 -代理一建立连接,输出内容中就应包含 INFO 级别的消息,这些消息会显示数据撰写器的创建情况: +PX4 终端会显示 [NuttShell/PX4 System Console](../debug/system_console.md) 系统控制台 的输出内容,该输出会在 PX4 启动和运行过程中实时呈现。代理一建立连接,输出内容中就应包含 INFO 级别的消息,这些消息会显示数据撰写器的创建情况: ```sh ... @@ -442,8 +431,7 @@ The [ROS 2 beginner tutorials](https://docs.ros.org/en/humble/Tutorials/Beginner export RMW_IMPLEMENTATION=rmw_zenoh_cpp ``` -3. 现在启动示例。 - 请注意,此处我们使用的是 ros2 launch,其相关说明如下。 +3. 现在启动示例。请注意,此处我们使用的是 ros2 launch,其相关说明如下。 ```sh ros2 launch px4_ros_com sensor_combined_listener.launch.py @@ -495,8 +483,7 @@ This example is built with PX4 and ROS 2 versions that use the same message defi - 订阅 (聆听) PX4 发布的数传主题 - 发布到导致PX4执行某些操作的主题。 -您可以使用的主题定义在[dds_topics.yaml](../middleware/dds_topics.md), 并且您可以在 [uORB Message Reference](../msg_docs/index.md)获取更多关于他们数据的信息。 -例如,[VehicleGlobalPosition](../msg_docs/VehicleGlobalPosition.md) 可以用来获得机体的全局位置。 [VehicleCommand](../msg_docs/VehicleCommand.md) 可以用于命令诸如起飞和降落等操作。 +您可以使用的主题定义在[dds_topics.yaml](../middleware/dds_topics.md), 并且您可以在 [uORB Message Reference](../msg_docs/index.md)获取更多关于他们数据的信息。例如,[VehicleGlobalPosition](../msg_docs/VehicleGlobalPosition.md) 可以用来获得机体的全局位置。 [VehicleCommand](../msg_docs/VehicleCommand.md) 可以用于命令诸如起飞和降落等操作。 下面的 [ROS 2 Example applications](#ros-2-example-applications) 示例提供了如何使用这些主题的具体例子。 @@ -506,8 +493,7 @@ This example is built with PX4 and ROS 2 versions that use the same message defi ### ROS 2 订阅者QoS 设置 -用于订阅 PX4 发布的话题的 ROS 2 代码,必须指定合适(兼容)的 QoS(服务质量)设置,才能监听这些话题。 -具体而言,节点应使用 ROS 2 预定义的 QoS 传感器数据(可参考[listener example source code](#ros-2-listener))进行订阅: +用于订阅 PX4 发布的话题的 ROS 2 代码,必须指定合适(兼容)的 QoS(服务质量)设置,才能监听这些话题。具体而言,节点应使用 ROS 2 预定义的 QoS 传感器数据(可参考[listener example source code](#ros-2-listener))进行订阅: ```cpp ... @@ -518,8 +504,7 @@ subscription_ = this->create_subscription<0>("/fmu/out/sensor_combined", qos, ... ``` -需要这样做的原因是,ROS 2 的默认 [Quality of Service (QoS) settings](https://docs.ros.org/en/humble/Concepts/About-Quality-of-Service-Settings.html#qos-profiles)与 PX4 所使用的设置不同。 -并非所有发布者 - 订阅者的 [Qos settings are possible](https://docs.ros.org/en/humble/Concepts/About-Quality-of-Service-Settings.html#qos-compatibilities),而事实证明,ROS 2 默认的订阅者设置就属于不可行的情况!需注意,ROS 代码在发布时无需设置 QoS参数(在此场景下,PX4 的 QoS 设置与 ROS 的默认 QoS 设置是兼容的)。 +需要这样做的原因是,ROS 2 的默认 [Quality of Service (QoS) settings](https://docs.ros.org/en/humble/Concepts/About-Quality-of-Service-Settings.html#qos-profiles)与 PX4 所使用的设置不同。并非所有发布者 - 订阅者的 [Qos settings are possible](https://docs.ros.org/en/humble/Concepts/About-Quality-of-Service-Settings.html#qos-compatibilities),而事实证明,ROS 2 默认的订阅者设置就属于不可行的情况!需注意,ROS 代码在发布时无需设置 QoS参数(在此场景下,PX4 的 QoS 设置与 ROS 的默认 QoS 设置是兼容的)。 @@ -540,8 +525,7 @@ See [REP105: Coordinate Frames for Mobile Platforms](https://www.ros.org/reps/re ![Reference frames](../../assets/lpe/ref_frames.png) -除非在相关消息定义中明确指定,否则所有PX4 话题均采用 FRD(即 NED)坐标系约定。 -因此,想要与 PX4 进行交互的 ROS 2 节点,必须妥善处理坐标系约定问题。 +除非在相关消息定义中明确指定,否则所有PX4 话题均采用 FRD(即 NED)坐标系约定。因此,想要与 PX4 进行交互的 ROS 2 节点,必须妥善处理坐标系约定问题。 - 要将一个向量从ENU坐标系旋转到NED坐标系,必须执行两个基本旋转操作: - 首先是绕 Z 轴(朝上方向)旋转 π/2 弧度。 @@ -550,7 +534,7 @@ See [REP105: Coordinate Frames for Mobile Platforms](https://www.ros.org/reps/re - 要将一个向量从NED坐标系旋转到ENU坐标系,必须执行两个基本旋转操作: - - 首先是绕 Z 轴(朝下方向)旋转 π/2 弧度。 - - 然后是绕 X 轴(原北向 / 新东向)旋转 π 弧度。 需注意,这两种最终得到的操作在数学上是等效的 + - 然后是绕 X 轴(原北向 / 新东向)旋转 π 弧度。需注意,这两种最终得到的操作在数学上是等效的 - 将向量从 FLU坐标系旋转到 FRD坐标系,仅需绕 X 轴(朝前方向)旋转 π 弧度即可。 @@ -561,17 +545,15 @@ See [REP105: Coordinate Frames for Mobile Platforms](https://www.ros.org/reps/re - [TrajectorySetpoint](../msg_docs/TrajectorySetpoint.md)消息中的所有字段;发送这些字段前,需先将其从 ENU坐标系转换为 NED坐标系。 - [VehicleThrustSetpoint](../msg_docs/VehicleThrustSetpoint.md)消息中的所有字段;发送这些字段前,需先将其从 FLU坐标系转换为 FRD坐标系。 -与向量类似,用于表示飞行器(机体坐标系)相对于(w.r.t.)姿态的四元数也是如此。 (相对于)世界坐标系(的四元数)需要进行转换。 +与向量类似,用于表示飞行器(机体坐标系)相对于(w.r.t.)姿态的四元数也是如此。(相对于)世界坐标系(的四元数)需要进行转换。 [PX4/px4_ros_com](https://github.com/PX4/px4_ros_com) 提供了名为 [frame_transforms](https://github.com/PX4/px4_ros_com/blob/main/include/px4_ros_com/frame_transforms.h)的共享库,可便捷地执行此类转换操作。 ### ROS, Gazebo 和 PX4 时间同步 -默认情况下,ROS 2 与 PX4 之间的时间同步由[uXRCE-DDS middleware](https://micro-xrce-dds.docs.eprosima.com/en/latest/time_sync.html) 自动管理;若需查看时间同步统计信息,可监听已桥接的话题 /fmu/out/timesync_status。 -当 uXRCE-DDS 客户端运行在飞控器上,且代理运行在机载计算机上时,这便是理想的运行状态 —— 此时时间偏移、时间漂移以及通信延迟会被自动计算并补偿。 +默认情况下,ROS 2 与 PX4 之间的时间同步由[uXRCE-DDS middleware](https://micro-xrce-dds.docs.eprosima.com/en/latest/time_sync.html) 自动管理;若需查看时间同步统计信息,可监听已桥接的话题 /fmu/out/timesync_status。当 uXRCE-DDS 客户端运行在飞控器上,且代理运行在机载计算机上时,这便是理想的运行状态 —— 此时时间偏移、时间漂移以及通信延迟会被自动计算并补偿。 -在 Gazebo 仿真中,GZBridge 会在每个仿真步长(sim step)为 PX4 设置时间[Change simulation speed](../sim_gazebo_gz/index.md#change-simulation-speed)。 -需注意,这与 Gazebo Classic所采用的仿真锁步[simulation lockstep](../sim_gazebo_classic/index.md#lockstep)流程不同。 +在 Gazebo 仿真中,GZBridge 会在每个仿真步长(sim step)为 PX4 设置时间[Change simulation speed](../sim_gazebo_gz/index.md#change-simulation-speed)。需注意,这与 Gazebo Classic所采用的仿真锁步[simulation lockstep](../sim_gazebo_classic/index.md#lockstep)流程不同。 ROS 2 users have then two possibilities regarding the [time source](https://design.ros2.org/articles/clock_and_time.html) of their nodes. @@ -685,9 +667,7 @@ public: ``` :::info -该订阅会基于 rmw_qos_profile_sensor_data 设置一个 QoS 配置文件。 -之所以需要这样做,是因为 ROS 2 订阅者的默认 QoS(服务质量)配置文件,与 PX4 发布者的配置文件不兼容。 -欲了解更多信息,请参阅:[ROS 2 Subscriber QoS Settings](#ros-2-subscriber-qos-settings), +该订阅会基于 rmw_qos_profile_sensor_data 设置一个 QoS 配置文件。之所以需要这样做,是因为 ROS 2 订阅者的默认 QoS(服务质量)配置文件,与 PX4 发布者的配置文件不兼容。欲了解更多信息,请参阅:[ROS 2 Subscriber QoS Settings](#ros-2-subscriber-qos-settings), ::: 以下代码行创建了一个发布者,用于向 SensorCombined uORB 话题发布数据;该发布者可与一个或多个兼容的 ROS 2 订阅者匹配,这些订阅者监听的是 fmu/sensor_combined/out ROS 2 话题。 @@ -713,8 +693,7 @@ int main(int argc, char *argv[]) } ``` -此特殊示例在[launch/sensor_combined_listener.launch.py](https://github.com/PX4/px4_ros_com/blob/main/launch/sensor_combined_listener.launch.py).有一个相关的启动文件。 -这使得它可以通过 [`ros2 launch`](#ros2-launch) 命令启动 +此特殊示例在[launch/sensor_combined_listener.launch.py](https://github.com/PX4/px4_ros_com/blob/main/launch/sensor_combined_listener.launch.py).有一个相关的启动文件。这使得它可以通过 [`ros2 launch`](#ros2-launch) 命令启动 ### ROS 2 发布者 @@ -737,8 +716,7 @@ class DebugVectAdvertiser : public rclcpp::Node { ``` -这段代码创建了一个用来发送消息的回调函数。 -发送消息的回调函数由定时器触发的,每秒钟发送两次消息。 +这段代码创建了一个用来发送消息的回调函数。发送消息的回调函数由定时器触发的,每秒钟发送两次消息。 ```cpp public: @@ -822,15 +800,10 @@ See Zenoh client [node setup](../middleware/zenoh.md#px4-zenoh-pico-node-setup) ## 自定义 uORB 主题 -ROS 2需要有用于在 PX4 固件中创建 uXRCE-DDS客户端模块的 _sam_message 定义,以便解释消息。 -这些定义存储在 ROS 2 接口包[PX4/px4_msgs](https://github.com/PX4/px4_msgs)中,并且会通过CI在 main(主)分支和发布分支上自动同步。 -需要注意的是,PX4 源代码中的所有消息均存在于该代码仓库中,但只有在dds_topics.yaml文件中列出的消息,才会作为 ROS 2 话题可用。 -因此 +ROS 2需要有用于在 PX4 固件中创建 uXRCE-DDS客户端模块的 _sam_message 定义,以便解释消息。这些定义存储在 ROS 2 接口包[PX4/px4_msgs](https://github.com/PX4/px4_msgs)中,并且会通过CI在 main(主)分支和发布分支上自动同步。需要注意的是,PX4 源代码中的所有消息均存在于该代码仓库中,但只有在dds_topics.yaml文件中列出的消息,才会作为 ROS 2 话题可用。因此 - 如果您正在使用 PX4 的主要版本或发布版本,您可以通过克隆接口包[PX4/px4_msgs](https://github.com/PX4/px4_msgs)获得消息定义。 -- 如果您要创建或修改 uORB 消息,必须从 PX4 源代码树中手动更新工作空间中的消息。 - 一般来说,这意味着您将更新 [dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml),克隆接口包。 然后手动同步,将新的/修改的消息定义从 [PX4-Autopilot/msg](https://github.com/PX4/PX4-Autopilot/tree/main/msg)复制到它的 `msg` 文件夹。 - 假定PX4-Autopilot在你的主目录`~`中,而`px4_msgs`则在`~/ros2_ws/src/`中,命令可能是: +- 如果您要创建或修改 uORB 消息,必须从 PX4 源代码树中手动更新工作空间中的消息。一般来说,这意味着您将更新 [dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml),克隆接口包。 然后手动同步,将新的/修改的消息定义从 [PX4-Autopilot/msg](https://github.com/PX4/PX4-Autopilot/tree/main/msg)复制到它的 `msg` 文件夹。假定PX4-Autopilot在你的主目录`~`中,而`px4_msgs`则在`~/ros2_ws/src/`中,命令可能是: ```sh rm ~/ros2_ws/src/px4_msgs/msg/*.msg @@ -838,8 +811,7 @@ ROS 2需要有用于在 PX4 固件中创建 uXRCE-DDS客户端模块的 _sam_mes ``` ::: info - 从技术角度而言,[dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml) 这个文件完整定义了 PX4 uORB 话题与 ROS 2 消息之间的对应关系。 - 欲了解更多信息,请参阅[uXRCE-DDS > DDS Topics YAML](../middleware/uxrce_dds.md#dds-topics-yaml)。 + 从技术角度而言,[dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml) 这个文件完整定义了 PX4 uORB 话题与 ROS 2 消息之间的对应关系。欲了解更多信息,请参阅[uXRCE-DDS > DDS Topics YAML](../middleware/uxrce_dds.md#dds-topics-yaml)。 ::: @@ -847,13 +819,11 @@ ROS 2需要有用于在 PX4 固件中创建 uXRCE-DDS客户端模块的 _sam_mes 自定义主题和服务命名空间可以在构建时间(更改 [dds_topics.yaml](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/dds_topics.yaml))或运行时间(对多载体操作有用): -- 一种可能性是在从命令行启动[uxrce_dds_client](../modules/modules_system.md#uxrce-dds-client)时使用 "-n" 选项。 - 这种技术既可用于模拟,也可用于实际机体。 +- 一种可能性是在从命令行启动[uxrce_dds_client](../modules/modules_system.md#uxrce-dds-client)时使用 "-n" 选项。这种技术既可用于模拟,也可用于实际机体。 - 在开始模拟前,可以通过设置环境变量 `PX4_UXRCE_DDS_NS`来提供自定义命名空间 (仅限) :::info -更改运行时的命名空间将会将所需的命名空间作为一个前缀附加到 [dds_topics.yaml](../middleware/dds_topics.md) 中所有的 "topic " 字段和所有 [service servers](#px4-ros-2-service-servers)。 -因此,命令如下: +更改运行时的命名空间将会将所需的命名空间作为一个前缀附加到 [dds_topics.yaml](../middleware/dds_topics.md) 中所有的 "topic " 字段和所有 [service servers](#px4-ros-2-service-servers)。因此,命令如下: ```sh uxrce_dds_client start -n uav_1 @@ -907,8 +877,7 @@ VehicleCommand request VehicleCommandAck reply ``` -用户可通过发送 [VehicleCommand](../msg_docs/VehicleCommand.md)消息发起服务请求,并会收到一条[VehicleCommandAck](../msg_docs/VehicleCommandAck.md) 消息作为响应。 -该服务可确保仅将针对用户发起的特定请求所生成的 VehicleCommandAck回复返回。 +用户可通过发送 [VehicleCommand](../msg_docs/VehicleCommand.md)消息发起服务请求,并会收到一条[VehicleCommandAck](../msg_docs/VehicleCommandAck.md) 消息作为响应。该服务可确保仅将针对用户发起的特定请求所生成的 VehicleCommandAck回复返回。 #### 载体指挥服务离板控制示例 @@ -922,15 +891,13 @@ First the ROS 2 application declares a service client of type `px4_msgs::srv::Ve rclcpp::Client<0>::SharedPtr vehicle_command_client_; ``` -然后客户端初始化到正确的 ROS 2 服务 (`/fmu/vehicle_command` )。 -当应用程序假设使用标准的 PX4 命名空间时,这样做的代码看起来就像这样: +然后客户端初始化到正确的 ROS 2 服务 (`/fmu/vehicle_command` )。当应用程序假设使用标准的 PX4 命名空间时,这样做的代码看起来就像这样: ```cpp vehicle_command_client_{this->create_client("/fmu/vehicle_command")} ``` -此后,客户可以用来发送任何机体命令请求。 -例如,`arm()`函数用于请求机体放置: +此后,客户可以用来发送任何机体命令请求。例如,`arm()`函数用于请求机体放置: ```cpp void OffboardControl::arm() @@ -985,10 +952,7 @@ void OffboardControl::response_callback( ## ros2 CLI -[ros2 CLI](https://docs.ros.org/en/humble/Tutorials/Beginner-CLI-Tools.html)是一个有用的工具来处理ROS。 -例如,您可以使用它快速检查话题是否正在发布;如果您的工作空间中包含 px4_msg,还可以详细查看这些话题的内容。 -该命令还允许您通过启动文件(launch file)启动更复杂的 ROS 系统。 -下文显示了几种可能性。 +[ros2 CLI](https://docs.ros.org/en/humble/Tutorials/Beginner-CLI-Tools.html)是一个有用的工具来处理ROS。例如,您可以使用它快速检查话题是否正在发布;如果您的工作空间中包含 px4_msg,还可以详细查看这些话题的内容。该命令还允许您通过启动文件(launch file)启动更复杂的 ROS 系统。下文显示了几种可能性。 ### ros2 topic list @@ -1040,8 +1004,7 @@ hil_state: 0 ### ros2 topic hz -你可以使用 ros2 topic hz 命令获取消息速率相关的统计信息。 -例如,获取`SensorCombined`速率: +你可以使用 ros2 topic hz 命令获取消息速率相关的统计信息。例如,获取`SensorCombined`速率: ```sh ros2 topic hz /fmu/out/sensor_combined @@ -1066,8 +1029,7 @@ min: 0.000s max: 0.012s std dev: 0.00148s window: 3960 ### ros2 launch -ros2 launch 命令用于启动一个 ROS 2 启动文件 -例如,前面我们使用 ros2 launch px4_ros_com sensor_combined_listener.launch.py 命令启动了监听器示例。 +ros2 launch 命令用于启动一个 ROS 2 启动文件例如,前面我们使用 ros2 launch px4_ros_com sensor_combined_listener.launch.py 命令启动了监听器示例。 你并非必须使用启动文件,但如果你的 ROS 2 系统较为复杂,需要启动多个组件,那么启动文件会非常实用。 @@ -1081,15 +1043,13 @@ ros2 launch 命令用于启动一个 ROS 2 启动文件 如果有任何缺失,可以单独添加: -- **`colcon`** 构建工具应该在开发工具中。 - 可以使用以下方式安装它: +- **`colcon`** 构建工具应该在开发工具中。可以使用以下方式安装它: ```sh sudo apt install python3-colcon-common-extensions ``` -- 变换库(transforms library)所使用的 Eigen3 库,应同时存在于桌面版(desktop)功能包和基础版(base)功能包中。 - 它应该安装在显示中: +- 变换库(transforms library)所使用的 Eigen3 库,应同时存在于桌面版(desktop)功能包和基础版(base)功能包中。它应该安装在显示中: :::: tabs diff --git a/docs/zh/security/index.md b/docs/zh/security/index.md new file mode 100644 index 00000000000..5018eafd941 --- /dev/null +++ b/docs/zh/security/index.md @@ -0,0 +1,26 @@ +# Security + +Securing PX4 for a production vehicle is the integrator's responsibility. + +:::tip +PX4 is open by default: every PX4 control interface is unauthenticated, unsigned and unencrypted, and any peer that can reach a link can command the vehicle. +This is intended! +::: + +This section provides links to security documentation for integrators and security researchers. + +## Integrators + +- [MAVLink Security Hardening](../mavlink/security_hardening.md) — what an unauthenticated link exposes, and the checklist for a production deployment. +- [MAVLink Message Signing](../mavlink/message_signing.md) — authenticating MAVLink frames, and what signing does not cover. +- [Bootloader Secure Boot](../advanced_config/bootloader_secure_boot.md) — verifying firmware at boot, and replacing the committed test key. +- [Log Encryption](../dev_log/log_encryption.md) — encrypting flight logs at rest. +- [Read-Only Parameters](../advanced/parameters_and_configurations.md#read-only-parameters) — locking down settings that end users should not change. + +Securing the link itself sits below PX4. +An encrypted radio, a VPN or IPsec uses standard cryptography and protects every interface at once, including the ones MAVLink signing does not cover. + +## Security Researchers + +- [Security Policy](https://github.com/PX4/PX4-Autopilot/blob/main/SECURITY.md) — supported versions, how to report a vulnerability, and the rules for AI-assisted findings. +- [Security Scope](https://github.com/PX4/PX4-Autopilot/blob/main/SECURITY_SCOPE.md) — where PX4's security boundary sits, and what is in scope for a report. diff --git a/docs/zh/sensor/airspeed.md b/docs/zh/sensor/airspeed.md index e4d868f1c6c..e3f9058a7b6 100644 --- a/docs/zh/sensor/airspeed.md +++ b/docs/zh/sensor/airspeed.md @@ -25,7 +25,7 @@ Recommended digital airspeed sensors include: - [RCDrone Digital AirSpeed sensor ASPD-DLVR](https://rcdrone.top/products/matek-mateksys-digital-airspeed-sensor-aspd-dlvr) - DroneCAN interface - [Holybro High Precision DroneCAN Airspeed Sensor - DLVR](https://holybro.com/collections/sensors/products/high-precision-dronecan-airspeed-sensor-dlvr) - - [RaccoonLab Cyphal/CAN and DroneCAN Airspeed Sensor - MS4525DO](https://raccoonlab.co/tproduct/360882105-652259850171-cyphal-and-dronecan-airspeed-v2) + - [RaccoonLab Cyphal/CAN and DroneCAN Airspeed Sensor - MS4525DO](https://docs.raccoonlab.co/guide/airspeed/) - [Avionics Anonymous Air Data Computer with OAT probe](https://www.tindie.com/products/avionicsanonymous/uavcan-air-data-computer-airspeed-sensor/) - [UAV-DEV GmbH DroneCAN Airspeed and Barometer Sensor - AUAV](https://wiki.uav-dev.com/en/product/airspeed/auav) - Based on [Venturi effect](https://en.wikipedia.org/wiki/Venturi_effect) diff --git a/docs/zh/sensor/barometer.md b/docs/zh/sensor/barometer.md index 02d4bc8a482..94ee753bdea 100644 --- a/docs/zh/sensor/barometer.md +++ b/docs/zh/sensor/barometer.md @@ -15,7 +15,7 @@ Generally barometers require no user configuration (or thought)! They are also present in other hardware: - [CUAV NEO 3 Pro GNSS module](https://doc.cuav.net/gps/neo-series-gnss/en/neo-3-pro.html#key-data) ([MS5611](../modules/modules_driver_baro.md#ms5611)) -- [RaccoonLab L1 GNSS NEO-M8N](https://raccoonlab.co/tproduct/360882105-258620719271-cyphal-and-dronecan-gnss-m8n-magnetomete) +- [RaccoonLab L1 GNSS NEO-M8N](https://docs.raccoonlab.co/guide/gps_mag_baro/) At time of writing, drivers/parts include: bmp280, bmp388 (and BMP380), dps310, goertek (spl06), invensense (icp10100, icp10111, icp101xx, icp201xx), lps22hb, lps25h, lps33hw, maiertek (mpc2520), mpl3115a2, ms5611, ms5837, tcbp001ta. diff --git a/docs/zh/sensor/rangefinders.md b/docs/zh/sensor/rangefinders.md index c56b3800b38..2a441d5b40b 100644 --- a/docs/zh/sensor/rangefinders.md +++ b/docs/zh/sensor/rangefinders.md @@ -128,8 +128,7 @@ PX4 提供以下通过 I2C总线连接的型号:TeraRanger One, TeraRanger Evo ### Ainstein US-D1 标准雷达高度计 The _Ainstein_ [US-D1 Standard Radar Altimeter](../sensor/ulanding_radar.md) is compact microwave rangefinder that has been optimised for use on UAVs. -它有大约50米的感测范围。 -该产品的一个特别优势是它可以在所有天气条件下和所有地形类型(包括水)上有效运行。 +它有大约50米的感测范围。该产品的一个特别优势是它可以在所有天气条件下和所有地形类型(包括水)上有效运行。 ### LeddarOne @@ -158,7 +157,7 @@ The [Avionics Anonymous UAVCAN Laser Altimeter Interface](../dronecan/avanon_las ### RaccoonLab Cyphal and DroneCAN Rangefinder Adapter -The [RaccoonLab Cyphal and DroneCAN Rangefinder Adapter](https://raccoonlab.co/tproduct/360882105-910084093051-cyphal-and-dronecan-rangefinder-adapter) allows several common rangefinders to be connected to the CAN bus via Cyphal or DroneCAN, providing a more robust interface than I2C or UART. +The [RaccoonLab Cyphal and DroneCAN Rangefinder Adapter](https://docs.raccoonlab.co/guide/rangefinder/) allows several common rangefinders to be connected to the CAN bus via Cyphal or DroneCAN, providing a more robust interface than I2C or UART. This adapter efficiently reads measurements via I2C or UART and publishes range data in meters, making it a versatile solution for UAVs, robotics, and technical documentation applications. Supported rangefinders include: diff --git a/docs/zh/sensor/tachometers.md b/docs/zh/sensor/tachometers.md index 4a8aee8f749..993d69d6a23 100644 --- a/docs/zh/sensor/tachometers.md +++ b/docs/zh/sensor/tachometers.md @@ -6,8 +6,7 @@ 当前 PX4 仅记录 RPM 数据:它没有用于状态估计或控制。 ::: -本节列出了 PX4 支持的转速计传感器(更详细的文档点击链接)。 -更详细的设置和配置信息在下方(和侧边栏)的主题链接中提供 +本节列出了 PX4 支持的转速计传感器(更详细的文档点击链接)。更详细的设置和配置信息在下方(和侧边栏)的主题链接中提供 ![TFRPM01A](../../assets/hardware/sensors/tfrpm/tfrpm01_electronics.jpg) diff --git a/docs/zh/sensor_bus/i2c_development.md b/docs/zh/sensor_bus/i2c_development.md index 8e7cbef1b42..06f6fbe639f 100644 --- a/docs/zh/sensor_bus/i2c_development.md +++ b/docs/zh/sensor_bus/i2c_development.md @@ -1,14 +1,12 @@ # I2C Bus (Development Overview) -I2C 是一种分组交换串行通信协议,允许多个主设备连接到多个从属设备,每个连接只需使用2根电线。 -它用于在短距离、板内通信中将低速外设 IC 连接到处理器和微控制器。 +I2C 是一种分组交换串行通信协议,允许多个主设备连接到多个从属设备,每个连接只需使用2根电线。它用于在短距离、板内通信中将低速外设 IC 连接到处理器和微控制器。 Pixhawk/PX4 支持: - Connecting off board components that require higher data rates than provided by a strict serial UART, such as rangefinders. - 与仅支持 I2C 的外围设备兼容。 -- 允许多个设备连接到单个总线(有效保护端口)。 - 例如,LED、指南针、测距仪等。 +- 允许多个设备连接到单个总线(有效保护端口)。例如,LED、指南针、测距仪等。 :::info The page [Hardware > I2C Peripherals](../sensor_bus/i2c_general.md) contains information about how to _use_ (rather than integrate) I2C peripherals and solve common setup problems. diff --git a/docs/zh/sensor_bus/index.md b/docs/zh/sensor_bus/index.md index c270f44dab7..82fd43cded4 100644 --- a/docs/zh/sensor_bus/index.md +++ b/docs/zh/sensor_bus/index.md @@ -1,4 +1,3 @@ # 传感器和执行器 I/O -本节包含有关 PX4 中集成的传感器和执行器的主题。 -它涵盖传感器总线([I2C](../sensor_bus/i2c_general.md)、 [CAN](../can/index.md)、 [UART](../uart/index.md)、SPI)以及主要的 PWM 端口。 +本节包含有关 PX4 中集成的传感器和执行器的主题。它涵盖传感器总线([I2C](../sensor_bus/i2c_general.md)、 [CAN](../can/index.md)、 [UART](../uart/index.md)、SPI)以及主要的 PWM 端口。 diff --git a/docs/zh/sim_gazebo_classic/index.md b/docs/zh/sim_gazebo_classic/index.md index 4bb624c6608..46eb262a8c5 100644 --- a/docs/zh/sim_gazebo_classic/index.md +++ b/docs/zh/sim_gazebo_classic/index.md @@ -6,8 +6,7 @@ Until then you can continue to use Gazebo-Classic on Ubuntu 22.04 for the few ca For more information see [PX4-Autopilot#23602: GZ Feature tracker](https://github.com/PX4/PX4-Autopilot/issues/23602). ::: -Gazebo Classic 是一个功能强大的三维仿真环境,专门用于测试避障和计算机视觉等自主机器人技术。 -本页描述了在SITL和单一载具上的使用方式。 +Gazebo Classic 是一个功能强大的三维仿真环境,专门用于测试避障和计算机视觉等自主机器人技术。本页描述了在SITL和单一载具上的使用方式。 Gazebo Classic can also be used with [HITL](../simulation/hitl.md) and for [multi-vehicle simulation](../sim_gazebo_classic/multi_vehicle_simulation.md). **Supported Vehicles:** Quad ([Iris](../airframes/airframe_reference.md#copter_quadrotor_x_generic_quadcopter), Hex (Typhoon H480), [Generic Standard VTOL (QuadPlane)](../airframes/airframe_reference.md#vtol_standard_vtol_generic_standard_vtol), Tailsitter, Plane, Rover, Submarine/UUV. diff --git a/docs/zh/sim_jmavsim/index.md b/docs/zh/sim_jmavsim/index.md index b808cd9dc4b..02b6dd42319 100644 --- a/docs/zh/sim_jmavsim/index.md +++ b/docs/zh/sim_jmavsim/index.md @@ -1,401 +1 @@ -# jMAVSim with SITL - -:::warning -This simulator is [community supported and maintained](../simulation/community_supported_simulators.md). -It may or may not work with current versions of PX4 and may be removed in future releases. - -See [Toolchain Installation](../dev_setup/dev_env.md) for information about the environments and tools supported by the core development team. -::: - -jMAVSim is a simple multirotor/Quad simulator that allows you to fly _copter_ type vehicles running PX4 around a simulated world. -It is easy to set up and can be used to test that your vehicle can take off, fly, land, and responds appropriately to various fail conditions (e.g. GPS failure). - -Supported Vehicles: - -- Quad - -This topic shows how to set up jMAVSim to connect with a SITL version of PX4. - -:::tip -jMAVSim can also be used for HITL Simulation ([as shown here](../simulation/hitl.md#jmavsim-quadrotor-only)). -::: - -## 安装 - -jMAVSim requires JDK 17 or later. -On Ubuntu and Windows, the [standard development environment setup](../dev_setup/dev_env.md) scripts install all required dependencies including Java. -On macOS, `./Tools/setup/macos.sh --sim-tools` installs a suitable JDK and links it into `/Library/Java/JavaVirtualMachines` (see [macOS Development Environment](../dev_setup/dev_env_mac.md)). -If you set up without `--sim-tools`, install Java manually as shown below. - -### macOS - -jMAVSim requires OpenJDK 17 or later. -Install it via Homebrew: - -```sh -brew install openjdk@17 -``` - -Homebrew installs OpenJDK but does not link it into your `PATH`, so you need to set `JAVA_HOME` for jMAVSim to find it. -Add this to your shell profile (e.g. `~/.zshrc`): - -```sh -export JAVA_HOME=$(/usr/libexec/java_home -v 17) -``` - -## Simulation Environment - -Software in the Loop Simulation runs the complete system on the host machine and simulates the autopilot. -It connects via local network to the simulator. -The setup looks like this: - -[![Mermaid graph: SITL Simulator](https://mermaid.ink/img/eyJjb2RlIjoiZ3JhcGggTFI7XG4gIFNpbXVsYXRvci0tPk1BVkxpbms7XG4gIE1BVkxpbmstLT5TSVRMOyIsIm1lcm1haWQiOnsidGhlbWUiOiJkZWZhdWx0In0sInVwZGF0ZUVkaXRvciI6ZmFsc2V9)](https://mermaid-js.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoiZ3JhcGggTFI7XG4gIFNpbXVsYXRvci0tPk1BVkxpbms7XG4gIE1BVkxpbmstLT5TSVRMOyIsIm1lcm1haWQiOnsidGhlbWUiOiJkZWZhdWx0In0sInVwZGF0ZUVkaXRvciI6ZmFsc2V9) - - - -## Running SITL - -After ensuring that the [simulation prerequisites](../dev_setup/dev_env.md) are installed on the system, just launch: The convenience make target will compile the POSIX host build and run the simulation. - -```sh -make px4_sitl_default jmavsim -``` - -This will bring up the PX4 shell: - -```sh -[init] shell id: 140735313310464 -[init] task name: px4 - -______ __ __ ___ -| ___ \ \ \ / / / | -| |_/ / \ V / / /| | -| __/ / \ / /_| | -| | / /^\ \ \___ | -\_| \/ \/ |_/ - -Ready to fly. - - -pxh> -``` - -It will also bring up a window showing a 3D view of the [jMAVSim](https://github.com/PX4/jMAVSim) simulator: - -![jMAVSim 3d View](../../assets/simulation/jmavsim/jmavsim.jpg) - -## Taking it to the Sky - -The system will start printing status information. -You will be able to start flying once you have a position lock (shortly after the console displays the message: _EKF commencing GPS fusion_). - -To takeoff enter the following into the console: - -```sh -pxh> commander takeoff -``` - -You can use _QGroundControl_ to fly a mission or to connect to a [joystick](#using-a-joystick). - -## Usage/Configuration Options - -Options that apply to all simulators are covered in the top level [Simulation](../simulation/index.md#sitl-simulation-environment) topic (some of these may be duplicated below). - -### Simulating Sensor/Hardware Failure - -[Simulate Failsafes](../simulation/failsafes.md) explains how to trigger safety failsafes like GPS failure and battery drain. - -### Set Custom Takeoff Location - -The default takeoff location in can be overridden using the environment variables: `PX4_HOME_LAT`, `PX4_HOME_LON`, and `PX4_HOME_ALT`. - -For example, to set the latitude, longitude and altitude: - -```sh -export PX4_HOME_LAT=28.452386 -export PX4_HOME_LON=-13.867138 -export PX4_HOME_ALT=28.5 -make px4_sitl_default jmavsim -``` - -### Change Simulation Speed - -The simulation speed can be increased or decreased with respect to realtime using the environment variable `PX4_SIM_SPEED_FACTOR`. - -To run at double real-time: - -```sh -PX4_SIM_SPEED_FACTOR=2 make px4_sitl_default jmavsim -``` - -To run at half real-time: - -```sh -PX4_SIM_SPEED_FACTOR=0.5 make px4_sitl_default jmavsim -``` - -To apply a factor to all SITL runs in the current session, use `EXPORT`: - -```sh -export PX4_SIM_SPEED_FACTOR=2 -make px4_sitl_default jmavsim -``` - -### Using a Joystick - -Joystick and thumb-joystick support are supported through _QGroundControl_ ([setup instructions here](../simulation/index.md#joystick-gamepad-integration)). - -### Simulating a Wifi Drone - -There is a special target to simulate a drone connected via Wifi on the local network: - -```sh -make broadcast jmavsim -``` - -The simulator broadcasts its address on the local network as a real drone would do. - -### Start JMAVSim and PX4 Separately - -You can start JMAVSim and PX4 separately: - -```sh -./Tools/simulation/jmavsim/jmavsim_run.sh -l -make px4_sitl none -``` - -This allows a faster testing cycle (restarting jMAVSim takes significantly more time). - -### Headless Mode - -To start jMAVSim without the GUI, set the env variable `HEADLESS=1` as shown: - -```sh -HEADLESS=1 make px4_sitl jmavsim -``` - -## 基于gazebo的多飞行器仿真 - -JMAVSim can be used for multi-vehicle simulation: [Multi-Vehicle Sim with JMAVSim](../sim_jmavsim/multi_vehicle.md). - -## Lockstep - -PX4 SITL and jMAVSim have been set up to run in _lockstep_. -What this means is that PX4 and the simulator run at the same speed, and therefore can react appropriately to sensor and actuator messages. -Lockstep makes it possible to [change the simulation speed](#change-simulation-speed), and also to pause it in order to step through code. - -#### Lockstep Sequence - -The sequence of steps for lockstep are: - -1. The simulation sends a sensor message [HIL_SENSOR](https://mavlink.io/en/messages/common.html#HIL_SENSOR) including a timestamp `time_usec` to update the sensor state and time of PX4. -2. PX4 receives this and does one iteration of state estimation, controls, etc. and eventually sends an actuator message [HIL_ACTUATOR_CONTROLS](https://mavlink.io/en/messages/common.html#HIL_ACTUATOR_CONTROLS). -3. The simulation waits until it receives the actuator/motor message, then simulates the physics and calculates the next sensor message to send to PX4 again. - -The system starts with a "freewheeling" period where the simulation sends sensor messages including time and therefore runs PX4 until it has initialized and responds with an actuator message. - -#### Disabling Lockstep - -The lockstep simulation can be disabled if, for example, SITL is to be used with a simulator that does not support this feature. -In this case the simulator and PX4 use the host system time and do not wait on each other. - -To disable lockstep in: - -- PX4, run `make px4_sitl_default boardconfig` and set the `BOARD_NOLOCKSTEP` "Force disable lockstep" symbol which is located under toolchain. -- jMAVSim, remove `-l` in [sitl_run.sh](https://github.com/PX4/PX4-Autopilot/blob/main/Tools/simulation/jsbsim/sitl_run.sh#L40), or make sure otherwise that the java binary is started without the `-lockstep` flag. - - - - - - - -## Extending and Customizing - -To extend or customize the simulation interface, edit the files in the **Tools/jMAVSim** folder. -The code can be accessed through the[jMAVSim repository](https://github.com/px4/jMAVSim) on Github. - -:::info -The build system enforces the correct submodule to be checked out for all dependencies, including the simulator. -It will not overwrite changes in files in the directory, however, when these changes are committed the submodule needs to be registered in the Firmware repo with the new commit hash. -To do so, `git add Tools/jMAVSim` and commit the change. -This will update the GIT hash of the simulator. -::: - -## Interfacing to ROS - -The simulation can be [interfaced to ROS](../simulation/ros_interface.md) the same way as onboard a real vehicle. - -## Important Files - -- The startup scripts are discussed in [System Startup](../concept/system_startup.md). -- The simulated root file system ("`/`" directory) is created inside the build directory here: `build/px4_sitl_default/rootfs`. - -## Display-Only Mode - -jMAVSim can run as a display-only renderer for other simulators (like [SIH](../sim_sih/index.md)), with its internal physics disabled. -In this mode, jMAVSim receives vehicle position via MAVLink and only renders the 3D view. - -To use jMAVSim as a display for SIH running in SITL: - -```sh -# Start SIH first -make px4_sitl_sih sihsim_quadx - -# In another terminal, start jMAVSim in display-only mode -./Tools/simulation/jmavsim/jmavsim_run.sh -p 19410 -u -q -o # 19410 is the default SIH display port -``` - -For SIH running on flight controller hardware: - -```sh -./Tools/simulation/jmavsim/jmavsim_run.sh -q -d /dev/ttyACM0 -b 2000000 -o -``` - -Use `-a` for airplane display or `-t` for tailsitter display. - -## Command-Line Reference - -The `jmavsim_run.sh` launch script accepts the following flags: - -| Flag | 描述 | -| ------------- | -------------------------------------------------------------------------------------------- | -| `-b ` | Serial baud rate (default: 921600) | -| `-d ` | Serial device path (e.g., `/dev/ttyACM0`) | -| `-u` | Use UDP connection instead of serial | -| `-i ` | Simulated MAVLink system ID | -| `-p ` | UDP port (default: 14560) | -| `-q` | No interactive console | -| `-s ` | TCP serial port | -| `-r ` | Render rate in Hz | -| `-l` | Enable lockstep | -| `-o` | Display-only mode (disable physics, render only) | -| `-a` | Use airplane model | -| `-t` | Use tailsitter model | -| `HEADLESS=1` | Environment variable: run without GUI window | - -## How jMAVSim Works - -jMAVSim is a Java-based lightweight simulator that communicates with PX4 via MAVLink HIL (Hardware-In-the-Loop) messages. - -In normal mode: - -1. PX4 sends actuator commands via [HIL_ACTUATOR_CONTROLS](https://mavlink.io/en/messages/common.html#HIL_ACTUATOR_CONTROLS). -2. jMAVSim runs its physics engine to compute the vehicle state. -3. jMAVSim sends sensor data back via [HIL_SENSOR](https://mavlink.io/en/messages/common.html#HIL_SENSOR) and [HIL_GPS](https://mavlink.io/en/messages/common.html#HIL_GPS). - -In **display-only mode** (`-o` flag), jMAVSim disables its physics engine and only reads [HIL_STATE_QUATERNION](https://mavlink.io/en/messages/common.html#HIL_STATE_QUATERNION) messages to render the vehicle position. -This allows it to visualize vehicles from other simulators like SIH. - -jMAVSim supports [lockstep synchronization](#lockstep) with PX4 (enabled with `-l` flag), ensuring deterministic simulation results. - -## Keyboard Shortcuts - -Camera modes in the jMAVSim 3D view: - -| Key | Camera Mode | -| -------------------------------- | ------------------------------------------------------- | -| **F** | First person (attached to vehicle) | -| **S** | Stationary (fixed position) | -| **G** | Gimbal (follows vehicle orientation) | -| **(default)** | Third person follow | - -## 故障处理 - -### java.long.NoClassDefFoundError - -```sh -Exception in thread "main" java.lang.NoClassDefFoundError: javax/vecmath/Tuple3d -at java.base/java.lang.Class.forName0(Native Method) -at java.base/java.lang.Class.forName(Class.java:374) -at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:56) -Caused by: java.lang.ClassNotFoundException: javax.vecmath.Tuple3d -at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:466) -at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:566) -at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499) -... 3 more -Exception in thread "main" java.lang.NoClassDefFoundError: javax/vecmath/Tuple3d -at java.base/java.lang.Class.forName0(Native Method) -at java.base/java.lang.Class.forName(Class.java:374) -at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:56) -Caused by: java.lang.ClassNotFoundException: javax.vecmath.Tuple3d -at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:466) -at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:566) -at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499) -``` - -This error should no longer occur once the jMAVSim submodule is [updated to newer jar libs](https://github.com/PX4/jMAVSim/pull/119) and Java 11 or Java 14 should work fine. - -### An illegal reflective access operation has occurred - -This warning can be ignored (it will probably be displayed but the simulation will still work correctly). - -```sh -WARNING: An illegal reflective access operation has occurred -WARNING: Illegal reflective access by javax.media.j3d.JoglPipeline (rsrc:j3dcore.jar) to method sun.awt.AppContext.getAppContext() -WARNING: Please consider reporting this to the maintainers of javax.media.j3d.JoglPipeline -WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations -WARNING: All illegal access operations will be denied in a future release -Inconsistency detected by ld.so: dl-lookup.c: 112: check_match: Assertion version->filename == NULL || ! _dl_name_match_p (version->filename, map)' failed! -``` - -### java.awt.AWTError: Assistive Technology not found: org.GNOME.Accessibility.AtkWrapper - -```sh -Exception in thread "main" java.lang.reflect.InvocationTargetException -at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) -at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) -at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) -at java.lang.reflect.Method.invoke(Method.java:498) -at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58) -Caused by: java.awt.AWTError: Assistive Technology not found: org.GNOME.Accessibility.AtkWrapper -at java.awt.Toolkit.loadAssistiveTechnologies(Toolkit.java:807) -at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:886) -at java.awt.Window.getToolkit(Window.java:1358) -at java.awt.Window.init(Window.java:506) -at java.awt.Window.(Window.java:537) -at java.awt.Frame.(Frame.java:420) -at java.awt.Frame.(Frame.java:385) -at javax.swing.JFrame.(JFrame.java:189) -at me.drton.jmavsim.Visualizer3D.(Visualizer3D.java:104) -at me.drton.jmavsim.Simulator.(Simulator.java:157) -at me.drton.jmavsim.Simulator.main(Simulator.java:678) -``` - -If you see this error, try this workaround: - -Edit the **accessibility.properties** file: - -```sh -sudo gedit /etc/java-8-openjdk/accessibility.properties -``` - -and comment out the line indicated below: - -```sh -#assistive_technologies=org.GNOME.Accessibility.AtkWrapper -``` - -For more info, check [this GitHub issue](https://github.com/PX4/PX4-Autopilot/issues/9557). -A contributor found the fix in [askubuntu.com](https://askubuntu.com/questions/695560/assistive-technology-not-found-awterror). - -### Exception in thread "main" java.lang.UnsupportedClassVersionError - -When compiling jMAVsim, you might encounter the following error: - -```sh -Exception in thread "main" java.lang.UnsupportedClassVersionError: me/drton/jmavsim/Simulator has been compiled by a more recent version of the Java Runtime (class file version 59.0), this version of the Java Runtime only recognizes class file versions up to 58.0 -``` - -This error is telling you, you need a more recent version of Java in your environment. -Class file version 58 corresponds to jdk14, version 59 to jdk15, version 60 to jdk 16 etc. - -To fix it under macOS, install a newer OpenJDK via Homebrew: - -```sh -brew install openjdk@17 -``` + diff --git a/docs/zh/sim_jmavsim/multi_vehicle.md b/docs/zh/sim_jmavsim/multi_vehicle.md index ba4100b5119..f290cdc9e72 100644 --- a/docs/zh/sim_jmavsim/multi_vehicle.md +++ b/docs/zh/sim_jmavsim/multi_vehicle.md @@ -1,53 +1 @@ -# Multi-Vehicle Simulation with JMAVSim - -This topic explains how to simulate multiple UAV (multicopter) vehicles using [JMAVSim](../sim_jmavsim/index.md) and SITL. -All vehicle instances are started at the same position in the simulation. - -:::tip -This is the easiest way to simulate multiple vehicles running PX4. -It is suitable for testing multi-vehicle support in _QGroundControl_ (or the [MAVSDK](https://mavsdk.mavlink.io/), etc.). -[Multi-Vehicle Simulation with Gazebo](../simulation/multi-vehicle-simulation.md) should be used for swarm simulations with many vehicles, or for testing features like computer vision that are only supported by Gazebo. -::: - -## How to Start Multiple Instances - -To start multiple instances (on separate ports): - -1. Build PX4 - - ```sh - make px4_sitl_default - ``` - -2. Run **sitl_multiple_run.sh**, specifying the number of instances to start (e.g. 2): - - ```sh - ./Tools/sitl_multiple_run.sh 2 - ``` - -3. Start the first instance in the same terminal (this will run in the foreground): - - ```sh - ./Tools/simulation/jmavsim/jmavsim_run.sh -l - ``` - -4. Open a new terminal for each subsequent instance, specifying the _simulation_ TCP port for the instance: - - ```sh - ./Tools/simulation/jmavsim/jmavsim_run.sh -p 4560 -l - ``` - - The port should be set to `4560+i` where `i` iterates for each instance (from `0` to `N-1`) - -_QGroundControl_ should automatically connect to all the new vehicle instances (all GCS traffic is sent to PX4's remote UDP port: `14550` from all instances). -The vehicle that is currently being controlled is displayed in the application to bar; you can select this vehicle text to display a selection list of all of the (simulated) connected vehicle instances (`Vehicle 1`, `Vehicle 2`, etc.) and choose a new vehicle to control. - -Developer APIs such as _MAVSDK_ or _MAVROS_ can connect to individual instances by listening on sequentially allocated PX4 remote UDP ports from `14540` (first instance) to `14549`. -Additional instances _all_ connect to port `14549`. - -> **Tip** The **sitl_multiple_run.sh** script starts a separate process for each vehicle. -> To restart the simulations after killing one of them, you must call **sitl_multiple_run.sh** again, and also restart each of the individual instances in their own terminals. - -## Additional Resources - -- See [Simulation](../simulation/index.md) for more information about the port configuration. + diff --git a/docs/zh/sim_jsbsim/index.md b/docs/zh/sim_jsbsim/index.md index 55fa4b218de..d5d43451cd6 100644 --- a/docs/zh/sim_jsbsim/index.md +++ b/docs/zh/sim_jsbsim/index.md @@ -7,9 +7,7 @@ It may or may not work with current versions of PX4. See [Toolchain Installation](../dev_setup/dev_env.md) for information about the environments and tools supported by the core development team. ::: -[JSBSim](https://jsbsim.sourceforge.net/index.html)是一款开源飞行仿真器(“飞行动力学模型”,FDM),可运行于 Microsoft Windows、Apple Macintosh、Linux、IRIX、Cygwin(Windows 上的 Unix 环境)等平台。 -其功能包括完全可配置的空气动力学和推进系统,可对飞行器的复杂飞行动力学进行建模。 -动力学模型还考虑了地球自转效应。 +[JSBSim](https://jsbsim.sourceforge.net/index.html)是一款开源飞行仿真器(“飞行动力学模型”,FDM),可运行于 Microsoft Windows、Apple Macintosh、Linux、IRIX、Cygwin(Windows 上的 Unix 环境)等平台。其功能包括完全可配置的空气动力学和推进系统,可对飞行器的复杂飞行动力学进行建模。动力学模型还考虑了地球自转效应。 支持的飞行器:固定翼飞机、四旋翼飞行器、六旋翼飞行器 @@ -33,8 +31,7 @@ These instructions were tested on Ubuntu 18.04 dpkg -i JSBSim-devel_1.1.0.dev1-.bionic.amd64.deb ``` -3. (可选)可使用 FlightGear 进行可视化。 - 如需安装 FlightGear,请参阅 FlightGear 安装说明(../sim_flightgear/index.md))。 +3. (可选)可使用 FlightGear 进行可视化。如需安装 FlightGear,请参阅 FlightGear 安装说明(../sim_flightgear/index.md))。 ## Running the Simulation @@ -45,8 +42,7 @@ cd /path/to/PX4-Autopilot make px4_sitl jsbsim ``` -这将同时运行 PX4 SITL 实例和 FlightGear 用户界面(用于可视化)。 -如果希望在不启动 FlightGear 用户界面的情况下运行,可在 make 命令前添加 HEADLESS=1。 +这将同时运行 PX4 SITL 实例和 FlightGear 用户界面(用于可视化)。如果希望在不启动 FlightGear 用户界面的情况下运行,可在 make 命令前添加 HEADLESS=1。 The supported vehicles and `make` commands are listed below (click on the links to see the vehicle images). diff --git a/docs/zh/sim_sih/hardware.md b/docs/zh/sim_sih/hardware.md index fa923367986..cd73e9717c4 100644 --- a/docs/zh/sim_sih/hardware.md +++ b/docs/zh/sim_sih/hardware.md @@ -94,7 +94,6 @@ You can add SIH to any board -- see [Check if SIH is in Firmware](#check-if-sih- - A flight controller with SIH module included in firmware (see [Firmware Builds with SIH](#firmware-builds-with-sih)). - USB connection for QGroundControl. -- Optional: jMAVSim for 3D visualization via serial link (see [Visualization](#hardware-visualization)). ## Check if SIH is in Firmware @@ -115,16 +114,24 @@ If you need a visual aid to see what the simulated vehicle is doing on hardware: Connect the flight controller via USB. QGC shows the vehicle on the map view with attitude, position, and telemetry, the same as a real flight. -### jMAVSim (3D Display-Only) +### Hawkeye (3D Display-Only) -jMAVSim can render a 3D view of the vehicle over a serial connection. No physics are simulated in jMAVSim -- it is display-only. +[Hawkeye](../sim_hawkeye/index.md) can render a 3D view of the vehicle from the [HIL_STATE_QUATERNION](https://mavlink.io/en/messages/common.html#HIL_STATE_QUATERNION) messages SIH sends. +No physics are simulated in Hawkeye: it is display-only. + +Hawkeye listens on UDP, so bridge the flight controller's serial link to UDP port 19410 (for example with [MAVProxy](https://ardupilot.org/mavproxy/)), then start Hawkeye: ```sh -./Tools/simulation/jmavsim/jmavsim_run.sh -q -d /dev/ttyACM0 -b 2000000 -o +# Terminal 1 +mavproxy.py --master /dev/ttyACM0 --out udp:localhost:19410 --out udp:localhost:14550 + +# Terminal 2 +hawkeye ``` Where `/dev/ttyACM0` is the serial device for the flight controller. On macOS, this is typically `/dev/tty.usbmodem*`. +The second `--out` keeps QGroundControl connected on its default port. ## Controlling Actuators diff --git a/docs/zh/sim_xplane/index.md b/docs/zh/sim_xplane/index.md index 92a839f7ee9..07a065fae4c 100644 --- a/docs/zh/sim_xplane/index.md +++ b/docs/zh/sim_xplane/index.md @@ -22,8 +22,7 @@ PX4 为以下机体提供 X-Plane SITL 机架配置: | Alia-250 | VTOL quadplane | `make px4_sitl_default xplane_alia250` | | QuadTailsitter | VTOL tailsitter | `make px4_sitl_default xplane_qtailsitter` | -匹配的 X-Plane 飞机文件和桥接配置由 px4xplane 项目分发。 -如果 PX4 具备支持 SITL 的相应控制路径,并且 px4xplane 能够将所需的执行器输出映射到可写的 X-Plane dataref,也可以集成其他 X-Plane 飞机或机体模型。 +匹配的 X-Plane 飞机文件和桥接配置由 px4xplane 项目分发。如果 PX4 具备支持 SITL 的相应控制路径,并且 px4xplane 能够将所需的执行器输出映射到可写的 X-Plane dataref,也可以集成其他 X-Plane 飞机或机体模型。 ## 安装 @@ -33,34 +32,27 @@ PX4 为以下机体提供 X-Plane SITL 机架配置: 3. 从 [px4xplane 发布页面](https://github.com/alireza787b/px4xplane/releases)下载适用于当前操作系统的最新 px4xplane 发布包。 -4. 该发布包是压缩归档文件,而不是安装程序。 - 解压发布包,并将完整的 px4xplane 插件文件夹复制到: +4. 该发布包是压缩归档文件,而不是安装程序。解压发布包,并将完整的 px4xplane 插件文件夹复制到: ```sh X-Plane/Resources/plugins/px4xplane ``` -5. 将同一解压包中匹配的 X-Plane 飞机文件夹复制到 X-Plane 的飞机目录中。 - 除非发布说明另有要求,否则应将发布包中的 64/config.ini 与 px4xplane 插件放在一起。 +5. 将同一解压包中匹配的 X-Plane 飞机文件夹复制到 X-Plane 的飞机目录中。除非发布说明另有要求,否则应将发布包中的 64/config.ini 与 px4xplane 插件放在一起。 [px4xplane 构建和安装指南](https://github.com/alireza787b/px4xplane/blob/master/docs/BUILD.md#installation)提供了有关插件文件夹结构的更多详细信息。 ## 网络设置 -PX4 通过 TCP 端口 4560 连接到 X-Plane 桥接器。 -默认主机为 localhost,适用于 PX4 和 X-Plane 在同一台 Linux 或 macOS 计算机上运行的情况。 +PX4 通过 TCP 端口 4560 连接到 X-Plane 桥接器。默认主机为 localhost,适用于 PX4 和 X-Plane 在同一台 Linux 或 macOS 计算机上运行的情况。 -在 Windows 上,通常是在 Windows 中原生运行 X-Plane,并在 WSL2 中运行 PX4。 -在这种情况下,启动 PX4 前,应在 WSL2 shell 中将 PX4_SIM_HOSTNAME 设置为 Windows 主机的 IP 地址。 -该变量在 PX4/SITL 端设置,并指向运行 X-Plane 和 px4xplane 插件的主机: +在 Windows 上,通常是在 Windows 中原生运行 X-Plane,并在 WSL2 中运行 PX4。在这种情况下,启动 PX4 前,应在 WSL2 shell 中将 PX4_SIM_HOSTNAME 设置为 Windows 主机的 IP 地址。该变量在 PX4/SITL 端设置,并指向运行 X-Plane 和 px4xplane 插件的主机: ```sh export PX4_SIM_HOSTNAME=$(ip route | awk '/default/ {print $3; exit}') ``` -然后从同一 shell 启动所需的 PX4 构建目标。 -如果 PX4 在 Docker 或另一台计算机上运行,则应将 PX4_SIM_HOSTNAME 设置为 X-Plane 计算机可访问的 IP 地址或主机名。 -确保 X-Plane 主机的防火墙允许 TCP 端口 4560 的入站连接。 +然后从同一 shell 启动所需的 PX4 构建目标。如果 PX4 在 Docker 或另一台计算机上运行,则应将 PX4_SIM_HOSTNAME 设置为 X-Plane 计算机可访问的 IP 地址或主机名。确保 X-Plane 主机的防火墙允许 TCP 端口 4560 的入站连接。 ## Running SITL @@ -68,7 +60,7 @@ export PX4_SIM_HOSTNAME=$(ip route | awk '/default/ {print $3; exit}') 2. 确认 X-Plane 插件菜单中已加载 px4xplane 插件。 -3. 启动 PX4 SITL。 例如: +3. 启动 PX4 SITL。例如: ```sh cd PX4-Autopilot @@ -88,8 +80,7 @@ export PX4_SIM_HOSTNAME=$(ip route | awk '/default/ {print $3; exit}') 3. 配置 px4xplane 桥接器,将 PX4 执行器输出映射到该飞机的 dataref。 4. 根据 ULog 数据和 X-Plane 真值日志调优 PX4 参数。 -有关桥接器配置的详细信息,请参阅 px4xplane 自定义机架指南(https://github.com/alireza787b/px4xplane/blob/master/docs/custom-airframe-config.md)。 -有关 X-Plane 端的飞机设计和 dataref 映射,请参阅官方 Plane Maker 手册(https://developer.x-plane.com/manuals/planemaker/)和 X-Plane dataref 参考文档(https://developer.x-plane.com/datarefs/)。 +有关桥接器配置的详细信息,请参阅 px4xplane 自定义机架指南(https://github.com/alireza787b/px4xplane/blob/master/docs/custom-airframe-config.md)。有关 X-Plane 端的飞机设计和 dataref 映射,请参阅官方 Plane Maker 手册(https://developer.x-plane.com/manuals/planemaker/)和 X-Plane dataref 参考文档(https://developer.x-plane.com/datarefs/)。 ## 故障处理 diff --git a/docs/zh/simulation/community_supported_simulators.md b/docs/zh/simulation/community_supported_simulators.md index fe3e4fae045..1e47ce83fdb 100644 --- a/docs/zh/simulation/community_supported_simulators.md +++ b/docs/zh/simulation/community_supported_simulators.md @@ -16,7 +16,6 @@ Questions about these tools should be raised on the [discussion forums](../contr | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [AirSim](../sim_airsim/index.md) |

A cross platform simulator that provides physically and visually realistic simulations. This simulator is resource intensive, and requires a significantly more powerful computer than the other simulators described here.

Supported Vehicles: Iris (MultiRotor model and a configuration for PX4 QuadRotor in the X configuration).

| | [FlightGear](../sim_flightgear/index.md) |

A simulator that provides physically and visually realistic simulations. In particular it can simulate many weather conditions, including thunderstorms, snow, rain and hail, and can also simulate thermals and different types of atmospheric flows. [Multi-vehicle simulation](../sim_flightgear/multi_vehicle.md) is also supported.

Supported Vehicles: Plane, Autogyro, Rover

| -| [JMAVSim](../sim_jmavsim/index.md) |

A simple multirotor/quad simulator. This was previously part of the PX4 development toolchain but was removed in favour of [Gazebo](../sim_gazebo_gz/index.md).

Supported Vehicles: Quad

| | [JSBSim](../sim_jsbsim/index.md) |

A simulator that provides advanced flight dynamics models. This can be used to model realistic flight dynamics based on wind tunnel data.

Supported Vehicles: Plane, Quad, Hex

| | [PteroSim](../sim_pterosim/index.md) |

Proprietary high-fidelity UAV simulation built on Unreal Engine 5 and JSBSim. Connects to PX4 SITL over the Simulator MAVLink API with lockstep synchronization.

Supported Vehicles: Free tier: Multicopter. Paid tiers: Fixed-wing, VTOL, Helicopter.

| | [RotorPy](../sim_rotorpy/index.md) |

A Python-based multirotor simulation environment with aerodynamic forces and moments, actuator limits, sensor noise, wind, obstacles, and a Gymnasium interface for research workflows.

Supported Vehicles: Quad

| diff --git a/docs/zh/simulation/failsafes.md b/docs/zh/simulation/failsafes.md index 136fda9bcb8..55a2b674cd8 100644 --- a/docs/zh/simulation/failsafes.md +++ b/docs/zh/simulation/failsafes.md @@ -2,8 +2,7 @@ [Failsafes](../config/safety.md) define the safe limits/conditions under which you can safely use PX4, and the action that will be performed if a failsafe is triggered (for example, landing, holding position, or returning to a specified point). -在 SITL 中,默认情况下会禁用某一些故障,以便方便模拟使用。 -本主题说明如何在实际世界中尝试 SITL 仿真之前测试安全关键行为。 +在 SITL 中,默认情况下会禁用某一些故障,以便方便模拟使用。本主题说明如何在实际世界中尝试 SITL 仿真之前测试安全关键行为。 :::info You can also test failsafes using [HITL simulation](../simulation/hitl.md). diff --git a/docs/zh/simulation/hardware.md b/docs/zh/simulation/hardware.md index ad1229bcfa7..5ef1e8d9837 100644 --- a/docs/zh/simulation/hardware.md +++ b/docs/zh/simulation/hardware.md @@ -9,14 +9,14 @@ It can surface issues with running PX4 that might hidden when running on a deskt Two simulation approaches are available, controlled by the [SYS_HITL](../advanced_config/parameter_reference.md#SYS_HITL) parameter: -- **[HITL Simulation](../simulation/hitl.md) (`SYS_HITL=1`):** An external simulator (Gazebo Classic or jMAVSim) runs physics on a companion computer and sends sensor data to the flight controller via MAVLink HIL messages. Requires a USB/UART connection and simulator setup. +- **[HITL Simulation](../simulation/hitl.md) (`SYS_HITL=1`):** An external simulator (Gazebo Classic) runs physics on a companion computer and sends sensor data to the flight controller via MAVLink HIL messages. Requires a USB/UART connection and simulator setup. - **[SIH on Hardware](../sim_sih/hardware.md) (`SYS_HITL=2`):** A C++ physics model runs directly on the flight controller itself. No external simulator, no companion computer, no MAVLink sensor data. Just set the parameter and reboot. ## HITL vs SIH {#comparision} | | HITL (`SYS_HITL=1`) | SIH (`SYS_HITL=2`) | | ----------------- | ---------------------------------------------------------------------- | ---------------------------------------------------- | -| Physics model | External simulator (Gazebo Classic, jMAVSim) | Internal C++ module | +| Physics model | External simulator (Gazebo Classic) | Internal C++ module | | Communication | MAVLink HIL messages | uORB (internal) | | External process | Required | Not required | | Setup complexity | Higher | Lower | diff --git a/docs/zh/simulation/hitl.md b/docs/zh/simulation/hitl.md index 2d83aef69e0..cdcdcf73560 100644 --- a/docs/zh/simulation/hitl.md +++ b/docs/zh/simulation/hitl.md @@ -7,10 +7,10 @@ It may or may not work with current versions of PX4. See [Toolchain Installation](../dev_setup/dev_env.md) for information about the environments and tools supported by the core development team. ::: -硬件在环仿真模式 (HITL 或 HIL) 下 PX4 固件代码运行在真实的飞行控制器硬件平台上。 -这种方法的优点是可以在实际硬件上测试大多数的实际飞行代码。 +硬件在环仿真模式 (HITL 或 HIL) 下 PX4 固件代码运行在真实的飞行控制器硬件平台上。这种方法的优点是可以在实际硬件上测试大多数的实际飞行代码。 -PX4 支持多轴( [jMAVSim](../sim_jmavsim/index.md)或[Gazebo Classic](../sim_gazebo_classic/index.md))及VTOL (using Gazebo Classic)的仿真。 +PX4 supports HITL for multicopters and VTOL using [Gazebo Classic](../sim_gazebo_classic/index.md). +To simulate on flight controller hardware without an external simulator, use [SIH on hardware](../sim_sih/hardware.md). For a comparison of HITL and SIH on hardware, see [Hardware Simulation](../simulation/hardware.md). @@ -18,36 +18,35 @@ For a comparison of HITL and SIH on hardware, see [Hardware Simulation](../simul 机架与模拟器兼容情况: -| 机架 | `SYS_AUTOSTART` | Gazebo Classic | jMAVSim | -| ---------------------------------------------------------------------------------------------------------------- | --------------- | -------------- | ------- | -| [HIL Quadcopter X](../airframes/airframe_reference.md#copter_simulation_hil_quadcopter_x) | 1002 | Y | Y | -| [HIL Standard VTOL QuadPlane](../airframes/airframe_reference.md#vtol_standard_vtol_hil_standard_vtol_quadplane) | 4001 | Y | | +| 机架 | `SYS_AUTOSTART` | Gazebo Classic | +| ---------------------------------------------------------------------------------------------------------------- | --------------- | -------------- | +| [HIL Quadcopter X](../airframes/airframe_reference.md#copter_simulation_hil_quadcopter_x) | 1002 | Y | +| [HIL Standard VTOL QuadPlane](../airframes/airframe_reference.md#vtol_standard_vtol_hil_standard_vtol_quadplane) | 4001 | Y | ## HITL Simulation Environment {#simulation_environment} 硬件在环仿真(HITL)模式下标准的 PX4 固件在真实的硬件上运行。 -JMAVSim or Gazebo Classic (running on a development computer) are connected to the flight controller hardware via USB/UART. +Gazebo Classic (running on a development computer) is connected to the flight controller hardware via USB/UART. The simulator acts as gateway to share MAVLink data between PX4 and _QGroundControl_. :::info The simulator can also be connected via UDP if the flight controller has networking support and uses a stable, low-latency connection (e.g. a wired Ethernet connection - WiFi is usually not sufficiently reliable). -For example, this configuration has been tested with PX4 running on a Raspberry Pi connected via Ethernet to the computer (a startup configuration that includes the command for running jMAVSim can be found in [px4_hil.config](https://github.com/PX4/PX4-Autopilot/blob/main/posix-configs/rpi/px4_hil.config)). +For example, this configuration has been tested with PX4 running on a Raspberry Pi connected via Ethernet to the computer (the startup configuration can be found in [px4_hil.config](https://github.com/PX4/PX4-Autopilot/blob/main/posix-configs/rpi/px4_hil.config)). ::: The diagram below shows the simulation environment: - A HITL configuration is selected (via _QGroundControl_) that doesn't start any real sensors. -- _jMAVSim_ or _Gazebo Classic_ are connected to the flight controller via USB. +- _Gazebo Classic_ is connected to the flight controller via USB. - The simulator is connected to _QGroundControl_ via UDP and bridges its MAVLink messages to PX4. -- _Gazebo Classic_ and _jMAVSim_ can also connect to an offboard API and bridge MAVLink messages to PX4. +- _Gazebo Classic_ can also connect to an offboard API and bridge MAVLink messages to PX4. - (Optional) A serial connection can be used to connect Joystick/Gamepad hardware via _QGroundControl_. -![HITL Setup - jMAVSim and Gazebo Classic](../../assets/simulation/px4_hitl_overview_jmavsim_gazebo.svg) +![HITL Setup - Gazebo Classic](../../assets/simulation/px4_hitl_overview_jmavsim_gazebo.svg) ## HITL 相比于 SITL -相比之下, HITL 在正常飞控硬件平台上运行正常的处于 ”HITL 模式“ 的 PX4 固件。 -仿真数据进入整个仿真系统的时间点与 SITL 有所不同。 +相比之下, HITL 在正常飞控硬件平台上运行正常的处于 ”HITL 模式“ 的 PX4 固件。仿真数据进入整个仿真系统的时间点与 SITL 有所不同。 By contrast, HITL runs normal PX4 firmware in "HITL mode", on normal hardware. The simulation data enters the system at a different point than for SITL. @@ -165,32 +164,6 @@ Make sure _QGroundControl_ is not running! 5. Start _QGroundControl_. It should autoconnect to PX4 and Gazebo Classic. -#### jMAVSim (仅适用于四旋翼无人机) - -:::info -Make sure _QGroundControl_ is not running! -::: - -1. 将飞行控制器连接到计算机, 并等待其启动。 - -2. 在 HITL 模式下运行 jMAVSim (r如有必要,修改串口号名称 /dev/ttyACM0 - 比如,在 Mac OS 上该参数应为 /dev/tty.usbmodem1): - sh - ./Tools/jmavsim_run.sh -q -d /dev/ttyACM0 -b 921600 -r 250 - - ```sh - ./Tools/simulation/jmavsim/jmavsim_run.sh -q -s -d /dev/ttyACM0 -b 921600 -r 250 - ``` - - ::: info - Replace the serial port name `/dev/ttyACM0` as appropriate. - On macOS this port would be `/dev/tty.usbmodem1`. - On Windows (including Cygwin) it would be the COM1 or another port - check the connection in the Windows Device Manager. - -::: - -3. Start _QGroundControl_. - 它应该会自动连接 PX4 和 Gazebo 。 - ## 在 HITL 仿真中执行自主飞行任务 You should be able to use _QGroundControl_ to [run missions](https://docs.qgroundcontrol.com/master/en/qgc-user-guide/fly_view/fly_view.html#missions) and otherwise control the vehicle. diff --git a/docs/zh/simulation/index.md b/docs/zh/simulation/index.md index 7613020b301..6b301e1a1f7 100644 --- a/docs/zh/simulation/index.md +++ b/docs/zh/simulation/index.md @@ -41,7 +41,7 @@ To run PX4 SITL without setting up a build environment, [pre-built packages and | 特性 | Gazebo | SIH | | ------------------------- | ------------------------------------------------- | -------------------------------------------------------------------------------------- | | **Default Mode** | GUI with 3D rendering | Headless (fastest iteration) | -| **3D Visualization** | Built-in (photorealistic) | Optional: QGC map or jMAVSim display-only | +| **3D Visualization** | Built-in (photorealistic) | Optional: QGC map or [Hawkeye](../sim_hawkeye/index.md) | | **Physics Engine** | External (gz-physics) | Internal (C++ module, uORB) | | **External Dependencies** | Gazebo packages, rendering libs | None | | **Vehicle Types** | Quad, VTOL, Plane, Rovers | Quad, Hex, Plane, Tailsitter, Std VTOL, Rover | @@ -67,7 +67,7 @@ For a detailed analysis of PX4 simulation user needs, priorities, and pain point - **Hardware integration testing without propellers:** Use [SIH on flight controller hardware](../sim_sih/index.md#sih-on-flight-controller-hardware) (`SYS_HITL=2`). :::info -SIH is headless by default. For optional 3D visualization, you can use [jMAVSim in display-only mode](../sim_sih/index.md#visualization-optional) or monitor the vehicle in QGroundControl's map view. +SIH is headless by default. For optional 3D visualization, you can use the [Hawkeye](../sim_hawkeye/index.md) visualizer or monitor the vehicle in QGroundControl's map view. ::: ## 仿真器 MAVLink API @@ -90,15 +90,15 @@ All motors / actuators are blocked, but internal software is fully operational. The messages are described below (see links for specific detail). -| 消息 | 方向 | 描述 | -| -------------------------------------------------------------------- | --------- | ------------------------------------------------------------------------------- | -| [MAV\_MODE:MAV\_MODE\_FLAG\_HIL\_ENABLED][mav_mode_flag_hil_enabled] | 不可用 | 使用模拟时的模式标志。 所有电机/执行器都被卡停,但内部软件可以完全正常运行。 | -| [HIL\_ACTUATOR\_CONTROLS][hil_actuator_controls] | PX4 至 Sim | PX4 控制输出 (电机、执行器)。 | -| [HIL\_SENSOR][hil_sensor] | Sim 至 PX4 | 在 NED 体框架中以 SI 单位模拟 IMU 读数。 | -| [HIL\_GPS][hil_gps] | Sim 至 PX4 | 模拟的 GPS RAW 传感器值。 | -| [HIL\_OPTICAL\_FLOW][hil_optical_flow] | Sim 至 PX4 | 来自流量传感器的模拟光流 (例如 PX4FLOW 或光学鼠标传感器)。 | -| [HIL\_STATE\_QUATERNION][hil_state_quaternion] | Sim 至 PX4 | 包含实际的“仿真”无人机位置、姿态、速度等。 这可以记录并与 px4 的分析和调试估计进行比较 (例如,检查估计器在噪声 (仿真) 传感器输入中的工作情况)。 | -| [HIL\_RC\_INPUTS\_RAW][hil_rc_inputs_raw] | Sim 至 PX4 | 收到 RC 通道的 RAW 值。 | +| 消息 | 方向 | 描述 | +| -------------------------------------------------------------------- | --------- | ------------------------------------------------------------------------------ | +| [MAV\_MODE:MAV\_MODE\_FLAG\_HIL\_ENABLED][mav_mode_flag_hil_enabled] | 不可用 | 使用模拟时的模式标志。所有电机/执行器都被卡停,但内部软件可以完全正常运行。 | +| [HIL\_ACTUATOR\_CONTROLS][hil_actuator_controls] | PX4 至 Sim | PX4 控制输出 (电机、执行器)。 | +| [HIL\_SENSOR][hil_sensor] | Sim 至 PX4 | 在 NED 体框架中以 SI 单位模拟 IMU 读数。 | +| [HIL\_GPS][hil_gps] | Sim 至 PX4 | 模拟的 GPS RAW 传感器值。 | +| [HIL\_OPTICAL\_FLOW][hil_optical_flow] | Sim 至 PX4 | 来自流量传感器的模拟光流 (例如 PX4FLOW 或光学鼠标传感器)。 | +| [HIL\_STATE\_QUATERNION][hil_state_quaternion] | Sim 至 PX4 | 包含实际的“仿真”无人机位置、姿态、速度等。这可以记录并与 px4 的分析和调试估计进行比较 (例如,检查估计器在噪声 (仿真) 传感器输入中的工作情况)。 | +| [HIL\_RC\_INPUTS\_RAW][hil_rc_inputs_raw] | Sim 至 PX4 | 收到 RC 通道的 RAW 值。 | @@ -122,8 +122,7 @@ These ports are: - PX4's remote UDP Port **14550** is used for communication with ground control stations. 期望 GCS 侦听此端口上的连接。 _QGroundControl_ 默认侦听此端口。 -- PX4的远程UDP端口 **14540** 用于与 offboard API 通信。 - 期望 Offboard APIs 侦听此端口上的连接。 +- PX4的远程UDP端口 **14540** 用于与 offboard API 通信。期望 Offboard APIs 侦听此端口上的连接。 ::: info Multi-vehicle simulations use a separate remote port for each instance, allocated sequentially from `14540` to `14549` (additional instances all use port `14549`). @@ -179,7 +178,7 @@ The syntax (simplified) looks like this: make px4_sitl simulator[_vehicle-model] ``` -where `simulator` is `gz` (for Gazebo), `gazebo-classic`, `jmavsim` or some other simulator, and vehicle-model is a particular vehicle type supported by that simulator ([Gazebo](../sim_gazebo_gz/index.md) and [jMAVSim](../sim_jmavsim/index.md) only support multicopters at time of writing, while [Gazebo Classic](../sim_gazebo_classic/index.md) supports many different types). +where `simulator` is `gz` (for Gazebo), `gazebo-classic` or some other simulator, and vehicle-model is a particular vehicle type supported by that simulator ([Gazebo](../sim_gazebo_gz/index.md) only supports multicopters at time of writing, while [Gazebo Classic](../sim_gazebo_classic/index.md) supports many different types). A number of examples are shown below, and there are many more in the individual pages for each of the simulators: @@ -193,9 +192,6 @@ make px4_sitl gazebo-classic_plane # Start Gazebo Classic with iris and optical flow make px4_sitl gazebo-classic_iris_opt_flow -# Start JMavSim with iris (default vehicle model) -make px4_sitl jmavsim - # Start PX4 with no simulator (i.e. to use your own "custom" simulator) make px4_sitl none_iris @@ -218,7 +214,7 @@ For more information see: [Building the Code > PX4 Make Build Targets](../dev_se ### Run Simulation Faster than Realtime {#simulation_speed} -SITL can be run faster or slower than real-time when using Gazebo, Gazebo Classic, jMAVSim, or SIH. +SITL can be run faster or slower than real-time when using Gazebo, Gazebo Classic, or SIH. The speed factor is set using the environment variable `PX4_SIM_SPEED_FACTOR`. @@ -231,7 +227,6 @@ This is what makes it possible to run the simulation at different speeds, and al - Gazebo: [Change Simulation Speed](../sim_gazebo_gz/index.md#change-simulation-speed) - Gazebo Classic: [Change Simulation Speed](../sim_gazebo_classic/index.md#change-simulation-speed) and [Lockstep](../sim_gazebo_classic/index.md#lockstep) -- jMAVSim: [Change Simulation Speed](../sim_jmavsim/index.md#change-simulation-speed) and [Lockstep](../sim_jmavsim/index.md#lockstep) - SIH: Supports `PX4_SIM_SPEED_FACTOR` for faster-than-realtime simulation. ### 启动脚本 diff --git a/docs/zh/simulation/multi-vehicle-simulation.md b/docs/zh/simulation/multi-vehicle-simulation.md index 08208f22602..0a939e2b92f 100644 --- a/docs/zh/simulation/multi-vehicle-simulation.md +++ b/docs/zh/simulation/multi-vehicle-simulation.md @@ -5,7 +5,6 @@ - [Multi-Vehicle Sim with Gazebo](../sim_gazebo_gz/multi_vehicle_simulation.md) (both with and without ROS) - [Multi-Vehicle Sim with Gazebo Classic](../sim_gazebo_classic/multi_vehicle_simulation.md) (both with and without ROS) - [Multi-Vehicle Sim with FlightGear](../sim_flightgear/multi_vehicle.md) -- [Multi-Vehicle Sim with JMAVSim](../sim_jmavsim/multi_vehicle.md) - [Multi-Vehicle Sim with SIH](../sim_sih/index.md#multi-vehicle-simulation) The choice of the simulator depends on the vehicle to be simulated, how "good" the simulation needs to be (and for what features), and how many vehicles need to be simulated at a time: @@ -19,8 +18,6 @@ The choice of the simulator depends on the vehicle to be simulated, how "good" t Note, this is the successor of [Gazebo Classic](../sim_gazebo_classic/index.md) (below). - [Gazebo Classic](../sim_gazebo_classic/index.md) is less accurate and less heavy-weight and supports many features and vehicles that aren't available for FlightGear. It can simulate many more vehicles at a time than FlightGear and it allows for different types of vehicles to be simulated at the same time. -- [JMAVSim](../sim_jmavsim/index.md) is a very light-weight simulator that supports only quadcopters. - It is recommended if you need to support a lot of quadcopters, and the simulation only needs to be approximate. - [SIH](../sim_sih/index.md) is the lightest-weight option with zero external dependencies. Since SIH is headless and runs physics internally, it can launch many instances with minimal resource usage. It supports all 6 vehicle types (quad, hex, plane, tailsitter, standard VTOL, rover). diff --git a/docs/zh/test_and_ci/bench_testing.md b/docs/zh/test_and_ci/bench_testing.md index df741a940df..62e5b6bda6b 100644 --- a/docs/zh/test_and_ci/bench_testing.md +++ b/docs/zh/test_and_ci/bench_testing.md @@ -79,7 +79,7 @@ A per-test watchdog turns a hung board into a named failure instead of a stuck t ## Simulated Flight on the FMU (SIH) -`sih/flight_mission.py` performs a complete hardware-in-the-loop flight without any host-side simulator: it switches the board to a [SIH airframe](../sim_sih/index.md) (`SYS_HITL=2`, physics computed on the autopilot), uploads a mission, arms through the NuttX shell, and asserts takeoff, waypoint progression, RTL, landing, and auto-disarm against per-phase timeouts. +`sih/flight_mission.py` performs a complete hardware-in-the-loop flight without any host-side simulator: it switches the board to a [SIH airframe](../sim_sih/index.md) (`SYS_HITL=2`, physics computed on the autopilot), uploads a mission, arms through the NuttX shell, and asserts takeoff, waypoint progression, Return, landing, and auto-disarm against per-phase timeouts. It runs as the last test of the default bench suite and also works standalone. Because it arms the flight controller, the suite asks for explicit confirmation on a terminal (type `arm`), and non-interactive runs skip it unless `--allow-arming` is passed. It first probes the running firmware for the SIH module and records a skip, not a failure, when the build does not include it. diff --git a/docs/zh/test_and_ci/integration_testing_mavsdk.md b/docs/zh/test_and_ci/integration_testing_mavsdk.md index 37a9477912d..3695d975198 100644 --- a/docs/zh/test_and_ci/integration_testing_mavsdk.md +++ b/docs/zh/test_and_ci/integration_testing_mavsdk.md @@ -2,8 +2,7 @@ PX4 can be tested end to end to using integration tests based on [MAVSDK](https://mavsdk.mavlink.io). -目前主要针对 SITL 开发测试,并在持续集成(CI)中运行。 -但是,它们最终旨在推广到实际测试。 +目前主要针对 SITL 开发测试,并在持续集成(CI)中运行。但是,它们最终旨在推广到实际测试。 测试需要将MAVSAK C++库安装到系统目录(如: /usr/lib or /usr/local/lib) @@ -90,7 +89,7 @@ Run a single test by specifying the `model` and test `case` as command line opti For example, to test a multicopter mission using the SIH simulator: ```sh -test/mavsdk_tests/mavsdk_test_runner.py test/mavsdk_tests/configs/sih-sitl.json --speed-factor 10 --model quadx --case 'Fly square Multicopter Missions including RTL' +test/mavsdk_tests/mavsdk_test_runner.py test/mavsdk_tests/configs/sih-sitl.json --speed-factor 10 --model quadx --case 'Fly square Multicopter Missions including Return' ``` The easiest way to find out the current set of models and their associated test cases is to run all PX4 tests [as shown above](#run-all-px4-tests) (note, you can then cancel the build if you wish to test just one). @@ -108,8 +107,8 @@ About to run 39 test cases for 3 selected models (1 iteration): - 'Continue on baro stuck during mission (baro height mode)' - 'Continue on baro stuck during mission (GPS height mode)' - 'Takeoff and Land' - - 'Fly square Multicopter Missions including RTL' - - 'Fly square Multicopter Missions with manual RTL' + - 'Fly square Multicopter Missions including Return' + - 'Fly square Multicopter Missions with manual Return' - 'Fly straight Multicopter Mission' - 'Offboard takeoff and land' - 'Offboard position control' @@ -124,8 +123,8 @@ About to run 39 test cases for 3 selected models (1 iteration): - 'Continue on baro stuck during mission (baro height mode)' - 'Continue on baro stuck during mission (GPS height mode)' - 'Takeoff and Land' - - 'Fly square Multicopter Missions including RTL' - - 'Fly square Multicopter Missions with manual RTL' + - 'Fly square Multicopter Missions including Return' + - 'Fly square Multicopter Missions with manual Return' - 'Fly forward in position control' - 'Fly forward in altitude control' - tailsitter: @@ -137,8 +136,8 @@ About to run 39 test cases for 3 selected models (1 iteration): - 'Continue on baro stuck during mission (baro height mode)' - 'Continue on baro stuck during mission (GPS height mode)' - 'Takeoff and Land' - - 'Fly square Multicopter Missions including RTL' - - 'Fly square Multicopter Missions with manual RTL' + - 'Fly square Multicopter Missions including Return' + - 'Fly square Multicopter Missions with manual Return' - 'Fly forward in position control' - 'Fly forward in altitude control' ``` diff --git a/docs/zh/test_and_ci/unit_tests.md b/docs/zh/test_and_ci/unit_tests.md index 182caffa365..6f642e3d29b 100644 --- a/docs/zh/test_and_ci/unit_tests.md +++ b/docs/zh/test_and_ci/unit_tests.md @@ -6,7 +6,7 @@ 1. Unit tests with [Google Test](https://github.com/google/googletest/blob/main/docs/primer.md) ("GTest") - tests that have minimal, internal-only dependencies 2. 使用GTest的功能性测试 - 依赖parameters和 uORB消息的测试 -3. 软件在环(SITL)单元测试。 这些测试需要运行在完整的SITL环境中, 运行起来更慢,更难调试,所以建议尽可能使用GTest代替。 +3. 软件在环(SITL)单元测试。这些测试需要运行在完整的SITL环境中,运行起来更慢,更难调试,所以建议尽可能使用GTest代替。 ## 编写测试 @@ -14,10 +14,10 @@ 创建新的单元测试步骤如下: -1. 单元测试分成三个部分:设置、运行、检查结果。 每个单元测试都应该测试一个特定行为或设置案例,如果测试失败,则很明显你的测试代码有错误。 请尽可能遵循这些标准。 +1. 单元测试分成三个部分:设置、运行、检查结果。每个单元测试都应该测试一个特定行为或设置案例,如果测试失败,则很明显你的测试代码有错误。请尽可能遵循这些标准。 2. Copy and rename the example unit test [AttitudeControlTest](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/mc_att_control/AttitudeControl/AttitudeControlTest.cpp) to the directory the code to be tested is in. 3. Add the new file to the directory's `CMakeLists.txt`. It should look something like `px4_add_unit_gtest(SRC MyNewUnitTest.cpp LINKLIBS )` -4. 添加你想要的测试功能。 这包括了添加所需的头文件、新测试(每个测试都应该有单独的名称),并加入相关逻辑,运行测试代码并验证其行为是否符合预期。 +4. 添加你想要的测试功能。这包括了添加所需的头文件、新测试(每个测试都应该有单独的名称),并加入相关逻辑,运行测试代码并验证其行为是否符合预期。 5. If additional library dependencies are required, they should also be added to the CMakeLists after the `LINKLIBS` as shown above. Tests can be run via `make tests`, after which you will find the binary in `build/px4_sitl_test/unit-MyNewUnit`. @@ -30,15 +30,12 @@ Additionally, functional tests can contain local usage of STL data structures (a 创建一个新的功能测试步骤如下: -1. 一般来说(与单元测试类似)功能测试应分为三个部分:设置,运行,检查结果。 - 每个单元测试都应该测试一个特定行为或设置案例,如果测试失败,则很明显你的测试代码有错误。 - 请尽可能遵循这些标准。 +1. 一般来说(与单元测试类似)功能测试应分为三个部分:设置,运行,检查结果。每个单元测试都应该测试一个特定行为或设置案例,如果测试失败,则很明显你的测试代码有错误。请尽可能遵循这些标准。 2. Copy and rename the example functional test [ParameterTest](https://github.com/PX4/PX4-Autopilot/blob/main/src/lib/parameters/ParameterTest.cpp) to the directory the code to be tested is in. 3. 将ParameterTest 重命名为更符合你正在测试的代码功能。 4. Add the new file to the directory's `CMakeLists.txt`. It should look something like `px4_add_functional_gtest(SRC MyNewFunctionalTest.cpp LINKLIBS )` -5. 添加你想要的测试功能。 - 这包括了,添加特定的头文件、新测试(每个测试都应该使用不同的命名),并设置相关逻辑,运行测试代码并验证是否符合预期。 +5. 添加你想要的测试功能。这包括了,添加特定的头文件、新测试(每个测试都应该使用不同的命名),并设置相关逻辑,运行测试代码并验证是否符合预期。 6. If additional library dependencies are required, they should also be added to the CMakeLists after the `LINKLIBS` as shown above. Tests can be run via `make tests`, after which you will find the binary in `build/px4_sitl_test/functional-MyNewFunctional`. @@ -46,8 +43,7 @@ It can be run directly in a debugger, however be careful to only run one test pe ## 写一个软件在环(SITL)单元测试 -当需要所有的飞行控制组件:驱动、时间或者更多时,应该SITL单元测试。 -这些测试运行较慢(每个模块至少1秒+),同时难以测试,所以仅在必要时使用它们。 +当需要所有的飞行控制组件:驱动、时间或者更多时,应该SITL单元测试。这些测试运行较慢(每个模块至少1秒+),同时难以测试,所以仅在必要时使用它们。 创建一个新的SITL单元测试步骤如下: diff --git a/docs/zh/test_cards/fw_02_full_autonomous.md b/docs/zh/test_cards/fw_02_full_autonomous.md index 34ce8063d4f..0855f6bfe18 100644 --- a/docs/zh/test_cards/fw_02_full_autonomous.md +++ b/docs/zh/test_cards/fw_02_full_autonomous.md @@ -2,7 +2,7 @@ ## Objective -To test the auto modes such as Mission, Takeoff, Hold, and RTL for fixed wing vehicles. +To test the auto modes such as Mission, Takeoff, Hold, and Return for fixed wing vehicles. ## Preflight @@ -10,7 +10,7 @@ Plan a mission on the ground. Ensure the mission has: - Takeoff as first waypoint - Changes in altitude throughout the mission -- Last waypoint is an RTL +- Last waypoint is a Return item - Duration of 1 to 2 minutes ## Flight Tests @@ -29,7 +29,7 @@ Plan a mission on the ground. Ensure the mission has:     ❏ Verify changes in altitude throughout the mission -    ❏ Verify Mission Ends in RTL +    ❏ Verify Mission Ends in Return     ❏ Duration of 1 to 2 minutes @@ -43,7 +43,7 @@ Plan a mission on the ground. Ensure the mission has:     ❏ Orbit radius and direction should match parameters -❏ RTL +❏ Return     ❏ Arm and takeoff in any manual mode @@ -51,7 +51,7 @@ Plan a mission on the ground. Ensure the mission has:     ❏ Engage Return mode -    ❏ Vehicle should climb to RTL altitude if below it +    ❏ Vehicle should climb to return altitude if below it     ❏ Vehicle should return to home and hold or land @@ -60,5 +60,5 @@ Plan a mission on the ground. Ensure the mission has: - 任务应该在第一次尝试时上传 - Vehicle should automatically takeoff upon engaging Auto - Waypoint tracking should be smooth with appropriate turn radius -- Vehicle should adjust height to RTL altitude before returning home +- Vehicle should adjust height to return altitude before returning home - Landing approach should be stable (if auto-land is configured) diff --git a/docs/zh/test_cards/mc_02_full_autonomous.md b/docs/zh/test_cards/mc_02_full_autonomous.md index 179564ab36f..8997dbfacd6 100644 --- a/docs/zh/test_cards/mc_02_full_autonomous.md +++ b/docs/zh/test_cards/mc_02_full_autonomous.md @@ -2,7 +2,7 @@ ## Objective -To test the auto modes such as Mission, RTL, etc... +To test the auto modes such as Mission, Return, etc... ## Preflight @@ -10,7 +10,7 @@ Plan a mission on the ground. Ensure the mission has - Takeoff as first waypoint - Changes in Altitude throughout the mission -- Last waypoint is an RTL +- Last waypoint is a Return item - Duration of 5 to 6 minutes ## Flight Tests @@ -23,7 +23,7 @@ Plan a mission on the ground. Ensure the mission has     ❏ First waypoint set to Takeoff -    ❏ Enable Mission End RTL +    ❏ Enable Mission End Return     ❏ Duration of 5 to 6 minutes @@ -35,26 +35,26 @@ Plan a mission on the ground. Ensure the mission has     ❏ Engage Auto (Mission Mode) to trigger take-off -    ❏ Observe tracking, cornering and proper RTL performance +    ❏ Observe tracking, cornering and proper Return performance     ❏ Upon touching ground, copter should disarm automatically within 2 seconds (disarm time set by parameter: [COM_DISARM_LAND](../advanced_config/parameter_reference.md#COM_DISARM_LAND)) -❏ RTL +❏ Return     ❏ Arm and takeoff in position mode     ❏ Fly out ~10m from start point -    ❏ Engage RTL Mode +    ❏ Engage Return mode -    ❏ Observe tracking, cornering and proper RTL performance +    ❏ Observe tracking, cornering and proper Return performance ## 预期成果 - 当油门升高时,起飞应该是平稳的 - 任务应该在第一次尝试时上传 - 使用 Auto 时飞机应自动起飞 -- Vehicle should adjust height to RTL altitude before returning home +- Vehicle should adjust height to return altitude before returning home - 着陆时,直升机不应在地面上反弹