Skip to content

Commit

Permalink
Merge branch 'main' into board_specific_dds_topics
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexisTM authored Oct 21, 2024
2 parents bfa3c1f + 965d5b3 commit c71b670
Show file tree
Hide file tree
Showing 257 changed files with 40,850 additions and 109 deletions.
10 changes: 6 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
path = src/modules/mavlink/mavlink
url = https://github.com/mavlink/mavlink.git
branch = master
[submodule "src/drivers/uavcan/libuavcan"]
path = src/drivers/uavcan/libuavcan
url = https://github.com/dronecan/libuavcan.git
branch = main
[submodule "Tools/simulation/jmavsim/jMAVSim"]
path = Tools/simulation/jmavsim/jMAVSim
url = https://github.com/PX4/jMAVSim.git
Expand Down Expand Up @@ -87,3 +83,9 @@
path = src/drivers/actuators/vertiq_io/iq-module-communication-cpp
url = https://github.com/PX4/iq-module-communication-cpp.git
branch = master
[submodule "src/drivers/uavcan/libdronecan/dsdl"]
path = src/drivers/uavcan/libdronecan/dsdl
url = https://github.com/PX4/DSDL.git
[submodule "src/drivers/uavcan/libdronecan/libuavcan/dsdl_compiler/pydronecan"]
path = src/drivers/uavcan/libdronecan/libuavcan/dsdl_compiler/pydronecan
url = https://github.com/dronecan/pydronecan
2 changes: 1 addition & 1 deletion Documentation/Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ RECURSIVE = YES
# Note that relative paths are relative to the directory from which doxygen is
# run.

EXCLUDE = @CMAKE_SOURCE_DIR@/src/modules/uavcan/libuavcan \
EXCLUDE = @CMAKE_SOURCE_DIR@/src/modules/uavcan/libdronecan \
@CMAKE_SOURCE_DIR@/src/examples \
@CMAKE_SOURCE_DIR@/src/templates

Expand Down
10 changes: 10 additions & 0 deletions ROMFS/px4fmu_common/init.d/airframes/4601_droneblocks_dexi_5
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,16 @@ param set-default CA_ROTOR3_PX -0.0762
param set-default CA_ROTOR3_PY 0.09525
param set-default CA_ROTOR3_KM -0.05

param set-default PWM_MAIN_TIM0 -3
param set-default DSHOT_TEL_CFG 104

param set-default EKF2_MIN_RNG 0.01
param set-default EKF2_OF_POS_X 0.043
param set-default EKF2_OF_POS_Y 0.011
param set-default EKF2_OF_QMIN_GND 1
param set-default EKF2_RNG_POS_X 0.043
param set-default EKF2_RNG_POS_Y 0.0
param set-default EKF2_RNG_A_HMAX 25.0

param set-default IMU_GYRO_DNF_EN 2

Expand Down Expand Up @@ -78,3 +82,9 @@ param set-default SENS_FLOW_MINHGT 0.0
param set-default SER_TEL2_BAUD 3000000

param set-default UXRCE_DDS_CFG 102

param set-default EKF2_HGT_REF 2

# I saw a very sketchy extreme yaw setpoint that I cant explain
# https://review.px4.io/plot_app?log=4b69399f-b001-4dc2-acd5-e779fe266799
param set-default MC_YAWRATE_MAX 100
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 @@ -11,7 +11,7 @@ exec find boards msg src platforms test \
-path platforms/nuttx/NuttX -prune -o \
-path platforms/qurt/dspal -prune -o \
-path src/drivers/ins/vectornav/libvnc -prune -o \
-path src/drivers/uavcan/libuavcan -prune -o \
-path src/drivers/uavcan/libdronecan -prune -o \
-path src/drivers/uavcan/uavcan_drivers/kinetis/driver/include/uavcan_kinetis -prune -o \
-path src/drivers/cyphal/libcanard -prune -o \
-path src/lib/crypto/monocypher -prune -o \
Expand Down
3 changes: 2 additions & 1 deletion Tools/px_uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,8 @@ def __drawProgressBar(self, label, progress, maxVal):

percent = (float(progress) / float(maxVal)) * 100.0

sys.stdout.write("\r%s: [%-20s] %.1f%%" % (label, '='*int(percent/5.0), percent))
redraw = "\r" if sys.stdout.isatty() else "\n"
sys.stdout.write("%s%s: [%-20s] %.1f%%" % (redraw, label, '='*int(percent/5.0), percent))
sys.stdout.flush()

# send the CHIP_ERASE command and wait for the bootloader to become ready
Expand Down
2 changes: 1 addition & 1 deletion boards/holybro/kakuteh7/default.px4board
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ CONFIG_MODULES_COMMANDER=y
CONFIG_MODULES_CONTROL_ALLOCATOR=y
CONFIG_MODULES_DATAMAN=y
CONFIG_MODULES_EKF2=y
CONFIG_EKF2_EXTERNAL_VISION=y
# CONFIG_EKF2_AUXVEL is not set
# CONFIG_EKF2_BARO_COMPENSATION is not set
# CONFIG_EKF2_DRAG_FUSION is not set
# CONFIG_EKF2_EXTERNAL_VISION is not set
# CONFIG_EKF2_GNSS_YAW is not set
# CONFIG_EKF2_SIDESLIP is not set
CONFIG_MODULES_ESC_BATTERY=y
Expand Down
2 changes: 1 addition & 1 deletion boards/holybro/kakuteh7mini/default.px4board
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ CONFIG_MODULES_COMMANDER=y
CONFIG_MODULES_CONTROL_ALLOCATOR=y
CONFIG_MODULES_DATAMAN=y
CONFIG_MODULES_EKF2=y
CONFIG_EKF2_EXTERNAL_VISION=y
# CONFIG_EKF2_AUXVEL is not set
# CONFIG_EKF2_BARO_COMPENSATION is not set
# CONFIG_EKF2_DRAG_FUSION is not set
# CONFIG_EKF2_EXTERNAL_VISION is not set
# CONFIG_EKF2_GNSS_YAW is not set
# CONFIG_EKF2_SIDESLIP is not set
CONFIG_MODULES_ESC_BATTERY=y
Expand Down
2 changes: 1 addition & 1 deletion boards/holybro/kakuteh7v2/default.px4board
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ CONFIG_MODULES_COMMANDER=y
CONFIG_MODULES_CONTROL_ALLOCATOR=y
CONFIG_MODULES_DATAMAN=y
CONFIG_MODULES_EKF2=y
CONFIG_EKF2_EXTERNAL_VISION=y
# CONFIG_EKF2_AUXVEL is not set
# CONFIG_EKF2_BARO_COMPENSATION is not set
# CONFIG_EKF2_DRAG_FUSION is not set
# CONFIG_EKF2_EXTERNAL_VISION is not set
# CONFIG_EKF2_GNSS_YAW is not set
# CONFIG_EKF2_SIDESLIP is not set
CONFIG_MODULES_ESC_BATTERY=y
Expand Down
2 changes: 1 addition & 1 deletion platforms/nuttx/NuttX/nuttx
Submodule nuttx updated 1 files
+7 −1 fs/littlefs/lfs_vfs.c
8 changes: 5 additions & 3 deletions platforms/nuttx/src/bootloader/common/bl.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
#define STATE_ALLOWS_REBOOT (STATE_ALLOWS_ERASE|STATE_PROTO_PROG_MULTI|STATE_PROTO_GET_CRC)
# define SET_BL_STATE(s) bl_state |= (s)
#endif
#define STATE_ALLOWS_BOOTLOADER (STATE_PROTO_GET_SYNC|STATE_PROTO_GET_DEVICE)

static uint8_t bl_type;
static uint8_t last_input;
Expand Down Expand Up @@ -1107,9 +1108,10 @@ bootloader(unsigned timeout)
continue;
}

// we got a command worth syncing, so kill the timeout because
// we are probably talking to the uploader
timeout = 0;
// We got a sync command as well as a get_device command, we are very likely talking to the uploader.
if ((bl_state & STATE_ALLOWS_BOOTLOADER) == STATE_ALLOWS_BOOTLOADER) {
timeout = 0;
}

// Set the bootloader port based on the port from which we received the first valid command
if (bl_type == NONE) {
Expand Down
62 changes: 31 additions & 31 deletions src/drivers/actuators/vertiq_io/module.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -254,36 +254,36 @@ parameters:
The module IDs [32, 62] that should be asked for telemetry. The data received from these IDs will be published via the esc_status topic.
type: bitmask
bit:
32: Module ID 32
33: Module ID 33
34: Module ID 34
35: Module ID 35
36: Module ID 36
37: Module ID 37
38: Module ID 38
39: Module ID 39
40: Module ID 40
41: Module ID 41
42: Module ID 42
43: Module ID 43
44: Module ID 44
45: Module ID 45
46: Module ID 46
47: Module ID 47
48: Module ID 48
49: Module ID 49
50: Module ID 50
51: Module ID 51
52: Module ID 52
53: Module ID 53
54: Module ID 54
55: Module ID 55
56: Module ID 56
57: Module ID 57
58: Module ID 58
59: Module ID 59
60: Module ID 60
61: Module ID 61
62: Module ID 62
0: Module ID 32
1: Module ID 33
2: Module ID 34
3: Module ID 35
4: Module ID 36
5: Module ID 37
6: Module ID 38
7: Module ID 39
8: Module ID 40
9: Module ID 41
10: Module ID 42
11: Module ID 43
12: Module ID 44
13: Module ID 45
14: Module ID 46
15: Module ID 47
16: Module ID 48
17: Module ID 49
18: Module ID 50
19: Module ID 51
20: Module ID 52
21: Module ID 53
22: Module ID 54
23: Module ID 55
24: Module ID 56
25: Module ID 57
26: Module ID 58
27: Module ID 59
28: Module ID 60
29: Module ID 61
30: Module ID 62
reboot_required: true
default: 0
42 changes: 22 additions & 20 deletions src/drivers/uavcan/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@
#
############################################################################

set(LIBUAVCAN_DIR ${PX4_SOURCE_DIR}/src/drivers/uavcan/libuavcan)
set(LIBUAVCAN_DIR_DRIVERS ${PX4_SOURCE_DIR}/src/drivers/uavcan/uavcan_drivers)
set(LIBDRONECAN_DIR ${PX4_SOURCE_DIR}/src/drivers/uavcan/libdronecan)
set(LIBDRONECAN_DIR_DRIVERS ${PX4_SOURCE_DIR}/src/drivers/uavcan/uavcan_drivers)

px4_add_git_submodule(TARGET git_uavcan PATH ${LIBUAVCAN_DIR})
set(DSDLC_DIR "${PX4_SOURCE_DIR}/src/drivers/uavcan/libdronecan/dsdl")

px4_add_git_submodule(TARGET git_uavcan_dsdl PATH ${DSDLC_DIR})
px4_add_git_submodule(TARGET git_uavcan_pydronecan PATH ${LIBDRONECAN_DIR}/libuavcan/dsdl_compiler/pydronecan)

set(UAVCAN_USE_CPP03 ON CACHE BOOL "uavcan cpp03")
set(UAVCAN_PLATFORM "generic")

if(CONFIG_ARCH_CHIP)
Expand Down Expand Up @@ -90,25 +92,24 @@ add_compile_options(
-Wno-address-of-packed-member
)
set(CMAKE_WARN_DEPRECATED OFF CACHE BOOL "" FORCE) # silence libuavcan deprecation warning for now (TODO: fix and remove)
add_subdirectory(${LIBUAVCAN_DIR} libuavcan EXCLUDE_FROM_ALL)
add_subdirectory(${LIBDRONECAN_DIR} libdronecan EXCLUDE_FROM_ALL)
add_dependencies(uavcan prebuild_targets)

# driver
add_subdirectory(${LIBUAVCAN_DIR_DRIVERS}/${UAVCAN_DRIVER}/driver libuavcan_drivers EXCLUDE_FROM_ALL)
add_subdirectory(${LIBDRONECAN_DIR_DRIVERS}/${UAVCAN_DRIVER}/driver libuavcan_drivers EXCLUDE_FROM_ALL)
target_include_directories(uavcan_${UAVCAN_DRIVER}_driver PUBLIC
${LIBUAVCAN_DIR}/libuavcan/include
${LIBUAVCAN_DIR}/libuavcan/include/dsdlc_generated
${LIBDRONECAN_DIR}/libuavcan/include
${LIBDRONECAN_DIR}/libuavcan/include/dsdlc_generated
)


# generated DSDL
set(DSDLC_DIR "${PX4_SOURCE_DIR}/src/drivers/uavcan/dsdl")
set(DSDLC_INPUTS
"${LIBUAVCAN_DIR}/dsdl/ardupilot"
"${LIBUAVCAN_DIR}/dsdl/com"
"${LIBUAVCAN_DIR}/dsdl/cuav"
"${LIBUAVCAN_DIR}/dsdl/dronecan"
"${LIBUAVCAN_DIR}/dsdl/uavcan"
"${DSDLC_DIR}/ardupilot"
"${DSDLC_DIR}/com"
"${DSDLC_DIR}/cuav"
"${DSDLC_DIR}/dronecan"
"${DSDLC_DIR}/uavcan"
)
set(DSDLC_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/include/dsdlc_generated")

Expand All @@ -119,7 +120,7 @@ foreach(DSDLC_INPUT ${DSDLC_INPUTS})
endforeach(DSDLC_INPUT)
add_custom_command(OUTPUT px4_uavcan_dsdlc_run.stamp
COMMAND
${PYTHON_EXECUTABLE} ${LIBUAVCAN_DIR}/libuavcan/dsdl_compiler/libuavcan_dsdlc
${PYTHON_EXECUTABLE} ${LIBDRONECAN_DIR}/libuavcan/dsdl_compiler/libuavcan_dsdlc
--outdir ${DSDLC_OUTPUT} ${DSDLC_INPUTS}
#--verbose
COMMAND ${CMAKE_COMMAND} -E touch px4_uavcan_dsdlc_run.stamp
Expand All @@ -138,10 +139,10 @@ px4_add_module(
#-DDEBUG_BUILD
INCLUDES
${DSDLC_OUTPUT}
${LIBUAVCAN_DIR}/libuavcan/include
${LIBUAVCAN_DIR}/libuavcan/include/dsdlc_generated
${LIBUAVCAN_DIR}/libuavcan_drivers/posix/include
${LIBUAVCAN_DIR_DRIVERS}/${UAVCAN_DRIVER}/driver/include
${LIBDRONECAN_DIR}/libuavcan/include
${LIBDRONECAN_DIR}/libuavcan/include/dsdlc_generated
${LIBDRONECAN_DIR_DRIVERS}/posix/include
${LIBDRONECAN_DIR_DRIVERS}/${UAVCAN_DRIVER}/driver/include
SRCS
arming_status.cpp
arming_status.hpp
Expand Down Expand Up @@ -191,7 +192,8 @@ px4_add_module(
mixer_module
version

git_uavcan
git_uavcan_dsdl
git_uavcan_pydronecan
uavcan_${UAVCAN_DRIVER}_driver

drivers_rangefinder # Fix undefined reference when no distance sensors are selected
Expand Down
30 changes: 30 additions & 0 deletions src/drivers/uavcan/libdronecan/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Build outputs
*.o
*.d
lib*.so
lib*.so.*
*.a
build*/
.dep
__pycache__
*.pyc

# Eclipse
.metadata
.settings
.project
.cproject
.pydevproject
.gdbinit

# vsstudio code
.vscode

# vagrant
.vagrant

# libuavcan DSDL compiler default output directory
dsdlc_generated

# Log files
*.log
Loading

0 comments on commit c71b670

Please sign in to comment.