mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
* Add vitepress tree * Update existing workflows so they dont trigger on changes in the docs path * Add nojekyll, package.json, LICENCE etc * Add crowdin docs upload/download scripts * Add docs flaw checker workflows * Used docs prefix for docs workflows * Crowdin obvious fixes * ci: docs move to self hosted runner runs on a beefy server for faster builds Signed-off-by: Ramon Roche <mrpollo@gmail.com> * ci: don't run build action for docs or ci changes Signed-off-by: Ramon Roche <mrpollo@gmail.com> * ci: update runners Signed-off-by: Ramon Roche <mrpollo@gmail.com> * Add docs/en * Add docs assets and scripts * Fix up editlinks to point to PX4 sources * Download just the translations that are supported * Add translation sources for zh, uk, ko * Update latest tranlsation and uorb graphs * update vitepress to latest --------- Signed-off-by: Ramon Roche <mrpollo@gmail.com> Co-authored-by: Ramon Roche <mrpollo@gmail.com>
65 lines
3.7 KiB
Markdown
65 lines
3.7 KiB
Markdown
# Flight Controller/Sensor Orientation
|
|
|
|
By default the flight controller and external compass(es) (if present) should be placed on the frame top-side up, oriented so that the arrow points towards the front of the vehicle.
|
|
If the board or any external compasses are mounted in any other orientation then you will need configure this in the firmware.
|
|
|
|
## Calculating Orientation
|
|
|
|
ROLL, PITCH and/or YAW offsets of the flight controller are calculated relative to the vehicle around the forward (x), right (y), down (z) axes.
|
|
|
|

|
|
|
|
The axes to rotate around stay the same from one rotation step to the next one.
|
|
So the frame to perform the rotation in stays fixed.
|
|
This is also known as _extrinsic rotation_.
|
|
|
|

|
|
|
|
For example, the vehicles shown below have rotations around the z-axis (i.e. yaw only) corresponding to: `ROTATION_NONE`, `ROTATION_YAW_90`,`ROTATION_YAW_180`,`ROTATION_YAW_270`.
|
|
|
|

|
|
|
|
::: info
|
|
For a VTOL Tailsitter airframe set the vehicle orientation according to its multirotor configuration (i.e. relative to the vehicle during, takeoff, hovering, landing) for all sensor calibrations.
|
|
|
|
The axis are normally relative to the orientation of the vehicle during steady forward flight.
|
|
For more information see [Basic Concepts](../getting_started/px4_basic_concepts.md#heading-and-directions).
|
|
:::
|
|
|
|
## Setting the Flight Controller Orientation
|
|
|
|
To set the orientations:
|
|
|
|
1. Start _QGroundControl_ and connect the vehicle.
|
|
1. Select **"Q" icon > Vehicle Setup > Sensors** (sidebar) to open _Sensor Setup_.
|
|
1. Select the **Orientations** button.
|
|
|
|

|
|
|
|
1. Select the **AutoPilot Orientation** (as [calculated above](#calculating-orientation)).
|
|
|
|

|
|
|
|
1. Press **OK**.
|
|
|
|
::: info
|
|
You can use [Level Horizon Calibration](../config/level_horizon_calibration.md) to compensate for small miss-alignments in controller orientation and to level the horizon in flight view.
|
|
:::
|
|
|
|
## Setting the Compass Orientation
|
|
|
|
PX4 will automatically detect the compass orientation as part of [compass calibration](../config/compass.md) ([by default](../advanced_config/parameter_reference.md#SENS_MAG_AUTOROT)) for any of the [standard MAVLink orientations](https://mavlink.io/en/messages/common.html#MAV_SENSOR_ORIENTATION) (upright and facing forward, or any multiple of 45° offset in any axis) .
|
|
|
|
::: info
|
|
You can confirm that auto detection worked by looking at the [CAL_MAGn_ROT](../advanced_config/parameter_reference.md#CAL_MAG0_ROT) parameters.
|
|
:::
|
|
|
|
If a non-standard orientation has been used you will need to set the [CAL_MAGx_ROLL](../advanced_config/parameter_reference.md#CAL_MAG0_ROLL), [CAL_MAGx_PITCH](../advanced_config/parameter_reference.md#CAL_MAG0_PITCH), and [CAL_MAGx_YAW](../advanced_config/parameter_reference.md#CAL_MAG0_YAW) parameters for each compass to the angles that were used.
|
|
|
|
This will automatically set [CAL_MAGn_ROT](../advanced_config/parameter_reference.md#CAL_MAG0_ROT) to "custom euler angle" and prevents automatic calibration for the selected compass (even if [SENS_MAG_AUTOROT](../advanced_config/parameter_reference.md#SENS_MAG_AUTOROT) is set).
|
|
|
|
## Further Information
|
|
|
|
- [Advanced Orientation Tuning](../advanced_config/advanced_flight_controller_orientation_leveling.md) (advanced users only).
|
|
- [QGroundControl User Guide > Sensors](https://docs.qgroundcontrol.com/master/en/qgc-user-guide/setup_view/sensors_px4.html#flight_controller_orientation)
|