Skip to content

Commit

Permalink
Merge branch 'PX4:main' into develop_v1.14.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Peize-Liu authored Apr 2, 2024
2 parents 9a7816d + 8e61026 commit 286c61b
Show file tree
Hide file tree
Showing 147 changed files with 4,452 additions and 1,281 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
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
Binary file modified boards/holybro/durandal-v1/extras/px4_io-v2_default.bin
Binary file not shown.
2 changes: 1 addition & 1 deletion boards/holybro/kakuteh7/src/spi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = {
initSPIDevice(DRV_OSD_DEVTYPE_ATXXXX, SPI::CS{GPIO::PortB, GPIO::Pin12}),
}),
initSPIBus(SPI::Bus::SPI4, {
initSPIDevice(DRV_IMU_DEVTYPE_ICM20689, SPI::CS{GPIO::PortE, GPIO::Pin4}, SPI::DRDY{GPIO::PortE, GPIO::Pin1}),
initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortE, GPIO::Pin4}, SPI::DRDY{GPIO::PortE, GPIO::Pin1}),
initSPIDevice(DRV_IMU_DEVTYPE_MPU6000, SPI::CS{GPIO::PortE, GPIO::Pin4}, SPI::DRDY{GPIO::PortE, GPIO::Pin1}),
initSPIDevice(DRV_IMU_DEVTYPE_BMI270, SPI::CS{GPIO::PortE, GPIO::Pin4}, SPI::DRDY{GPIO::PortE, GPIO::Pin1}),
}),
Expand Down
Binary file modified boards/holybro/pix32v5/extras/px4_io-v2_default.bin
Binary file not shown.
4 changes: 1 addition & 3 deletions boards/matek/h743-mini/src/board_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,7 @@
(1 << ADC_RSSI_IN_CHANNEL))


/* Define Battery 1 Voltage Divider and A per V
*/

/* Define Battery Voltage Divider and A per V */
#define BOARD_BATTERY1_V_DIV (11.0f) /* measured with the provided PM board */
#define BOARD_BATTERY1_A_PER_V (40.0f)
#define BOARD_BATTERY2_V_DIV (11.0f) /* measured with the provided PM board */
Expand Down
4 changes: 1 addition & 3 deletions boards/matek/h743/src/board_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,7 @@
(1 << ADC_RSSI_IN_CHANNEL))


/* Define Battery 1 Voltage Divider and A per V
*/

/* Define Battery Voltage Divider and A per V */
#define BOARD_BATTERY1_V_DIV (11.0f) /* measured with the provided PM board */
#define BOARD_BATTERY1_A_PER_V (40.0f)
#define BOARD_BATTERY2_V_DIV (11.0f) /* measured with the provided PM board */
Expand Down
2 changes: 1 addition & 1 deletion boards/modalai/fc-v2/default.px4board
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ CONFIG_MODULES_NAVIGATOR=y
CONFIG_MODULES_RC_UPDATE=y
CONFIG_MODULES_ROVER_POS_CONTROL=y
CONFIG_MODULES_SENSORS=y
CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y
# CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y
CONFIG_MODULES_TEMPERATURE_COMPENSATION=y
CONFIG_MODULES_UXRCE_DDS_CLIENT=y
CONFIG_MODULES_VTOL_ATT_CONTROL=y
Expand Down
2 changes: 2 additions & 0 deletions boards/modalai/voxl2-slpi/default.px4board
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ CONFIG_DRIVERS_ACTUATORS_VOXL_ESC=y
CONFIG_DRIVERS_BAROMETER_INVENSENSE_ICP101XX=y
CONFIG_DRIVERS_DISTANCE_SENSOR_VL53L0X=y
CONFIG_DRIVERS_DISTANCE_SENSOR_VL53L1X=y
CONFIG_DRIVERS_GPS=y
CONFIG_DRIVERS_IMU_INVENSENSE_ICM42688P=y
CONFIG_DRIVERS_LIGHTS_RGBLED_NCP5623C=y
CONFIG_DRIVERS_MAGNETOMETER_ISENTEK_IST8308=y
CONFIG_DRIVERS_MAGNETOMETER_ISENTEK_IST8310=y
CONFIG_DRIVERS_MAGNETOMETER_QMC5883L=y
CONFIG_DRIVERS_POWER_MONITOR_VOXLPM=y
CONFIG_DRIVERS_RC_CRSF_RC=y
CONFIG_DRIVERS_QSHELL_QURT=y
CONFIG_MODULES_COMMANDER=y
CONFIG_MODULES_CONTROL_ALLOCATOR=y
Expand Down
2 changes: 1 addition & 1 deletion boards/modalai/voxl2-slpi/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ add_library(drivers_board
add_subdirectory(${PX4_BOARD_DIR}/src/drivers/rc_controller)
add_subdirectory(${PX4_BOARD_DIR}/src/drivers/mavlink_rc_in)
# add_subdirectory(${PX4_BOARD_DIR}/src/drivers/spektrum_rc)
# add_subdirectory(${PX4_BOARD_DIR}/src/drivers/ghst_rc)
add_subdirectory(${PX4_BOARD_DIR}/src/drivers/ghst_rc)
add_subdirectory(${PX4_BOARD_DIR}/src/drivers/dsp_hitl)
# add_subdirectory(${PX4_BOARD_DIR}/src/drivers/dsp_sbus)
add_subdirectory(${PX4_BOARD_DIR}/src/drivers/elrs_led)
34 changes: 34 additions & 0 deletions boards/modalai/voxl2/cmake/init.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
############################################################################
#
# Copyright (c) 2024 ModalAI, Inc. 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_directories(${PX4_BOARD_DIR}/libfc-sensor-api/inc)
2 changes: 1 addition & 1 deletion boards/modalai/voxl2/cmake/link_libraries.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# Link against the public stub version of the proprietary fc sensor library
target_link_libraries(px4 PRIVATE
${PX4_SOURCE_DIR}/src//modules/muorb/apps/libfc-sensor-api/build/libfc_sensor.so
${PX4_BOARD_DIR}/libfc-sensor-api/build/libfc_sensor.so
px4_layer
${module_libraries}
)
5 changes: 2 additions & 3 deletions boards/modalai/voxl2/scripts/build-deps.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#!/bin/bash

cd src/modules/muorb/apps/libfc-sensor-api
cd boards/modalai/voxl2/libfc-sensor-api
rm -fR build
mkdir build
cd build
CC=/home/4.1.0.4/tools/linaro64/bin/aarch64-linux-gnu-gcc cmake ..
make
cd ../../../../../..

cd ../../../../..
4 changes: 3 additions & 1 deletion boards/modalai/voxl2/target/voxl-px4-start
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,10 @@ qshell rgbled_ncp5623c start -X -b 1 -f 400 -a 56

# We do not change the value of SYS_AUTOCONFIG but if it does not
# show up as used then it is not reported to QGC and we get a
# missing parameter error.
# missing parameter error. Also, we don't use SYS_AUTOSTART but QGC
# complains about it as well.
param touch SYS_AUTOCONFIG
param touch SYS_AUTOSTART

# ESC driver
if [ "$ESC" == "VOXL_ESC" ]; then
Expand Down
Binary file modified boards/mro/x21-777/extras/px4_io-v2_default.bin
Binary file not shown.
Binary file modified boards/mro/x21/extras/px4_io-v2_default.bin
Binary file not shown.
Binary file modified boards/px4/fmu-v2/extras/px4_io-v2_default.bin
Binary file not shown.
Binary file modified boards/px4/fmu-v3/extras/px4_io-v2_default.bin
Binary file not shown.
Binary file modified boards/px4/fmu-v4pro/extras/px4_io-v2_default.bin
Binary file not shown.
Binary file modified boards/px4/fmu-v5/extras/px4_io-v2_default.bin
Binary file not shown.
3 changes: 0 additions & 3 deletions boards/px4/fmu-v5x/default.px4board
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ CONFIG_MODULES_NAVIGATOR=y
CONFIG_MODE_NAVIGATOR_VTOL_TAKEOFF=y
CONFIG_MODULES_PAYLOAD_DELIVERER=y
CONFIG_MODULES_RC_UPDATE=y
CONFIG_MODULES_ROVER_POS_CONTROL=y
CONFIG_MODULES_SENSORS=y
CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y
CONFIG_MODULES_TEMPERATURE_COMPENSATION=y
Expand All @@ -102,9 +101,7 @@ CONFIG_SYSTEMCMDS_NSHTERM=y
CONFIG_SYSTEMCMDS_PARAM=y
CONFIG_SYSTEMCMDS_PERF=y
CONFIG_SYSTEMCMDS_REBOOT=y
CONFIG_SYSTEMCMDS_REFLECT=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
Expand Down
Binary file modified boards/px4/fmu-v5x/extras/px4_io-v2_default.bin
Binary file not shown.
Binary file modified boards/px4/fmu-v6c/extras/px4_io-v2_default.bin
Binary file not shown.
Binary file modified boards/px4/fmu-v6x/extras/px4_io-v2_default.bin
Binary file not shown.
1 change: 1 addition & 0 deletions boards/px4/fmu-v6xrt/allyes.px4board
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_BOARD_LINKER_PREFIX="allyes"
Loading

0 comments on commit 286c61b

Please sign in to comment.