mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-01 10:11:36 +08:00
uavcan: add optical flow support (Here Flow)
* move uavcan dsdlc generation to module * 20200.Measurement.uavcan sync with upstream project (https://github.com/OpenMotorDrive/flow/blob/master/dsdl/com/hex/equipment/flow/20200.Measurement.uavcan) Signed-off-by: DanielePettenuzzo <daniele@px4.io>
This commit is contained in:
committed by
Daniel Agar
parent
dab66e92d3
commit
be3d09c700
@@ -71,12 +71,31 @@ add_compile_options(-Wno-cast-align) # TODO: fix and enable
|
||||
add_subdirectory(libuavcan EXCLUDE_FROM_ALL)
|
||||
add_dependencies(uavcan prebuild_targets)
|
||||
|
||||
|
||||
# generated DSDL
|
||||
set(DSDLC_INPUTS "${CMAKE_CURRENT_SOURCE_DIR}/dsdl/com" "${CMAKE_CURRENT_SOURCE_DIR}/libuavcan/dsdl/uavcan")
|
||||
set(DSDLC_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/include/dsdlc_generated")
|
||||
|
||||
set(DSDLC_INPUT_FILES)
|
||||
foreach(DSDLC_INPUT ${DSDLC_INPUTS})
|
||||
file(GLOB_RECURSE DSDLC_NEW_INPUT_FILES ${CMAKE_CURRENT_SOURCE_DIR} "${DSDLC_INPUT}/*.uavcan")
|
||||
list(APPEND DSDLC_INPUT_FILES ${DSDLC_NEW_INPUT_FILES})
|
||||
endforeach(DSDLC_INPUT)
|
||||
add_custom_command(OUTPUT px4_uavcan_dsdlc_run.stamp
|
||||
COMMAND ${PYTHON} ${CMAKE_CURRENT_SOURCE_DIR}/libuavcan/libuavcan/dsdl_compiler/libuavcan_dsdlc ${DSDLC_INPUTS} -O${DSDLC_OUTPUT}
|
||||
COMMAND ${CMAKE_COMMAND} -E touch px4_uavcan_dsdlc_run.stamp
|
||||
DEPENDS ${DSDLC_INPUT_FILES}
|
||||
COMMENT "PX4 UAVCAN dsdl compiler"
|
||||
)
|
||||
add_custom_target(px4_uavcan_dsdlc DEPENDS px4_uavcan_dsdlc_run.stamp)
|
||||
|
||||
px4_add_module(
|
||||
MODULE modules__uavcan
|
||||
MAIN uavcan
|
||||
STACK_MAIN 3200
|
||||
STACK_MAX 1500
|
||||
INCLUDES
|
||||
${DSDLC_OUTPUT}
|
||||
${PX4_SOURCE_DIR}/mavlink/include/mavlink
|
||||
libuavcan/libuavcan/include
|
||||
libuavcan/libuavcan/include/dsdlc_generated
|
||||
@@ -97,15 +116,17 @@ px4_add_module(
|
||||
sensors/gnss.cpp
|
||||
sensors/mag.cpp
|
||||
sensors/baro.cpp
|
||||
sensors/flow.cpp
|
||||
|
||||
DEPENDS
|
||||
px4_uavcan_dsdlc
|
||||
|
||||
mixer
|
||||
version
|
||||
|
||||
git_uavcan
|
||||
|
||||
# within libuavcan
|
||||
libuavcan_dsdlc
|
||||
uavcan
|
||||
uavcan_${UAVCAN_PLATFORM}_driver
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user