Skip to content

Commit

Permalink
Merge branch 'PX4:main' into px4xplane-sitl
Browse files Browse the repository at this point in the history
  • Loading branch information
alireza787b authored Apr 8, 2024
2 parents 3bb67bd + 5f61e3b commit 40f6fb7
Show file tree
Hide file tree
Showing 253 changed files with 13,351 additions and 2,815 deletions.
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
root = true

[*]
insert_final_newline = false

[{*.{c,cpp,cc,h,hpp},CMakeLists.txt,Kconfig}]
indent_style = tab
tab_width = 8
# Not in the official standard, but supported by many editors
max_line_length = 120

[*.yaml]
indent_style = space
indent_size = 2
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,5 @@
url = https://github.com/PX4/PX4-gazebo-models.git
branch = main
[submodule "boards/modalai/voxl2/libfc-sensor-api"]
path = src/modules/muorb/apps/libfc-sensor-api
path = boards/modalai/voxl2/libfc-sensor-api
url = https://gitlab.com/voxl-public/voxl-sdk/core-libs/libfc-sensor-api.git
6 changes: 4 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,11 @@ pipeline {
sh('cp airframes.md PX4-user_guide/en/airframes/airframe_reference.md')
sh('cp parameters.md PX4-user_guide/en/advanced_config/parameter_reference.md')
sh('cp -R modules/*.md PX4-user_guide/en/modules/')
sh('cp -R graph_*.json PX4-user_guide/.vuepress/public/en/middleware/')
sh('cp -R graph_*.json PX4-user_guide/.vuepress/public/en/middleware/') // vuepress
sh('cp -R graph_*.json PX4-user_guide/public/middleware/') // vitepress
sh('cp -R msg_docs/*.md PX4-user_guide/en/msg_docs/')
sh('cp -R failsafe_sim/* PX4-user_guide/.vuepress/public/en/config/failsafe')
sh('cp -R failsafe_sim/* PX4-user_guide/.vuepress/public/en/config/failsafe') // vuepress
sh('cp -R failsafe_sim/* PX4-user_guide/public/config/failsafe') // vitepress
sh('cd PX4-user_guide; git status; git add .; git commit -a -m "Update PX4 Firmware metadata `date`" || true')
sh('cd PX4-user_guide; git push origin main || true')
sh('rm -rf PX4-user_guide')
Expand Down
2 changes: 1 addition & 1 deletion Tools/astyle/files_to_check_code_style.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ exec find boards msg src platforms test \
-path src/lib/cdrstream/cyclonedds -prune -o \
-path src/lib/cdrstream/rosidl -prune -o \
-path src/modules/zenoh/zenoh-pico -prune -o \
-path src/modules/muorb/apps/libfc-sensor-api -prune -o \
-path boards/modalai/voxl2/libfc-sensor-api -prune -o \
-type f \( -name "*.c" -o -name "*.h" -o -name "*.cpp" -o -name "*.hpp" \) | grep $PATTERN
126 changes: 126 additions & 0 deletions Tools/kconfig/allyesconfig.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
#!/usr/bin/env python3

# Copyright (c) 2018-2019, Ulf Magnusson
# SPDX-License-Identifier: ISC

"""
Writes a configuration file where as many symbols as possible are set to 'y'.
The default output filename is '.config'. A different filename can be passed
in the KCONFIG_CONFIG environment variable.
Usage for the Linux kernel:
$ make [ARCH=<arch>] scriptconfig SCRIPT=Kconfiglib/allyesconfig.py
"""
import kconfiglib
import os


exception_list = [
'DRIVERS_BOOTLOADERS', # Only used for bootloader target
'MODULES_PX4IOFIRMWARE', # Only needed for PX4IO firmware itself, maybe fix through dependencies
'BOARD_LTO', # Experimental
'BOARD_TESTING', # Don't build test suite
'BOARD_CONSTRAINED_FLASH', # only used to reduce flash size
'BOARD_NO_HELP', # only used to reduce flash size
'BOARD_CONSTRAINED_MEMORY', # only used to reduce flash size
'BOARD_EXTERNAL_METADATA', # only used to reduce flash size
'BOARD_CRYPTO', # Specialized use
'BOARD_PROTECTED', # Experimental for MPU use
'DRIVERS_LIGHTS_RGBLED_PWM', # Only on specific boards, needs dependency fixing
'DRIVERS_LIGHTS_NEOPIXEL', # Only on specific boards, needs dependency fixing
'DRIVERS_DISTANCE_SENSOR_LIGHTWARE_SF45_SERIAL', # Only on specific boards, needs dependency fixing
'PARAM_PRIMARY', # Plainly broken
'PARAM_REMOTE', # Plainly broken
'DRIVERS_ACTUATORS_VOXL_ESC', # Dependency need fixing, requires VOXL_ESC_DEFAULT_XXX
'DRIVERS_VOXL2_IO', # Dependency need fixing, requires VOXL2_IO_DEFAULT_XX
'DRIVERS_BAROMETER_TCBP001TA', # Requires hardcoded PX4_SPI_BUS_BARO mapping
'DRIVERS_DISTANCE_SENSOR_BROADCOM_AFBRS50', # Requires hardcoded PX4_SPI_BUS_BARO mapping
'DRIVERS_DISTANCE_SENSOR_SRF05', # Requires hardcoded GPIO_ULTRASOUND
'DRIVERS_PPS_CAPTURE', # Requires PPS GPIO config
'DRIVERS_PWM_INPUT', # Requires PWM config
'DRIVERS_TEST_PPM', # PIN config not portable
'DRIVERS_TATTU_CAN', # Broken needs fixing
'MODULES_REPLAY', # Fails on NuttX targets maybe force POSIX dependency?
'SYSTEMCMDS_HIST', # This module can only be used on boards that enable BOARD_ENABLE_LOG_HISTORY
'SYSTEMCMDS_GPIO', # PIN config not portable
'SYSTEMCMDS_SHUTDOWN', # Needs dependency checking
'EXAMPLES_DYN_HELLO', # NuttX doesn't support dynamic linking
'SYSTEMCMDS_DYN', # NuttX doesn't support dynamic linking
'DRIVERS_RPI_RC_IN', # RPI specific driver
'SYSTEMCMDS_I2C_LAUNCHER', # undefined reference to `system',
'MODULES_MUORB_APPS', # Weird QURT/Posix package doesn't work on x86 px4 sitl
'MODULES_SIMULATION_SIMULATOR_SIH', # Causes compile errors
]

exception_list_sitl = [
'DRIVERS_BAROMETER', # Fails I2C dependencies
'COMMON_BAROMETERS', # Fails I2C dependencies
'DRIVERS_ADC_BOARD_ADC', # Fails HW dependencies, I think this only works on NuttX
'DRIVERS_CAMERA_CAPTURE', # GPIO config failure
'DRIVERS_DSHOT', # No Posix driver, I think this only works on NuttX
'DRIVERS_PWM_OUT', # No Posix driver, I think this only works on NuttX
'COMMON', # Fails I2C dependencies
'DRIVERS', # Fails I2C dependencies
'SYSTEMCMDS_REBOOT', # Sitl can't reboot
'MODULES_BATTERY_STATUS', # Sitl doesn't provide a power brick
'SYSTEMCMDS_SERIAL_PASSTHRU', # Not supported in SITL
'SYSTEMCMDS_SERIAL_TEST', # Not supported in SITL
'SYSTEMCMDS_SD_STRESS', # Not supported in SITL
'SYSTEMCMDS_SD_BENCH', # Not supported in SITL
'SYSTEMCMDS_I2CDETECT', # Not supported in SITL
'SYSTEMCMDS_DMESG', # Not supported in SITL
'SYSTEMCMDS_USB_CONNECTED', # Not supported in SITL
]

def main():
kconf = kconfiglib.standard_kconfig(__doc__)


if 'BASE_DEFCONFIG' in os.environ:
kconf.load_config(os.environ['BASE_DEFCONFIG'])

if 'MODEL' in os.environ:
if os.environ['MODEL'] == 'sitl':
for sym in kconf.unique_defined_syms:
if sym.name.startswith(tuple(exception_list_sitl)):
exception_list.append(sym.name)


# See allnoconfig.py
kconf.warn = False

# Try to set all symbols to 'y'. Dependencies might truncate the value down
# later, but this will at least give the highest possible value.
#
# Assigning 0/1/2 to non-bool/tristate symbols has no effect (int/hex
# symbols still take a string, because they preserve formatting).
for sym in kconf.unique_defined_syms:
# Set choice symbols to 'm'. This value will be ignored for choices in
# 'y' mode (the "normal" mode), which will instead just get their
# default selection, but will set all symbols in m-mode choices to 'm',
# which is as high as they can go.
#
# Here's a convoluted example of how you might get an m-mode choice
# even during allyesconfig:
#
# choice
# tristate "weird choice"
# depends on m
if sym.name not in exception_list:
sym.set_value(1 if sym.choice else 2)

# Set all choices to the highest possible mode
for choice in kconf.unique_choices:
choice.set_value(2)

kconf.warn = True

kconf.load_allconfig("allyes.config")

print(kconf.write_config())


if __name__ == "__main__":
main()
Binary file modified boards/ark/fmu-v6x/extras/px4_io-v2_default.bin
Binary file not shown.
1 change: 1 addition & 0 deletions boards/ark/septentrio-gps/default.px4board
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ CONFIG_UAVCANNODE_RTK_DATA=y
CONFIG_UAVCANNODE_SAFETY_BUTTON=y
CONFIG_UAVCANNODE_STATIC_PRESSURE=y
CONFIG_UAVCANNODE_STATIC_TEMPERATURE=y
CONFIG_MODULES_EKF2=y
CONFIG_MODULES_GYRO_CALIBRATION=y
CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y
CONFIG_MODULES_SENSORS=y
Expand Down
2 changes: 2 additions & 0 deletions boards/ark/septentrio-gps/init/rc.board_defaults
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ param set-default SENS_IMU_CLPNOTI 0

safety_button start
tone_alarm start

ekf2 start
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ CONFIG_STACK_COLORATION=y
CONFIG_START_DAY=30
CONFIG_START_MONTH=11
CONFIG_STDIO_DISABLE_BUFFERING=y
CONFIG_STM32_FLASH_CONFIG_G=y
CONFIG_STM32_NOEXT_VECTORS=y
CONFIG_STM32_TIM8=y
CONFIG_TASK_NAME_SIZE=0
Expand Down
1 change: 1 addition & 0 deletions boards/ark/septentrio-gps/nuttx-config/nsh/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ CONFIG_STM32_ADC1=y
CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y
CONFIG_STM32_DMA1=y
CONFIG_STM32_DMA2=y
CONFIG_STM32_FLASH_CONFIG_G=y
CONFIG_STM32_FLASH_PREFETCH=y
CONFIG_STM32_FLOWCONTROL_BROKEN=y
CONFIG_STM32_I2C1=y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
*
****************************************************************************/

/* The STM32F412 has 512Kb of FLASH beginning at address 0x0800:0000 and
/* The STM32F412 has 1M of FLASH beginning at address 0x0800:0000 and
* 256Kb of SRAM. SRAM is split up into three blocks:
*
* 1) 112Kb of SRAM beginning at address 0x2000:0000
Expand Down
2 changes: 1 addition & 1 deletion boards/ark/septentrio-gps/nuttx-config/scripts/script.ld
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
*
****************************************************************************/

/* The STM32F412 has 512Kb of FLASH beginning at address 0x0800:0000 and
/* The STM32F412 has 1M of FLASH beginning at address 0x0800:0000 and
* 256Kb of SRAM. SRAM is split up into three blocks:
*
* 1) 112Kb of SRAM beginning at address 0x2000:0000
Expand Down
Binary file modified boards/cubepilot/cubeorange/extras/cubepilot_io-v2_default.bin
Binary file not shown.
Binary file modified boards/cubepilot/cubeyellow/extras/cubepilot_io-v2_default.bin
Binary file not shown.
3 changes: 1 addition & 2 deletions boards/diatone/mamba-f405-mk2/src/board_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@
#define ADC_BATTERY_CURRENT_CHANNEL 13
#define ADC_RC_RSSI_CHANNEL 12

/* Define Battery 1 Voltage Divider and A per V
*/
/* Define Battery Voltage Divider and A per V */
#define BOARD_BATTERY1_V_DIV (11.12f)
#define BOARD_BATTERY1_A_PER_V (31.f)

Expand Down
3 changes: 3 additions & 0 deletions boards/hkust/nxt-dual/bootloader.px4board
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CONFIG_BOARD_TOOLCHAIN="arm-none-eabi"
CONFIG_BOARD_ARCHITECTURE="cortex-m7"
CONFIG_BOARD_ROMFSROOT=""
89 changes: 89 additions & 0 deletions boards/hkust/nxt-dual/default.px4board
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
CONFIG_BOARD_TOOLCHAIN="arm-none-eabi"
CONFIG_BOARD_ARCHITECTURE="cortex-m7"
CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS0"
CONFIG_BOARD_SERIAL_GPS2="/dev/ttyS2"
CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS1"
CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS3"
CONFIG_BOARD_SERIAL_TEL3="/dev/ttyS6"
CONFIG_BOARD_SERIAL_TEL4="/dev/ttyS7"
CONFIG_BOARD_SERIAL_RC="/dev/ttyS4"
CONFIG_DRIVERS_ADC_BOARD_ADC=y
CONFIG_COMMON_BAROMETERS=y
CONFIG_DRIVERS_BATT_SMBUS=y
CONFIG_DRIVERS_CAMERA_CAPTURE=y
CONFIG_DRIVERS_CAMERA_TRIGGER=y
CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y
CONFIG_COMMON_DISTANCE_SENSOR=y
CONFIG_DRIVERS_DSHOT=y
CONFIG_DRIVERS_GPS=y
CONFIG_DRIVERS_IMU_BOSCH_BMI088=y
CONFIG_DRIVERS_IRLOCK=y
CONFIG_COMMON_LIGHT=y
CONFIG_COMMON_MAGNETOMETER=y
CONFIG_COMMON_OPTICAL_FLOW=y
CONFIG_DRIVERS_PWM_OUT=y
CONFIG_DRIVERS_RC_INPUT=y
CONFIG_COMMON_TELEMETRY=y
CONFIG_DRIVERS_TONE_ALARM=y
CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y
CONFIG_MODULES_BATTERY_STATUS=y
CONFIG_MODULES_CAMERA_FEEDBACK=y
CONFIG_MODULES_COMMANDER=y
CONFIG_MODULES_CONTROL_ALLOCATOR=y
CONFIG_MODULES_DATAMAN=y
CONFIG_MODULES_EKF2=y
CONFIG_MODULES_ESC_BATTERY=y
CONFIG_MODULES_EVENTS=y
CONFIG_MODULES_FLIGHT_MODE_MANAGER=y
CONFIG_MODULES_FW_ATT_CONTROL=y
CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y
CONFIG_MODULES_FW_POS_CONTROL=y
CONFIG_MODULES_FW_RATE_CONTROL=y
CONFIG_MODULES_GIMBAL=y
CONFIG_MODULES_GYRO_CALIBRATION=y
CONFIG_MODULES_GYRO_FFT=y
CONFIG_MODULES_LAND_DETECTOR=y
CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y
CONFIG_MODULES_LOAD_MON=y
CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=y
CONFIG_MODULES_LOGGER=y
CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y
CONFIG_MODULES_MANUAL_CONTROL=y
CONFIG_MODULES_MAVLINK=y
CONFIG_MODULES_MC_ATT_CONTROL=y
CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y
CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y
CONFIG_MODULES_MC_POS_CONTROL=y
CONFIG_MODULES_MC_RATE_CONTROL=y
CONFIG_MODULES_NAVIGATOR=y
CONFIG_MODULES_RC_UPDATE=y
CONFIG_MODULES_ROVER_POS_CONTROL=y
CONFIG_MODULES_SENSORS=y
CONFIG_MODULES_TEMPERATURE_COMPENSATION=y
CONFIG_MODULES_UXRCE_DDS_CLIENT=y
CONFIG_MODULES_VTOL_ATT_CONTROL=y
CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y
CONFIG_SYSTEMCMDS_BL_UPDATE=y
CONFIG_SYSTEMCMDS_DMESG=y
CONFIG_SYSTEMCMDS_DUMPFILE=y
CONFIG_SYSTEMCMDS_GPIO=y
CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y
CONFIG_SYSTEMCMDS_I2CDETECT=y
CONFIG_SYSTEMCMDS_LED_CONTROL=y
CONFIG_SYSTEMCMDS_MFT=y
CONFIG_SYSTEMCMDS_MTD=y
CONFIG_SYSTEMCMDS_NSHTERM=y
CONFIG_SYSTEMCMDS_PARAM=y
CONFIG_SYSTEMCMDS_PERF=y
CONFIG_SYSTEMCMDS_REBOOT=y
CONFIG_SYSTEMCMDS_SD_BENCH=y
CONFIG_SYSTEMCMDS_SD_STRESS=y
CONFIG_SYSTEMCMDS_SYSTEM_TIME=y
CONFIG_SYSTEMCMDS_TOP=y
CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y
CONFIG_SYSTEMCMDS_TUNE_CONTROL=y
CONFIG_SYSTEMCMDS_UORB=y
CONFIG_SYSTEMCMDS_USB_CONNECTED=y
CONFIG_SYSTEMCMDS_VER=y
CONFIG_SYSTEMCMDS_WORK_QUEUE=y
CONFIG_EXAMPLES_FAKE_GPS=y
Binary file not shown.
13 changes: 13 additions & 0 deletions boards/hkust/nxt-dual/firmware.prototype
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"board_id": 1013,
"magic": "PX4FWv1",
"description": "Firmware for the MatekH743-slim board",
"image": "",
"build_time": 0,
"summary": "MatekH743-mini",
"version": "0.1",
"image_size": 0,
"image_maxsize": 1835008,
"git_identity": "",
"board_revision": 0
}
24 changes: 24 additions & 0 deletions boards/hkust/nxt-dual/init/rc.board_defaults
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh
#
# board specific defaults
#------------------------------------------------------------------------------
param set-default BAT1_A_PER_V 17
param set-default BAT1_N_CELLS 4
param set-default BAT1_V_CHARGED 4.2
param set-default BAT1_V_DIV 10.1
param set-default BAT1_V_EMPTY 3.2

param set-default SYS_HAS_MAG 0
param set-default PWM_MAIN_TIM0 -4
param set-default RC_INPUT_PROTO -1

param set-default IMU_GYRO_RATEMAX 2000
param set-default SYS_AUTOSTART 4001
param set-default MC_PITCHRATE_K 0.4
param set-default MC_ROLLRATE_K 0.35
param set-default MC_YAWRATE_K 1.2
param set-default MC_YAWRATE_MAX 360
param set-default MAV_TYPE 2
param set-default CA_AIRFRAME 0
param set-default CA_ROTOR_COUNT 4
param set-default CBRK_SUPPLY_CHK 894281
13 changes: 13 additions & 0 deletions boards/hkust/nxt-dual/init/rc.board_extras
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh
#
# board specific extras init
#------------------------------------------------------------------------------

# NxtV1 does not have OSD
# if ! param compare OSD_ATXXXX_CFG 0
# then
# atxxxx start -s
# fi

# DShot telemetry is always on UART7
# dshot telemetry /dev/ttyS5
16 changes: 16 additions & 0 deletions boards/hkust/nxt-dual/init/rc.board_sensors
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh
#
# board specific sensors init
#------------------------------------------------------------------------------

board_adc start

# # Internal SPI bus BMI088 accel/gyro
bmi088 -s -b 1 -A -R 2 start
bmi088 -s -b 1 -G -R 2 start

bmi088 -s -b 4 -A -R 2 start
bmi088 -s -b 4 -G -R 2 start

# internal baro
spl06 -X -a 0x77 start
Loading

0 comments on commit 40f6fb7

Please sign in to comment.