mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-31 18:47:21 +08:00
uorb autogeneration
This commit is contained in:
committed by
Lorenz Meier
parent
3aa2297497
commit
76387b1693
@@ -359,13 +359,15 @@ function(px4_generate_messages)
|
||||
NAME px4_generate_messages
|
||||
OPTIONS VERBOSE
|
||||
ONE_VALUE OS TARGET
|
||||
MULTI_VALUE MSG_FILES DEPENDS
|
||||
MULTI_VALUE MSG_FILES DEPENDS INCLUDES
|
||||
REQUIRED MSG_FILES OS TARGET
|
||||
ARGN ${ARGN})
|
||||
set(QUIET)
|
||||
if(NOT VERBOSE)
|
||||
set(QUIET "-q")
|
||||
endif()
|
||||
|
||||
# headers
|
||||
set(msg_out_path ${CMAKE_BINARY_DIR}/src/modules/uORB/topics)
|
||||
set(msg_list)
|
||||
foreach(msg_file ${MSG_FILES})
|
||||
@@ -390,6 +392,26 @@ function(px4_generate_messages)
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
# !sources
|
||||
set(msg_source_out_path ${CMAKE_BINARY_DIR}/topics_sources)
|
||||
set(msg_source_files_out ${msg_source_out_path}/uORBTopics.cpp)
|
||||
foreach(msg ${msg_list})
|
||||
list(APPEND msg_source_files_out ${msg_source_out_path}/${msg}.cpp)
|
||||
endforeach()
|
||||
add_custom_command(OUTPUT ${msg_source_files_out}
|
||||
COMMAND ${PYTHON_EXECUTABLE}
|
||||
Tools/px_generate_uorb_topic_sources.py
|
||||
${QUIET}
|
||||
-d msg
|
||||
-e msg/templates/uorb
|
||||
-o ${msg_source_out_path}
|
||||
DEPENDS ${DEPENDS} ${MSG_FILES}
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
COMMENT "Generating uORB topic sources"
|
||||
VERBATIM
|
||||
)
|
||||
set_source_files_properties(${msg_source_files_out} PROPERTIES GENERATED TRUE)
|
||||
|
||||
# multi messages for target OS
|
||||
set(msg_multi_out_path
|
||||
${CMAKE_BINARY_DIR}/src/platforms/${OS}/px4_messages)
|
||||
@@ -411,8 +433,13 @@ function(px4_generate_messages)
|
||||
COMMENT "Generating uORB topic multi headers for ${OS}"
|
||||
VERBATIM
|
||||
)
|
||||
add_custom_target(${TARGET}
|
||||
DEPENDS ${msg_multi_files_out} ${msg_files_out})
|
||||
|
||||
add_library(${TARGET}
|
||||
${msg_source_files_out}
|
||||
${msg_multi_files_out}
|
||||
${msg_files_out}
|
||||
)
|
||||
|
||||
endfunction()
|
||||
|
||||
#=============================================================================
|
||||
|
||||
@@ -0,0 +1,189 @@
|
||||
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "build type")
|
||||
|
||||
|
||||
include(nuttx/px4_impl_nuttx)
|
||||
|
||||
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)
|
||||
|
||||
set(config_module_list
|
||||
#
|
||||
# Board support modules
|
||||
#
|
||||
drivers/device
|
||||
drivers/stm32
|
||||
drivers/stm32/adc
|
||||
drivers/stm32/tone_alarm
|
||||
drivers/led
|
||||
drivers/px4fmu
|
||||
drivers/px4io
|
||||
drivers/boards/px4fmu-v2
|
||||
drivers/rgbled
|
||||
drivers/mpu6000
|
||||
#drivers/mpu9250
|
||||
drivers/lsm303d
|
||||
drivers/l3gd20
|
||||
#drivers/hmc5883
|
||||
drivers/ms5611
|
||||
#drivers/mb12xx
|
||||
#drivers/srf02
|
||||
#drivers/sf0x
|
||||
#drivers/ll40ls
|
||||
drivers/trone
|
||||
drivers/gps
|
||||
drivers/pwm_out_sim
|
||||
#drivers/hott
|
||||
#drivers/hott/hott_telemetry
|
||||
#drivers/hott/hott_sensors
|
||||
#drivers/blinkm
|
||||
drivers/airspeed
|
||||
drivers/ets_airspeed
|
||||
drivers/meas_airspeed
|
||||
#drivers/frsky_telemetry
|
||||
modules/sensors
|
||||
#drivers/mkblctrl
|
||||
#drivers/px4flow
|
||||
#drivers/oreoled
|
||||
drivers/gimbal
|
||||
drivers/pwm_input
|
||||
drivers/camera_trigger
|
||||
drivers/bst
|
||||
#drivers/snapdragon_rc_pwm
|
||||
#drivers/lis3mdl
|
||||
|
||||
#
|
||||
# System commands
|
||||
#
|
||||
systemcmds/bl_update
|
||||
systemcmds/mixer
|
||||
systemcmds/param
|
||||
systemcmds/perf
|
||||
systemcmds/pwm
|
||||
systemcmds/esc_calib
|
||||
systemcmds/reboot
|
||||
#systemcmds/topic_listener
|
||||
systemcmds/top
|
||||
systemcmds/config
|
||||
systemcmds/nshterm
|
||||
systemcmds/mtd
|
||||
systemcmds/dumpfile
|
||||
systemcmds/ver
|
||||
|
||||
#
|
||||
# General system control
|
||||
#
|
||||
modules/commander
|
||||
modules/navigator
|
||||
modules/mavlink
|
||||
modules/gpio_led
|
||||
#modules/uavcan
|
||||
modules/land_detector
|
||||
|
||||
#
|
||||
# Estimation modules (EKF/ SO3 / other filters)
|
||||
#
|
||||
# Too high RAM usage due to static allocations
|
||||
# modules/attitude_estimator_ekf
|
||||
modules/attitude_estimator_q
|
||||
modules/ekf_att_pos_estimator
|
||||
modules/position_estimator_inav
|
||||
|
||||
#
|
||||
# Vehicle Control
|
||||
#
|
||||
# modules/segway # XXX Needs GCC 4.7 fix
|
||||
modules/fw_pos_control_l1
|
||||
modules/fw_att_control
|
||||
modules/mc_att_control
|
||||
modules/mc_pos_control
|
||||
modules/vtol_att_control
|
||||
|
||||
#
|
||||
# Logging
|
||||
#
|
||||
modules/sdlog2
|
||||
|
||||
#
|
||||
# Library modules
|
||||
#
|
||||
modules/param
|
||||
modules/systemlib
|
||||
modules/systemlib/mixer
|
||||
modules/uORB
|
||||
modules/dataman
|
||||
|
||||
#
|
||||
# Libraries
|
||||
#
|
||||
lib/controllib
|
||||
lib/mathlib
|
||||
lib/mathlib/math/filter
|
||||
lib/ecl
|
||||
lib/external_lgpl
|
||||
lib/geo
|
||||
lib/geo_lookup
|
||||
lib/conversion
|
||||
lib/launchdetection
|
||||
lib/terrain_estimation
|
||||
lib/runway_takeoff
|
||||
lib/tailsitter_recovery
|
||||
platforms/nuttx
|
||||
|
||||
# had to add for cmake, not sure why wasn't in original config
|
||||
platforms/common
|
||||
platforms/nuttx/px4_layer
|
||||
|
||||
#
|
||||
# OBC challenge
|
||||
#
|
||||
#modules/bottle_drop
|
||||
|
||||
#
|
||||
# Rover apps
|
||||
#
|
||||
#examples/rover_steering_control
|
||||
|
||||
#
|
||||
# Demo apps
|
||||
#
|
||||
#examples/math_demo
|
||||
# Tutorial code from
|
||||
# https://px4.io/dev/px4_simple_app
|
||||
#examples/px4_simple_app
|
||||
|
||||
# Tutorial code from
|
||||
# https://px4.io/dev/daemon
|
||||
#examples/px4_daemon_app
|
||||
|
||||
# Tutorial code from
|
||||
# https://px4.io/dev/debug_values
|
||||
#examples/px4_mavlink_debug
|
||||
|
||||
# Tutorial code from
|
||||
# https://px4.io/dev/example_fixedwing_control
|
||||
#examples/fixedwing_control
|
||||
|
||||
# Hardware test
|
||||
#examples/hwtest
|
||||
)
|
||||
|
||||
set(config_extra_builtin_cmds
|
||||
serdis
|
||||
sercon
|
||||
)
|
||||
|
||||
set(config_io_board
|
||||
px4io-v2
|
||||
)
|
||||
|
||||
set(config_io_extra_libs
|
||||
)
|
||||
|
||||
add_custom_target(sercon)
|
||||
set_target_properties(sercon PROPERTIES
|
||||
PRIORITY "SCHED_PRIORITY_DEFAULT"
|
||||
MAIN "sercon" STACK_MAIN "2048")
|
||||
|
||||
add_custom_target(serdis)
|
||||
set_target_properties(serdis PROPERTIES
|
||||
PRIORITY "SCHED_PRIORITY_DEFAULT"
|
||||
MAIN "serdis" STACK_MAIN "2048")
|
||||
Reference in New Issue
Block a user