mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-17 08:27:34 +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:
@@ -28,7 +28,7 @@ pipeline {
|
||||
]
|
||||
|
||||
def base_builds = [
|
||||
target: ["px4_sitl_rtps"],
|
||||
target: ["px4_sitl_default"],
|
||||
image: docker_images.base,
|
||||
archive: false
|
||||
]
|
||||
@@ -63,23 +63,17 @@ pipeline {
|
||||
"matek_gnss-m9n-f4_canbootloader",
|
||||
"matek_gnss-m9n-f4_default",
|
||||
"modalai_fc-v1_default",
|
||||
"modalai_fc-v1_rtps",
|
||||
"modalai_fc-v2_default",
|
||||
"mro_ctrl-zero-f7_default",
|
||||
"mro_ctrl-zero-f7-oem_default",
|
||||
"mro_ctrl-zero-h7_default",
|
||||
"mro_ctrl-zero-h7_rtps",
|
||||
"mro_ctrl-zero-h7-oem_default",
|
||||
"mro_ctrl-zero-h7-oem_rtps",
|
||||
"mro_pixracerpro_default",
|
||||
"mro_pixracerpro_rtps",
|
||||
"mro_x21-777_default",
|
||||
"mro_x21_default",
|
||||
"nxp_fmuk66-e_default",
|
||||
"nxp_fmuk66-e_rtps",
|
||||
"nxp_fmuk66-e_socketcan",
|
||||
"nxp_fmuk66-v3_default",
|
||||
"nxp_fmuk66-v3_rtps",
|
||||
"nxp_fmuk66-v3_socketcan",
|
||||
"nxp_fmurt1062-v1_default",
|
||||
"nxp_ucans32k146_canbootloader",
|
||||
@@ -95,7 +89,6 @@ pipeline {
|
||||
"px4_fmu-v4pro_default",
|
||||
"px4_fmu-v5_debug",
|
||||
"px4_fmu-v5_default",
|
||||
"px4_fmu-v5_rtps",
|
||||
"px4_fmu-v5_stackcheck",
|
||||
"px4_fmu-v5_uavcanv0periph",
|
||||
"px4_fmu-v5_uavcanv1",
|
||||
|
||||
@@ -23,7 +23,6 @@ jobs:
|
||||
"shellcheck_all",
|
||||
"NO_NINJA_BUILD=1 px4_fmu-v5_default",
|
||||
"NO_NINJA_BUILD=1 px4_sitl_default",
|
||||
"BUILD_MICRORTPS_AGENT=1 px4_sitl_rtps",
|
||||
"airframe_metadata",
|
||||
"module_documentation",
|
||||
"parameters_metadata",
|
||||
|
||||
@@ -115,43 +115,3 @@ jobs:
|
||||
cd Tools/uorb_graph
|
||||
ls -ls *
|
||||
# TODO: deploy graph_px4_sitl.json to S3 px4-travis:Firmware/master/
|
||||
|
||||
micrortps_agent:
|
||||
runs-on: ubuntu-latest
|
||||
container: px4io/px4-dev-base-focal:2021-09-08
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
with:
|
||||
token: ${{ secrets.ACCESS_TOKEN }}
|
||||
|
||||
- name: microRTPS agent
|
||||
run: |
|
||||
make px4_sitl_rtps
|
||||
git clone https://github.com/PX4/micrortps_agent.git
|
||||
cp -R build/px4_sitl_rtps/src/modules/micrortps_bridge/micrortps_agent/* micrortps_agent
|
||||
|
||||
ROS_msgs:
|
||||
runs-on: ubuntu-latest
|
||||
container: px4io/px4-dev-base-focal:2021-09-08
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
with:
|
||||
token: ${{ secrets.ACCESS_TOKEN }}
|
||||
|
||||
- name: PX4 ROS msgs
|
||||
run: |
|
||||
git clone https://github.com/PX4/px4_msgs.git
|
||||
python3 msg/tools/uorb_to_ros_msgs.py msg/ px4_msgs/msg/
|
||||
|
||||
ROS2_bridge:
|
||||
runs-on: ubuntu-latest
|
||||
container: px4io/px4-dev-base-focal:2021-09-08
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
with:
|
||||
token: ${{ secrets.ACCESS_TOKEN }}
|
||||
|
||||
- name: PX4 ROS2 bridge
|
||||
run: |
|
||||
git clone https://github.com/PX4/px4_ros_com.git
|
||||
./msg/tools/uorb_to_ros_urtps_topics.py -i msg/tools/urtps_bridge_topics.yaml -o px4_ros_com/templates/urtps_bridge_topics.yaml
|
||||
|
||||
@@ -18,10 +18,6 @@
|
||||
path = src/drivers/gps/devices
|
||||
url = https://github.com/PX4/PX4-GPSDrivers.git
|
||||
branch = master
|
||||
[submodule "src/modules/micrortps_bridge/micro-CDR"]
|
||||
path = src/modules/micrortps_bridge/micro-CDR
|
||||
url = https://github.com/PX4/Micro-CDR.git
|
||||
branch = master
|
||||
[submodule "platforms/nuttx/NuttX/nuttx"]
|
||||
path = platforms/nuttx/NuttX/nuttx
|
||||
url = https://github.com/PX4/NuttX.git
|
||||
|
||||
Vendored
+5
-5
@@ -6,11 +6,6 @@ CONFIG:
|
||||
buildType: RelWithDebInfo
|
||||
settings:
|
||||
CONFIG: px4_sitl_default
|
||||
px4_sitl_rtps:
|
||||
short: px4_sitl_rtps
|
||||
buildType: RelWithDebInfo
|
||||
settings:
|
||||
CONFIG: px4_sitl_rtps
|
||||
px4_sitl_asan:
|
||||
short: px4_sitl (AddressSanitizer)
|
||||
buildType: AddressSanitizer
|
||||
@@ -31,6 +26,11 @@ CONFIG:
|
||||
buildType: RelWithDebInfo
|
||||
settings:
|
||||
CONFIG: px4_sitl_test
|
||||
px4_ros2_default:
|
||||
short: px4_ros2
|
||||
buildType: RelWithDebInfo
|
||||
settings:
|
||||
CONFIG: px4_ros2_default
|
||||
px4_io-v2_default:
|
||||
short: px4_io-v2
|
||||
buildType: MinSizeRel
|
||||
|
||||
Vendored
+5
-2
@@ -6,7 +6,7 @@
|
||||
"C_Cpp.autoAddFileAssociations": false,
|
||||
"C_Cpp.clang_format_fallbackStyle": "none",
|
||||
"C_Cpp.default.browse.limitSymbolsToIncludedHeaders": true,
|
||||
"C_Cpp.default.cppStandard": "c++14",
|
||||
"C_Cpp.default.cppStandard": "c++17",
|
||||
"C_Cpp.default.cStandard": "c11",
|
||||
"C_Cpp.formatting": "Disabled",
|
||||
"C_Cpp.intelliSenseEngine": "Default",
|
||||
@@ -121,6 +121,7 @@
|
||||
"variant": "cpp",
|
||||
"vector": "cpp"
|
||||
},
|
||||
"ros.distro": "foxy",
|
||||
"search.exclude": {
|
||||
"${workspaceFolder}/build": true
|
||||
},
|
||||
@@ -136,5 +137,7 @@
|
||||
"yaml.schemas": {
|
||||
"${workspaceFolder}/validation/module_schema.yaml": "${workspaceFolder}/src/modules/*/module.yaml"
|
||||
},
|
||||
"cortex-debug.openocdPath": "${env:PICO_SDK_PATH}/../openocd/src/openocd" // Added for rp2040
|
||||
"python.autoComplete.extraPaths": [
|
||||
"/opt/ros/foxy/lib/python3.8/site-packages"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,172 +0,0 @@
|
||||
# This file is NOT licensed under the GPLv3, which is the license for the rest
|
||||
# of YouCompleteMe.
|
||||
#
|
||||
# Here's the license text for this file:
|
||||
#
|
||||
# This is free and unencumbered software released into the public domain.
|
||||
#
|
||||
# Anyone is free to copy, modify, publish, use, compile, sell, or
|
||||
# distribute this software, either in source code form or as a compiled
|
||||
# binary, for any purpose, commercial or non-commercial, and by any
|
||||
# means.
|
||||
#
|
||||
# In jurisdictions that recognize copyright laws, the author or authors
|
||||
# of this software dedicate any and all copyright interest in the
|
||||
# software to the public domain. We make this dedication for the benefit
|
||||
# of the public at large and to the detriment of our heirs and
|
||||
# successors. We intend this dedication to be an overt act of
|
||||
# relinquishment in perpetuity of all present and future rights to this
|
||||
# software under copyright law.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
# OTHER DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
# For more information, please refer to <http://unlicense.org/>
|
||||
|
||||
import os
|
||||
import ycm_core
|
||||
|
||||
# These are the compilation flags that will be used in case there's no
|
||||
# compilation database set (by default, one is not set).
|
||||
# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.
|
||||
flags = [
|
||||
'-Wall',
|
||||
'-Wextra',
|
||||
'-Werror',
|
||||
#'-Wc++98-compat',
|
||||
'-Wno-long-long',
|
||||
'-Wno-variadic-macros',
|
||||
'-fexceptions',
|
||||
'-DNDEBUG',
|
||||
# You 100% do NOT need -DUSE_CLANG_COMPLETER in your flags; only the YCM
|
||||
# source code needs it.
|
||||
#'-DUSE_CLANG_COMPLETER',
|
||||
# THIS IS IMPORTANT! Without a "-std=<something>" flag, clang won't know which
|
||||
# language to use when compiling headers. So it will guess. Badly. So C++
|
||||
# headers will be compiled as C headers. You don't want that so ALWAYS specify
|
||||
# a "-std=<something>".
|
||||
# For a C project, you would set this to something like 'c99' instead of
|
||||
# 'c++14'.
|
||||
'-std=c++14',
|
||||
# ...and the same thing goes for the magic -x option which specifies the
|
||||
# language that the files to be compiled are written in. This is mostly
|
||||
# relevant for c++ headers.
|
||||
# For a C project, you would set this to 'c' instead of 'c++'.
|
||||
'-x',
|
||||
'c++',
|
||||
'-undef', # get rid of standard definitions to allow us to include arm math header
|
||||
'-I', os.path.join(os.path.expanduser("~"),'gcc-arm-none-eabi-4_7-2013q3/arm-none-eabi/include'),
|
||||
'-I', 'Build/px4_io-v2_default.build/nuttx-export/include/',
|
||||
'-I', './NuttX/nuttx/arch/arm/include',
|
||||
'-include', './src/include/visibility.h',
|
||||
'-I', './src',
|
||||
'-I', './src/modules',
|
||||
'-I', './src/include',
|
||||
'-I', './src/lib',
|
||||
'-I', './NuttX',
|
||||
]
|
||||
|
||||
|
||||
# Set this to the absolute path to the folder (NOT the file!) containing the
|
||||
# compile_commands.json file to use that instead of 'flags'. See here for
|
||||
# more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html
|
||||
#
|
||||
# Most projects will NOT need to set this to anything; you can just change the
|
||||
# 'flags' list of compilation flags. Notice that YCM itself uses that approach.
|
||||
compilation_database_folder = ''
|
||||
|
||||
if os.path.exists( compilation_database_folder ):
|
||||
database = ycm_core.CompilationDatabase( compilation_database_folder )
|
||||
else:
|
||||
database = None
|
||||
|
||||
SOURCE_EXTENSIONS = [ '.cpp', '.cxx', '.cc', '.c', '.m', '.mm' ]
|
||||
|
||||
def DirectoryOfThisScript():
|
||||
return os.path.dirname( os.path.abspath( __file__ ) )
|
||||
|
||||
|
||||
def MakeRelativePathsInFlagsAbsolute( flags, working_directory ):
|
||||
if not working_directory:
|
||||
return list( flags )
|
||||
new_flags = []
|
||||
make_next_absolute = False
|
||||
path_flags = [ '-isystem', '-I', '-iquote', '--sysroot=' ]
|
||||
for flag in flags:
|
||||
new_flag = flag
|
||||
|
||||
if make_next_absolute:
|
||||
make_next_absolute = False
|
||||
if not flag.startswith( '/' ):
|
||||
new_flag = os.path.join( working_directory, flag )
|
||||
|
||||
for path_flag in path_flags:
|
||||
if flag == path_flag:
|
||||
make_next_absolute = True
|
||||
break
|
||||
|
||||
if flag.startswith( path_flag ):
|
||||
path = flag[ len( path_flag ): ]
|
||||
new_flag = path_flag + os.path.join( working_directory, path )
|
||||
break
|
||||
|
||||
if new_flag:
|
||||
new_flags.append( new_flag )
|
||||
return new_flags
|
||||
|
||||
|
||||
def IsHeaderFile( filename ):
|
||||
extension = os.path.splitext( filename )[ 1 ]
|
||||
return extension in [ '.h', '.hxx', '.hpp', '.hh' ]
|
||||
|
||||
|
||||
def GetCompilationInfoForFile( filename ):
|
||||
# The compilation_commands.json file generated by CMake does not have entries
|
||||
# for header files. So we do our best by asking the db for flags for a
|
||||
# corresponding source file, if any. If one exists, the flags for that file
|
||||
# should be good enough.
|
||||
if IsHeaderFile( filename ):
|
||||
basename = os.path.splitext( filename )[ 0 ]
|
||||
for extension in SOURCE_EXTENSIONS:
|
||||
replacement_file = basename + extension
|
||||
if os.path.exists( replacement_file ):
|
||||
compilation_info = database.GetCompilationInfoForFile(
|
||||
replacement_file )
|
||||
if compilation_info.compiler_flags_:
|
||||
return compilation_info
|
||||
return None
|
||||
return database.GetCompilationInfoForFile( filename )
|
||||
|
||||
|
||||
def FlagsForFile( filename, **kwargs ):
|
||||
if database:
|
||||
# Bear in mind that compilation_info.compiler_flags_ does NOT return a
|
||||
# python list, but a "list-like" StringVec object
|
||||
compilation_info = GetCompilationInfoForFile( filename )
|
||||
if not compilation_info:
|
||||
return None
|
||||
|
||||
final_flags = MakeRelativePathsInFlagsAbsolute(
|
||||
compilation_info.compiler_flags_,
|
||||
compilation_info.compiler_working_dir_ )
|
||||
|
||||
# NOTE: This is just for YouCompleteMe; it's highly likely that your project
|
||||
# does NOT need to remove the stdlib flag. DO NOT USE THIS IN YOUR
|
||||
# ycm_extra_conf IF YOU'RE NOT 100% SURE YOU NEED IT.
|
||||
#try:
|
||||
# final_flags.remove( '-stdlib=libc++' )
|
||||
#except ValueError:
|
||||
# pass
|
||||
else:
|
||||
relative_to = DirectoryOfThisScript()
|
||||
final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to )
|
||||
|
||||
return {
|
||||
'flags': final_flags,
|
||||
'do_cache': True
|
||||
}
|
||||
+173
-60
@@ -1,6 +1,6 @@
|
||||
############################################################################
|
||||
#
|
||||
# Copyright (c) 2017 - 2019 PX4 Development Team. All rights reserved.
|
||||
# Copyright (c) 2017 - 2022 PX4 Development Team. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
@@ -101,6 +101,8 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
|
||||
|
||||
cmake_policy(SET CMP0058 NEW)
|
||||
|
||||
set(PX4_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" CACHE FILEPATH "PX4 source directory" FORCE)
|
||||
set(PX4_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}" CACHE FILEPATH "PX4 binary directory" FORCE)
|
||||
|
||||
@@ -138,30 +140,41 @@ define_property(GLOBAL PROPERTY PX4_SRC_FILES
|
||||
BRIEF_DOCS "src files from all PX4 modules & libs"
|
||||
FULL_DOCS "SRC files from px4_add_{module,library}"
|
||||
)
|
||||
|
||||
define_property(GLOBAL PROPERTY PX4_PUBLICATIONS
|
||||
BRIEF_DOCS "PX4 publication topics"
|
||||
FULL_DOCS "List of topics published by PX4 modules"
|
||||
)
|
||||
define_property(GLOBAL PROPERTY PX4_SUBSCRIPTIONS
|
||||
BRIEF_DOCS "PX4 subscription topics"
|
||||
FULL_DOCS "List of topics subscribed by PX4 modules"
|
||||
)
|
||||
#=============================================================================
|
||||
# configuration
|
||||
#
|
||||
|
||||
set(CONFIG "px4_sitl_default" CACHE STRING "desired configuration")
|
||||
# default to px4_ros2_default if building within a ROS2 colcon environment
|
||||
if((DEFINED ENV{COLCON_PREFIX_PATH}) AND (DEFINED ENV{ROS_VERSION}))
|
||||
if("$ENV{ROS_VERSION}" MATCHES "2")
|
||||
message(STATUS "ROS_VERSION: $ENV{ROS_VERSION}")
|
||||
set(CONFIG "px4_ros2_default" CACHE STRING "desired configuration") # TODO
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT CONFIG)
|
||||
set(CONFIG "px4_sitl_default" CACHE STRING "desired configuration")
|
||||
endif()
|
||||
|
||||
include(px4_add_module)
|
||||
set(config_module_list)
|
||||
set(config_kernel_list)
|
||||
|
||||
# Find Python
|
||||
# If using catkin, Python 2 is found since it points
|
||||
# to the Python libs installed with the ROS distro
|
||||
if (NOT CATKIN_DEVEL_PREFIX)
|
||||
find_package(PythonInterp 3)
|
||||
# We have a custom error message to tell users how to install python3.
|
||||
if (NOT PYTHONINTERP_FOUND)
|
||||
message(FATAL_ERROR "Python 3 not found. Please install Python 3:\n"
|
||||
" Ubuntu: sudo apt install python3 python3-dev python3-pip\n"
|
||||
" macOS: brew install python")
|
||||
endif()
|
||||
else()
|
||||
find_package(PythonInterp REQUIRED)
|
||||
find_package(PythonInterp 3)
|
||||
# We have a custom error message to tell users how to install python3.
|
||||
if(NOT PYTHONINTERP_FOUND)
|
||||
message(FATAL_ERROR "Python 3 not found. Please install Python 3:\n"
|
||||
" Ubuntu: sudo apt install python3 python3-dev python3-pip\n"
|
||||
" macOS: brew install python")
|
||||
endif()
|
||||
|
||||
option(PYTHON_COVERAGE "Python code coverage" OFF)
|
||||
@@ -197,10 +210,6 @@ set_property(GLOBAL PROPERTY PX4_MODULE_CONFIG_FILES)
|
||||
include(platforms/${PX4_PLATFORM}/cmake/px4_impl_os.cmake)
|
||||
list(APPEND CMAKE_MODULE_PATH ${PX4_SOURCE_DIR}/platforms/${PX4_PLATFORM}/cmake)
|
||||
|
||||
if(EXISTS "${PX4_SOURCE_DIR}/platforms/${PX4_PLATFORM}/cmake/init.cmake")
|
||||
include(init)
|
||||
endif()
|
||||
|
||||
# CMake build type (Debug Release RelWithDebInfo MinSizeRel Coverage)
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
if(${PX4_PLATFORM} STREQUAL "nuttx")
|
||||
@@ -236,20 +245,18 @@ project(px4 CXX C ASM)
|
||||
|
||||
set(package-contact "px4users@googlegroups.com")
|
||||
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_C_STANDARD 11)
|
||||
set(CMAKE_C_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
# For the catkin build process, unset build of dynamically-linked binaries
|
||||
# and do not change CMAKE_RUNTIME_OUTPUT_DIRECTORY
|
||||
if (NOT CATKIN_DEVEL_PREFIX)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PX4_BINARY_DIR})
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${PX4_BINARY_DIR})
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${PX4_BINARY_DIR})
|
||||
else()
|
||||
SET(BUILD_SHARED_LIBS OFF)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PX4_BINARY_DIR})
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${PX4_BINARY_DIR})
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${PX4_BINARY_DIR})
|
||||
|
||||
if(EXISTS "${PX4_SOURCE_DIR}/platforms/${PX4_PLATFORM}/cmake/init.cmake")
|
||||
include(init)
|
||||
endif()
|
||||
|
||||
#=============================================================================
|
||||
@@ -295,21 +302,6 @@ endif()
|
||||
|
||||
include(ccache)
|
||||
|
||||
#=============================================================================
|
||||
# find programs and packages
|
||||
#
|
||||
|
||||
# see if catkin was invoked to build this
|
||||
if (CATKIN_DEVEL_PREFIX)
|
||||
message(STATUS "catkin ENABLED")
|
||||
find_package(catkin REQUIRED)
|
||||
if (catkin_FOUND)
|
||||
catkin_package()
|
||||
else()
|
||||
message(FATAL_ERROR "catkin not found")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#=============================================================================
|
||||
# get chip and chip manufacturer
|
||||
#
|
||||
@@ -321,13 +313,6 @@ if(NOT PX4_CHIP)
|
||||
message(FATAL_ERROR "px4_os_determine_build_chip() needs to set PX4_CHIP")
|
||||
endif()
|
||||
|
||||
#=============================================================================
|
||||
# build flags
|
||||
#
|
||||
include(px4_add_common_flags)
|
||||
px4_add_common_flags()
|
||||
px4_os_add_flags()
|
||||
|
||||
#=============================================================================
|
||||
# board cmake init (optional)
|
||||
#
|
||||
@@ -335,6 +320,13 @@ if(EXISTS ${PX4_BOARD_DIR}/cmake/init.cmake)
|
||||
include(${PX4_BOARD_DIR}/cmake/init.cmake)
|
||||
endif()
|
||||
|
||||
#=============================================================================
|
||||
# build flags
|
||||
#
|
||||
include(px4_add_common_flags)
|
||||
px4_add_common_flags()
|
||||
px4_os_add_flags()
|
||||
|
||||
#=============================================================================
|
||||
# message, and airframe generation
|
||||
#
|
||||
@@ -416,8 +408,13 @@ add_library(parameters_interface INTERFACE)
|
||||
include(px4_add_library)
|
||||
add_subdirectory(src/lib EXCLUDE_FROM_ALL)
|
||||
|
||||
add_subdirectory(platforms/${PX4_PLATFORM}/src/px4)
|
||||
add_subdirectory(platforms EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(platforms/${PX4_PLATFORM}/src/px4 EXCLUDE_FROM_ALL)
|
||||
|
||||
if(${PX4_PLATFORM} MATCHES "ros2") # TODO: fix
|
||||
add_subdirectory(platforms/common/work_queue EXCLUDE_FROM_ALL)
|
||||
else()
|
||||
add_subdirectory(platforms EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
|
||||
if(EXISTS "${PX4_BOARD_DIR}/CMakeLists.txt")
|
||||
add_subdirectory(${PX4_BOARD_DIR})
|
||||
@@ -439,6 +436,126 @@ target_link_libraries(parameters_interface INTERFACE parameters)
|
||||
# firmware added last to generate the builtin for included modules
|
||||
add_subdirectory(platforms/${PX4_PLATFORM})
|
||||
|
||||
|
||||
set(PX4_ORB_TOPIC_COUNT 0)
|
||||
|
||||
if(${PX4_PLATFORM} MATCHES "ros2") # TODO: fix
|
||||
|
||||
configure_file(${CMAKE_SOURCE_DIR}/build/px4_fmu-v5x_default/uORBTopics.cpp ${CMAKE_BINARY_DIR}/uORBTopics.cpp COPYONLY)
|
||||
configure_file(${CMAKE_SOURCE_DIR}/build/px4_fmu-v5x_default/uORBTopics.hpp ${CMAKE_BINARY_DIR}/uORBTopics.hpp COPYONLY)
|
||||
|
||||
set(PX4_ORB_TOPIC_COUNT 1)
|
||||
|
||||
else()
|
||||
|
||||
get_property(publications GLOBAL PROPERTY PX4_PUBLICATIONS)
|
||||
get_property(subscriptions GLOBAL PROPERTY PX4_SUBSCRIPTIONS)
|
||||
|
||||
# TODO: for now combine subsriptions and publications for complete topic list
|
||||
list(APPEND publications ${subscriptions})
|
||||
|
||||
list(SORT publications)
|
||||
list(REMOVE_DUPLICATES publications)
|
||||
|
||||
set(pub_all_topics)
|
||||
set(PX4_MSG_TYPE_ID)
|
||||
set(PX4_MSG_TOPIC_ID)
|
||||
set(PX4_MSG_TOPIC_ID_STRING)
|
||||
set(PX4_MSG_TOPIC_ORB_ID)
|
||||
|
||||
set(PX4_ORB_DECLARE_STR)
|
||||
set(PX4_ORB_DEFINE_STR)
|
||||
set(PX4_ORB_HEADER_INCLUDE_STR)
|
||||
|
||||
|
||||
foreach(pub ${publications})
|
||||
#message(STATUS "pub: ${pub}")
|
||||
string(REPLACE " /" ";" pub ${pub})
|
||||
|
||||
list(GET pub 0 pub_type)
|
||||
list(GET pub 1 pub_topic)
|
||||
|
||||
string(REPLACE "::" ";" pub_type_split ${pub_type})
|
||||
list(GET pub_type_split 2 pub_type_simple_lower)
|
||||
|
||||
# Pascal case to snake case (PubType -> pub_type)
|
||||
string(REGEX REPLACE "(.)([A-Z][a-z]+)" "\\1_\\2" pub_type_simple_lower "${pub_type_simple_lower}")
|
||||
string(REGEX REPLACE "([a-z0-9])([A-Z])" "\\1_\\2" pub_type_simple_lower "${pub_type_simple_lower}")
|
||||
string(TOLOWER "${pub_type_simple_lower}" pub_type_simple_lower)
|
||||
|
||||
#message(STATUS "pub: Type: ${pub_type}, Topic: ${pub_topic} (${pub_type_simple_lower})")
|
||||
|
||||
|
||||
|
||||
|
||||
# pub_type to include path (eg px4::msg::VehicleStatus => px4/msg/vehicle_status.hpp)
|
||||
# temporary create px4/msg/vehicle_status.hpp which simply includes <uORB/topics/vehicle_status.h>
|
||||
|
||||
|
||||
|
||||
|
||||
list(APPEND pub_all_topics ${pub_topic})
|
||||
|
||||
list(APPEND PX4_MSG_TYPE_ID ${pub_type})
|
||||
|
||||
#list(APPEND PX4_MSG_TOPIC_ID ${pub_topic})
|
||||
set(PX4_MSG_TOPIC_ID "${PX4_MSG_TOPIC_ID}\t${pub_topic},\n")
|
||||
#set(PX4_MSG_TOPIC_ID_STRING "${PX4_MSG_TOPIC_ID_STRING}\t"case ORB_ID::${pub_topic}: return \"${pub_topic}\";"\n")
|
||||
set(PX4_MSG_TOPIC_ORB_ID "${PX4_MSG_TOPIC_ORB_ID}\tORB_ID(${pub_topic}),\n")
|
||||
|
||||
list(APPEND PX4_MSG_TOPIC_ID_STRING
|
||||
"case ORB_ID::${pub_topic}: return \"${pub_topic}\";\n"
|
||||
)
|
||||
|
||||
# PX4_MSG_TYPE_ID
|
||||
# PX4_MSG_TOPIC_ID
|
||||
|
||||
# .h ORB_DECLARE(actuator_controls_0);
|
||||
# .c ORB_DEFINE(actuator_controls_0, struct actuator_controls_s, 48, __orb_actuator_controls_fields, static_cast<uint8_t>(ORB_ID::actuator_controls_0));
|
||||
|
||||
|
||||
set(PX4_ORB_DECLARE_STR
|
||||
"${PX4_ORB_DECLARE_STR}ORB_DECLARE(${pub_topic});\n")
|
||||
|
||||
# ORB_DEFINE(actuator_armed, struct actuator_armed_s, 16, __orb_actuator_armed_fields, static_cast<uint8_t>(ORB_ID::actuator_armed));
|
||||
set(PX4_ORB_DEFINE_STR
|
||||
"${PX4_ORB_DEFINE_STR}ORB_DEFINE(${pub_topic}, ${pub_type}, px4_embedded::${pub_type_simple_lower}_s::SIZE_NO_PADDING, px4_embedded::${pub_type_simple_lower}_s::FIELDS, static_cast<uint8_t>(ORB_ID::${pub_topic}));\n")
|
||||
|
||||
set(PX4_ORB_HEADER_INCLUDE_STR
|
||||
"${PX4_ORB_HEADER_INCLUDE_STR}#include <uORB/topics/${pub_type_simple_lower}.h>\n")
|
||||
|
||||
math(EXPR PX4_ORB_TOPIC_COUNT "${PX4_ORB_TOPIC_COUNT}+1")
|
||||
|
||||
endforeach()
|
||||
list(REMOVE_DUPLICATES PX4_MSG_TYPE_ID)
|
||||
#list(REMOVE_DUPLICATES PX4_MSG_TOPIC_ID)
|
||||
|
||||
#message(STATUS "PX4_MSG_TYPE_ID: ${PX4_MSG_TYPE_ID}")
|
||||
#message(STATUS "PX4_MSG_TOPIC_ID: ${PX4_MSG_TOPIC_ID}")
|
||||
|
||||
if(PX4_ORB_TOPIC_COUNT GREATER 0)
|
||||
configure_file(uORBTopics.cpp.in ${CMAKE_BINARY_DIR}/uORBTopics.cpp)
|
||||
configure_file(uORBTopics.hpp.in ${CMAKE_BINARY_DIR}/uORBTopics.hpp)
|
||||
endif()
|
||||
|
||||
# .hpp enum ORB_ID
|
||||
# .cpp struct orb_metadat ORB_ID() array
|
||||
|
||||
foreach(f ${msg_files})
|
||||
#message(STATUS "MSG: ${f}")
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(PX4_ORB_TOPIC_COUNT GREATER 0)
|
||||
add_library(uorb_msgs ${uorb_headers} ${CMAKE_BINARY_DIR}/uORBTopics.cpp ${CMAKE_BINARY_DIR}/uORBTopics.hpp)
|
||||
add_dependencies(uorb_msgs prebuild_targets uorb_headers)
|
||||
endif()
|
||||
|
||||
if(${PX4_PLATFORM} MATCHES "ros2") # TODO: fix
|
||||
ament_target_dependencies(uorb_msgs rclcpp std_msgs)
|
||||
rosidl_target_interfaces(uorb_msgs ${PROJECT_NAME} "rosidl_typesupport_cpp")
|
||||
endif()
|
||||
|
||||
#=============================================================================
|
||||
# uORB graph generation: add a custom target 'uorb_graph'
|
||||
#
|
||||
@@ -466,17 +583,13 @@ include(doxygen)
|
||||
include(metadata)
|
||||
include(package)
|
||||
|
||||
# print size
|
||||
add_custom_target(size
|
||||
COMMAND size $<TARGET_FILE:px4>
|
||||
DEPENDS px4
|
||||
WORKING_DIRECTORY ${PX4_BINARY_DIR}
|
||||
USES_TERMINAL
|
||||
)
|
||||
|
||||
# install python requirements using configured python
|
||||
add_custom_target(install_python_requirements
|
||||
COMMAND ${PYTHON_EXECUTABLE} -m pip install --requirement ${PX4_SOURCE_DIR}/Tools/setup/requirements.txt
|
||||
DEPENDS ${PX4_SOURCE_DIR}/Tools/setup/requirements.txt
|
||||
USES_TERMINAL
|
||||
)
|
||||
|
||||
if(EXISTS "${PX4_SOURCE_DIR}/platforms/${PX4_PLATFORM}/cmake/finalize.cmake")
|
||||
include(finalize)
|
||||
endif()
|
||||
|
||||
@@ -829,7 +829,6 @@ RECURSIVE = YES
|
||||
# run.
|
||||
|
||||
EXCLUDE = @CMAKE_SOURCE_DIR@/src/modules/uavcan/libuavcan \
|
||||
@CMAKE_SOURCE_DIR@/src/modules/micrortps_bridge/micro-CDR \
|
||||
@CMAKE_SOURCE_DIR@/src/examples \
|
||||
@CMAKE_SOURCE_DIR@/src/templates
|
||||
|
||||
|
||||
Vendored
-172
@@ -12,76 +12,6 @@ pipeline {
|
||||
}
|
||||
}
|
||||
parallel {
|
||||
// stage('Catkin build on ROS workspace') {
|
||||
// agent {
|
||||
// docker {
|
||||
// image 'px4io/px4-dev-ros-melodic:2021-08-18'
|
||||
// args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw -e HOME=$WORKSPACE'
|
||||
// }
|
||||
// }
|
||||
// steps {
|
||||
// sh 'ls -l'
|
||||
// sh '''#!/bin/bash -l
|
||||
// echo $0;
|
||||
// mkdir -p catkin_ws/src;
|
||||
// cd catkin_ws;
|
||||
// git -C ${WORKSPACE}/catkin_ws/src/Firmware submodule update --init --recursive --force Tools/sitl_gazebo
|
||||
// git clone --recursive ${WORKSPACE}/catkin_ws/src/Firmware/Tools/sitl_gazebo src/mavlink_sitl_gazebo;
|
||||
// git -C ${WORKSPACE}/catkin_ws/src/Firmware fetch --tags;
|
||||
// source /opt/ros/melodic/setup.bash;
|
||||
// export PYTHONPATH=/opt/ros/$ROS_DISTRO/lib/python2.7/dist-packages:/usr/lib/python2.7/dist-packages:/usr/local/lib/python2.7/dist-packages;
|
||||
// catkin init;
|
||||
// catkin build -j$(nproc) -l$(nproc);
|
||||
// '''
|
||||
// // test if the binary was correctly installed and runs using 'mavros_posix_silt.launch'
|
||||
// sh '''#!/bin/bash -l
|
||||
// echo $0;
|
||||
// source catkin_ws/devel/setup.bash;
|
||||
// rostest px4 pub_test.launch;
|
||||
// '''
|
||||
// }
|
||||
// post {
|
||||
// always {
|
||||
// sh 'rm -rf catkin_ws'
|
||||
// }
|
||||
// failure {
|
||||
// archiveArtifacts(allowEmptyArchive: false, artifacts: '.ros/**/*.xml, .ros/**/*.log')
|
||||
// }
|
||||
// }
|
||||
// options {
|
||||
// checkoutToSubdirectory('catkin_ws/src/Firmware')
|
||||
// }
|
||||
// }
|
||||
|
||||
stage('Colcon build on ROS2 workspace') {
|
||||
agent {
|
||||
docker {
|
||||
image 'px4io/px4-dev-ros2-foxy:2021-08-18'
|
||||
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw -e HOME=$WORKSPACE'
|
||||
}
|
||||
}
|
||||
steps {
|
||||
sh 'ls -l'
|
||||
sh '''#!/bin/bash -l
|
||||
echo $0;
|
||||
unset ROS_DISTRO;
|
||||
mkdir -p colcon_ws/src;
|
||||
cd colcon_ws;
|
||||
git -C ${WORKSPACE}/colcon_ws/src/Firmware submodule update --init --recursive --force Tools/sitl_gazebo;
|
||||
git -C ${WORKSPACE}/colcon_ws/src/Firmware fetch --tags;
|
||||
source /opt/ros/foxy/setup.sh;
|
||||
colcon build --event-handlers console_direct+ --symlink-install;
|
||||
'''
|
||||
}
|
||||
post {
|
||||
always {
|
||||
sh 'rm -rf colcon_ws'
|
||||
}
|
||||
}
|
||||
options {
|
||||
checkoutToSubdirectory('colcon_ws/src/Firmware')
|
||||
}
|
||||
}
|
||||
|
||||
stage('Airframe') {
|
||||
agent {
|
||||
@@ -254,108 +184,6 @@ pipeline {
|
||||
}
|
||||
}
|
||||
|
||||
stage('microRTPS agent') {
|
||||
agent {
|
||||
docker { image 'px4io/px4-dev-base-focal:2021-08-18' }
|
||||
}
|
||||
steps {
|
||||
sh('export')
|
||||
sh('git fetch --all --tags')
|
||||
sh('make distclean; git clean -ff -x -d .')
|
||||
sh('make px4_sitl_rtps')
|
||||
withCredentials([usernamePassword(credentialsId: 'px4buildbot_github_personal_token', passwordVariable: 'GIT_PASS', usernameVariable: 'GIT_USER')]) {
|
||||
sh("git clone https://${GIT_USER}:${GIT_PASS}@github.com/PX4/micrortps_agent.git -b ${BRANCH_NAME}")
|
||||
sh("rm -rf micrortps_agent/src micrortps_agent/idl")
|
||||
sh('cp -R build/px4_sitl_rtps/src/modules/micrortps_bridge/micrortps_agent/* micrortps_agent')
|
||||
sh('cd micrortps_agent; git status; git add src; git commit -a -m "Update microRTPS agent source code `date`" || true')
|
||||
sh('cd micrortps_agent; git push origin ${BRANCH_NAME} || true')
|
||||
sh('cd micrortps_agent; git status; git add idl; git commit -a -m "Update IDL definitions `date`" || true')
|
||||
sh('cd micrortps_agent; git push origin ${BRANCH_NAME} || true')
|
||||
sh('cd micrortps_agent; git status; git add CMakeLists.txt; git commit -a -m "Update CMakeLists.txt `date`" || true')
|
||||
sh('cd micrortps_agent; git push origin ${BRANCH_NAME} || true')
|
||||
sh('rm -rf micrortps_agent')
|
||||
}
|
||||
}
|
||||
when {
|
||||
anyOf {
|
||||
branch 'master'
|
||||
branch 'pr-jenkins' // for testing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('PX4 ROS msgs') {
|
||||
agent {
|
||||
docker { image 'px4io/px4-dev-base-focal:2021-08-18' }
|
||||
}
|
||||
steps {
|
||||
sh('export')
|
||||
sh('make distclean; git clean -ff -x -d .')
|
||||
withCredentials([usernamePassword(credentialsId: 'px4buildbot_github_personal_token', passwordVariable: 'GIT_PASS', usernameVariable: 'GIT_USER')]) {
|
||||
sh("git clone https://${GIT_USER}:${GIT_PASS}@github.com/PX4/px4_msgs.git")
|
||||
// 'master' branch
|
||||
sh('./msg/tools/uorb_to_ros_msgs.py msg/ px4_msgs/msg/')
|
||||
sh('cd px4_msgs; git status; git add .; git commit -a -m "Update message definitions `date`" || true')
|
||||
sh('cd px4_msgs; git push origin master || true')
|
||||
// 'ros1' branch
|
||||
sh('cd px4_msgs; git checkout ros1')
|
||||
sh('./msg/tools/uorb_to_ros_msgs.py msg/ px4_msgs/msg/')
|
||||
sh('cd px4_msgs; git status; git add .; git commit -a -m "Update message definitions `date`" || true')
|
||||
sh('cd px4_msgs; git push origin ros1 || true')
|
||||
sh('rm -rf px4_msgs')
|
||||
}
|
||||
}
|
||||
when {
|
||||
anyOf {
|
||||
branch 'master'
|
||||
branch 'pr-jenkins' // for testing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('PX4 ROS2 bridge') {
|
||||
agent {
|
||||
docker { image 'px4io/px4-dev-base-focal:2021-08-18' }
|
||||
}
|
||||
steps {
|
||||
sh('export')
|
||||
sh('make distclean; git clean -ff -x -d .')
|
||||
withCredentials([usernamePassword(credentialsId: 'px4buildbot_github_personal_token', passwordVariable: 'GIT_PASS', usernameVariable: 'GIT_USER')]) {
|
||||
sh("git clone https://${GIT_USER}:${GIT_PASS}@github.com/PX4/px4_ros_com.git -b ${BRANCH_NAME}")
|
||||
// deploy uORB RTPS ID map
|
||||
sh('./msg/tools/uorb_to_ros_urtps_topics.py -i msg/tools/urtps_bridge_topics.yaml -o px4_ros_com/templates/urtps_bridge_topics.yaml')
|
||||
sh('cd px4_ros_com; git status; git add .; git commit -a -m "Update uORB RTPS ID map `date`" || true')
|
||||
sh('cd px4_ros_com; git push origin ${BRANCH_NAME} || true')
|
||||
// deploy uORB RTPS required tools
|
||||
sh('cp msg/tools/uorb_rtps_classifier.py px4_ros_com/scripts/uorb_rtps_classifier.py')
|
||||
sh('cp msg/tools/generate_microRTPS_bridge.py px4_ros_com/scripts/generate_microRTPS_bridge.py')
|
||||
sh('cp msg/tools/px_generate_uorb_topic_files.py px4_ros_com/scripts/px_generate_uorb_topic_files.py')
|
||||
sh('cp msg/tools/px_generate_uorb_topic_helper.py px4_ros_com/scripts/px_generate_uorb_topic_helper.py')
|
||||
// deploy templates
|
||||
sh('cp msg/templates/urtps/microRTPS_agent.cpp.em px4_ros_com/templates/microRTPS_agent.cpp.em')
|
||||
sh('cp msg/templates/urtps/microRTPS_timesync.cpp.em px4_ros_com/templates/microRTPS_timesync.cpp.em')
|
||||
sh('cp msg/templates/urtps/microRTPS_timesync.h.em px4_ros_com/templates/microRTPS_timesync.h.em')
|
||||
sh('cp msg/templates/urtps/microRTPS_transport.cpp px4_ros_com/templates/microRTPS_transport.cpp')
|
||||
sh('cp msg/templates/urtps/microRTPS_transport.h px4_ros_com/templates/microRTPS_transport.h')
|
||||
sh('cp msg/templates/urtps/Publisher.cpp.em px4_ros_com/templates/Publisher.cpp.em')
|
||||
sh('cp msg/templates/urtps/Publisher.h.em px4_ros_com/templates/Publisher.h.em')
|
||||
sh('cp msg/templates/urtps/Subscriber.cpp.em px4_ros_com/templates/Subscriber.cpp.em')
|
||||
sh('cp msg/templates/urtps/Subscriber.h.em px4_ros_com/templates/Subscriber.h.em')
|
||||
sh('cp msg/templates/urtps/RtpsTopics.cpp.em px4_ros_com/templates/RtpsTopics.cpp.em')
|
||||
sh('cp msg/templates/urtps/RtpsTopics.h.em px4_ros_com/templates/RtpsTopics.h.em')
|
||||
sh('cd px4_ros_com; git status; git add .; git commit -a -m "Update uORB RTPS script tools `date`" || true')
|
||||
sh('cd px4_ros_com; git push origin ${BRANCH_NAME} || true')
|
||||
sh('rm -rf px4_msgs')
|
||||
}
|
||||
}
|
||||
when {
|
||||
anyOf {
|
||||
branch 'master'
|
||||
branch 'pr-jenkins' // for testing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('S3') {
|
||||
agent {
|
||||
docker { image 'px4io/px4-dev-base-focal:2021-08-18' }
|
||||
|
||||
@@ -17,6 +17,8 @@ menu "Toolchain"
|
||||
bool "posix"
|
||||
config PLATFORM_QURT
|
||||
bool "qurt"
|
||||
config PLATFORM_ROS2
|
||||
bool "ros2"
|
||||
endchoice
|
||||
|
||||
config BOARD_PLATFORM
|
||||
@@ -24,6 +26,7 @@ menu "Toolchain"
|
||||
default "nuttx" if PLATFORM_NUTTX
|
||||
default "posix" if PLATFORM_POSIX
|
||||
default "qurt" if PLATFORM_QURT
|
||||
default "ros2" if PLATFORM_ROS2
|
||||
|
||||
config BOARD_LOCKSTEP
|
||||
bool "Force enable lockstep"
|
||||
|
||||
@@ -170,11 +170,6 @@ ifdef PYTHON_EXECUTABLE
|
||||
CMAKE_ARGS += -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}
|
||||
endif
|
||||
|
||||
# Check if the microRTPS agent is to be built
|
||||
ifdef BUILD_MICRORTPS_AGENT
|
||||
CMAKE_ARGS += -DBUILD_MICRORTPS_AGENT=ON
|
||||
endif
|
||||
|
||||
# Functions
|
||||
# --------------------------------------------------------------------
|
||||
# describe how to build a cmake config
|
||||
@@ -251,7 +246,7 @@ endef
|
||||
# Other targets
|
||||
# --------------------------------------------------------------------
|
||||
|
||||
.PHONY: qgc_firmware px4fmu_firmware misc_qgc_extra_firmware check_rtps
|
||||
.PHONY: qgc_firmware px4fmu_firmware misc_qgc_extra_firmware
|
||||
|
||||
# QGroundControl flashable NuttX firmware
|
||||
qgc_firmware: px4fmu_firmware misc_qgc_extra_firmware
|
||||
@@ -276,15 +271,7 @@ misc_qgc_extra_firmware: \
|
||||
check_airmind_mindpx-v2_default \
|
||||
sizes
|
||||
|
||||
# builds with RTPS
|
||||
check_rtps: \
|
||||
check_px4_fmu-v3_rtps \
|
||||
check_px4_fmu-v4_rtps \
|
||||
check_px4_fmu-v4pro_rtps \
|
||||
check_px4_sitl_rtps \
|
||||
sizes
|
||||
|
||||
.PHONY: sizes check quick_check check_rtps uorb_graphs
|
||||
.PHONY: sizes check quick_check uorb_graphs
|
||||
|
||||
sizes:
|
||||
@-find build -name *.elf -type f | xargs size 2> /dev/null || :
|
||||
@@ -479,7 +466,7 @@ clang-tidy-quiet: px4_sitl_default-clang
|
||||
# TODO: Fix cppcheck errors then try --enable=warning,performance,portability,style,unusedFunction or --enable=all
|
||||
cppcheck: px4_sitl_default
|
||||
@mkdir -p "$(SRC_DIR)"/build/cppcheck
|
||||
@cppcheck -i"$(SRC_DIR)"/src/examples --enable=performance --std=c++14 --std=c99 --std=posix --project="$(SRC_DIR)"/build/px4_sitl_default/compile_commands.json --xml-version=2 2> "$(SRC_DIR)"/build/cppcheck/cppcheck-result.xml > /dev/null
|
||||
@cppcheck -i"$(SRC_DIR)"/src/examples --enable=performance --std=c++17 --std=c99 --std=posix --project="$(SRC_DIR)"/build/px4_sitl_default/compile_commands.json --xml-version=2 2> "$(SRC_DIR)"/build/cppcheck/cppcheck-result.xml > /dev/null
|
||||
@cppcheck-htmlreport --source-encoding=ascii --file="$(SRC_DIR)"/build/cppcheck/cppcheck-result.xml --report-dir="$(SRC_DIR)"/build/cppcheck --source-dir="$(SRC_DIR)"/src/
|
||||
|
||||
shellcheck_all:
|
||||
@@ -559,12 +546,3 @@ ifneq ($(ROS2_WS_DIR),)
|
||||
else
|
||||
ROS2_WS_DIR := ~/colcon_ws
|
||||
endif
|
||||
|
||||
update_ros2_bridge:
|
||||
@Tools/update_px4_ros2_bridge.sh --ws_dir ${ROS2_WS_DIR} --all
|
||||
|
||||
update_px4_ros_com:
|
||||
@Tools/update_px4_ros2_bridge.sh --ws_dir ${ROS2_WS_DIR} --px4_ros_com
|
||||
|
||||
update_px4_msgs:
|
||||
@Tools/update_px4_ros2_bridge.sh --ws_dir ${ROS2_WS_DIR} --px4_msgs
|
||||
|
||||
@@ -36,7 +36,6 @@ add_subdirectory(airframes)
|
||||
px4_add_romfs_files(
|
||||
px4-rc.mavlink
|
||||
px4-rc.params
|
||||
px4-rc.rtps
|
||||
px4-rc.simulator
|
||||
rc.replay
|
||||
rcS
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/bin/sh
|
||||
# shellcheck disable=SC2154
|
||||
|
||||
micrortps_client start -t UDP -r $((2019+2*px4_instance)) -s $((2020+2*px4_instance))
|
||||
@@ -226,12 +226,6 @@ sensors start
|
||||
commander start
|
||||
navigator start
|
||||
|
||||
# Try to start the micrortps_client with UDP transport if module exists
|
||||
if px4-micrortps_client status > /dev/null 2>&1
|
||||
then
|
||||
. px4-rc.rtps
|
||||
fi
|
||||
|
||||
if param greater -s MNT_MODE_IN -1
|
||||
then
|
||||
gimbal start
|
||||
|
||||
@@ -8,7 +8,6 @@ if [ $# -gt 0 ]; then
|
||||
fi
|
||||
|
||||
exec find boards msg src platforms test \
|
||||
-path msg/templates/urtps -prune -o \
|
||||
-path platforms/nuttx/NuttX -prune -o \
|
||||
-path platforms/qurt/dspal -prune -o \
|
||||
-path src/drivers/uavcan/libuavcan -prune -o \
|
||||
@@ -21,8 +20,6 @@ exec find boards msg src platforms test \
|
||||
-path src/modules/ekf2/EKF -prune -o \
|
||||
-path src/modules/gyro_fft/CMSIS_5 -prune -o \
|
||||
-path src/modules/mavlink/mavlink -prune -o \
|
||||
-path src/modules/micrortps_bridge/micro-CDR -prune -o \
|
||||
-path src/modules/micrortps_bridge/microRTPS_client -prune -o \
|
||||
-path test/mavsdk_tests/catch2 -prune -o \
|
||||
-path src/lib/crypto/monocypher -prune -o \
|
||||
-path src/lib/crypto/libtomcrypt -prune -o \
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR=$0
|
||||
if [[ ${SCRIPT_DIR:0:1} != '/' ]]; then
|
||||
SCRIPT_DIR=$(dirname $(realpath -s "$PWD/$0"))
|
||||
fi
|
||||
|
||||
PX4_DIR=$(cd "$(dirname $(dirname $SCRIPT_DIR))" && pwd)
|
||||
|
||||
if [ -d $PX4_DIR/build/*_rtps ]; then
|
||||
cd $PX4_DIR/build/*_rtps/src/modules/micrortps_bridge/micrortps_agent/
|
||||
cmake -Bbuild
|
||||
cmake --build build -j$(nproc --all)
|
||||
fi
|
||||
@@ -93,7 +93,6 @@ pca9685_pwm_out,CONFIG_DRIVERS_PCA9685_PWM_OUT=y
|
||||
power_monitor/ina226,CONFIG_DRIVERS_POWER_MONITOR_INA226=y
|
||||
power_monitor/voxlpm,CONFIG_DRIVERS_POWER_MONITOR_VOXLPM=y
|
||||
pps_capture,CONFIG_DRIVERS_PPS_CAPTURE=y
|
||||
protocol_splitter,CONFIG_DRIVERS_PROTOCOL_SPLITTER=y
|
||||
pwm_input,CONFIG_DRIVERS_PWM_INPUT=y
|
||||
pwm_out_sim,CONFIG_DRIVERS_PWM_OUT_SIM=y
|
||||
pwm_out,CONFIG_DRIVERS_PWM_OUT=y
|
||||
@@ -138,7 +137,6 @@ mc_att_control,CONFIG_MODULES_MC_ATT_CONTROL=y
|
||||
mc_hover_thrust_estimator,CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y
|
||||
mc_pos_control,CONFIG_MODULES_MC_POS_CONTROL=y
|
||||
mc_rate_control,CONFIG_MODULES_MC_RATE_CONTROL=y
|
||||
micrortps_bridge,CONFIG_MODULES_MICRORTPS_BRIDGE=y
|
||||
navigator,CONFIG_MODULES_NAVIGATOR=y
|
||||
px4iofirmware,CONFIG_MODULES_PX4IOFIRMWARE=y
|
||||
rc_update,CONFIG_MODULES_RC_UPDATE=y
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
$(info px4_developer.mk inclded)
|
||||
ifeq ($(UAVCAN_BL_OVERRIDE),y)
|
||||
$(info ************************** UAVCAN BOOT LOADERS built for In place application Debugging ***************************************)
|
||||
export EXTRAFLAGS +=-DDEBUG_APPLICATION_INPLACE
|
||||
endif
|
||||
+1
-3
@@ -9,8 +9,6 @@
|
||||
## - jMAVSim simulator (omit with arg: --no-sim-tools)
|
||||
## - Gazebo simulator (not by default, use --gazebo)
|
||||
##
|
||||
## Not Installs:
|
||||
## - FastRTPS and FastCDR
|
||||
|
||||
INSTALL_NUTTX="true"
|
||||
INSTALL_SIM="true"
|
||||
@@ -122,7 +120,7 @@ if [[ $INSTALL_SIM == "true" ]]; then
|
||||
echo
|
||||
echo "Installing PX4 simulation dependencies"
|
||||
|
||||
# java (jmavsim or fastrtps)
|
||||
# java (jmavsim)
|
||||
sudo pacman -S --noconfirm --needed \
|
||||
ant \
|
||||
jdk-openjdk \
|
||||
|
||||
@@ -10,8 +10,6 @@ set -e
|
||||
## - NuttX toolchain (omit with arg: --no-nuttx)
|
||||
## - jMAVSim and Gazebo9 simulator (omit with arg: --no-sim-tools)
|
||||
##
|
||||
## Not Installs:
|
||||
## - FastRTPS and FastCDR
|
||||
|
||||
INSTALL_NUTTX="true"
|
||||
INSTALL_SIM="true"
|
||||
@@ -208,7 +206,7 @@ if [[ $INSTALL_SIM == "true" ]]; then
|
||||
java_version=14
|
||||
gazebo_version=11
|
||||
fi
|
||||
# Java (jmavsim or fastrtps)
|
||||
# Java (jmavsim)
|
||||
sudo DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends install \
|
||||
ant \
|
||||
openjdk-$java_version-jre \
|
||||
|
||||
@@ -1,135 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
agent_template_files_updated=0
|
||||
code_generator_files_updated=0
|
||||
|
||||
# parse help argument
|
||||
if [[ $1 == "-h" ]] || [[ $1 == "--help" ]]; then
|
||||
echo -e "Usage: update_px4_ros2_bridge.bash [options...] \t This script allows to update px4_ros_com and px4_msgs in a specified directory." >&2
|
||||
echo
|
||||
echo -e "\t--ws_dir \t\t Location of the ament/colcon workspace. Default: $HOME/colcon_ws."
|
||||
echo -e "\t--px4_ros_com \t\t Updates px4_ros_com microRTPS agent code generation and templates."
|
||||
echo -e "\t--px4_msgs \t\t Updates px4_msgs messages definition files."
|
||||
echo -e "\t--all \t\t Updates both px4_ros_com and px4_msgs."
|
||||
echo
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# parse the arguments
|
||||
while [ $# -gt 0 ]; do
|
||||
if [[ $1 == *"--"* ]]; then
|
||||
v="${1/--/}"
|
||||
if [ ! -z $2 ]; then
|
||||
declare $v="$2"
|
||||
else
|
||||
declare $v=1
|
||||
fi
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
# get script directory
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
# get PX4-Autopilot directory
|
||||
PX4_DIR=$(cd "$(dirname "$SCRIPT_DIR")" && pwd)
|
||||
|
||||
function compare_and_update () {
|
||||
cmp -s "$1" "$2"
|
||||
if [ $? -eq 1 ]; then
|
||||
cp "$1" "$2"
|
||||
return 0
|
||||
fi
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
# update microRTPS agent code generators / helpers
|
||||
function update_agent_code {
|
||||
declare -a templates=( \
|
||||
"microRTPS_agent.cpp.em" \
|
||||
"microRTPS_timesync.cpp.em" \
|
||||
"microRTPS_timesync.h.em" \
|
||||
"microRTPS_transport.cpp" \
|
||||
"microRTPS_transport.h" \
|
||||
"Publisher.cpp.em" \
|
||||
"Publisher.h.em" \
|
||||
"Subscriber.cpp.em" \
|
||||
"Subscriber.h.em" \
|
||||
"RtpsTopics.cpp.em" \
|
||||
"RtpsTopics.h.em" \
|
||||
)
|
||||
|
||||
for file in ${templates[@]}; do
|
||||
compare_and_update "$PX4_DIR/msg/templates/urtps/$file" "$ws_dir/src/px4_ros_com/templates/$file" \
|
||||
&& echo -e "--\t\t- '$ws_dir/src/px4_ros_com/templates/$file' updated" && ((agent_template_files_updated+=1))
|
||||
done
|
||||
if [ $agent_template_files_updated -eq 0 ]; then
|
||||
echo -e "--\t\t- No template files updated"
|
||||
elif [ $agent_template_files_updated -eq 1 ]; then
|
||||
echo -e "--\t\t - 1 template file updated"
|
||||
else
|
||||
echo -e "--\t\t - $agent_template_files_updated template files updated"
|
||||
fi
|
||||
}
|
||||
|
||||
# update microRTPS agent code templates
|
||||
function update_agent_templates {
|
||||
declare -a code_generators=( \
|
||||
"uorb_rtps_classifier.py" \
|
||||
"generate_microRTPS_bridge.py" \
|
||||
"px_generate_uorb_topic_files.py" \
|
||||
)
|
||||
for file in ${code_generators[@]}; do
|
||||
compare_and_update "$PX4_DIR/msg/tools/$file $ws_dir/src/px4_ros_com/scripts/$file" \
|
||||
&& echo -e "--\t\t- '$ws_dir/src/px4_ros_com/scripts/$file' updated" && ((code_generator_files_updated+=1))
|
||||
done
|
||||
if [ $code_generator_files_updated -eq 0 ]; then
|
||||
echo -e "--\t\t- No code generators / helpers files updated"
|
||||
elif [ $code_generator_files_updated -eq 1 ]; then
|
||||
echo -e "--\t\t - 1 code generator / helper file updated"
|
||||
else
|
||||
echo -e "--\t\t - $code_generator_files_updated code generator / helper files updated"
|
||||
fi
|
||||
}
|
||||
|
||||
# update px4_ros_com files
|
||||
function update_px4_ros_com {
|
||||
python3 $PX4_DIR/msg/tools/uorb_to_ros_urtps_topics.py -i $PX4_DIR/msg/tools/urtps_bridge_topics.yaml -o $ws_dir/src/px4_ros_com/templates/urtps_bridge_topics.yaml
|
||||
echo -e "--------------- \033[1mmicroRTPS agent code generation and templates update\033[0m ----------------"
|
||||
echo "-------------------------------------------------------------------------------------------------------"
|
||||
update_agent_code
|
||||
update_agent_templates
|
||||
return 0
|
||||
}
|
||||
|
||||
# function to update px4_msgs
|
||||
function update_px4_msgs {
|
||||
find "$ws_dir/src/px4_msgs/msg/" -maxdepth 1 -type f -delete
|
||||
python3 $PX4_DIR/msg/tools/uorb_to_ros_msgs.py $PX4_DIR/msg/ $ws_dir/src/px4_msgs/msg/
|
||||
}
|
||||
|
||||
# decisor
|
||||
echo "-------------------------------------------------------------------------------------------------------"
|
||||
if [ -d "${ws_dir}" ]; then
|
||||
ws_dir=$(cd "$ws_dir" && pwd)
|
||||
if [ ! -z ${all} ]; then
|
||||
update_px4_ros_com
|
||||
echo "-------------------------------------------------------------------------------------------------------"
|
||||
update_px4_msgs
|
||||
elif [ ! -z ${px4_ros_com} ]; then
|
||||
update_px4_ros_com
|
||||
echo "-------------------------------------------------------------------------------------------------------"
|
||||
elif [ ! -z ${px4_msgs} ]; then
|
||||
update_px4_msgs
|
||||
fi
|
||||
echo -e "-------------------------------- \033[0;32mUpdate successful!\033[0m ---------------------------------"
|
||||
echo "-------------------------------------------------------------------------------------------------------"
|
||||
exit 0
|
||||
else
|
||||
echo -e "-- \033[0;31mWorkspace directory doesn't exist...\033[0m"
|
||||
echo -e "---------------------------------- \033[0;31mUpdate failed!\033[0m -----------------------------------"
|
||||
echo "-------------------------------------------------------------------------------------------------------"
|
||||
exit $ERRCODE
|
||||
fi
|
||||
@@ -44,4 +44,6 @@ px4_add_module(
|
||||
syslink.c
|
||||
DEPENDS
|
||||
battery
|
||||
SUBSCRIPTIONS
|
||||
"px4::msg::BatteryStatus /battery_status"
|
||||
)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -3,4 +3,3 @@ CONFIG_BOARD_ARCHITECTURE="cortex-m7"
|
||||
CONFIG_BOARD_ROMFSROOT=""
|
||||
CONFIG_BOARD_CONSTRAINED_MEMORY=y
|
||||
CONFIG_DRIVERS_BOOTLOADERS=y
|
||||
CONFIG_DRIVERS_LIGHTS_RGBLED_NCP5623C=y
|
||||
|
||||
@@ -44,6 +44,8 @@ if("${PX4_BOARD_LABEL}" STREQUAL "canbootloader")
|
||||
nuttx_arch
|
||||
nuttx_drivers
|
||||
canbootloader
|
||||
drivers__device
|
||||
px4_platform
|
||||
)
|
||||
target_include_directories(drivers_board PRIVATE ${PX4_SOURCE_DIR}/platforms/nuttx/src/canbootloader)
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,6 +1,5 @@
|
||||
CONFIG_BOARD_TOOLCHAIN="arm-none-eabi"
|
||||
CONFIG_BOARD_ARCHITECTURE="cortex-m7"
|
||||
CONFIG_BOARD_IO="px4_io-v2_default"
|
||||
CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS0"
|
||||
CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS1"
|
||||
CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS2"
|
||||
@@ -47,6 +46,7 @@ CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y
|
||||
CONFIG_MODULES_BATTERY_STATUS=y
|
||||
CONFIG_MODULES_CAMERA_FEEDBACK=y
|
||||
CONFIG_MODULES_COMMANDER=y
|
||||
CONFIG_MODULES_CONTROL_ALLOCATOR=y
|
||||
CONFIG_MODULES_DATAMAN=y
|
||||
CONFIG_MODULES_EKF2=y
|
||||
CONFIG_MODULES_ESC_BATTERY=y
|
||||
@@ -55,6 +55,7 @@ CONFIG_MODULES_FLIGHT_MODE_MANAGER=y
|
||||
CONFIG_MODULES_FW_ATT_CONTROL=y
|
||||
CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y
|
||||
CONFIG_MODULES_FW_POS_CONTROL_L1=y
|
||||
CONFIG_MODULES_GIMBAL=y
|
||||
CONFIG_MODULES_GYRO_CALIBRATION=y
|
||||
CONFIG_MODULES_GYRO_FFT=y
|
||||
CONFIG_MODULES_LAND_DETECTOR=y
|
||||
@@ -70,7 +71,6 @@ CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y
|
||||
CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y
|
||||
CONFIG_MODULES_MC_POS_CONTROL=y
|
||||
CONFIG_MODULES_MC_RATE_CONTROL=y
|
||||
CONFIG_MODULES_CONTROL_ALLOCATOR=y
|
||||
CONFIG_MODULES_NAVIGATOR=y
|
||||
CONFIG_MODULES_RC_UPDATE=y
|
||||
CONFIG_MODULES_ROVER_POS_CONTROL=y
|
||||
@@ -79,10 +79,9 @@ CONFIG_MODULES_SIH=y
|
||||
CONFIG_MODULES_TEMPERATURE_COMPENSATION=y
|
||||
CONFIG_MODULES_UUV_ATT_CONTROL=y
|
||||
CONFIG_MODULES_UUV_POS_CONTROL=y
|
||||
CONFIG_MODULES_GIMBAL=y
|
||||
CONFIG_MODULES_VTOL_ATT_CONTROL=y
|
||||
CONFIG_SYSTEMCMDS_BL_UPDATE=y
|
||||
CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y
|
||||
CONFIG_SYSTEMCMDS_BL_UPDATE=y
|
||||
CONFIG_SYSTEMCMDS_DMESG=y
|
||||
CONFIG_SYSTEMCMDS_DUMPFILE=y
|
||||
CONFIG_SYSTEMCMDS_GPIO=y
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1 +0,0 @@
|
||||
CONFIG_MODULES_MICRORTPS_BRIDGE=y
|
||||
Binary file not shown.
Binary file not shown.
@@ -1 +0,0 @@
|
||||
CONFIG_MODULES_MICRORTPS_BRIDGE=y
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
CONFIG_MODULES_MICRORTPS_BRIDGE=y
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
CONFIG_MODULES_MICRORTPS_BRIDGE=y
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
CONFIG_MODULES_MICRORTPS_BRIDGE=y
|
||||
@@ -1 +0,0 @@
|
||||
CONFIG_MODULES_MICRORTPS_BRIDGE=y
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -12,10 +12,10 @@ CONFIG_DRIVERS_CAMERA_CAPTURE=y
|
||||
CONFIG_DRIVERS_CAMERA_TRIGGER=y
|
||||
CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y
|
||||
CONFIG_COMMON_DISTANCE_SENSOR=y
|
||||
CONFIG_COMMON_HYGROMETERS=y
|
||||
CONFIG_DRIVERS_DSHOT=y
|
||||
CONFIG_DRIVERS_GPS=y
|
||||
CONFIG_DRIVERS_HEATER=y
|
||||
CONFIG_COMMON_HYGROMETERS=y
|
||||
CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=y
|
||||
CONFIG_DRIVERS_IMU_BOSCH_BMI055=y
|
||||
CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y
|
||||
@@ -57,6 +57,7 @@ CONFIG_MODULES_FLIGHT_MODE_MANAGER=y
|
||||
CONFIG_MODULES_FW_ATT_CONTROL=y
|
||||
CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y
|
||||
CONFIG_MODULES_FW_POS_CONTROL_L1=y
|
||||
CONFIG_MODULES_GIMBAL=y
|
||||
CONFIG_MODULES_GYRO_CALIBRATION=y
|
||||
CONFIG_MODULES_GYRO_FFT=y
|
||||
CONFIG_MODULES_LAND_DETECTOR=y
|
||||
@@ -80,7 +81,6 @@ CONFIG_MODULES_SIH=y
|
||||
CONFIG_MODULES_TEMPERATURE_COMPENSATION=y
|
||||
CONFIG_MODULES_UUV_ATT_CONTROL=y
|
||||
CONFIG_MODULES_UUV_POS_CONTROL=y
|
||||
CONFIG_MODULES_GIMBAL=y
|
||||
CONFIG_MODULES_VTOL_ATT_CONTROL=y
|
||||
CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y
|
||||
CONFIG_SYSTEMCMDS_BL_UPDATE=y
|
||||
|
||||
Binary file not shown.
@@ -1,3 +0,0 @@
|
||||
CONFIG_DRIVERS_HEATER=n
|
||||
CONFIG_DRIVERS_OSD=n
|
||||
CONFIG_MODULES_MICRORTPS_BRIDGE=y
|
||||
@@ -23,6 +23,7 @@ CONFIG_EXAMPLES_FAKE_GPS=n
|
||||
CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=n
|
||||
CONFIG_MODULES_CAMERA_FEEDBACK=n
|
||||
CONFIG_MODULES_ESC_BATTERY=n
|
||||
CONFIG_MODULES_EVENTS=n
|
||||
CONFIG_MODULES_GIMBAL=n
|
||||
CONFIG_MODULES_GYRO_CALIBRATION=n
|
||||
CONFIG_MODULES_GYRO_FFT=n
|
||||
@@ -31,6 +32,9 @@ CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=n
|
||||
CONFIG_MODULES_ROVER_POS_CONTROL=n
|
||||
CONFIG_MODULES_SIH=n
|
||||
CONFIG_MODULES_TEMPERATURE_COMPENSATION=n
|
||||
CONFIG_SYSTEMCMDS_DUMPFILE=n
|
||||
CONFIG_SYSTEMCMDS_GPIO=n
|
||||
CONFIG_SYSTEMCMDS_REFLECT=n
|
||||
CONFIG_SYSTEMCMDS_SERIAL_TEST=n
|
||||
CONFIG_BOARD_CONSTRAINED_FLASH=y
|
||||
CONFIG_BOARD_TESTING=y
|
||||
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
CONFIG_MODULES_MICRORTPS_BRIDGE=y
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
CONFIG_PLATFORM_ROS2=y
|
||||
@@ -1,6 +1,6 @@
|
||||
############################################################################
|
||||
#
|
||||
# Copyright (c) 2015 PX4 Development Team. All rights reserved.
|
||||
# Copyright (c) 2021 PX4 Development Team. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
@@ -30,10 +30,7 @@
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################################
|
||||
px4_add_module(
|
||||
MODULE drivers__protocol_splitter
|
||||
MAIN protocol_splitter
|
||||
SRCS
|
||||
protocol_splitter.cpp
|
||||
DEPENDS
|
||||
)
|
||||
|
||||
add_library(drivers_board
|
||||
init.cpp
|
||||
)
|
||||
@@ -1,7 +1,6 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (C) 2012 PX4 Development Team. All rights reserved.
|
||||
* Author: @author Lorenz Meier <lm@inf.ethz.ch>
|
||||
* Copyright (c) 2021 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -33,25 +32,19 @@
|
||||
****************************************************************************/
|
||||
|
||||
/**
|
||||
* @file conversions.c
|
||||
* Implementation of commonly used conversions.
|
||||
* @file board_config.h
|
||||
*
|
||||
* SITL internal definitions
|
||||
*/
|
||||
|
||||
#include <px4_platform_common/px4_config.h>
|
||||
#include <float.h>
|
||||
#pragma once
|
||||
|
||||
#include "conversions.h"
|
||||
#define BOARD_OVERRIDE_UUID "SIMULATIONID0000" // must be of length 16
|
||||
#define PX4_SOC_ARCH_ID PX4_SOC_ARCH_ID_SITL
|
||||
|
||||
int16_t
|
||||
int16_t_from_bytes(uint8_t bytes[])
|
||||
{
|
||||
union {
|
||||
uint8_t b[2];
|
||||
int16_t w;
|
||||
} u;
|
||||
#define BOARD_HAS_POWER_CONTROL 1
|
||||
|
||||
u.b[1] = bytes[0];
|
||||
u.b[0] = bytes[1];
|
||||
#define BOARD_NUMBER_BRICKS 0
|
||||
|
||||
return u.w;
|
||||
}
|
||||
#include <system_config.h>
|
||||
#include <px4_platform_common/board_common.h>
|
||||
@@ -1 +0,0 @@
|
||||
CONFIG_MODULES_MICRORTPS_BRIDGE=y
|
||||
+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()
|
||||
|
||||
@@ -47,7 +47,6 @@ import glob
|
||||
import json
|
||||
import math
|
||||
import os
|
||||
from px4tools import ulog
|
||||
import sys
|
||||
from mavros import mavlink
|
||||
from mavros_msgs.msg import Mavlink, Waypoint, WaypointReached
|
||||
@@ -295,17 +294,6 @@ class MavrosMissionTest(MavrosTestCommon):
|
||||
rospy.loginfo("mission done, calculating performance metrics")
|
||||
last_log = get_last_log()
|
||||
rospy.loginfo("log file {0}".format(last_log))
|
||||
data = ulog.read_ulog(last_log).concat(dt=0.1)
|
||||
data = ulog.compute_data(data)
|
||||
res = ulog.estimator_analysis(data, False)
|
||||
|
||||
# enforce performance
|
||||
self.assertTrue(abs(res['roll_error_mean']) < 5.0, str(res))
|
||||
self.assertTrue(abs(res['pitch_error_mean']) < 5.0, str(res))
|
||||
self.assertTrue(abs(res['yaw_error_mean']) < 5.0, str(res))
|
||||
self.assertTrue(res['roll_error_std'] < 5.0, str(res))
|
||||
self.assertTrue(res['pitch_error_std'] < 5.0, str(res))
|
||||
self.assertTrue(res['yaw_error_std'] < 5.0, str(res))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
@@ -20,6 +20,3 @@ uint8 GROUP_INDEX_PAYLOAD = 6
|
||||
|
||||
uint64 timestamp_sample # the timestamp the data this control response is based on was sampled
|
||||
float32[8] control
|
||||
|
||||
# TOPICS actuator_controls actuator_controls_0 actuator_controls_1 actuator_controls_2 actuator_controls_3
|
||||
# TOPICS actuator_controls_virtual_fw actuator_controls_virtual_mc
|
||||
@@ -6,5 +6,3 @@ uint8 INDEX_YAW = 2
|
||||
uint8 INDEX_THROTTLE = 3
|
||||
|
||||
float32[4] control_power
|
||||
|
||||
# TOPICS actuator_controls_status actuator_controls_status_0 actuator_controls_status_1
|
||||
@@ -3,6 +3,3 @@ uint8 NUM_ACTUATOR_OUTPUTS = 16
|
||||
uint8 NUM_ACTUATOR_OUTPUT_GROUPS = 4 # for sanity checking
|
||||
uint32 noutputs # valid outputs
|
||||
float32[16] output # output data, in natural output units
|
||||
|
||||
# actuator_outputs_sim is used for SITL, HITL & SIH (with an output range of [-1, 1])
|
||||
# TOPICS actuator_outputs actuator_outputs_sim
|
||||
+182
-241
@@ -1,6 +1,6 @@
|
||||
############################################################################
|
||||
#
|
||||
# Copyright (c) 2016 PX4 Development Team. All rights reserved.
|
||||
# Copyright (c) 2016-2022 PX4 Development Team. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
@@ -37,213 +37,179 @@ cmake_policy(SET CMP0057 NEW)
|
||||
include(px4_list_make_absolute)
|
||||
|
||||
set(msg_files
|
||||
action_request.msg
|
||||
actuator_armed.msg
|
||||
actuator_controls.msg
|
||||
actuator_controls_status.msg
|
||||
actuator_motors.msg
|
||||
actuator_outputs.msg
|
||||
actuator_servos.msg
|
||||
actuator_servos_trim.msg
|
||||
actuator_test.msg
|
||||
adc_report.msg
|
||||
airspeed.msg
|
||||
airspeed_validated.msg
|
||||
airspeed_wind.msg
|
||||
autotune_attitude_control_status.msg
|
||||
battery_status.msg
|
||||
camera_capture.msg
|
||||
camera_status.msg
|
||||
camera_trigger.msg
|
||||
cellular_status.msg
|
||||
collision_constraints.msg
|
||||
collision_report.msg
|
||||
commander_state.msg
|
||||
control_allocator_status.msg
|
||||
cpuload.msg
|
||||
differential_pressure.msg
|
||||
distance_sensor.msg
|
||||
ekf2_timestamps.msg
|
||||
estimator_gps_status.msg
|
||||
esc_report.msg
|
||||
esc_status.msg
|
||||
estimator_baro_bias.msg
|
||||
estimator_event_flags.msg
|
||||
estimator_innovations.msg
|
||||
estimator_optical_flow_vel.msg
|
||||
estimator_selector_status.msg
|
||||
estimator_sensor_bias.msg
|
||||
estimator_states.msg
|
||||
estimator_status.msg
|
||||
estimator_status_flags.msg
|
||||
event.msg
|
||||
follow_target.msg
|
||||
failure_detector_status.msg
|
||||
generator_status.msg
|
||||
geofence_result.msg
|
||||
gimbal_device_attitude_status.msg
|
||||
gimbal_device_information.msg
|
||||
gimbal_device_set_attitude.msg
|
||||
gimbal_manager_information.msg
|
||||
gimbal_manager_set_attitude.msg
|
||||
gimbal_manager_set_manual_control.msg
|
||||
gimbal_manager_status.msg
|
||||
gps_dump.msg
|
||||
gps_inject_data.msg
|
||||
heater_status.msg
|
||||
home_position.msg
|
||||
hover_thrust_estimate.msg
|
||||
internal_combustion_engine_status.msg
|
||||
input_rc.msg
|
||||
iridiumsbd_status.msg
|
||||
irlock_report.msg
|
||||
landing_gear.msg
|
||||
landing_target_innovations.msg
|
||||
landing_target_pose.msg
|
||||
led_control.msg
|
||||
log_message.msg
|
||||
logger_status.msg
|
||||
mag_worker_data.msg
|
||||
magnetometer_bias_estimate.msg
|
||||
manual_control_setpoint.msg
|
||||
manual_control_switches.msg
|
||||
mavlink_log.msg
|
||||
mavlink_tunnel.msg
|
||||
mission.msg
|
||||
mission_result.msg
|
||||
mount_orientation.msg
|
||||
navigator_mission_item.msg
|
||||
npfg_status.msg
|
||||
obstacle_distance.msg
|
||||
offboard_control_mode.msg
|
||||
onboard_computer_status.msg
|
||||
optical_flow.msg
|
||||
orbit_status.msg
|
||||
parameter_update.msg
|
||||
ping.msg
|
||||
pps_capture.msg
|
||||
position_controller_landing_status.msg
|
||||
position_controller_status.msg
|
||||
position_setpoint.msg
|
||||
position_setpoint_triplet.msg
|
||||
power_button_state.msg
|
||||
power_monitor.msg
|
||||
pwm_input.msg
|
||||
px4io_status.msg
|
||||
radio_status.msg
|
||||
rate_ctrl_status.msg
|
||||
rc_channels.msg
|
||||
rc_parameter_map.msg
|
||||
rpm.msg
|
||||
rtl_time_estimate.msg
|
||||
safety.msg
|
||||
satellite_info.msg
|
||||
sensor_accel.msg
|
||||
sensor_accel_fifo.msg
|
||||
sensor_baro.msg
|
||||
sensor_combined.msg
|
||||
sensor_correction.msg
|
||||
sensor_gps.msg
|
||||
sensor_gyro.msg
|
||||
sensor_gyro_fft.msg
|
||||
sensor_gyro_fifo.msg
|
||||
sensor_hygrometer.msg
|
||||
sensor_mag.msg
|
||||
sensor_preflight_mag.msg
|
||||
sensor_selection.msg
|
||||
sensors_status_imu.msg
|
||||
system_power.msg
|
||||
takeoff_status.msg
|
||||
task_stack_info.msg
|
||||
tecs_status.msg
|
||||
telemetry_status.msg
|
||||
test_motor.msg
|
||||
timesync.msg
|
||||
timesync_status.msg
|
||||
trajectory_bezier.msg
|
||||
trajectory_waypoint.msg
|
||||
transponder_report.msg
|
||||
tune_control.msg
|
||||
uavcan_parameter_request.msg
|
||||
uavcan_parameter_value.msg
|
||||
ulog_stream.msg
|
||||
ulog_stream_ack.msg
|
||||
vehicle_acceleration.msg
|
||||
vehicle_air_data.msg
|
||||
vehicle_angular_acceleration.msg
|
||||
vehicle_angular_acceleration_setpoint.msg
|
||||
vehicle_angular_velocity.msg
|
||||
vehicle_attitude.msg
|
||||
vehicle_attitude_setpoint.msg
|
||||
vehicle_command.msg
|
||||
vehicle_command_ack.msg
|
||||
vehicle_constraints.msg
|
||||
vehicle_control_mode.msg
|
||||
vehicle_global_position.msg
|
||||
vehicle_gps_position.msg
|
||||
vehicle_imu.msg
|
||||
vehicle_imu_status.msg
|
||||
vehicle_land_detected.msg
|
||||
vehicle_local_position.msg
|
||||
vehicle_local_position_setpoint.msg
|
||||
vehicle_magnetometer.msg
|
||||
vehicle_odometry.msg
|
||||
vehicle_rates_setpoint.msg
|
||||
vehicle_roi.msg
|
||||
vehicle_status.msg
|
||||
vehicle_status_flags.msg
|
||||
vehicle_thrust_setpoint.msg
|
||||
vehicle_torque_setpoint.msg
|
||||
vehicle_trajectory_bezier.msg
|
||||
vehicle_trajectory_waypoint.msg
|
||||
vtol_vehicle_status.msg
|
||||
wheel_encoders.msg
|
||||
wind.msg
|
||||
yaw_estimator_status.msg
|
||||
ActionRequest.msg
|
||||
ActuatorArmed.msg
|
||||
ActuatorControls.msg
|
||||
ActuatorControlsStatus.msg
|
||||
ActuatorMotors.msg
|
||||
ActuatorOutputs.msg
|
||||
ActuatorServos.msg
|
||||
ActuatorServosTrim.msg
|
||||
ActuatorTest.msg
|
||||
AdcReport.msg
|
||||
Airspeed.msg
|
||||
AirspeedValidated.msg
|
||||
AirspeedWind.msg
|
||||
AutotuneAttitudeControlStatus.msg
|
||||
BatteryStatus.msg
|
||||
CameraCapture.msg
|
||||
CameraStatus.msg
|
||||
CameraTrigger.msg
|
||||
CellularStatus.msg
|
||||
CollisionConstraints.msg
|
||||
CollisionReport.msg
|
||||
CommanderState.msg
|
||||
ControlAllocatorStatus.msg
|
||||
Cpuload.msg
|
||||
DebugArray.msg
|
||||
DebugKeyValue.msg
|
||||
DebugValue.msg
|
||||
DebugVect.msg
|
||||
DifferentialPressure.msg
|
||||
DistanceSensor.msg
|
||||
Ekf2Timestamps.msg
|
||||
EscReport.msg
|
||||
EscStatus.msg
|
||||
EstimatorBaroBias.msg
|
||||
EstimatorEventFlags.msg
|
||||
EstimatorGpsStatus.msg
|
||||
EstimatorInnovations.msg
|
||||
EstimatorOpticalFlowVel.msg
|
||||
EstimatorSelectorStatus.msg
|
||||
EstimatorSensorBias.msg
|
||||
EstimatorStates.msg
|
||||
EstimatorStatus.msg
|
||||
EstimatorStatusFlags.msg
|
||||
Event.msg
|
||||
FailureDetectorStatus.msg
|
||||
FollowTarget.msg
|
||||
GeneratorStatus.msg
|
||||
GeofenceResult.msg
|
||||
GimbalDeviceAttitudeStatus.msg
|
||||
GimbalDeviceInformation.msg
|
||||
GimbalDeviceSetAttitude.msg
|
||||
GimbalManagerInformation.msg
|
||||
GimbalManagerSetAttitude.msg
|
||||
GimbalManagerSetManualControl.msg
|
||||
GimbalManagerStatus.msg
|
||||
GpsDump.msg
|
||||
GpsInjectData.msg
|
||||
HeaterStatus.msg
|
||||
HomePosition.msg
|
||||
HoverThrustEstimate.msg
|
||||
InputRc.msg
|
||||
InternalCombustionEngineStatus.msg
|
||||
IridiumsbdStatus.msg
|
||||
IrlockReport.msg
|
||||
LandingGear.msg
|
||||
LandingTargetInnovations.msg
|
||||
LandingTargetPose.msg
|
||||
LedControl.msg
|
||||
LoggerStatus.msg
|
||||
LogMessage.msg
|
||||
MagnetometerBiasEstimate.msg
|
||||
MagWorkerData.msg
|
||||
ManualControlSetpoint.msg
|
||||
ManualControlSwitches.msg
|
||||
MavlinkLog.msg
|
||||
MavlinkTunnel.msg
|
||||
Mission.msg
|
||||
MissionResult.msg
|
||||
MountOrientation.msg
|
||||
NavigatorMissionItem.msg
|
||||
NpfgStatus.msg
|
||||
ObstacleDistance.msg
|
||||
OffboardControlMode.msg
|
||||
OnboardComputerStatus.msg
|
||||
OpticalFlow.msg
|
||||
OrbitStatus.msg
|
||||
OrbTest.msg
|
||||
OrbTestLarge.msg
|
||||
OrbTestMedium.msg
|
||||
ParameterUpdate.msg
|
||||
Ping.msg
|
||||
PositionControllerLandingStatus.msg
|
||||
PositionControllerStatus.msg
|
||||
PositionSetpoint.msg
|
||||
PositionSetpointTriplet.msg
|
||||
PowerButtonState.msg
|
||||
PowerMonitor.msg
|
||||
PpsCapture.msg
|
||||
PwmInput.msg
|
||||
Px4ioStatus.msg
|
||||
RadioStatus.msg
|
||||
RateCtrlStatus.msg
|
||||
RcChannels.msg
|
||||
RcParameterMap.msg
|
||||
Rpm.msg
|
||||
RtlTimeEstimate.msg
|
||||
Safety.msg
|
||||
SatelliteInfo.msg
|
||||
SensorAccel.msg
|
||||
SensorAccelFifo.msg
|
||||
SensorBaro.msg
|
||||
SensorCombined.msg
|
||||
SensorCorrection.msg
|
||||
SensorGps.msg
|
||||
SensorGyro.msg
|
||||
SensorGyroFft.msg
|
||||
SensorGyroFifo.msg
|
||||
SensorHygrometer.msg
|
||||
SensorMag.msg
|
||||
SensorPreflightMag.msg
|
||||
SensorSelection.msg
|
||||
SensorsStatusImu.msg
|
||||
SystemPower.msg
|
||||
TakeoffStatus.msg
|
||||
TaskStackInfo.msg
|
||||
TecsStatus.msg
|
||||
TelemetryStatus.msg
|
||||
TestMotor.msg
|
||||
Timesync.msg
|
||||
TimesyncStatus.msg
|
||||
TrajectoryBezier.msg
|
||||
TrajectoryWaypoint.msg
|
||||
TransponderReport.msg
|
||||
TuneControl.msg
|
||||
UavcanParameterRequest.msg
|
||||
UavcanParameterValue.msg
|
||||
UlogStream.msg
|
||||
UlogStreamAck.msg
|
||||
VehicleAcceleration.msg
|
||||
VehicleAirData.msg
|
||||
VehicleAngularAcceleration.msg
|
||||
VehicleAngularAccelerationSetpoint.msg
|
||||
VehicleAngularVelocity.msg
|
||||
VehicleAttitude.msg
|
||||
VehicleAttitudeSetpoint.msg
|
||||
VehicleCommand.msg
|
||||
VehicleCommandAck.msg
|
||||
VehicleConstraints.msg
|
||||
VehicleControlMode.msg
|
||||
VehicleGlobalPosition.msg
|
||||
VehicleGpsPosition.msg
|
||||
VehicleImu.msg
|
||||
VehicleImuStatus.msg
|
||||
VehicleLandDetected.msg
|
||||
VehicleLocalPosition.msg
|
||||
VehicleLocalPositionSetpoint.msg
|
||||
VehicleMagnetometer.msg
|
||||
VehicleOdometry.msg
|
||||
VehicleRatesSetpoint.msg
|
||||
VehicleRoi.msg
|
||||
VehicleStatus.msg
|
||||
VehicleStatusFlags.msg
|
||||
VehicleThrustSetpoint.msg
|
||||
VehicleTorqueSetpoint.msg
|
||||
VehicleTrajectoryBezier.msg
|
||||
VehicleTrajectoryWaypoint.msg
|
||||
VtolVehicleStatus.msg
|
||||
WheelEncoders.msg
|
||||
Wind.msg
|
||||
YawEstimatorStatus.msg
|
||||
)
|
||||
|
||||
if(NOT px4_constrained_flash_build)
|
||||
list(APPEND msg_files
|
||||
debug_array.msg
|
||||
debug_key_value.msg
|
||||
debug_value.msg
|
||||
debug_vect.msg
|
||||
)
|
||||
endif()
|
||||
|
||||
if(PX4_TESTING)
|
||||
list(APPEND msg_files
|
||||
orb_test.msg
|
||||
orb_test_large.msg
|
||||
orb_test_medium.msg
|
||||
)
|
||||
endif()
|
||||
|
||||
list(SORT msg_files)
|
||||
|
||||
set(deprecated_msgs
|
||||
ekf2_innovations.msg # 2019-11-22, Updated estimator interface and logging; replaced by 'estimator_innovations'.
|
||||
)
|
||||
|
||||
foreach(msg IN LISTS deprecated_msgs)
|
||||
if(msg IN_LIST msg_files)
|
||||
get_filename_component(msg_we ${msg} NAME_WE)
|
||||
list(APPEND invalid_msgs ${msg_we})
|
||||
endif()
|
||||
endforeach()
|
||||
if(invalid_msgs)
|
||||
list(LENGTH invalid_msgs invalid_msgs_size)
|
||||
if(${invalid_msgs_size} GREATER 1)
|
||||
foreach(msg IN LISTS invalid_msgs)
|
||||
string(CONCAT invalid_msgs_cs ${invalid_msgs_cs} "'${msg}', ")
|
||||
endforeach()
|
||||
STRING(REGEX REPLACE ", +$" "" invalid_msgs_cs ${invalid_msgs_cs})
|
||||
message(FATAL_ERROR "${invalid_msgs_cs} are listed as deprecated. Please use different names for the messages.")
|
||||
else()
|
||||
message(FATAL_ERROR "'${invalid_msgs}' is listed as deprecated. Please use a different name for the message.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
px4_list_make_absolute(msg_files ${CMAKE_CURRENT_SOURCE_DIR} ${msg_files})
|
||||
|
||||
if(NOT EXTERNAL_MODULES_LOCATION STREQUAL "")
|
||||
@@ -258,40 +224,40 @@ if(NOT EXTERNAL_MODULES_LOCATION STREQUAL "")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# set parent scope msg_files for other modules to consume (eg topic_listener)
|
||||
set(msg_files ${msg_files} PARENT_SCOPE)
|
||||
|
||||
# headers
|
||||
set(msg_out_path ${PX4_BINARY_DIR}/uORB/topics)
|
||||
set(msg_source_out_path ${CMAKE_CURRENT_BINARY_DIR}/topics_sources)
|
||||
|
||||
set(uorb_headers ${msg_out_path}/uORBTopics.hpp)
|
||||
set(uorb_sources ${msg_source_out_path}/uORBTopics.cpp)
|
||||
set(uorb_headers)
|
||||
foreach(msg_file ${msg_files})
|
||||
get_filename_component(msg ${msg_file} NAME_WE)
|
||||
|
||||
# Pascal case to snake case (MsgFile -> msg_file)
|
||||
string(REGEX REPLACE "(.)([A-Z][a-z]+)" "\\1_\\2" msg "${msg}")
|
||||
string(REGEX REPLACE "([a-z0-9])([A-Z])" "\\1_\\2" msg "${msg}")
|
||||
string(TOLOWER "${msg}" msg)
|
||||
|
||||
list(APPEND uorb_headers ${msg_out_path}/${msg}.h)
|
||||
list(APPEND uorb_sources ${msg_source_out_path}/${msg}.cpp)
|
||||
endforeach()
|
||||
|
||||
if (px4_constrained_flash_build)
|
||||
if(px4_constrained_flash_build)
|
||||
set(added_arguments --constrained-flash)
|
||||
endif()
|
||||
|
||||
# set parent scope msg_files for other modules to consume (eg topic_listener)
|
||||
set(msg_files ${msg_files} PARENT_SCOPE)
|
||||
|
||||
# Generate uORB headers
|
||||
add_custom_command(OUTPUT ${uorb_headers}
|
||||
COMMAND ${PYTHON_EXECUTABLE} tools/px_generate_uorb_topic_files.py
|
||||
--headers
|
||||
-f ${msg_files}
|
||||
-i ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
-o ${msg_out_path}
|
||||
-e templates/uorb
|
||||
-t ${CMAKE_CURRENT_BINARY_DIR}/tmp/headers
|
||||
-q
|
||||
${added_arguments}
|
||||
DEPENDS
|
||||
${msg_files}
|
||||
templates/uorb/msg.h.em
|
||||
templates/uorb/uORBTopics.hpp.em
|
||||
tools/px_generate_uorb_topic_files.py
|
||||
tools/px_generate_uorb_topic_helper.py
|
||||
COMMENT "Generating uORB topic headers"
|
||||
@@ -299,28 +265,3 @@ add_custom_command(OUTPUT ${uorb_headers}
|
||||
VERBATIM
|
||||
)
|
||||
add_custom_target(uorb_headers DEPENDS ${uorb_headers})
|
||||
|
||||
# Generate uORB sources
|
||||
add_custom_command(OUTPUT ${uorb_sources}
|
||||
COMMAND ${PYTHON_EXECUTABLE} tools/px_generate_uorb_topic_files.py
|
||||
--sources
|
||||
-f ${msg_files}
|
||||
-i ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
-o ${msg_source_out_path}
|
||||
-e templates/uorb
|
||||
-t ${CMAKE_CURRENT_BINARY_DIR}/tmp/sources
|
||||
-q
|
||||
${added_arguments}
|
||||
DEPENDS
|
||||
${msg_files}
|
||||
templates/uorb/msg.cpp.em
|
||||
templates/uorb/uORBTopics.cpp.em
|
||||
tools/px_generate_uorb_topic_files.py
|
||||
tools/px_generate_uorb_topic_helper.py
|
||||
COMMENT "Generating uORB topic sources"
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
add_library(uorb_msgs ${uorb_sources})
|
||||
add_dependencies(uorb_msgs prebuild_targets uorb_headers)
|
||||
|
||||
@@ -5,5 +5,3 @@ uint32 seq # Image sequence number
|
||||
bool feedback # Trigger feedback from camera
|
||||
|
||||
uint32 ORB_QUEUE_LENGTH = 2
|
||||
|
||||
# TOPICS camera_trigger
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user