mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-12 14:41:36 +08:00
PX4 ROS2 msg conformity and explicit topics
- .msg files are PascalCase - topics are still either per msg or explicitly listed in TOPICS - compatible structs are still generated (eg struct msg_s), but ROS2 style px4::msg::Msg is also available
This commit is contained in:
+4
-1
@@ -57,4 +57,7 @@ else()
|
||||
endif()
|
||||
|
||||
include(CPack)
|
||||
include(bloaty)
|
||||
|
||||
if(${PX4_PLATFORM} MATCHES "nuttx")
|
||||
include(bloaty)
|
||||
endif()
|
||||
|
||||
@@ -71,11 +71,11 @@ function(px4_add_common_flags)
|
||||
-Werror
|
||||
|
||||
-Warray-bounds
|
||||
-Wcast-align
|
||||
#-Wcast-align # TODO
|
||||
-Wdisabled-optimization
|
||||
-Wdouble-promotion
|
||||
-Wfatal-errors
|
||||
-Wfloat-equal
|
||||
#-Wfloat-equal
|
||||
-Wformat-security
|
||||
-Winit-self
|
||||
-Wlogical-op
|
||||
@@ -156,9 +156,6 @@ function(px4_add_common_flags)
|
||||
# CXX only flags
|
||||
set(cxx_flags)
|
||||
list(APPEND cxx_flags
|
||||
-fno-exceptions
|
||||
-fno-threadsafe-statics
|
||||
|
||||
-Wreorder
|
||||
|
||||
# disabled warnings
|
||||
@@ -175,16 +172,19 @@ function(px4_add_common_flags)
|
||||
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:${flag}>)
|
||||
endforeach()
|
||||
|
||||
if(NOT (${PX4_PLATFORM} MATCHES "ros2")) # TODO: fix
|
||||
include_directories(
|
||||
${PX4_SOURCE_DIR}/platforms/${PX4_PLATFORM}/src/px4/${PX4_CHIP_MANUFACTURER}/${PX4_CHIP}/include
|
||||
${PX4_SOURCE_DIR}/platforms/${PX4_PLATFORM}/src/px4/common/include
|
||||
${PX4_SOURCE_DIR}/platforms/common
|
||||
${PX4_SOURCE_DIR}/platforms/common/include
|
||||
)
|
||||
endif()
|
||||
|
||||
include_directories(
|
||||
${PX4_BINARY_DIR}
|
||||
${PX4_BINARY_DIR}/src/lib
|
||||
|
||||
${PX4_SOURCE_DIR}/platforms/${PX4_PLATFORM}/src/px4/${PX4_CHIP_MANUFACTURER}/${PX4_CHIP}/include
|
||||
${PX4_SOURCE_DIR}/platforms/${PX4_PLATFORM}/src/px4/common/include
|
||||
${PX4_SOURCE_DIR}/platforms/common
|
||||
${PX4_SOURCE_DIR}/platforms/common/include
|
||||
|
||||
${PX4_SOURCE_DIR}/src
|
||||
${PX4_SOURCE_DIR}/src/include
|
||||
${PX4_SOURCE_DIR}/src/lib
|
||||
|
||||
@@ -39,7 +39,10 @@ include(px4_list_make_absolute)
|
||||
# Like add_library but with PX4 platform dependencies
|
||||
#
|
||||
function(px4_add_library target)
|
||||
add_library(${target} EXCLUDE_FROM_ALL ${ARGN})
|
||||
add_library(${target} STATIC
|
||||
EXCLUDE_FROM_ALL
|
||||
${ARGN}
|
||||
)
|
||||
|
||||
target_compile_definitions(${target} PRIVATE MODULE_NAME="${target}")
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ include(px4_list_make_absolute)
|
||||
# [ DEPENDS <string> ]
|
||||
# [ SRCS <list> ]
|
||||
# [ MODULE_CONFIG <list> ]
|
||||
# [ PUBLICATIONS <list> ]
|
||||
# [ EXTERNAL ]
|
||||
# [ DYNAMIC ]
|
||||
# )
|
||||
@@ -64,6 +65,8 @@ include(px4_list_make_absolute)
|
||||
# MODULE_CONFIG : yaml config file(s)
|
||||
# INCLUDES : include directories
|
||||
# DEPENDS : targets which this module depends on
|
||||
# PUBLICATIONS : List of publications from this module
|
||||
# SUBSCRIPTIONS : List of subsriptions used by this module
|
||||
# EXTERNAL : flag to indicate that this module is out-of-tree
|
||||
# DYNAMIC : don't compile into the px4 binary, but build a separate dynamically loadable module (posix)
|
||||
# UNITY_BUILD : merge all source files and build this module as a single compilation unit
|
||||
@@ -86,7 +89,7 @@ function(px4_add_module)
|
||||
px4_parse_function_args(
|
||||
NAME px4_add_module
|
||||
ONE_VALUE MODULE MAIN STACK_MAIN STACK_MAX PRIORITY
|
||||
MULTI_VALUE COMPILE_FLAGS LINK_FLAGS SRCS INCLUDES DEPENDS MODULE_CONFIG
|
||||
MULTI_VALUE COMPILE_FLAGS LINK_FLAGS SRCS INCLUDES DEPENDS MODULE_CONFIG PUBLICATIONS SUBSCRIPTIONS
|
||||
OPTIONS EXTERNAL DYNAMIC UNITY_BUILD
|
||||
REQUIRED MODULE MAIN
|
||||
ARGN ${ARGN})
|
||||
@@ -185,7 +188,7 @@ function(px4_add_module)
|
||||
|
||||
# set defaults if not set
|
||||
set(MAIN_DEFAULT MAIN-NOTFOUND)
|
||||
set(STACK_MAIN_DEFAULT 2048)
|
||||
set(STACK_MAIN_DEFAULT 4096)
|
||||
set(PRIORITY_DEFAULT SCHED_PRIORITY_DEFAULT)
|
||||
|
||||
foreach(property MAIN STACK_MAIN PRIORITY)
|
||||
@@ -238,7 +241,21 @@ function(px4_add_module)
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
foreach (prop LINK_FLAGS STACK_MAIN MAIN PRIORITY)
|
||||
if(PUBLICATIONS)
|
||||
foreach(publication ${PUBLICATIONS})
|
||||
#message(STATUS "${MODULE} PUBLICATION: ${publication}")
|
||||
set_property(GLOBAL APPEND PROPERTY PX4_PUBLICATIONS ${publication})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(SUBSCRIPTIONS)
|
||||
foreach(subscription ${SUBSCRIPTIONS})
|
||||
#message(STATUS "${MODULE} SUBSCRIPTION: ${subscription}")
|
||||
set_property(GLOBAL APPEND PROPERTY PX4_SUBSCRIPTIONS ${subscription})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
foreach(prop LINK_FLAGS STACK_MAIN MAIN PRIORITY)
|
||||
if (${prop})
|
||||
set_target_properties(${MODULE} PROPERTIES ${prop} ${${prop}})
|
||||
endif()
|
||||
|
||||
@@ -63,9 +63,9 @@ if(NOT PX4_CONFIG_FILE)
|
||||
)
|
||||
set(PX4_CONFIG_FILE "${PX4_SOURCE_DIR}/boards/${filename}" CACHE FILEPATH "path to PX4 CONFIG file" FORCE)
|
||||
set(PX4_BOARD_DIR "${PX4_SOURCE_DIR}/boards/${vendor}/${model}" CACHE STRING "PX4 board directory" FORCE)
|
||||
set(MODEL "${model}" CACHE STRING "PX4 board model" FORCE)
|
||||
set(VENDOR "${vendor}" CACHE STRING "PX4 board vendor" FORCE)
|
||||
set(LABEL "${label}" CACHE STRING "PX4 board vendor" FORCE)
|
||||
set(MODEL "${model}" CACHE STRING "PX4 board model" FORCE)
|
||||
set(VENDOR "${vendor}" CACHE STRING "PX4 board vendor" FORCE)
|
||||
set(LABEL "${label}" CACHE STRING "PX4 board vendor" FORCE)
|
||||
break()
|
||||
endif()
|
||||
|
||||
@@ -76,9 +76,9 @@ if(NOT PX4_CONFIG_FILE)
|
||||
)
|
||||
set(PX4_CONFIG_FILE "${PX4_SOURCE_DIR}/boards/${filename}" CACHE FILEPATH "path to PX4 CONFIG file" FORCE)
|
||||
set(PX4_BOARD_DIR "${PX4_SOURCE_DIR}/boards/${vendor}/${model}" CACHE STRING "PX4 board directory" FORCE)
|
||||
set(MODEL "${model}" CACHE STRING "PX4 board model" FORCE)
|
||||
set(VENDOR "${vendor}" CACHE STRING "PX4 board vendor" FORCE)
|
||||
set(LABEL "${label}" CACHE STRING "PX4 board vendor" FORCE)
|
||||
set(MODEL "${model}" CACHE STRING "PX4 board model" FORCE)
|
||||
set(VENDOR "${vendor}" CACHE STRING "PX4 board vendor" FORCE)
|
||||
set(LABEL "${label}" CACHE STRING "PX4 board vendor" FORCE)
|
||||
break()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user