Compare commits

...

17 Commits

Author SHA1 Message Date
Hamish Willee 1b52af583e Merge branch 'main' into purge_protocol_version 2025-12-03 09:08:36 +11:00
Jaeyoung Lim 789babae8e Update gz submodule (#26025) 2025-12-01 14:31:22 -08:00
Julian Oes 1de6001163 mavsdk_tests: bump MAVSDK version to v3.11.2 (#26024)
This should hopefully fix the annoying segfaults on destruction that we
have been seeing.
2025-12-01 13:30:08 -08:00
Hamish Willee a2b1795236 ark_rtk_gps_l1_l2 - numbering hints 2025-12-01 09:20:17 -09:00
Hamish Willee f7679dc576 Power supply tweaks 2025-12-01 09:20:17 -09:00
patrikpordi 817951b86b Removed Power Module No connector version, included it in Power Module. 2025-12-01 09:20:17 -09:00
Hamish Willee e7be62a342 Prettier and minor fixes 2025-12-01 09:20:17 -09:00
Hamish Willee 8c2a25edf8 Add to sidebar except no connector 2025-12-01 09:20:17 -09:00
Hamish Willee c83d8e807f Shrink all images 2025-12-01 09:20:17 -09:00
Hamish Willee 07f1ac682c pm no connector - prettier and fix heading 2025-12-01 09:20:17 -09:00
patrikpordi 204d82a5c1 Add ARK documentation for GPS modules, distance sensors, and power modules
- Added DAN, SAM, SAM Mini, X20, RTK L1 L5 GPS modules
- Added ARK distance sensors documentation
- Added ARK power modules documentation
2025-12-01 09:20:17 -09:00
Jaeyoung Lim ac2f2cf2c8 Follow camera with gz topic (#26023)
* Follow camera with gz topic

* Set follow pgain as well
2025-12-01 09:19:04 -08:00
Jaeyoung Lim 5df20b8e9b Add custom gz airspeed plugin and add wind effects (#26018)
* Add px4 custom airspeed sensor

* Format fix
2025-12-01 08:56:40 -08:00
MarkieMark 980956496b ICE Control Module: Added option for VTOL state (FW/Transition to FW) to start engine (#25948)
* ICE Control Module: Added option to use VTOL transition state to trigger ICE on/off states

Signed-off-by: Mf-ff99 <force.j.mark@gmail.com>

* ran make format

Signed-off-by: Mf-ff99 <force.j.mark@gmail.com>

* Update src/modules/internal_combustion_engine_control/InternalCombustionEngineControl.cpp to initialize vtol_vehicle_status_s correctly

Initialize appropriately

Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>

* ICE Module: adjusted VTOL logic to use vehicle_status

Signed-off-by: Mf-ff99 <force.j.mark@gmail.com>

---------

Signed-off-by: Mf-ff99 <force.j.mark@gmail.com>
Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>
2025-12-01 16:46:51 +01:00
mahima-yoga 0985c22701 [fix] autotune: fix indentation on _state_start_time in abort logic 2025-11-28 09:31:37 +01:00
Julian Oes 0618b0b529 mavlink: GNSS_INTEGRITY and GLOBAL_POSITION are WIP (#26012)
These two messages are still work in progress, only defined in the
development.xml MAVLink dialect. Therefore, we need to ifdef them.
2025-11-28 11:41:38 +13:00
Hamish Willee cec0eba79f Purge PROTOCOL_VERSION 2025-10-30 16:51:44 +11:00
40 changed files with 1097 additions and 126 deletions
@@ -11,8 +11,6 @@ PX4_SIM_MODEL=${PX4_SIM_MODEL:=advanced_plane}
param set-default SIM_GZ_EN 1
param set-default SENS_EN_ARSPDSIM 1
param set-default FW_LND_ANG 8
param set-default FW_PR_FF 0.08
@@ -159,24 +159,19 @@ if [ -n "${PX4_SIM_MODEL#*gz_}" ] && [ -z "${PX4_GZ_MODEL_NAME}" ]; then
fi
# Set up camera to follow the model if requested
if [ -n "${PX4_GZ_FOLLOW}" ]; then
if [ -z "${PX4_GZ_NO_FOLLOW}" ]; then
echo "INFO [init] Setting camera to follow ${MODEL_NAME_INSTANCE}"
# Set camera to follow the model
${gz_command} service -s "/gui/follow" --reqtype gz.msgs.StringMsg \
--reptype gz.msgs.Boolean --timeout 5000 \
--req "data: \"${MODEL_NAME_INSTANCE}\"" > /dev/null 2>&1
# Set default camera offset if not specified
follow_x=${PX4_GZ_FOLLOW_OFFSET_X:--2.0}
follow_y=${PX4_GZ_FOLLOW_OFFSET_Y:--2.0}
follow_z=${PX4_GZ_FOLLOW_OFFSET_Z:-2.0}
# Set camera offset
${gz_command} service -s "/gui/follow/offset" --reqtype gz.msgs.Vector3d \
--reptype gz.msgs.Boolean --timeout 5000 \
--req "x: ${follow_x}, y: ${follow_y}, z: ${follow_z}" > /dev/null 2>&1
${gz_command} topic -t /gui/track -m gz.msgs.CameraTrack \
-p "track_mode: FOLLOW, follow_target: {name: '${MODEL_NAME_INSTANCE}'},\
follow_offset: {x: ${follow_x}, y: ${follow_y}, z: ${follow_z}}, follow_pgain: 1.0, track_pgain: 1.0"
echo "INFO [init] Camera follow offset set to ${follow_x}, ${follow_y}, ${follow_z}"
fi
Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

+13 -6
View File
@@ -244,18 +244,22 @@
- [TFSlot Airspeed Sensor](sensor/airspeed_tfslot.md)
- [Barometers](sensor/barometer.md)
- [Distance Sensors \(Rangefinders\)](sensor/rangefinders.md)
- [Ainstein US-D1 Standard Radar Altimeter](sensor/ulanding_radar.md)
- [ARK DIST SR (CAN/UART)](dronecan/ark_dist.md)
- [ARK DIST MR (CAN/UART)](dronecan/ark_dist_mr.md)
- [Benewake TFmini Lidar](sensor/tfmini.md)
- [LeddarOne Lidar](sensor/leddar_one.md)
- [Lidar-Lite](sensor/lidar_lite.md)
- [Lightware Lidars (SF/LW)](sensor/sfxx_lidar.md)
- [Lightware SF45 Rotary Lidar](sensor/sf45_rotating_lidar.md)
- [Ainstein US-D1 Standard Radar Altimeter](sensor/ulanding_radar.md)
- [LeddarOne Lidar](sensor/leddar_one.md)
- [Benewake TFmini Lidar](sensor/tfmini.md)
- [Lidar-Lite](sensor/lidar_lite.md)
- [TeraRanger](sensor/teraranger.md)
- [✘ Lanbao PSK-CM8JL65-CC5](sensor/cm8jl65_ir_distance_sensor.md)
- [Avionics Anonymous Laser Altimeter UAVCAN Interface (CAN)](dronecan/avanon_laser_interface.md)
- [GNSS (GPS)](gps_compass/index.md)
- [ARK GPS (CAN)](dronecan/ark_gps.md)
- [ARK DAN GPS](gps_compass/ark_dan_gps.md)
- [ARK SAM GPS](gps_compass/ark_sam_gps.md)
- [ARK SAM GPS MINI](gps_compass/ark_sam_gps_mini.md)
- [ARK TESEO GPS](dronecan/ark_teseo_gps.md)
- [CUAV NEO 3 GPS](gps_compass/gps_cuav_neo_3.md)
- [CUAV NEO 3 Pro GPS (CAN)](gps_compass/gps_cuav_neo_3pro.md)
@@ -267,6 +271,8 @@
- [Sky-Drones SmartAP GPS](gps_compass/gps_smartap.md)
- [RTK GNSS](gps_compass/rtk_gps.md)
- [ARK RTK GPS (CAN)](dronecan/ark_rtk_gps.md)
- [ARK RTK GPS L1 L5 (CAN)](dronecan/ark_rtk_gps_l1_l2.md)
- [ARK X20 RTK GPS (CAN)](dronecan/ark_x20_rtk_gps.md)
- [ARK MOSAIC-X5 RTK GPS (CAN)](dronecan/ark_mosaic__rtk_gps.md)
- [RTK GPS Heading with Dual u-blox F9P](gps_compass/u-blox_f9p_heading.md)
- [CUAV C-RTK](gps_compass/rtk_gps_cuav_c-rtk.md)
@@ -344,13 +350,14 @@
- [Battery Estimation Tuning](config/battery.md)
- [Battery Chemistry Overview](power_systems/battery_chemistry.md)
- [Power Modules/PDB](power_module/index.md)
- [ARK PAB Power Module](power_module/ark_pab_power_module.md)
- [ARK 12S PAB Power Module](power_module/ark_12s_pab_power_module.md)
- [ARK 12S Payload Power Module](power_module/ark_12s_payload_power_module.md)
- [CUAV HV pm](power_module/cuav_hv_pm.md)
- [CUAV CAN PMU](dronecan/cuav_can_pmu.md)
- [Holybro PM02](power_module/holybro_pm02.md)
- [Holybro PM07](power_module/holybro_pm07_pixhawk4_power_module.md)
- [Holybro PM06 V2](power_module/holybro_pm06_pixhawk4mini_power_module.md)
- [ARK PAB Power Module](power_module/ark_pab_power_module.md)
- [ARK 12S PAB Power Module](power_module/ark_12s_pab_power_module.md)
- [Holybro PM02D (digital)](power_module/holybro_pm02d.md)
- [Holybro PM03D (digital)](power_module/holybro_pm03d.md)
- [Pomegranate Systems Power Module](dronecan/pomegranate_systems_pm.md)
+98
View File
@@ -0,0 +1,98 @@
# ARK DIST SR
ARK DIST SR is a low range, open source [DroneCAN](index.md) [distance sensor](../sensor/rangefinders.md).
It has an approximate range of between 8cm to 30m.
![ARK DIST SR](../../assets/hardware/sensors/optical_flow/ark_dist.jpg)
## Where to Buy
Order this module from:
- [ARK Electronics](https://arkelectron.com/product/ark-dist-sr/) (US)
## Hardware Specifications
- [Open Source Schematic and BOM](https://github.com/ARK-Electronics/ARK_DIST)
- Sensors
- [Broadcom AFBR-S50LV85D Time-of-Flight Distance Sensor](https://www.broadcom.com/products/optical-sensors/time-of-flight-3d-sensors/afbr-s50lv85d)
- Typical distance range up to 30m
- Integrated 850 nm laser light source
- Field-of-View (FoV) of 12.4° x 6.2° with 32 pixels
- Operation of up to 200k Lux ambient light
- Reference Pixel for system health monitoring
- Works well on all surface conditions
- Transmitter beam of 2° x 2° to illuminate between 1 and 3 pixels
- Two Pixhawk Standard CAN Connectors (4 Pin JST GH)
- Pixhawk Standard UART Connector (6 Pin JST SH)
- Pixhawk Standard Debug Connector (6 Pin JST SH)
- Small Form Factor
- 2.0cm x 2.8cm x 1.4cm
- 4g
- LED Indicators
- USA Built
- NDAA Compliant
- Power Requirements
- 5v
- 84mA Average
- 86mA Max
## Hardware Setup
### Wiring
The ARK DIST is connected to the CAN bus using a Pixhawk standard 4 pin JST GH cable.
For more information, refer to the [CAN Wiring](../can/index.md#wiring) instructions.
The ARK DIST can also be connected with UART and communicates over MAVLink sending the [DISTANCE_SENSOR](https://mavlink.io/en/messages/common.html#DISTANCE_SENSOR) message.
## Firmware Setup
ARK DIST SR runs the [PX4 DroneCAN Firmware](px4_cannode_fw.md).
As such, it supports firmware update over the CAN bus and [dynamic node allocation](index.md#node-id-allocation).
## PX4 Configuration
### DroneCAN
#### Enable DroneCAN
The steps are:
- In _QGroundControl_ set the parameter [UAVCAN_ENABLE](../advanced_config/parameter_reference.md#UAVCAN_ENABLE) to `2` for dynamic node allocation (or `3` if using [DroneCAN ESCs](../dronecan/escs.md)) and reboot (see [Finding/Updating Parameters](../advanced_config/parameters.md)).
- Connect ARK DIST SR CAN to the Pixhawk CAN.
Once enabled, the module will be detected on boot.
Distance sensor data should arrive at 40Hz.
DroneCAN configuration in PX4 is explained in more detail in [DroneCAN > Enabling DroneCAN](../dronecan/index.md#enabling-dronecan).
#### CAN Configuration
First set the parameters to [Enable DroneCAN](#enable-dronecan) (as shown above).
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`.
See also [Distance Sensor/Range Finder in _DroneCAN > Subscriptions and Publications_](../dronecan/#distance-sensor-range-finder).
### UART/MAVLink Configuration
If connecting via a UART set the following parameters in _QGroundControl_:
- Set [MAV_X_CONFIG](../advanced_config/parameter_reference.md#MAV_0_CONFIG) to the port the sensor is connected to.
- 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`.
## See Also
- [ARK DIST SR](https://docs.arkelectron.com/sensor/ark-dist) (ARK Docs)
+97
View File
@@ -0,0 +1,97 @@
# ARK DIST MR
ARK DIST MR is a mid range, open source [DroneCAN](index.md) [distance sensor](../sensor/rangefinders.md).
![ARK DIST MR](../../assets/hardware/sensors/optical_flow/ark_dist.jpg)
## Where to Buy
Order this module from:
- [ARK Electronics](https://arkelectron.com/product/ark-dist-mr/) (US)
## Hardware Specifications
- [Open Source Schematic and BOM](https://github.com/ARK-Electronics/ARK_DIST)
- Sensors
- [Broadcom AFBR-S50LX85D Time-of-Flight Distance Sensor](https://www.broadcom.com/products/optical-sensors/time-of-flight-3d-sensors/afbr-s50lx85d)
- Typical distance range up to 50m
- Integrated 850 nm laser light source
- Field-of-View (FoV) of 12.4° x 6.2° with 32 pixels
- Operation of up to 200k Lux ambient light
- Reference Pixel for system health monitoring
- Works well on all surface conditions
- Transmitter beam of 2° x 2° to illuminate between 1 and 3 pixels
- Two Pixhawk Standard CAN Connectors (4 Pin JST GH)
- Pixhawk Standard UART Connector (6 Pin JST SH)
- Pixhawk Standard Debug Connector (6 Pin JST SH)
- Small Form Factor
- 2.0cm x 2.8cm x 1.4cm
- 4g
- LED Indicators
- USA Built
- NDAA Compliant
- Power Requirements
- 5v
- 78mA Average
- 84mA Max
## Hardware Setup
### Wiring
The ARK DIST is connected to the CAN bus using a Pixhawk standard 4 pin JST GH cable.
For more information, refer to the [CAN Wiring](../can/index.md#wiring) instructions.
The ARK DIST can also be connected with UART and communicates over MAVLink sending the [DISTANCE_SENSOR](https://mavlink.io/en/messages/common.html#DISTANCE_SENSOR) message.
## Firmware Setup
ARK DIST MR runs the [PX4 DroneCAN Firmware](px4_cannode_fw.md).
As such, it supports firmware update over the CAN bus and [dynamic node allocation](index.md#node-id-allocation).
## PX4 Configuration
### DroneCAN
#### Enable DroneCAN
The steps are:
- In _QGroundControl_ set the parameter [UAVCAN_ENABLE](../advanced_config/parameter_reference.md#UAVCAN_ENABLE) to `2` for dynamic node allocation (or `3` if using [DroneCAN ESCs](../dronecan/escs.md)) and reboot (see [Finding/Updating Parameters](../advanced_config/parameters.md)).
- Connect ARK DIST SR CAN to the Pixhawk CAN.
Once enabled, the module will be detected on boot.
Distance sensor data should arrive at 40Hz.
DroneCAN configuration in PX4 is explained in more detail in [DroneCAN > Enabling DroneCAN](../dronecan/index.md#enabling-dronecan).
#### CAN Configuration
First set the parameters to [Enable DroneCAN](#enable-dronecan) (as shown above).
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`.
See also [Distance Sensor/Range Finder in _DroneCAN > Subscriptions and Publications_](../dronecan/#distance-sensor-range-finder).
### UART/MAVLink Configuration
If connecting via a UART set the following parameters in _QGroundControl_:
- Set [MAV_X_CONFIG](../advanced_config/parameter_reference.md#MAV_0_CONFIG) to the port the sensor is connected to.
- 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`.
## See Also
- [ARK DIST MR](https://docs.arkelectron.com/sensor/ark-dist) (ARK Docs)
+1
View File
@@ -20,6 +20,7 @@ Order this module from:
- Multi-band RTK with fast convergence times and reliable performance
- High update rate for highly dynamic applications
- Centimetre accuracy in a small and energy efficient module
- Moving Base for Heading
- Bosch BMM150 Magnetometer
- Bosch BMP388 Barometer
- Invensense ICM-42688-P 6-Axis IMU
+163
View File
@@ -0,0 +1,163 @@
# ARK RTK GPS L1 L5
[ARK RTK GPS L1 L5](https://arkelectron.gitbook.io/ark-documentation/sensors/ark-rtk-gps) is an open source [DroneCAN](index.md) [RTK GPS](../gps_compass/rtk_gps.md), [u-blox F9P](https://www.u-blox.com/en/product/zed-f9p-module), magnetometer, barometer, IMU, buzzer, and safety switch module.
![ARK RTK GPS L1 L5](../../assets/hardware/gps/ark/ark_rtk_gps_l1_l5.jpg)
## Where to Buy
Order this module from:
- [ARK Electronics](https://arkelectron.com/product/ark-rtk-gps-l1-l5/) (US)
## Hardware Specifications
- [Open Source Schematic and BOM](https://github.com/ARK-Electronics/ARK_RTK_GPS)
- Sensors
- Ublox F9P GPS
- Multi-band GNSS receiver delivers centimetre level accuracy in seconds
- Concurrent reception of GPS, GLONASS, Galileo and BeiDou
- Multi-band RTK with fast convergence times and reliable performance
- High update rate for highly dynamic applications
- Centimetre accuracy in a small and energy efficient module
- Does not Support Moving Base for Heading
- Bosch BMM150 Magnetometer
- Bosch BMP388 Barometer
- Invensense ICM-42688-P 6-Axis IMU
- STM32F412CEU6 MCU
- Safety Button
- Buzzer
- Two Pixhawk Standard CAN Connectors (4 Pin JST GH)
- F9P `UART 2` Connector
- 3 Pin JST GH
- TX, RX, GND
- Pixhawk Standard Debug Connector (6 Pin JST SH)
- LED Indicators
- Safety LED
- GPS Fix
- RTK Status
- RGB system status
- USA Built
- Power Requirements
- 5V
- 170mA Average
- 180mA Max
## Hardware Setup
### Wiring
The ARK RTK GPS L1 L5 is connected to the CAN bus using a Pixhawk standard 4 pin JST GH cable. For more information, refer to the [CAN Wiring](../can/index.md#wiring) instructions.
### Mounting
The recommended mounting orientation is with the connectors on the board pointing towards the **back of vehicle**.
The sensor can be mounted anywhere on the frame, but you will need to specify its position, relative to vehicle centre of gravity, during [PX4 configuration](#px4-configuration).
## Firmware Setup
ARK RTK GPS L1 L5 runs the [PX4 cannode firmware](px4_cannode_fw.md). As such, it supports firmware update over the CAN bus and [dynamic node allocation](index.md#node-id-allocation).
ARK RTK GPS L1 L5 boards ship with recent firmware pre-installed, but if you want to build and flash the latest firmware yourself, refer to the [cannode firmware build instructions](px4_cannode_fw.md#building-the-firmware).
Firmware target: `ark_can-rtk-gps_default`
Bootloader target: `ark_can-rtk-gps_canbootloader`
## Flight Controller Setup
### Enabling DroneCAN
In order to use the ARK RTK GPS L1 L5, connect it to the Pixhawk CAN bus and enable the DroneCAN driver by setting parameter [UAVCAN_ENABLE](../advanced_config/parameter_reference.md#UAVCAN_ENABLE) to `2` for dynamic node allocation (or `3` if using [DroneCAN ESCs](../dronecan/escs.md)).
The steps are:
- In _QGroundControl_ set the parameter [UAVCAN_ENABLE](../advanced_config/parameter_reference.md#UAVCAN_ENABLE) to `2` or `3` and reboot (see [Finding/Updating Parameters](../advanced_config/parameters.md)).
- Connect ARK RTK GPS L1 L5 CAN to the Pixhawk CAN.
Once enabled, the module will be detected on boot.
GPS data should arrive at 10Hz.
### PX4 Configuration
You need to set necessary [DroneCAN](index.md) parameters and define offsets if the sensor is not centred within the vehicle:
- Enable GPS yaw fusion by setting bit 3 of [EKF2_GPS_CTRL](../advanced_config/parameter_reference.md#EKF2_GPS_CTRL) to true.
- Enable GPS blending to ensure the heading is always published by setting [SENS_GPS_MASK](../advanced_config/parameter_reference.md#SENS_GPS_MASK) to 7 (all three bits checked).
- Enable [UAVCAN_SUB_GPS](../advanced_config/parameter_reference.md#UAVCAN_SUB_GPS), [UAVCAN_SUB_MAG](../advanced_config/parameter_reference.md#UAVCAN_SUB_MAG), and [UAVCAN_SUB_BARO](../advanced_config/parameter_reference.md#UAVCAN_SUB_BARO).
- The parameters [EKF2_GPS_POS_X](../advanced_config/parameter_reference.md#EKF2_GPS_POS_X), [EKF2_GPS_POS_Y](../advanced_config/parameter_reference.md#EKF2_GPS_POS_Y) and [EKF2_GPS_POS_Z](../advanced_config/parameter_reference.md#EKF2_GPS_POS_Z) can be set to account for the offset of the ARK RTK GPS L1 L5 from the vehicles centre of gravity.
### ARK RTK GPS L1 L5 Configuration
You may need to [configure the following parameters](../dronecan/index.md#qgc-cannode-parameter-configuration) on the ARK RTK GPS L1 L5 itself:
| Parameter | Description |
| -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| <a id="CANNODE_NODE_ID"></a>[CANNODE_NODE_ID](../advanced_config/parameter_reference.md#CANNODE_NODE_ID) | CAN node ID (0 for dynamic allocation). If set to 0 (default), dynamic node allocation is used. Set to 1-127 to use a static node ID. |
| <a id="CANNODE_TERM"></a>[CANNODE_TERM](../advanced_config/parameter_reference.md#CANNODE_TERM) | CAN built-in bus termination. Set to `1` if this is the last node on the CAN bus. |
### Setting Up Rover and Fixed Base
Position of the rover is established using RTCM messages from the RTK base module (the base module is connected to QGC, which sends the RTCM information to PX4 via MAVLink).
PX4 DroneCAN parameters:
- [UAVCAN_PUB_RTCM](../advanced_config/parameter_reference.md#UAVCAN_PUB_RTCM):
- Makes PX4 publish RTCM messages ([RTCMStream](https://dronecan.github.io/Specification/7._List_of_standard_data_types/#rtcmstream)) to the bus (which it gets from the RTK base module via QGC).
Rover module parameters (also [set using QGC](../dronecan/index.md#qgc-cannode-parameter-configuration)):
- [CANNODE_SUB_RTCM](../advanced_config/parameter_reference.md#CANNODE_SUB_RTCM) tells the rover that it should subscribe to [RTCMStream](https://dronecan.github.io/Specification/7._List_of_standard_data_types/#rtcmstream) RTCM messages on the bus (from the moving base).
::: info
Use [UAVCAN_PUB_MBD](../advanced_config/parameter_reference.md#UAVCAN_PUB_MBD) and [CANNODE_SUB_MBD](../advanced_config/parameter_reference.md#CANNODE_SUB_MBD) instead if you want to implement moving base (see below) at the same time.
:::
For more information see [Rover and Fixed Base](../dronecan/index.md#rover-and-fixed-base) in the DroneCAN guide.
## LED Meanings
- The GPS status lights are located to the right of the connectors
- Blinking green is GPS fix
- Blinking blue is received corrections and RTK Float
- Solid blue is RTK Fixed
- The CAN status lights are located top the left of the connectors
- Slow blinking green is waiting for CAN connection
- Fast blinking green is normal operation
- Slow blinking green and blue is CAN enumeration
- Fast blinking blue and red is firmware update in progress
- Blinking red is error
- If you see a red LED there is an error and you should check the following
- Make sure the flight controller has an SD card installed
- Make sure the ARK RTK GPS L1 L5 has `ark_can-rtk-gps_canbootloader` installed prior to flashing `ark_can-rtk-gps_default`
- Remove binaries from the root and ufw directories of the SD card and try to build and flash again
### Updating Ublox F9P Module
ARK RTK GPS L1 L5 comes with the Ublox F9P module up to date with version 1.13 or newer. However, you can check the version and update the firmware if desired.
The steps are:
1. [Download u-center from u-blox.com](https://www.u-blox.com/en/product/u-center) and install on your PC (Windows only)
2. Open the [u-blox ZED-F9P website](https://www.u-blox.com/en/product/zed-f9p-module#tab-documentation-resources)
3. Scroll down and click on the "Show Legacy Documents" box
4. Scroll down again to Firmware Update and download your desired firmware (at least version 1.13 is needed)
5. While holding down the safety switch on the ARK RTK GPS L1 L5, connect it to power via one of its CAN ports and hold until all 3 LEDs blink rapidly
6. Connect the ARK RTK GPS L1 L5 to your PC via its debug port with a cable such as the Black Magic Probe or an FTDI
7. Open u-center, select the COM port for the ARK RTK GPS L1 L5 and connect
![U-Center Connect](../../assets/hardware/gps/ark/ark_rtk_gps_ucenter_connect.png)
8. Check the current firmware version by selecting View, Messages View, UBX, MON, VER
![Check Version](../../assets/hardware/gps/ark/ark_rtk_gps_ublox_version.png)
9. To update the firmware:
1. Select Tools, Firmware Update
2. The Firmware image field should be the .bin file downloaded from the u-blox ZED-F9P website
3. Check the "Use this baudrate for update" checkbox and select 115200 from the drop-down
4. Ensure the other checkboxes are as shown below
5. Push the green GO button on the bottom left
6. "Firmware Update SUCCESS" should be displayed if it updated successfully
![Firmware Update](../../assets/hardware/gps/ark/ark_rtk_gps_ublox_f9p_firmware_update.png)
## See Also
- [ARK RTK GPS L1 L5 Documentation](https://arkelectron.gitbook.io/ark-documentation/sensors/ark-rtk-gps) (ARK Docs)
+141
View File
@@ -0,0 +1,141 @@
# ARK X20 RTK GPS
[ARK X20 RTK GPS](https://docs.arkelectron.com/gps/ark-x20-rtk-gps) is an open source [DroneCAN](index.md) [RTK GPS](../gps_compass/rtk_gps.md), [u-blox ZED-X20P all-band high precision GNSS module](https://www.u-blox.com/en/product/zed-x20p-module), magnetometer, barometer, IMU, buzzer, and safety switch module.
![ARK X20 RTK GPS](../../assets/hardware/gps/ark/ark_x20_rtk_gps.jpg)
## Where to Buy
Order this module from:
- [ARK Electronics](https://arkelectron.com/product/ark-x20-rtk-gps/) (US)
## Hardware Specifications
- [Open Source Schematic and BOM](https://github.com/ARK-Electronics/ARK_RTK_GPS)
- Sensors
- Ublox ZED-X20P
- All-band all constellation GNSS receiver
- Best position accuracy and availability in different environments
- RTK, PPP-RTK and PPP algorithms expanding the limits of performance
- Highest quality GNSS raw data
- u-blox end-to-end hardened security
- 25Hz update rate
- ST IIS2MDC Magnetometer
- Bosch BMP390 Barometer
- Invensense ICM-42688-P 6-Axis IMU
- STM32F412VGH6 MCU
- Safety Button
- Buzzer
- Two Pixhawk Standard CAN Connectors (4 Pin JST GH)
- X20 “UART 2” Connector
- 4 Pin JST GH
- TX, RX, PPS, GND
- I2C Expansion Connector
- 4 Pin JST-GH
- 5.0V, SCL, SDA, GND
- Pixhawk Standard Debug Connector (6 Pin JST SH)
- LED Indicators
- Safety LED
- GPS Fix
- RTK Status
- RGB system status
- USA Built
- Power Requirements
- 5V
- 144mA Average
- 157mA Max
## Hardware Setup
### Wiring
The ARK X20 RTK GPS is connected to the CAN bus using a Pixhawk standard 4 pin JST GH cable. For more information, refer to the [CAN Wiring](../can/index.md#wiring) instructions.
### Mounting
The recommended mounting orientation is with the connectors on the board pointing towards the **back of vehicle**.
The sensor can be mounted anywhere on the frame, but you will need to specify its position, relative to vehicle centre of gravity, during [PX4 configuration](#px4-configuration).
## Firmware Setup
ARK X20 RTK GPS runs the [PX4 cannode firmware](px4_cannode_fw.md). As such, it supports firmware update over the CAN bus and [dynamic node allocation](index.md#node-id-allocation).
ARK X20 RTK GPS boards ship with recent firmware pre-installed, but if you want to build and flash the latest firmware yourself, refer to the [cannode firmware build instructions](px4_cannode_fw.md#building-the-firmware).
Firmware target: `ark_can-rtk-gps_default`
Bootloader target: `ark_can-rtk-gps_canbootloader`
## Flight Controller Setup
### Enabling DroneCAN
In order to use the ARK X20 RTK GPS, connect it to the Pixhawk CAN bus and enable the DroneCAN driver by setting parameter [UAVCAN_ENABLE](../advanced_config/parameter_reference.md#UAVCAN_ENABLE) to `2` for dynamic node allocation (or `3` if using [DroneCAN ESCs](../dronecan/escs.md)).
The steps are:
- In _QGroundControl_ set the parameter [UAVCAN_ENABLE](../advanced_config/parameter_reference.md#UAVCAN_ENABLE) to `2` or `3` and reboot (see [Finding/Updating Parameters](../advanced_config/parameters.md)).
- Connect ARK X20 RTK GPS CAN to the Pixhawk CAN.
Once enabled, the module will be detected on boot.
GPS data should arrive at 10Hz.
### PX4 Configuration
You need to set necessary [DroneCAN](index.md) parameters and define offsets if the sensor is not centred within the vehicle:
- Enable GPS yaw fusion by setting bit 3 of [EKF2_GPS_CTRL](../advanced_config/parameter_reference.md#EKF2_GPS_CTRL) to true.
- Enable GPS blending to ensure the heading is always published by setting [SENS_GPS_MASK](../advanced_config/parameter_reference.md#SENS_GPS_MASK) to 7 (all three bits checked).
- Enable [UAVCAN_SUB_GPS](../advanced_config/parameter_reference.md#UAVCAN_SUB_GPS), [UAVCAN_SUB_MAG](../advanced_config/parameter_reference.md#UAVCAN_SUB_MAG), and [UAVCAN_SUB_BARO](../advanced_config/parameter_reference.md#UAVCAN_SUB_BARO).
- The parameters [EKF2_GPS_POS_X](../advanced_config/parameter_reference.md#EKF2_GPS_POS_X), [EKF2_GPS_POS_Y](../advanced_config/parameter_reference.md#EKF2_GPS_POS_Y) and [EKF2_GPS_POS_Z](../advanced_config/parameter_reference.md#EKF2_GPS_POS_Z) can be set to account for the offset of the ARK X20 RTK GPS from the vehicles centre of gravity.
### ARK X20 RTK GPS Configuration
You may need to [configure the following parameters](../dronecan/index.md#qgc-cannode-parameter-configuration) on the ARK X20 RTK GPS itself:
| Parameter | Description |
| -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| <a id="CANNODE_NODE_ID"></a>[CANNODE_NODE_ID](../advanced_config/parameter_reference.md#CANNODE_NODE_ID) | CAN node ID (0 for dynamic allocation). If set to 0 (default), dynamic node allocation is used. Set to 1-127 to use a static node ID. |
| <a id="CANNODE_TERM"></a>[CANNODE_TERM](../advanced_config/parameter_reference.md#CANNODE_TERM) | CAN built-in bus termination. Set to `1` if this is the last node on the CAN bus. |
### Setting Up Rover and Fixed Base
Position of the rover is established using RTCM messages from the RTK base module (the base module is connected to QGC, which sends the RTCM information to PX4 via MAVLink).
PX4 DroneCAN parameters:
- [UAVCAN_PUB_RTCM](../advanced_config/parameter_reference.md#UAVCAN_PUB_RTCM):
- Makes PX4 publish RTCM messages ([RTCMStream](https://dronecan.github.io/Specification/7._List_of_standard_data_types/#rtcmstream)) to the bus (which it gets from the RTK base module via QGC).
Rover module parameters (also [set using QGC](../dronecan/index.md#qgc-cannode-parameter-configuration)):
- [CANNODE_SUB_RTCM](../advanced_config/parameter_reference.md#CANNODE_SUB_RTCM) tells the rover that it should subscribe to [RTCMStream](https://dronecan.github.io/Specification/7._List_of_standard_data_types/#rtcmstream) RTCM messages on the bus (from the moving base).
::: info
Use [UAVCAN_PUB_MBD](../advanced_config/parameter_reference.md#UAVCAN_PUB_MBD) and [CANNODE_SUB_MBD](../advanced_config/parameter_reference.md#CANNODE_SUB_MBD) instead if you want to implement moving base (see below) at the same time.
:::
For more information see [Rover and Fixed Base](../dronecan/index.md#rover-and-fixed-base) in the DroneCAN guide.
## LED Meanings
- The GPS status lights are located to the right of the connectors
- Blinking green is GPS fix
- Blinking blue is received corrections and RTK Float
- Solid blue is RTK Fixed
- The CAN status lights are located top the left of the connectors
- Slow blinking green is waiting for CAN connection
- Fast blinking green is normal operation
- Slow blinking green and blue is CAN enumeration
- Fast blinking blue and red is firmware update in progress
- Blinking red is error
- If you see a red LED there is an error and you should check the following
- Make sure the flight controller has an SD card installed
- Make sure the ARK X20 RTK GPS has `ark_can-rtk-gps_canbootloader` installed prior to flashing `ark_can-rtk-gps_default`
- Remove binaries from the root and ufw directories of the SD card and try to build and flash again
## See Also
- [ARK X20 RTK GPS Documentation](https://docs.arkelectron.com/gps/ark-x20-rtk-gps) (ARK Docs)
+2
View File
@@ -62,6 +62,8 @@ Supported hardware includes (this is not an exhaustive list):
- [Holybro RM3100 Professional Grade Compass](https://holybro.com/products/dronecan-rm3100-compass)
- [RaccoonLab RM3100 Magnetometer](https://docs.raccoonlab.co/guide/gps_mag_baro/mag_rm3100.html)
- Distance sensors
- [ARK Dist](ark_dist.md)
- [Ark Dist MR](ark_dist_mr.md)
- [ARK Flow](ark_flow.md)
- [Ark Flow MR](ark_flow_mr.md)
- [Avionics Anonymous Laser Altimeter UAVCAN Interface](../dronecan/avanon_laser_interface.md)
+62
View File
@@ -0,0 +1,62 @@
# ARK DAN GPS
[ARK DAN GPS](https://arkelectron.gitbook.io/ark-documentation/gps/ark-dan-gps) is a made in the USA and NDAA-compliant [GNSS/GPS](../gps_compass/index.md) u-blox DAN-F10N GPS and industrial magnetometer.
![ARK DAN GPS](../../assets/hardware/gps/ark/ark_dan_gps.jpg)
## Where to Buy
Order this module from:
- [ARK Electronics](https://arkelectron.com/product/ark-dan-gps/) (US)
## Hardware Specifications
- [Open Source Schematic and BOM](https://github.com/ARK-Electronics/ARK_DAN_GPS)
- Sensors
- [u-blox DAN-F10N](https://www.u-blox.com/en/product/dan-f10n-module)
- L1/L5/E5a/B2a bands
- Consistently strong performance regardless of installation
- Integrated SAW-LNA-SAW for exceptional out-of-band jamming immunity
- u-blox F10 proprietary dual-band multipath mitigation technology
- [ST IIS2MDC Magnetometer](https://www.st.com/en/mems-and-sensors/iis2mdc.html)
- Pixhawk Standard UART/I2C Connector (6 Pin JST SH)
- Power Requirements
- 5V
- 25mA Average
- 44mA Max
- LED Indicators
- GPS Fix
- USA Built
- NDAA Compliant
- 6 Pin Pixhawk Standard UART/I2C Cable
## Hardware setup
The module comes with a Pixhawk-standard 6pin connector that will plug into the `GPS2` port on recent Pixhawk flight controllers.
It should be mounted front facing, as far away from the flight controller and other electronics as possible.
For more information see [Mounting the GNSS/Compass](../gps_compass/index.md#mounting-the-gnss-compass) and [Hardware Setup](../gps_compass/index.md#hardware-setup).
## PX4 Configuration
The module should be plug-n-play when used with the `GPS2` port on most flight controllers.
[Secondary GPS Configuration (UART)](../gps_compass/index.md#secondary-gps-configuration-uart) explains how you can configure the port if the GPS is not detected (note, that the configuration is the same, even if you are using GPS 2 as the primary compass).
## Pinout
### Pixhawk Standard UART/I2C Connector - 6 Pin JST-SH
| Pin Number | Signal Name | Voltage |
| ---------- | ----------- | ------- |
| 1 | 5V | 5.0V |
| 2 | RX | 3.3V |
| 3 | TX | 3.3V |
| 4 | SCL | 3.3V |
| 5 | SDA | 3.3V |
| 6 | GND | GND |
## See Also
- [ARK DAN GPS Documentation](https://arkelectron.gitbook.io/ark-documentation/gps/ark-dan-gps) (ARK Docs)
+2 -2
View File
@@ -1,6 +1,6 @@
# ARK SAM GPS
[ARK SAM GPS](https://arkelectron.gitbook.io/ark-documentation/gps/ark-sam-gps>) is a made in the USA and NDAA-compliant [GNSS/GPS](../gps_compass/index.md) u-blox SAM-M10Q GPS and industrial magnetometer.
[ARK SAM GPS](https://arkelectron.gitbook.io/ark-documentation/gps/ark-sam-gps) is a made in the USA and NDAA-compliant [GNSS/GPS](../gps_compass/index.md) u-blox SAM-M10Q GPS and industrial magnetometer.
![ARK SAM GPS](../../assets/hardware/gps/ark/ark_sam_gps.jpg)
@@ -33,7 +33,7 @@ Order this module from:
## Hardware setup
The module comes with a Pixhawk-standard 6pin connector that will plug into the `GPS2` port on recent Pixhawk flight controllers.
It should be mounted front facing, as far away from the flight controller and other electronics as possible.
It should be mounted front facing, as far away from the flight controller and other electronics as possible.
For more information see [Mounting the GNSS/Compass](../gps_compass/index.md#mounting-the-gnss-compass) and [Hardware Setup](../gps_compass/index.md#hardware-setup).
+61
View File
@@ -0,0 +1,61 @@
# ARK SAM GPS MINI
[ARK SAM GPS MINI](https://arkelectron.gitbook.io/ark-documentation/gps/ark-sam-gps) is a made in the USA and NDAA-compliant [GNSS/GPS](../gps_compass/index.md) u-blox SAM-M10Q GPS and industrial magnetometer.
![ARK SAM GPS MINI](../../assets/hardware/gps/ark/ark_sam_gps_mini.jpg)
## Where to Buy
Order this module from:
- [ARK Electronics](https://arkelectron.com/product/ark-sam-gps-mini/) (US)
## Hardware Specifications
- [Open Source Schematic and BOM](https://github.com/ARK-Electronics/ARK_SAM_GPS/tree/main)
- Sensors
- [u-blox SAM-M10Q](https://www.u-blox.com/en/product/sam-m10q-module)
- Less than 38 mW power consumption without compromising GNSS performance
- Maximum position availability with 4 concurrent GNSS reception
- Advanced spoofing and jamming detection
- [ST IIS2MDC Magnetometer](https://www.st.com/en/mems-and-sensors/iis2mdc.html)
- Pixhawk Standard UART/I2C Connector (6 Pin JST SH)
- Power Requirements
- 5V
- 15mA Average
- 20mA Max
- LED Indicators
- GPS Fix
- USA Built
- NDAA Compliant
- 6 Pin Pixhawk Standard UART/I2C Cable
## Hardware setup
The module comes with a Pixhawk-standard 6pin connector that will plug into the `GPS2` port on recent Pixhawk flight controllers.
It should be mounted front facing, as far away from the flight controller and other electronics as possible.
For more information see [Mounting the GNSS/Compass](../gps_compass/index.md#mounting-the-gnss-compass) and [Hardware Setup](../gps_compass/index.md#hardware-setup).
## PX4 Configuration
The module should be plug-n-play when used with the `GPS2` port on most flight controllers.
[Secondary GPS Configuration (UART)](../gps_compass/index.md#secondary-gps-configuration-uart) explains how you can configure the port if the GPS is not detected (note, that the configuration is the same, even if you are using GPS 2 as the primary compass).
## Pinout
### Pixhawk Standard UART/I2C Connector - 6 Pin JST-SH
| Pin Number | Signal Name | Voltage |
| ---------- | ----------- | ------- |
| 1 | 5V | 5.0V |
| 2 | RX | 3.3V |
| 3 | TX | 3.3V |
| 4 | SCL | 3.3V |
| 5 | SDA | 3.3V |
| 6 | GND | GND |
## See Also
- [ARK SAM GPS MINI Documentation](https://arkelectron.gitbook.io/ark-documentation/gps/ark-sam-gps) (ARK Docs)
+2
View File
@@ -25,7 +25,9 @@ These have been tested by the PX4 dev team, or which are popular within the PX4
| Device | GPS | Compass | [CAN](../dronecan/index.md) | Buzzer / SafeSw / LED | Notes |
| :----------------------------------------------------------- | :---------: | :-----------------------: | :-------------------------: | :-------------------: | :-------------------------- |
| [ARK GPS](../dronecan/ark_gps.md) | M9N | BMM150 | ✓ | ✓ | + Baro, IMU |
| [ARK DAN GPS](../gps_compass/ark_dan_gps.md) | DAN-F10N | IIS2MDC | | ✓ | |
| [ARK SAM GPS](../gps_compass/ark_sam_gps.md) | SAM-M10Q | IIS2MDC | | ✓ | |
| [ARK SAM GPS MINI ](../gps_compass/ark_sam_gps_mini.md) | SAM-M10Q | IIS2MDC | | ✓ | |
| [ARK TESEO GPS](../dronecan/ark_teseo_gps.md) | Teseo-LIV4F | BMM150 | ✓ | ✓ | + Baro, IMU |
| [Avionics Anonymous UAVCAN GNSS/Mag][avionics_anon_can_gnss] | SAM-M8Q | MMC5983MA | ✓ | ✘ | |
| [CUAV NEO 3 GPS](../gps_compass/gps_cuav_neo_3.md) | M9N | IST8310 | | ✓ | |
+2
View File
@@ -23,7 +23,9 @@ It also highlights devices that connect via the CAN bus, and those which support
| Device | GPS | Compass | [DroneCAN](../dronecan/index.md) | [GPS Yaw](#configuring-gps-as-yaw-heading-source) | PPK |
| :-------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------: | :------: | :------------------------------: | :-----------------------------------------------: | :-: |
| [ARK RTK GPS](../dronecan/ark_rtk_gps.md) | F9P | BMM150 | ✓ | [Dual F9P][DualF9P] |
| [ARK RTK GPS L1 L5](../dronecan/ark_rtk_gps_l1_l2.md) | F9P | BMM150 | ✓ | |
| [ARK MOSAIC-X5 RTK GPS](../dronecan/ark_mosaic__rtk_gps.md) | Mosaic-X5 | IIS2MDC | ✓ | [Septentrio Dual Antenna][SeptDualAnt] |
| [ARK X20 RTK GPS](../dronecan/ark_x20_rtk_gps.md) | X20P | BMP390 | ✓ | |
| [CUAV C-RTK GPS](../gps_compass/rtk_gps_cuav_c-rtk.md) | M8P/M8N | ✓ | | |
| [CUAV C-RTK2](../gps_compass/rtk_gps_cuav_c-rtk2.md) | F9P | ✓ | | [Dual F9P][DualF9P] |
| [CUAV C-RTK 9Ps GPS](../gps_compass/rtk_gps_cuav_c-rtk-9ps.md) | F9P | RM3100 | | [Dual F9P][DualF9P] |
@@ -0,0 +1,56 @@
# ARK 12S Payload Power Module
The [ARK 12S Payload Power Module](https://arkelectron.com/product/ark-12s-payload-power-module/) is a dual 5V 6A and 12V 6A power supply and digital power monitor designed for the Pixhawk Autopilot Bus Carrier boards.
This is similar to the [ARK 12S PAB Power Module](../power_module/ark_12s_pab_power_module.md) except that the additional 12V 6A supply allows easier powering of a payload.
![ARK 12S Payload Power Module](../../assets/hardware/power_module/ark_power_modules//ark_12s_payload_power.jpg)
## Where to Buy
Order this module from:
- [ARK Electronics](https://arkelectron.com/product/ark-12s-payload-power-module/) (US)
## Hardware Specifications
- **TI INA238 Digital Power Monitor**
- 0.0001 Ohm Shunt
- I2C Interface
- **5.2V 6A Step-Down Regulator**
- 10V Minimum Input Voltage at 6A Out
- Output Over-Current Protection
- **12.0V 6A Step-Down Regulator**
- 15V Minimum Input Voltage at 6A Out
- Output Over-Current Protection
- **75V Maximum Input Voltage**
- **Connections**
- Solder Pads Battery Input
- Solder Pads Battery Output
- 6 Pin Molex CLIK-Mate Output
- [Matches ARK PAB Carrier Power Pinout](https://arkelectron.gitbook.io/ark-documentation/flight-controllers/ark-pixhawk-autopilot-bus-carrier/pinout)
- 4 Pin Molex CLIK-Mate 12V Output
- **Other**
- USA Built
- Includes 6 Pin Molex CLIK-Mate Cable
- **Additional Information**
- Weight: 20.5 g
- Dimensions: 3.7 cm x 3.5 cm x 1.3 cm
## PX4 Setup
- Disable the `SENS_EN_INA226` parameter if it is enabled.
- Enable the `SENS_EN_INA238` parameter.
- Reboot the flight controller.
- Set the `INA238_SHUNT` parameter to 0.0001.
- Reboot the flight controller.
## See Also
- [ARK 12S Payload Power Module Documentation](https://docs.arkelectron.com/power/ark-12s-payload-power-module) (ARK Docs)
+8 -7
View File
@@ -6,35 +6,36 @@ Note that at 60A and 20°C without cooling, the 5V regulator is de-rated to a 3A
![ARK PAB Power Module](../../assets/hardware/power_module/ark_power_modules//ark_pab_power_module.jpg)
This power module is also available without connectors:
![ARK PAB Power Module No Connector](../../assets/hardware/power_module/ark_power_modules//ark_pab_power_no_connector.jpg)
## Where to Buy
Order this module from:
- [ARK Electronics](https://arkelectron.com/product/ark-pab-power-module/) (US)
- [ARK Electronics - ARK PAB Power Module](https://arkelectron.com/product/ark-pab-power-module/) (US)
- [ARK Electronics - ARK PAB Power Module No Connector](https://arkelectron.com/product/ark-pab-power-module-no-connector/) (US)
## Hardware Specifications
- **TI INA226 Digital Power Monitor**
- 0.0005 Ohm Shunt
- I2C Interface
- **5.2V 6A Step-Down Regulator**
- 33V Maximum Input Voltage
- 5.8V Minimum Input Voltage at 6A Out
- Output Over-Voltage Protection
- Output Over-Current Protection
- **Connections**
- XT60 Battery Input
- XT60 Battery Output
- XT60 Battery Input / Solder Pad Battery Input (No Connector version)
- XT60 Battery Output / Solder Pad Battery Output (No Connector version)
- 6 Pin Molex CLIK-Mate Output
- [Matches ARK PAB Carrier Power Pinout](https://arkelectron.gitbook.io/ark-documentation/flight-controllers/ark-pixhawk-autopilot-bus-carrier/pinout)
- **Other**
- USA Built
- FCC Compliant
- Includes 6 Pin Molex CLIK-Mate Cable
+1
View File
@@ -27,6 +27,7 @@ This section provides information about a number of power modules and power dist
- Digital (I2C) voltage and current power modules (for Pixhawk FMUv6X and FMUv5X derived controllers):
- [ARK PAB Power Module](../power_module/ark_pab_power_module.md)
- [ARK 12S PAB Power Module](../power_module/ark_12s_pab_power_module.md)
- [ARK 12S Payload Power Module](../power_module/ark_12s_payload_power_module.md)
- [Holybro PM02D](../power_module/holybro_pm02d.md)
- [Holybro PM03D](../power_module/holybro_pm03d.md)
- [DroneCAN](../dronecan/index.md) power modules
+62 -4
View File
@@ -15,11 +15,69 @@ This is a subset of the rangefinders that can be used with PX4.
There may also be other DroneCAN rangefinders than those listed here.
:::
### ARK Flow & AKR Flow MR
| Rangefinder | Technology | Range (min max) | Connections | NDAA | Notes |
| ------------------------------------------- | --------------- | ------------------------ | ---------------------- | ---- | ----------------------------------- |
| [Ainstein US-D1 Standard Radar Altimeter] | Microwave radar | ~50 m | UART | ✔️ | |
| [ARK DIST SR] | ToF (850 nm IR) | 8 cm to ~30 m | DroneCAN, UART | ✔️ | |
| [ARK DIST MR] | ToF (IR) | 8 cm to ~50 m | DroneCAN, UART | ✔️ | |
| [Benewake TFmini] | ToF (IR laser) | ~12 m | UART | ~ | |
| [Holybro ST VL53L1X Lidar] | ToF (IR) | up to ~4 m | I2C | ~ | |
| [LeddarOne] | ToF (IR) | 1 cm 40 m | UART | ~ | |
| [Lidar-Lite] | ToF (IR laser) | 5 cm 40 m | I2C, PWM | ~ | |
| [LightWare SF11/C] | ToF (IR laser) | up to ~120 m | UART, I2C | ~ | |
| [LightWare LW20/C] | ToF (IR laser) | up to ~100 m | I2C | ~ | Waterproof (IP67) + servo |
| [LightWare SF45/B] | ToF (IR laser) | ~50 m | UART | ~ | Rotary lidar (collision prevention) |
| [MaxBotix I2CXL-MaxSonar-EZ] | Ultrasonic | | I2C | ~ | |
| [RaccoonLab Cyphal & DroneCAN µRANGEFINDER] | ToF (IR) | ~0.1 m ~8 m | DroneCAN, Cyphal | ~ | |
| [TeraRanger Evo 60m] | ToF (IR) | 0.5 m 60 m | I2C | ~ | |
| [TeraRanger Evo 600Hz] | ToF (IR) | 0.75 m 8 m | I2C | ~ | High update rate (600 Hz) |
| [LightWare SF02] _(disc.)_ | ToF (IR laser) | ~50 m | UART | ~ | Discontinued |
| [LightWare SF10/A] _(disc.)_ | ToF (IR laser) | ~25 m | UART, I2C | ~ | Discontinued |
| [LightWare SF10/B] _(disc.)_ | ToF (IR laser) | ~50 m | UART, I2C | ~ | Discontinued |
| [LightWare SF10/C] _(disc.)_ | ToF (IR laser) | ~100 m | UART, I2C | ~ | Discontinued |
| [Lanbao PSK-CM8JL65-CC5] _(disc.)_ | ToF (IR) | 0.17 m 8 m | UART | ✖️ | Discontinued |
| [TeraRanger One] _(disc.)_ | ToF (IR) | ~0.2 m ~14 m (typical) | I2C (adapter required) | ~ | Discontinued |
[ARK Flow](../dronecan/ark_flow.md) and [ARK Flow MR](../dronecan/ark_flow_mr.md) are open-source Time-of-Flight (ToF) and optical flow sensor modules, which are capable of measuring distances from 8cm to 30m and from 8cm to 50m, respectively.
It can be connected to the flight controller via its CAN1 port, allowing additional sensors to connect through its CAN2 port.
It supports [DroneCAN](../dronecan/index.md), runs [PX4 DroneCAN Firmware](../dronecan/px4_cannode_fw.md), and is packed into a tiny form factor.
[Ainstein US-D1 Standard Radar Altimeter]: ../sensor/ulanding_radar.md
[ARK DIST SR]: ../dronecan/ark_dist.md
[ARK DIST MR]: ../dronecan/ark_dist_mr.md
[Benewake TFmini]: ../sensor/tfmini.md
[Holybro ST VL53L1X Lidar]: #holybro-st-vl53l1x-lidar
[Lanbao PSK-CM8JL65-CC5]: ../sensor/cm8jl65_ir_distance_sensor.md
[LeddarOne]: ../sensor/leddar_one.md
[Lidar-Lite]: ../sensor/lidar_lite.md
[LightWare Lidar]: ../sensor/sfxx_lidar.md
[LightWare SF11/C]: ../sensor/sfxx_lidar.md
[LightWare LW20/C]: ../sensor/sfxx_lidar.md
[LightWare SF45/B]: ../sensor/sfxx_lidar.md
[LightWare SF02]: ../sensor/sfxx_lidar.md
[LightWare SF10/A]: ../sensor/sfxx_lidar.md
[LightWare SF10/B]: ../sensor/sfxx_lidar.md
[LightWare SF10/C]: ../sensor/sfxx_lidar.md
[MaxBotix I2CXL-MaxSonar-EZ]: #maxbotix-i2cxl-maxsonar-ez
[TeraRanger Evo 60 m]: ../sensor/teraranger.md
[TeraRanger Evo 600Hz]: ../sensor/teraranger.md
[TeraRanger One]: ../sensor/teraranger.md
These adaptors allows you to connect a non-CAN rangefinder via the CAN interface.
Note that the range depends on the connected rangefinder
| Adaptor | Connections | NDAA |
| ------------------------------------------------------- | ---------------- | ---- |
| **Avionics Anonymous UAVCAN Laser Altimeter Interface** | DroneCAN | ~ |
| [RaccoonLab Cyphal & DroneCAN Rangefinder Adapter] | DroneCAN, Cyphal | ~ |
[RaccoonLab Cyphal & DroneCAN µRANGEFINDER]: #raccoonlab-cyphal-and-dronecan-μrangefinder
[RaccoonLab Cyphal & DroneCAN Rangefinder Adapter]: #raccoonlab-cyphal-and-dronecan-rangefinder-adapter
Note that some [Optical Flow](../sensor/optical_flow.md) sensors also include a rangefinder, such as [ARK Flow](../dronecan/ark_flow.md) and [ARK Flow MR](../dronecan/ark_flow_mr.md).
### ARK DIST SR & ARK DIST MR
[ARK DIST SR](../dronecan/ark_dist.md) and [ARK DIST MR](../dronecan/ark_dist_mr.md) are open-source Time-of-Flight (ToF) rangefinder modules, which are capable of measuring distances from 8cm to 30m and from 8cm to 50m, respectively.
The sensors support [DroneCAN](../dronecan/index.md), run [PX4 DroneCAN Firmware](../dronecan/px4_cannode_fw.md), and are packed into a tiny form factor.
They can be connected to a flight controller via its `CAN1` port, allowing additional sensors to connected through the `CAN2` port.
### Holybro ST VL53L1X Lidar
@@ -562,6 +562,8 @@ void FwAutotuneAttitudeControl::updateStateMachine(hrt_abstime now)
mavlink_log_critical(&mavlink_log_pub, "Autotune aborted before finishing");
_state = state::fail;
_state_start_time = now;
} else if (timeout) {
// Skip to next axis
mavlink_log_critical(&mavlink_log_pub, "Autotune axis timeout, skipping to next axis");
@@ -586,9 +588,11 @@ void FwAutotuneAttitudeControl::updateStateMachine(hrt_abstime now)
_state = state::fail; // safety fallback
break;
}
_state_start_time = now;
}
_state_start_time = now;
}
}
@@ -134,6 +134,12 @@ void InternalCombustionEngineControl::Run()
}
}
break;
case ICESource::VtolStatus: {
_user_request = (vehicle_status.vehicle_type == vehicle_status_s::VEHICLE_TYPE_FIXED_WING
|| vehicle_status.in_transition_to_fw) ? UserOnOffRequest::On : UserOnOffRequest::Off;
}
break;
}
switch (_state) {
@@ -108,6 +108,7 @@ private:
ArmingState,
Aux1,
Aux2,
VtolStatus,
};
hrt_abstime _state_start_time{0};
@@ -19,6 +19,7 @@ parameters:
0: On arming - disarming
1: Aux1
2: Aux2
3: On Vtol Transitions
ICE_CHOKE_ST_DUR:
description:
+14 -16
View File
@@ -1145,22 +1145,6 @@ Mavlink::send_autopilot_capabilities()
return false;
}
void
Mavlink::send_protocol_version()
{
mavlink_protocol_version_t msg = {};
msg.version = _protocol_version * 100;
msg.min_version = 100;
msg.max_version = 203;
uint64_t mavlink_lib_git_version_binary = px4_mavlink_lib_version_binary();
// TODO add when available
//memcpy(&msg.spec_version_hash, &mavlink_spec_git_version_binary, sizeof(msg.spec_version_hash));
memcpy(&msg.library_version_hash, &mavlink_lib_git_version_binary, sizeof(msg.library_version_hash));
mavlink_msg_protocol_version_send_struct(get_channel(), &msg);
}
int
Mavlink::configure_stream(const char *stream_name, const float rate)
{
@@ -1435,9 +1419,13 @@ Mavlink::configure_streams_to_default(const char *configure_single_stream)
configure_stream_local("GIMBAL_DEVICE_ATTITUDE_STATUS", 1.0f);
configure_stream_local("GIMBAL_DEVICE_SET_ATTITUDE", 5.0f);
configure_stream_local("GIMBAL_MANAGER_STATUS", 0.5f);
#if defined(MAVLINK_MSG_ID_GLOBAL_POSITION)
configure_stream_local("GLOBAL_POSITION", 5.0f);
#endif
configure_stream_local("GLOBAL_POSITION_INT", 5.0f);
#if defined(MAVLINK_MSG_ID_GNSS_INTEGRITY)
configure_stream_local("GNSS_INTEGRITY", 1.0f);
#endif
configure_stream_local("GPS2_RAW", 1.0f);
configure_stream_local("GPS_GLOBAL_ORIGIN", 1.0f);
configure_stream_local("GPS_RAW_INT", 5.0f);
@@ -1510,7 +1498,9 @@ Mavlink::configure_streams_to_default(const char *configure_single_stream)
configure_stream_local("GIMBAL_DEVICE_SET_ATTITUDE", 5.0f);
configure_stream_local("GIMBAL_MANAGER_STATUS", 0.5f);
configure_stream_local("GLOBAL_POSITION_INT", 50.0f);
#if defined(MAVLINK_MSG_ID_GNSS_INTEGRITY)
configure_stream_local("GNSS_INTEGRITY", 1.0f);
#endif
configure_stream_local("GPS2_RAW", unlimited_rate);
configure_stream_local("GPS_GLOBAL_ORIGIN", 1.0f);
configure_stream_local("GPS_RAW_INT", unlimited_rate);
@@ -1671,7 +1661,9 @@ Mavlink::configure_streams_to_default(const char *configure_single_stream)
configure_stream_local("ESTIMATOR_STATUS", 5.0f);
configure_stream_local("EXTENDED_SYS_STATE", 2.0f);
configure_stream_local("GLOBAL_POSITION_INT", 10.0f);
#if defined(MAVLINK_MSG_ID_GNSS_INTEGRITY)
configure_stream_local("GNSS_INTEGRITY", 1.0f);
#endif
configure_stream_local("GPS2_RAW", unlimited_rate);
configure_stream_local("GPS_GLOBAL_ORIGIN", 1.0f);
configure_stream_local("GPS_RAW_INT", unlimited_rate);
@@ -1770,10 +1762,14 @@ Mavlink::configure_streams_to_default(const char *configure_single_stream)
configure_stream_local("CURRENT_MODE", 0.5f);
configure_stream_local("ESTIMATOR_STATUS", 1.0f);
configure_stream_local("EXTENDED_SYS_STATE", 1.0f);
#if defined(MAVLINK_MSG_ID_GLOBAL_POSITION)
configure_stream_local("GLOBAL_POSITION", 10.0f);
#endif
configure_stream_local("GLOBAL_POSITION_INT", 10.0f);
configure_stream_local("GPS_GLOBAL_ORIGIN", 1.0f);
#if defined(MAVLINK_MSG_ID_GNSS_INTEGRITY)
configure_stream_local("GNSS_INTEGRITY", 1.0f);
#endif
configure_stream_local("GPS2_RAW", unlimited_rate);
configure_stream_local("GPS_RAW_INT", unlimited_rate);
configure_stream_local("HOME_POSITION", 0.5f);
@@ -1834,7 +1830,9 @@ Mavlink::configure_streams_to_default(const char *configure_single_stream)
configure_stream_local("ESTIMATOR_STATUS", 1.0f);
configure_stream_local("EXTENDED_SYS_STATE", 0.5f);
configure_stream_local("GLOBAL_POSITION_INT", 2.0f);
#if defined(MAVLINK_MSG_ID_GLOBAL_POSITION)
configure_stream_local("GLOBAL_POSITION", 2.0f);
#endif
configure_stream_local("GPS_GLOBAL_ORIGIN", 1.0f);
configure_stream_local("GPS2_RAW", 2.0f);
configure_stream_local("GPS_RAW_INT", 2.0f);
-4
View File
@@ -371,10 +371,6 @@ public:
*/
bool send_autopilot_capabilities();
/**
* Send the protocol version of MAVLink
*/
void send_protocol_version();
List<MavlinkStream *> &get_streams() { return _streams; }
-4
View File
@@ -108,7 +108,6 @@
#include "streams/PING.hpp"
#include "streams/POSITION_TARGET_GLOBAL_INT.hpp"
#include "streams/POSITION_TARGET_LOCAL_NED.hpp"
#include "streams/PROTOCOL_VERSION.hpp"
#include "streams/RAW_RPM.hpp"
#include "streams/RC_CHANNELS.hpp"
#include "streams/SCALED_IMU.hpp"
@@ -471,9 +470,6 @@ static const StreamListItem streams_list[] = {
#if defined(AUTOPILOT_VERSION_HPP)
create_stream_list_item<MavlinkStreamAutopilotVersion>(),
#endif // AUTOPILOT_VERSION_HPP
#if defined(PROTOCOL_VERSION_HPP)
create_stream_list_item<MavlinkStreamProtocolVersion>(),
#endif // PROTOCOL_VERSION_HPP
#if defined(FLIGHT_INFORMATION_HPP)
create_stream_list_item<MavlinkStreamFlightInformation>(),
#endif // FLIGHT_INFORMATION_HPP
-4
View File
@@ -444,7 +444,6 @@ MavlinkReceiver::evaluate_target_ok(int command, int target_system, int target_c
switch (command) {
case MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES:
case MAV_CMD_REQUEST_PROTOCOL_VERSION:
/* broadcast and ignore component */
target_ok = (target_system == 0) || (target_system == mavlink_system.sysid);
break;
@@ -569,9 +568,6 @@ void MavlinkReceiver::handle_message_command_both(mavlink_message_t *msg, const
if (cmd_mavlink.command == MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES) {
result = handle_request_message_command(MAVLINK_MSG_ID_AUTOPILOT_VERSION);
} else if (cmd_mavlink.command == MAV_CMD_REQUEST_PROTOCOL_VERSION) {
result = handle_request_message_command(MAVLINK_MSG_ID_PROTOCOL_VERSION);
} else if (cmd_mavlink.command == MAV_CMD_GET_HOME_POSITION) {
result = handle_request_message_command(MAVLINK_MSG_ID_HOME_POSITION);
@@ -1,63 +0,0 @@
/****************************************************************************
*
* Copyright (c) 2020 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name PX4 nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#ifndef PROTOCOL_VERSION_HPP
#define PROTOCOL_VERSION_HPP
class MavlinkStreamProtocolVersion : public MavlinkStream
{
public:
static MavlinkStream *new_instance(Mavlink *mavlink) { return new MavlinkStreamProtocolVersion(mavlink); }
static constexpr const char *get_name_static() { return "PROTOCOL_VERSION"; }
static constexpr uint16_t get_id_static() { return MAVLINK_MSG_ID_PROTOCOL_VERSION; }
const char *get_name() const override { return get_name_static(); }
uint16_t get_id() override { return get_id_static(); }
unsigned get_size() override
{
return MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN + MAVLINK_NUM_NON_PAYLOAD_BYTES;
}
private:
explicit MavlinkStreamProtocolVersion(Mavlink *mavlink) : MavlinkStream(mavlink) {}
bool send() override
{
_mavlink->send_protocol_version();
return true;
}
};
#endif // PROTOCOL_VERSION_HPP
@@ -71,11 +71,12 @@ if (gz-transport_FOUND)
add_subdirectory(buoyancy)
add_subdirectory(spacecraft_thruster)
add_subdirectory(motor_failure)
add_subdirectory(airspeed)
# Add an alias target for each plugin
if (TARGET GstCameraSystem)
add_custom_target(px4_gz_plugins ALL DEPENDS OpticalFlowSystem MovingPlatformController TemplatePlugin GenericMotorModelPlugin BuoyancySystemPlugin GstCameraSystem SpacecraftThrusterModelPlugin MotorFailurePlugin)
add_custom_target(px4_gz_plugins ALL DEPENDS OpticalFlowSystem MovingPlatformController TemplatePlugin GenericMotorModelPlugin BuoyancySystemPlugin GstCameraSystem SpacecraftThrusterModelPlugin MotorFailurePlugin AirSpeedPlugin)
else()
add_custom_target(px4_gz_plugins ALL DEPENDS OpticalFlowSystem MovingPlatformController TemplatePlugin GenericMotorModelPlugin BuoyancySystemPlugin SpacecraftThrusterModelPlugin MotorFailurePlugin)
add_custom_target(px4_gz_plugins ALL DEPENDS OpticalFlowSystem MovingPlatformController TemplatePlugin GenericMotorModelPlugin BuoyancySystemPlugin SpacecraftThrusterModelPlugin MotorFailurePlugin AirSpeedPlugin)
endif()
endif()
@@ -0,0 +1,137 @@
/****************************************************************************
*
* Copyright (c) 2025 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name PX4 nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#include "AirSpeed.hpp"
#include <gz/plugin/Register.hh>
#include <gz/msgs/air_speed.pb.h>
using namespace px4;
// Sign function taken from https://stackoverflow.com/a/4609795/8548472
template <typename T> int sign(T val)
{
return (T(0) < val) - (val < T(0));
}
// Register the plugin
GZ_ADD_PLUGIN(
AirSpeed,
gz::sim::System,
AirSpeed::ISystemPreUpdate,
AirSpeed::ISystemConfigure
)
void AirSpeed::Configure(const gz::sim::Entity &entity,
const std::shared_ptr<const sdf::Element> &sdf,
gz::sim::EntityComponentManager &ecm,
gz::sim::EventManager &eventMgr)
{
_entity = entity;
_model = gz::sim::Model(entity);
const std::string link_name = sdf->Get<std::string>("link_name");
_link_entity = _model.LinkByName(ecm, link_name);
std::string model_name = _model.Name(ecm);
if (!_link_entity) {
throw std::runtime_error("Airspeed::Configure: Link \"" + link_name + "\" was not found. "
"Please ensure that your model contains the corresponding link.");
}
_link = gz::sim::Link(_link_entity);
// Needed to report linear & angular velocity
_link.EnableVelocityChecks(ecm, true);
_world_entity = gz::sim::worldEntity(ecm);
_world = gz::sim::World(_world_entity);
std::string world_name = _world.Name(ecm).value_or("default");
std::string airspeed_topic = "/world/" + world_name + "/model/" + model_name +
"/link/airspeed_link/sensor/air_speed/air_speed";
_pub = _node.Advertise<gz::msgs::AirSpeed>(airspeed_topic);
std::string wind_topic = "/world/" + world_name + "/wind_info";
_node.Subscribe(wind_topic, &AirSpeed::windCallback, this);
///TODO: Read sdf for altitude home position
}
void AirSpeed::PreUpdate(const gz::sim::UpdateInfo &_info,
gz::sim::EntityComponentManager &_ecm)
{
const auto optional_pose = _link.WorldPose(_ecm);
if (optional_pose.has_value()) {
_vehicle_position = optional_pose.value().Pos();
_vehicle_attitude = optional_pose.value().Rot();
} else {
gzerr << "Unable to get pose" << std::endl;
}
const auto optional_vel = _link.WorldLinearVelocity(_ecm);
if (optional_vel.has_value()) {
_vehicle_velocity = optional_vel.value();
} else {
gzerr << "Unable to get linear velocity" << std::endl;
}
// Compute the air density at the local altitude / temperature
const float alt_rel = _vehicle_position.Z(); // Z-component from ENU
const float alt_amsl = (float)_alt_home + alt_rel;
const float temperature_local = TEMPERATURE_MSL - LAPSE_RATE * alt_amsl;
const float density_ratio = powf(TEMPERATURE_MSL / temperature_local, 4.256f);
const float air_density = AIR_DENSITY_MSL / density_ratio;
// Calculate differential pressure + noise in hPa
const float diff_pressure_noise = standard_normal_distribution_(random_generator_) * diff_pressure_stddev_;
// Body-relateive air velocity
gz::math::Vector3d air_relative_velocity = _vehicle_velocity - _wind_velocity;
gz::math::Vector3d body_velocity = _vehicle_attitude.RotateVectorReverse(air_relative_velocity);
// Calculate differential pressure in hPa
double diff_pressure = sign(body_velocity.X()) * 0.005 * (double)air_density * body_velocity.X() * body_velocity.X() +
(double)diff_pressure_noise;
gz::msgs::AirSpeed airspeed_msg;
airspeed_msg.set_diff_pressure(diff_pressure * 100.0);
_pub.Publish(airspeed_msg);
}
void AirSpeed::windCallback(const gz::msgs::Wind &msg)
{
_wind_velocity = gz::math::Vector3d(msg.linear_velocity().x(), msg.linear_velocity().y(), msg.linear_velocity().z());
}
@@ -0,0 +1,96 @@
/****************************************************************************
*
* Copyright (c) 2025 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name PX4 nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#pragma once
#include <gz/sim/Util.hh>
#include <gz/sim/Link.hh>
#include <gz/sim/Model.hh>
#include <gz/sim/World.hh>
#include <gz/sim/System.hh>
#include "gz/sim/components/LinearVelocity.hh"
#include <gz/msgs/wind.pb.h>
#include <gz/transport/Node.hh>
#include <random>
namespace px4
{
static constexpr float DEFAULT_HOME_ALT_AMSL = 488.0; // altitude AMSL at Irchel Park, Zurich, Switzerland [m]
// international standard atmosphere (troposphere model - valid up to 11km) see [1]
static constexpr float TEMPERATURE_MSL = 288.15; // temperature at MSL [K] (15 [C])
static constexpr float PRESSURE_MSL = 101325.0; // pressure at MSL [Pa]
static constexpr float LAPSE_RATE = 0.0065; // reduction in temperature with altitude for troposphere [K/m]
static constexpr float AIR_DENSITY_MSL = 1.225; // air density at MSL [kg/m^3]
class AirSpeed:
public gz::sim::System,
public gz::sim::ISystemPreUpdate,
public gz::sim::ISystemConfigure
{
public:
void PreUpdate(const gz::sim::UpdateInfo &_info,
gz::sim::EntityComponentManager &_ecm) final;
void Configure(const gz::sim::Entity &entity,
const std::shared_ptr<const sdf::Element> &sdf,
gz::sim::EntityComponentManager &ecm,
gz::sim::EventManager &eventMgr) override;
void windCallback(const gz::msgs::Wind &msg);
private:
gz::sim::Entity _entity;
gz::sim::Model _model{gz::sim::kNullEntity};
gz::sim::Entity _link_entity;
gz::sim::Link _link;
gz::sim::Entity _world_entity;
gz::sim::World _world;
gz::transport::Node _node;
gz::transport::Node::Publisher _pub;
gz::math::Quaterniond _vehicle_attitude;
gz::math::Vector3d _vehicle_velocity{0., 0., 0.};
gz::math::Vector3d _vehicle_position{0., 0., 0.};
gz::math::Vector3d _wind_velocity{0., 0., 0.};
std::default_random_engine random_generator_;
std::normal_distribution<float> standard_normal_distribution_;
float diff_pressure_stddev_{0.01f}; // [hPa]
float _alt_home{DEFAULT_HOME_ALT_AMSL};
};
} // end namespace px4
@@ -0,0 +1,57 @@
############################################################################
#
# Copyright (c) 2025 PX4 Development Team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name PX4 nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
project(AirSpeedPlugin)
add_library(${PROJECT_NAME} SHARED
AirSpeed.cpp
)
target_link_libraries(${PROJECT_NAME}
PUBLIC px4_gz_msgs
PUBLIC ${GZ_SENSORS_TARGET}
PUBLIC ${GZ_PLUGIN_TARGET}
PUBLIC ${GZ_SIM_TARGET}
PUBLIC ${GZ_TRANSPORT_TARGET}
)
target_include_directories(${PROJECT_NAME}
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
PUBLIC ${CMAKE_CURRENT_BINARY_DIR}
PUBLIC px4_gz_msgs
)
if (NOT CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION lib/px4_gz_plugins)
endif()
+1 -1
View File
@@ -1 +1 @@
3.11.1
3.11.2