This repository has been archived by the owner on Mar 22, 2019. It is now read-only.
forked from PX4/PX4-Autopilot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
02ba331
commit 529460d
Showing
8 changed files
with
245 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
if [[ "$#" < 2 ]]; then | ||
echo "usage: scp_upload.sh SRC1 [SRC2 ...] DEST" | ||
exit | ||
fi | ||
|
||
echo "Uploading..." | ||
|
||
# Get last argument | ||
for last; do true; done | ||
|
||
# Go through source files and push them one by one. | ||
i=0 | ||
for arg | ||
do | ||
if [[ $((i+1)) == "$#" ]]; then | ||
break | ||
fi | ||
# echo "Pushing $arg to $last" | ||
#adb push $arg $last | ||
scp $arg pi@px4autopilot:$last | ||
((i+=1)) | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,109 @@ | ||
include(posix/px4_impl_posix) | ||
|
||
if ("${RPI_TOOLCHAIN_DIR}" STREQUAL "") | ||
set(RPI_TOOLCHAIN_DIR /opt/rpi_toolchain) | ||
endif() | ||
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-linux-gnueabihf-raspbian.cmake) | ||
|
||
set(CMAKE_PROGRAM_PATH | ||
"${RPI_TOOLCHAIN_DIR}/gcc-linaro-arm-linux-gnueabihf-raspbian/bin" | ||
${CMAKE_PROGRAM_PATH} | ||
) | ||
|
||
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-linux-gnueabihf.cmake) | ||
# This definition allows to differentiate if this just the usual POSIX build | ||
# or if it is for the RPi. | ||
add_definitions( | ||
-D__PX4_POSIX_RPI2 | ||
) | ||
|
||
set(config_module_list | ||
# | ||
# Board support modules | ||
# | ||
drivers/device | ||
platforms/common | ||
platforms/posix/px4_layer | ||
platforms/posix/work_queue | ||
modules/sensors | ||
platforms/posix/drivers/df_mpu9250_wrapper | ||
platforms/posix/drivers/df_bmp280_wrapper | ||
platforms/posix/drivers/df_hmc5883_wrapper | ||
platforms/posix/drivers/df_trone_wrapper | ||
platforms/posix/drivers/df_isl29501_wrapper | ||
|
||
# | ||
# System commands | ||
# | ||
systemcmds/param | ||
systemcmds/mixer | ||
systemcmds/ver | ||
systemcmds/esc_calib | ||
systemcmds/reboot | ||
systemcmds/topic_listener | ||
systemcmds/perf | ||
modules/uORB | ||
modules/param | ||
modules/systemlib | ||
modules/systemlib/mixer | ||
modules/sensors | ||
modules/mavlink | ||
|
||
# | ||
# Estimation modules (EKF/ SO3 / other filters) | ||
# | ||
#modules/attitude_estimator_ekf | ||
modules/ekf_att_pos_estimator | ||
modules/attitude_estimator_q | ||
modules/position_estimator_inav | ||
modules/navigator | ||
modules/vtol_att_control | ||
modules/mc_pos_control | ||
modules/local_position_estimator | ||
modules/ekf2 | ||
|
||
# | ||
# Vehicle Control | ||
# | ||
modules/mc_att_control | ||
modules/land_detector | ||
modules/mc_pos_control | ||
modules/fw_att_control | ||
modules/fw_pos_control_l1 | ||
modules/dataman | ||
modules/fw_pos_control_l1 | ||
modules/vtol_att_control | ||
|
||
# | ||
# Library modules | ||
# | ||
modules/sdlog2 | ||
modules/logger | ||
modules/commander | ||
modules/load_mon | ||
modules/param | ||
modules/systemlib | ||
modules/systemlib/mixer | ||
modules/uORB | ||
modules/dataman | ||
modules/land_detector | ||
modules/navigator | ||
modules/mavlink | ||
|
||
# | ||
# PX4 drivers | ||
# | ||
|
||
# | ||
# Libraries | ||
# | ||
lib/controllib | ||
lib/mathlib | ||
lib/mathlib/math/filter | ||
lib/conversion | ||
lib/ecl | ||
lib/external_lgpl | ||
lib/geo | ||
lib/ecl | ||
lib/geo_lookup | ||
lib/launchdetection | ||
lib/external_lgpl | ||
lib/conversion | ||
lib/terrain_estimation | ||
lib/runway_takeoff | ||
lib/tailsitter_recovery | ||
lib/DriverFramework/framework | ||
) | ||
|
||
# | ||
# POSIX | ||
# | ||
platforms/common | ||
platforms/posix/px4_layer | ||
platforms/posix/work_queue | ||
|
||
) | ||
|
||
set(config_df_driver_list | ||
mpu9250 | ||
bmp280 | ||
hmc5883 | ||
trone | ||
isl29501 | ||
) |
86 changes: 86 additions & 0 deletions
86
cmake/toolchains/Toolchain-arm-linux-gnueabihf-raspbian.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# defines: | ||
# | ||
# NM | ||
# OBJCOPY | ||
# LD | ||
# CXX_COMPILER | ||
# C_COMPILER | ||
# CMAKE_SYSTEM_NAME | ||
# CMAKE_SYSTEM_VERSION | ||
# GENROMFS | ||
# LINKER_FLAGS | ||
# CMAKE_EXE_LINKER_FLAGS | ||
# CMAKE_FIND_ROOT_PATH | ||
# CMAKE_FIND_ROOT_PATH_MODE_PROGRAM | ||
# CMAKE_FIND_ROOT_PATH_MODE_LIBRARY | ||
# CMAKE_FIND_ROOT_PATH_MODE_INCLUDE | ||
|
||
include(CMakeForceCompiler) | ||
|
||
if ("$ENV{RPI_TOOLCHAIN_DIR}" STREQUAL "") | ||
message(FATAL_ERROR "RPI_TOOLCHAIN_DIR not set") | ||
else() | ||
set(RPI_TOOLCHAIN_DIR $ENV{RPI_TOOLCHAIN_DIR}) | ||
endif() | ||
|
||
# this one is important | ||
set(CMAKE_SYSTEM_NAME Generic) | ||
|
||
#this one not so much | ||
set(CMAKE_SYSTEM_VERSION 1) | ||
|
||
# specify the cross compiler | ||
find_program(C_COMPILER arm-linux-gnueabihf-gcc | ||
PATHS ${RPI_TOOLCHAIN_DIR}/gcc-linaro-arm-linux-gnueabihf-raspbian/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++ | ||
PATHS ${RPI_TOOLCHAIN_DIR}/gcc-linaro-arm-linux-gnueabihf-raspbian/bin | ||
NO_DEFAULT_PATH | ||
) | ||
|
||
if(NOT CXX_COMPILER) | ||
message(FATAL_ERROR "could not find arm-linux-gnueabihf-g++ compiler") | ||
endif() | ||
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} | ||
PATHS ${RPI_TOOLCHAIN_DIR}/gcc-linaro-arm-linux-gnueabihf-raspbian/bin | ||
NO_DEFAULT_PATH | ||
) | ||
if(NOT ${TOOL}) | ||
message(FATAL_ERROR "could not find arm-linux-gnueabihf-${tool}") | ||
endif() | ||
endforeach() | ||
|
||
# os tools | ||
foreach(tool echo patch grep rm mkdir nm genromfs cp touch make unzip) | ||
string(TOUPPER ${tool} TOOL) | ||
find_program(${TOOL} ${tool}) | ||
if(NOT ${TOOL}) | ||
message(FATAL_ERROR "could not find ${TOOL}") | ||
endif() | ||
endforeach() | ||
|
||
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)) | ||
|
||
# search for programs in the build host directories | ||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
# for libraries and headers in the target directories | ||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
uorb start | ||
param set SYS_AUTOSTART 4001 | ||
sleep 1 | ||
param set MAV_TYPE 2 | ||
df_mpu9250_wrapper start | ||
df_hmc5883_wrapper start | ||
sensors start | ||
commander start | ||
ekf2 start | ||
land_detector start multicopter | ||
mc_pos_control start | ||
mc_att_control start | ||
mavlink start -u 14556 -r 1000000 | ||
sleep 1 | ||
mavlink stream -u 14556 -s HIGHRES_IMU -r 50 | ||
mavlink stream -u 14556 -s ATTITUDE -r 50 | ||
mavlink boot_complete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters