Rebase changes on upstream master

This brings in many of the changes from the PX4 fork on ATLFLight.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
Mark Charlebois
2016-01-18 23:16:31 -08:00
committed by Julian Oes
parent efe9344fc2
commit 9f3bf8e9f4
71 changed files with 2734 additions and 564 deletions
+9 -8
View File
@@ -90,7 +90,7 @@ include(CMakeParseArguments)
# endfunction()
#
# test(NAME "hello" LIST a b c)
#
#
# OUTPUT:
# name: hello
# list: a b c
@@ -349,11 +349,11 @@ function(px4_generate_messages)
list(APPEND msg_files_out ${msg_out_path}/${msg}.h)
endforeach()
add_custom_command(OUTPUT ${msg_files_out}
COMMAND ${PYTHON_EXECUTABLE}
COMMAND ${PYTHON_EXECUTABLE}
Tools/px_generate_uorb_topic_headers.py
${QUIET}
-d msg
-o ${msg_out_path}
-o ${msg_out_path}
-e msg/templates/uorb
-t ${CMAKE_BINARY_DIR}/topics_temporary
DEPENDS ${DEPENDS} ${MSG_FILES}
@@ -370,11 +370,11 @@ function(px4_generate_messages)
list(APPEND msg_multi_files_out ${msg_multi_out_path}/px4_${msg}.h)
endforeach()
add_custom_command(OUTPUT ${msg_multi_files_out}
COMMAND ${PYTHON_EXECUTABLE}
COMMAND ${PYTHON_EXECUTABLE}
Tools/px_generate_uorb_topic_headers.py
${QUIET}
-d msg
-o ${msg_multi_out_path}
-o ${msg_multi_out_path}
-e msg/templates/px4/uorb
-t ${CMAKE_BINARY_DIR}/multi_topics_temporary/${OS}
-p "px4_"
@@ -556,6 +556,7 @@ function(px4_add_common_flags)
-funsafe-math-optimizations
-ffunction-sections
-fdata-sections
-fPIC
)
endif()
@@ -685,7 +686,7 @@ endfunction()
# Input:
# dirname : path to module dir
#
# Output:
# Output:
# newname : module name
#
# Example:
@@ -716,8 +717,8 @@ endfunction()
function(px4_create_git_hash_header)
px4_parse_function_args(
NAME px4_create_git_hash_header
ONE_VALUE HEADER
REQUIRED HEADER
ONE_VALUE HEADER
REQUIRED HEADER
ARGN ${ARGN})
execute_process(
COMMAND git rev-parse HEAD
@@ -83,6 +83,7 @@ set(config_module_list
modules/attitude_estimator_q
modules/ekf_att_pos_estimator
modules/position_estimator_inav
modules/ekf2
#
# Vehicle Control
+3
View File
@@ -1,6 +1,9 @@
include(posix/px4_impl_posix)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-linux-gnueabihf.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/cmake_hexagon/qurt_app.cmake)
set(CONFIG_SHMEM "1")
set(config_module_list
drivers/device
+9
View File
@@ -16,8 +16,14 @@ set(CMAKE_PROGRAM_PATH
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-linux-gnueabihf.cmake)
set(CONFIG_SHMEM "1")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DENABLE_SHMEM")
set(config_module_list
drivers/device
drivers/boards/sitl
drivers/led
systemcmds/param
systemcmds/ver
@@ -28,6 +34,9 @@ set(config_module_list
modules/systemlib
modules/uORB
modules/dataman
modules/sdlog2
modules/simulator
modules/commander
lib/mathlib
lib/mathlib/math/filter
+30 -10
View File
@@ -1,18 +1,38 @@
include(qurt/px4_impl_qurt)
if ("${HEXAGON_DRIVERS_ROOT}" STREQUAL "")
message(FATAL_ERROR "HEXAGON_DRIVERS_ROOT is not set")
if ("$ENV{EAGLE_ADDON_ROOT}" STREQUAL "")
message(FATAL_ERROR "Enviroment variable EAGLE_ADDON_ROOT must be set")
else()
set(EAGLE_ADDON_ROOT $ENV{EAGLE_ADDON_ROOT})
endif()
if ("${EAGLE_DRIVERS_SRC}" STREQUAL "")
message(FATAL_ERROR "EAGLE_DRIVERS_SRC is not set")
if ("$ENV{HEXAGON_SDK_ROOT}" STREQUAL "")
message(FATAL_ERROR "Enviroment variable HEXAGON_SDK_ROOT must be set")
else()
set(HEXAGON_SDK_ROOT $ENV{HEXAGON_SDK_ROOT})
endif()
include_directories(${HEXAGON_DRIVERS_ROOT}/inc)
if ("$ENV{EAGLE_DRIVERS_SRC}" STREQUAL "")
message(FATAL_ERROR "Environment variable EAGLE_DRIVERS_SRC must be set")
else()
set(EAGLE_DRIVERS_SRC $ENV{EAGLE_DRIVERS_SRC})
endif()
STRING(REGEX REPLACE "//" "/" EAGLE_DRIVERS_SRC ${EAGLE_DRIVERS_SRC})
STRING(REGEX REPLACE "/" "__" EAGLE_DRIVERS_MODULE_PREFIX ${EAGLE_DRIVERS_SRC})
include_directories(${EAGLE_ADDON_ROOT}/flight_controller/hexagon/inc)
include_directories(${HEXAGON_SDK_ROOT}/lib/common/qurt/ADSPv5MP/include)
message("hexagon_sdk_root is ${HEXAGON_SDK_ROOT}")
set(QURT_ENABLE_STUBS "0")
set(CONFIG_SHMEM "1")
# For Actual flight we need to link against the driver dynamic libraries
set(target_libraries
-L${HEXAGON_DRIVERS_ROOT}/libs
-L${EAGLE_ADDON_ROOT}/flight_controller/hexagon/libs
mpu9x50
uart_esc
csr_gps
@@ -29,10 +49,10 @@ set(config_module_list
#
drivers/device
modules/sensors
$(EAGLE_DRIVERS_SRC)/mpu9x50
$(EAGLE_DRIVERS_SRC)/uart_esc
$(EAGLE_DRIVERS_SRC)/rc_receiver
$(EAGLE_DRIVERS_SRC)/csr_gps
${EAGLE_DRIVERS_SRC}/mpu9x50
${EAGLE_DRIVERS_SRC}/uart_esc
${EAGLE_DRIVERS_SRC}/rc_receiver
${EAGLE_DRIVERS_SRC}/csr_gps
#
# System commands
+9 -1
View File
@@ -1,11 +1,19 @@
include(qurt/px4_impl_qurt)
# Run a full link with build stubs to make sure qurt target isn't broken
set(QURT_ENABLE_STUBS "1")
set(QURT_ENABLE_STUBS "0")
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/cmake_hexagon/toolchain/Toolchain-qurt.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/cmake_hexagon/qurt_app.cmake)
if ("$ENV{HEXAGON_SDK_ROOT}" STREQUAL "")
message(FATAL_ERROR "Enviroment variable HEXAGON_SDK_ROOT must be set")
else()
set(HEXAGON_SDK_ROOT $ENV{HEXAGON_SDK_ROOT})
endif()
include_directories(${HEXAGON_SDK_ROOT}/lib/common/qurt/ADSPv5MP/include)
set(config_module_list
drivers/device
drivers/boards/sitl
+22
View File
@@ -182,6 +182,7 @@ if(UNIX AND APPLE)
else()
set(added_definitions
-D__PX4_POSIX
-D__PX4_LINUX
@@ -196,12 +197,33 @@ else()
)
endif()
if ("${BOARD}" STREQUAL "eagle")
if ("$ENV{HEXAGON_ARM_SYSROOT}" STREQUAL "")
message(FATAL_ERROR "HEXAGON_ARM_SYSROOT not set")
else()
set(HEXAGON_ARM_SYSROOT $ENV{HEXAGON_ARM_SYSROOT})
endif()
# Add the toolchain specific flags
set(HEXAGON_ARM_SYSROOT ${HEXAGON_SDK_ROOT}/sysroot)
set(added_cflags ${POSIX_CMAKE_C_FLAGS} --sysroot=${HEXAGON_ARM_SYSROOT})
set(added_cxx_flags ${POSIX_CMAKE_CXX_FLAGS} --sysroot=${HEXAGON_ARM_SYSROOT})
list(APPEND added_exe_linker_flags
-Wl,-rpath-link,${HEXAGON_ARM_SYSROOT}/usr/lib/arm-linux-gnueabihf
-Wl,-rpath-link,${HEXAGON_ARM_SYSROOT}/lib/arm-linux-gnueabihf
--sysroot=${HEXAGON_ARM_SYSROOT}
)
else()
# Add the toolchain specific flags
set(added_cflags ${POSIX_CMAKE_C_FLAGS})
set(added_cxx_flags ${POSIX_CMAKE_CXX_FLAGS})
endif()
# output
foreach(var ${inout_vars})
string(TOLOWER ${var} lower_var)
+2 -2
View File
@@ -36,9 +36,9 @@ ${builtin_apps_string}
void list_builtins(map<string,px4_main_t> &apps)
{
printf("Builtin Commands:\\n");
PX4_INFO("Builtin Commands:\\n");
for (map<string,px4_main_t>::iterator it=apps.begin(); it!=apps.end(); ++it)
printf("\\t%s\\n", (it->first).c_str());
PX4_INFO("%s : 0x%x\n", (it->first).c_str(), it->second);
}
static int shutdown_main(int argc, char *argv[])
+2 -2
View File
@@ -158,7 +158,7 @@ function(px4_os_add_flags)
LINK_DIRS ${LINK_DIRS}
DEFINITIONS ${DEFINITIONS})
set(DSPAL_ROOT src/lib/dspal)
set(DSPAL_ROOT src/lib/DriverFramework/dspal)
set(added_include_dirs
${DSPAL_ROOT}/include
${DSPAL_ROOT}/sys
@@ -222,7 +222,7 @@ function(px4_os_prebuild_targets)
ONE_VALUE OUT BOARD THREADS
REQUIRED OUT BOARD
ARGN ${ARGN})
add_custom_target(${OUT} DEPENDS git_dspal)
add_custom_target(${OUT} DEPENDS git_driverframework)
endfunction()
-1
View File
@@ -45,4 +45,3 @@
#
# The macros are called from the top level CMakeLists.txt
#
px4_add_git_submodule(TARGET git_dspal PATH "src/lib/dspal")
@@ -17,6 +17,12 @@
include(CMakeForceCompiler)
if ("$ENV{HEXAGON_SDK_ROOT}" STREQUAL "")
message(FATAL_ERROR "HEXAGON_SDK_ROOT not set")
else()
set(HEXAGON_TOOLS_ROOT $ENV{HEXAGON_SDK_ROOT})
endif()
# this one is important
set(CMAKE_SYSTEM_NAME Generic)
@@ -24,13 +30,19 @@ set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_VERSION 1)
# specify the cross compiler
find_program(C_COMPILER arm-linux-gnueabihf-gcc)
find_program(C_COMPILER arm-linux-gnueabihf-gcc
PATHS ${HEXAGON_SDK_ROOT}/gcc-linaro-arm-linux-gnueabihf-4.8-2013.08_linux/bin
NO_DEFAULT_PATH
)
if(NOT C_COMPILER)
message(FATAL_ERROR "could not find arm-linux-gnueabihf-gcc compiler")
endif()
cmake_force_c_compiler(${C_COMPILER} GNU)
find_program(CXX_COMPILER arm-linux-gnueabihf-g++)
find_program(CXX_COMPILER arm-linux-gnueabihf-g++
PATHS ${HEXAGON_SDK_ROOT}/gcc-linaro-arm-linux-gnueabihf-4.8-2013.08_linux/bin
NO_DEFAULT_PATH
)
if(NOT CXX_COMPILER)
message(FATAL_ERROR "could not find arm-linux-gnueabihf-g++ compiler")
endif()
@@ -39,7 +51,10 @@ cmake_force_cxx_compiler(${CXX_COMPILER} GNU)
# compiler tools
foreach(tool objcopy nm ld)
string(TOUPPER ${tool} TOOL)
find_program(${TOOL} arm-linux-gnueabihf-${tool})
find_program(${TOOL} arm-linux-gnueabihf-${tool}
PATHS ${HEXAGON_SDK_ROOT}/gcc-linaro-arm-linux-gnueabihf-4.8-2013.08_linux/bin
NO_DEFAULT_PATH
)
if(NOT ${TOOL})
message(FATAL_ERROR "could not find arm-linux-gnueabihf-${tool}")
endif()
@@ -54,8 +69,11 @@ foreach(tool echo patch grep rm mkdir nm genromfs cp touch make unzip)
endif()
endforeach()
set(C_FLAGS "--sysroot=${HEXAGON_SDK_ROOT}/sysroot")
set(LINKER_FLAGS "-Wl,-gc-sections")
set(CMAKE_EXE_LINKER_FLAGS ${LINKER_FLAGS})
set(CMAKE_C_FLAGS ${C_FLAGS})
set(CMAKE_CXX_LINKER_FLAGS ${C_FLAGS})
# where is the target environment
set(CMAKE_FIND_ROOT_PATH get_file_component(${C_COMPILER} PATH))