Skip to content

Commit

Permalink
Merge remote-tracking branch 'px4/main' into pr-ekf2_output_predictor…
Browse files Browse the repository at this point in the history
…_init_cleanup
  • Loading branch information
dagar committed Oct 26, 2023
2 parents b172705 + 12b291b commit 0290a61
Show file tree
Hide file tree
Showing 655 changed files with 35,012 additions and 14,562 deletions.
3 changes: 2 additions & 1 deletion .ci/Jenkinsfile-compile
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ pipeline {
"spracing_h7extreme_default",
"thepeach_k1_default",
"thepeach_r1_default",
"uvify_core_default"
"uvify_core_default",
"siyi_n7_default"
],
image: docker_images.nuttx,
archive: true
Expand Down
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"twxs.cmake",
"uavcan.dsdl",
"wholroyd.jinja",
"zixuanwang.linkerscript"
"zixuanwang.linkerscript",
"ms-vscode.makefile-tools"
],

"containerUser": "user",
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/compile_nuttx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ jobs:
raspberrypi_pico,
sky-drones_smartap-airlink,
spracing_h7extreme,
uvify_core
uvify_core,
siyi_n7
]
steps:
- uses: actions/checkout@v1
Expand Down
10 changes: 10 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,13 @@
path = src/modules/uxrce_dds_client/Micro-XRCE-DDS-Client
url = https://github.com/PX4/Micro-XRCE-DDS-Client.git
branch = px4
[submodule "src/lib/cdrstream/cyclonedds"]
path = src/lib/cdrstream/cyclonedds
url = https://github.com/px4/cyclonedds
[submodule "src/lib/cdrstream/rosidl"]
path = src/lib/cdrstream/rosidl
url = https://github.com/px4/rosidl
[submodule "src/modules/zenoh/zenoh-pico"]
path = src/modules/zenoh/zenoh-pico
url = https://github.com/px4/zenoh-pico
branch = pr-zubf-werror-fix
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"twxs.cmake",
"uavcan.dsdl",
"wholroyd.jinja",
"zixuanwang.linkerscript"
"zixuanwang.linkerscript",
"ms-vscode.makefile-tools"
]
}
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,5 +127,6 @@
"terminal.integrated.scrollback": 15000,
"yaml.schemas": {
"${workspaceFolder}/validation/module_schema.yaml": "${workspaceFolder}/src/modules/*/module.yaml"
}
},
"ros.distro": "humble"
}
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,8 @@ endif()
#
add_library(parameters_interface INTERFACE)
add_library(kernel_parameters_interface INTERFACE)
add_library(events_interface INTERFACE)
add_library(kernel_events_interface INTERFACE)

include(px4_add_library)
add_subdirectory(src/lib EXCLUDE_FROM_ALL)
Expand All @@ -440,8 +442,11 @@ add_subdirectory(src/lib/parameters EXCLUDE_FROM_ALL)
if(${PX4_PLATFORM} STREQUAL "nuttx" AND NOT CONFIG_BUILD_FLAT)
target_link_libraries(parameters_interface INTERFACE usr_parameters)
target_link_libraries(kernel_parameters_interface INTERFACE parameters)
target_link_libraries(events_interface INTERFACE usr_events)
target_link_libraries(kernel_events_interface INTERFACE events)
else()
target_link_libraries(parameters_interface INTERFACE parameters)
target_link_libraries(events_interface INTERFACE events)
endif()

# firmware added last to generate the builtin for included modules
Expand Down
2 changes: 2 additions & 0 deletions Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,5 @@ menu "platforms"
depends on PLATFORM_QURT || PLATFORM_POSIX
source "platforms/common/Kconfig"
endmenu

source "src/lib/*/Kconfig"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ These boards are maintained to be compatible with PX4-Autopilot by the Manufactu

### Community supported

These boards don't fully comply industry standards, and thus is solely maintained by the PX4 publc community members.
These boards don't fully comply industry standards, and thus is solely maintained by the PX4 public community members.

### Experimental

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ param set-default PWM_MAIN_FUNC4 104

# EKF2
param set-default EKF2_GPS_CTRL 0
param set-default EKF2_HGT_REF 0
param set-default EKF2_EVP_NOISE 0.05
param set-default EKF2_EVA_NOISE 0.05
param set-default EKF2_OF_CTRL 1
Expand All @@ -39,6 +40,9 @@ param set-default EKF2_OF_CTRL 1
param set-default LPE_FUSION 242
param set-default LPE_FAKE_ORIGIN 1

# Commander
# param set-default COM_HOME_EN 0 # Disable setting of home position

param set-default MPC_ALT_MODE 2

param set-default SENS_FLOW_ROT 6
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
#
# @name 3DR Iris Quadrotor with a depth camera (forward-facing)
#
# @type Quadrotor Wide
#

. ${R}etc/init.d-posix/airframes/10015_gazebo-classic_iris
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
#
# @name 3DR Iris Quadrotor with a depth camera (downward-facing)
#
# @type Quadrotor Wide
#

. ${R}etc/init.d-posix/airframes/10015_gazebo-classic_iris
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

param set-default FW_LAUN_DETCN_ON 1
param set-default FW_THR_IDLE 0.1 # needs to be running before throw as that's how gazebo detects arming
param set-default FW_LAUN_AC_THLD 10

param set-default FW_LND_ANG 8

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


param set-default FW_LND_ANG 8
param set-default FW_THR_LND_MAX 0

param set-default NPFG_PERIOD 12

Expand Down Expand Up @@ -36,7 +35,6 @@ param set-default NAV_DLL_ACT 2

param set-default RWTO_TKOFF 1

#param set-default SYS_CTRL_ALLOC 1
param set-default CA_AIRFRAME 1

param set-default CA_ROTOR_COUNT 1
Expand All @@ -61,7 +59,3 @@ param set-default PWM_MAIN_FUNC7 202
param set-default PWM_MAIN_FUNC8 203
param set-default PWM_MAIN_FUNC9 206
param set-default PWM_MAIN_REV 256


set MIXER_FILE etc/mixers-sitl/plane_sitl.main.mix
set MIXER custom
6 changes: 4 additions & 2 deletions ROMFS/px4fmu_common/init.d-posix/airframes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ px4_add_romfs_files(
1012_gazebo-classic_iris_rplidar
1013_gazebo-classic_iris_vision
1013_gazebo-classic_iris_vision.post
1015_gazebo-classic_iris_obs_avoid
1015_gazebo-classic_iris_obs_avoid.post
1014_gazebo-classic_iris_obs_avoid
1014_gazebo-classic_iris_obs_avoid.post
1015_gazebo-classic_iris_depth_camera
1016_gazebo-classic_iris_downward_depth_camera
1017_gazebo-classic_iris_opt_flow_mockup
1019_gazebo-classic_iris_dual_gps
1021_gazebo-classic_uuv_hippocampus
Expand Down
2 changes: 0 additions & 2 deletions ROMFS/px4fmu_common/init.d/airframes/4019_x500_v2
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,3 @@ param set-default PWM_MAIN_FUNC1 101
param set-default PWM_MAIN_FUNC2 102
param set-default PWM_MAIN_FUNC3 103
param set-default PWM_MAIN_FUNC4 104
param set-default PWM_MAIN_TIM0 -4

1 change: 0 additions & 1 deletion ROMFS/px4fmu_common/init.d/airframes/4900_crazyflie
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ param set-default MC_ROLLRATE_P 0.07
param set-default MC_YAW_P 3

param set-default MPC_THR_HOVER 0.7
param set-default MPC_THR_MAX 1
param set-default MPC_Z_P 1.5
param set-default MPC_Z_VEL_P_ACC 8
param set-default MPC_Z_VEL_I_ACC 6
Expand Down
1 change: 0 additions & 1 deletion ROMFS/px4fmu_common/init.d/airframes/4901_crazyflie21
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ param set-default MC_ROLLRATE_P 0.07
param set-default MC_YAW_P 3

param set-default MPC_THR_HOVER 0.7
param set-default MPC_THR_MAX 1
param set-default MPC_Z_P 1.5
param set-default MPC_Z_VEL_P_ACC 8
param set-default MPC_Z_VEL_I_ACC 6
Expand Down
1 change: 1 addition & 0 deletions ROMFS/px4fmu_common/init.d/rc.fw_defaults
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ param set-default EKF2_REQ_EPV 10
param set-default EKF2_REQ_HDRIFT 0.5
param set-default EKF2_REQ_SACC 1
param set-default EKF2_REQ_VDRIFT 1.0
param set-default EKF2_RNG_QLTY_T 3.0

param set-default RTL_TYPE 1
param set-default RTL_RETURN_ALT 100
Expand Down
6 changes: 6 additions & 0 deletions ROMFS/px4fmu_common/init.d/rc.sensors
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,12 @@ then
ms5525dso start -X
fi

# TE ASP5033 differential pressure sensor external I2C
if param compare -s SENS_EN_ASP5033 1
then
asp5033 start -X
fi

# SHT3x temperature and hygrometer sensor, external I2C
if param compare -s SENS_EN_SHT3X 1
then
Expand Down
12 changes: 12 additions & 0 deletions ROMFS/px4fmu_common/init.d/rcS
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@ then
fi
fi

# Check for an update of the ext_autostart folder, and replace the old one with it
if [ -e /fs/microsd/ext_autostart_new ]
then
echo "Updating external autostart files"
rm -r $SDCARD_EXT_PATH
mv /fs/microsd/ext_autostart_new $SDCARD_EXT_PATH
fi

set PARAM_FILE /fs/microsd/params
set PARAM_BACKUP_FILE "/fs/microsd/parameters_backup.bson"
fi
Expand Down Expand Up @@ -529,6 +537,10 @@ else
cyphal start
fi
fi
if param greater -s ZENOH_ENABLE 0
then
zenoh start
fi

#
# End of autostart.
Expand Down
3 changes: 3 additions & 0 deletions Tools/astyle/files_to_check_code_style.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,7 @@ exec find boards msg src platforms test \
-path src/lib/crypto/libtomcrypt -prune -o \
-path src/lib/crypto/libtommath -prune -o \
-path src/modules/uxrce_dds_client/Micro-XRCE-DDS-Client -prune -o \
-path src/lib/cdrstream/cyclonedds -prune -o \
-path src/lib/cdrstream/rosidl -prune -o \
-path src/drivers/zenoh/zenoh-pico -prune -o \
-type f \( -name "*.c" -o -name "*.h" -o -name "*.cpp" -o -name "*.hpp" \) | grep $PATTERN
115 changes: 115 additions & 0 deletions Tools/auterion/remote_update_fmu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
#!/bin/bash
# Flash PX4 to a device running AuterionOS in the local network
if [ "$1" == "-h" ] || [ "$1" == "--help" ] || [ $# -lt 2 ]; then
echo "Usage: $0 -f <firmware.px4|.elf> [-c <configuration_dir>] -d <IP/Device> [-u <user>] [-p <ssh_port>] [--revert]"
exit 1
fi

ssh_port=22
ssh_user=root

while getopts ":f:c:d:p:u:r" opt; do
case ${opt} in
f )
if [ -n "$OPTARG" ]; then
firmware_file="$OPTARG"
else
echo "ERROR: -f requires a non-empty option argument."
exit 1
fi
;;
c )
if [ -f "$OPTARG/rc.autostart" ]; then
config_dir="$OPTARG"
else
echo "ERROR: -c configuration directory is empty or does not contain a valid rc.autostart"
exit 1
fi
;;
d )
if [ "$OPTARG" ]; then
device="$OPTARG"
else
echo "ERROR: -d requires a non-empty option argument."
exit 1
fi
;;
p )
if [[ "$OPTARG" =~ ^[0-9]+$ ]]; then
ssh_port="$OPTARG"
else
echo "ERROR: -p ssh_port must be a number."
exit 1
fi
;;
u )
if [ "$OPTARG" ]; then
ssh_user="$OPTARG"
else
echo "ERROR: -u requires a non-empty option argument."
exit 1
fi
;;
r )
revert=true
;;
esac
done

if [ -z "$device" ]; then
echo "Error: missing device"
exit 1
fi

target_dir=/shared_container_dir/fmu
target_file_name="update-dev.tar"

if [ "$revert" == true ]; then
# revert to the release version which was originally deployed
cmd="cp $target_dir/update.tar $target_dir/$target_file_name"
ssh -t -p $ssh_port $ssh_user@$device "$cmd"
else
# create custom update-dev.tar
tmp_dir="$(mktemp -d)"
config_path=""
firmware_path=""

if [ -d "$config_dir" ]; then
cp -r "$config_dir" "$tmp_dir/config"
config_path=config
fi

if [ -f "$firmware_file" ]; then
extension="${firmware_file##*.}"
cp "$firmware_file" "$tmp_dir/firmware.$extension"
if [ "$extension" == "elf" ]; then
# ensure the file is stripped to reduce file size
arm-none-eabi-strip "$tmp_dir/firmware.$extension"
fi
firmware_path="firmware.$extension"
fi

pushd "$tmp_dir" &>/dev/null

if [ -z $firmware_path ] && [ -z $config_path ]; then
exit 1
fi

tar_name="tar"

if [ -x "$(command -v gtar)" ]; then
# check if gnu-tar is installed on macOS and use that instead
tar_name="gtar"
fi

$tar_name -C "$tmp_dir" --sort=name --owner=root:0 --group=root:0 --mtime='2019-01-01 00:00:00' -cvf $target_file_name $firmware_path $config_path

# send it to the target to start flashing
scp -P $ssh_port "$target_file_name" $ssh_user@"$device":$target_dir
popd &>/dev/null
rm -rf "$tmp_dir"
fi

# grab status output for flashing progress
cmd="tail --follow=name $target_dir/update_status 2>/dev/null || true"
ssh -t -p $ssh_port $ssh_user@$device "$cmd"
Loading

0 comments on commit 0290a61

Please sign in to comment.