mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
ekf2: add symforce code generation helper target
This commit is contained in:
parent
c9441bb48a
commit
41cda14126
@ -33,6 +33,36 @@
|
||||
|
||||
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(
|
||||
MODULE modules__ekf2
|
||||
MAIN ekf2
|
||||
|
||||
1
src/modules/ekf2/EKF/python/ekf_derivation/generated/.gitignore
vendored
Normal file
1
src/modules/ekf2/EKF/python/ekf_derivation/generated/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
*.bak
|
||||
Loading…
x
Reference in New Issue
Block a user