mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-17 03:03:33 +08:00
ekf2: add symforce code generation helper target
This commit is contained in:
@@ -33,6 +33,36 @@
|
|||||||
|
|
||||||
add_subdirectory(Utility)
|
add_subdirectory(Utility)
|
||||||
|
|
||||||
|
# Symforce code generation
|
||||||
|
execute_process(
|
||||||
|
COMMAND ${PYTHON_EXECUTABLE} -m symforce.symbolic
|
||||||
|
RESULT_VARIABLE PYTHON_SYMFORCE_EXIT_CODE
|
||||||
|
OUTPUT_QUIET
|
||||||
|
)
|
||||||
|
if(${PYTHON_SYMFORCE_EXIT_CODE} EQUAL 0)
|
||||||
|
|
||||||
|
set(EKF_DERIVATION_DIR ${CMAKE_CURRENT_SOURCE_DIR}/EKF/python/ekf_derivation)
|
||||||
|
|
||||||
|
set(EKF_GENERATED_SRC_FILES
|
||||||
|
${EKF_DERIVATION_DIR}/generated/compute_airspeed_h_and_k.h
|
||||||
|
${EKF_DERIVATION_DIR}/generated/compute_airspeed_innov_and_innov_var.h
|
||||||
|
)
|
||||||
|
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT ${EKF_GENERATED_SRC_FILES}
|
||||||
|
COMMAND ${PYTHON_EXECUTABLE} derivation.py
|
||||||
|
DEPENDS
|
||||||
|
${EKF_DERIVATION_DIR}/derivation.py
|
||||||
|
${EKF_DERIVATION_DIR}/derivation_utils.py
|
||||||
|
|
||||||
|
WORKING_DIRECTORY ${EKF_DERIVATION_DIR}
|
||||||
|
COMMENT "Symforce code generation"
|
||||||
|
USES_TERMINAL
|
||||||
|
)
|
||||||
|
|
||||||
|
add_custom_target(ekf2_symforce_generate DEPENDS ${EKF_GENERATED_SRC_FILES})
|
||||||
|
endif()
|
||||||
|
|
||||||
px4_add_module(
|
px4_add_module(
|
||||||
MODULE modules__ekf2
|
MODULE modules__ekf2
|
||||||
MAIN ekf2
|
MAIN ekf2
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
*.bak
|
||||||
Reference in New Issue
Block a user