From d90ac975a7f461979acc9f3e971007141445a986 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Sat, 4 Aug 2018 17:26:05 +0200 Subject: [PATCH] posix shell: required updates for RPi, bepob, ocpoc, eagle & exxcelsior - RPi works - the rest is not tested, and requires a bit more (such as uploading the bin/ directory) --- platforms/posix/CMakeLists.txt | 4 ++-- posix-configs/bebop/px4.config | 10 +++++++++- posix-configs/eagle/200qx/mainapp.config | 6 ++++++ posix-configs/eagle/210qc/mainapp.config | 6 ++++++ posix-configs/eagle/flight/mainapp.config | 6 ++++++ posix-configs/excelsior/mainapp.config | 5 +++++ posix-configs/ocpoc/px4.config | 10 +++++++++- posix-configs/rpi/px4.config | 21 +++++++++++++++++---- posix-configs/rpi/px4_fw.config | 5 +++++ posix-configs/rpi/px4_hil.config | 5 +++++ posix-configs/rpi/px4_no_shield.config | 5 +++++ 11 files changed, 75 insertions(+), 8 deletions(-) diff --git a/platforms/posix/CMakeLists.txt b/platforms/posix/CMakeLists.txt index 922298980c..25471c07dd 100644 --- a/platforms/posix/CMakeLists.txt +++ b/platforms/posix/CMakeLists.txt @@ -46,7 +46,7 @@ if (("${BOARD}" STREQUAL "eagle") OR ("${BOARD}" STREQUAL "excelsior")) ) add_custom_target(upload - COMMAND ${PX4_SOURCE_DIR}/Tools/adb_upload.sh $ ${PX4_SOURCE_DIR}/posix-configs/eagle/flight/mainapp.config /home/linaro + COMMAND ${PX4_SOURCE_DIR}/Tools/adb_upload.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${PX4_SOURCE_DIR}/posix-configs/eagle/flight/mainapp.config /home/linaro DEPENDS px4 COMMENT "uploading px4" USES_TERMINAL @@ -75,7 +75,7 @@ endif() if ("${BOARD}" STREQUAL "rpi") add_custom_target(upload - COMMAND scp -r $ ${PX4_SOURCE_DIR}/posix-configs/rpi/*.config ${PX4_SOURCE_DIR}/ROMFS pi@"ENV{AUTOPILOT_HOST}":/home/pi + COMMAND rsync -arh --progress ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${PX4_SOURCE_DIR}/posix-configs/rpi/*.config ${PX4_SOURCE_DIR}/ROMFS pi@"$ENV{AUTOPILOT_HOST}":/home/pi DEPENDS px4 COMMENT "uploading px4" USES_TERMINAL diff --git a/posix-configs/bebop/px4.config b/posix-configs/bebop/px4.config index 9e20c39ad2..55e4340bc9 100644 --- a/posix-configs/bebop/px4.config +++ b/posix-configs/bebop/px4.config @@ -1,6 +1,14 @@ +#!/usr/bin/bash +# PX4 commands need the 'px4-' prefix in bash. +# (px4-alias.sh is expected to be in the PATH) +source px4-alias.sh + uorb start param select /home/root/parameters -param load +if [ -f /home/root/parameters ] +then + param load +fi param set SYS_AUTOSTART 4013 param set MAV_BROADCAST 1 param set MAV_TYPE 3 diff --git a/posix-configs/eagle/200qx/mainapp.config b/posix-configs/eagle/200qx/mainapp.config index 94c0fb3f5e..eca8d025ed 100644 --- a/posix-configs/eagle/200qx/mainapp.config +++ b/posix-configs/eagle/200qx/mainapp.config @@ -1,3 +1,9 @@ +#!/usr/bin/bash + +# PX4 commands need the 'px4-' prefix in bash. +# (px4-alias.sh is expected to be in the PATH) +source px4-alias.sh + uorb start muorb start logger start -t -b 200 diff --git a/posix-configs/eagle/210qc/mainapp.config b/posix-configs/eagle/210qc/mainapp.config index 94c0fb3f5e..eca8d025ed 100644 --- a/posix-configs/eagle/210qc/mainapp.config +++ b/posix-configs/eagle/210qc/mainapp.config @@ -1,3 +1,9 @@ +#!/usr/bin/bash + +# PX4 commands need the 'px4-' prefix in bash. +# (px4-alias.sh is expected to be in the PATH) +source px4-alias.sh + uorb start muorb start logger start -t -b 200 diff --git a/posix-configs/eagle/flight/mainapp.config b/posix-configs/eagle/flight/mainapp.config index 94c0fb3f5e..eca8d025ed 100644 --- a/posix-configs/eagle/flight/mainapp.config +++ b/posix-configs/eagle/flight/mainapp.config @@ -1,3 +1,9 @@ +#!/usr/bin/bash + +# PX4 commands need the 'px4-' prefix in bash. +# (px4-alias.sh is expected to be in the PATH) +source px4-alias.sh + uorb start muorb start logger start -t -b 200 diff --git a/posix-configs/excelsior/mainapp.config b/posix-configs/excelsior/mainapp.config index 73833c2a6c..415bc5b420 100644 --- a/posix-configs/excelsior/mainapp.config +++ b/posix-configs/excelsior/mainapp.config @@ -1,3 +1,8 @@ +#!/usr/bin/bash +# PX4 commands need the 'px4-' prefix in bash. +# (px4-alias.sh is expected to be in the PATH) +source px4-alias.sh + uorb start muorb start logger start -e -t diff --git a/posix-configs/ocpoc/px4.config b/posix-configs/ocpoc/px4.config index 34fb225aa7..af40c1406b 100644 --- a/posix-configs/ocpoc/px4.config +++ b/posix-configs/ocpoc/px4.config @@ -1,7 +1,15 @@ +#!/usr/bin/bash +# PX4 commands need the 'px4-' prefix in bash. +# (px4-alias.sh is expected to be in the PATH) +source px4-alias.sh + uorb start param select /root/rootfs/eeprom/parameters -param load +if [ -f /root/rootfs/eeprom/parameters ] +then + param load +fi param set SYS_AUTOSTART 4001 param set MAV_BROADCAST 1 param set MAV_TYPE 2 diff --git a/posix-configs/rpi/px4.config b/posix-configs/rpi/px4.config index 0182cce846..cdcfcf9494 100644 --- a/posix-configs/rpi/px4.config +++ b/posix-configs/rpi/px4.config @@ -1,6 +1,14 @@ +#!/usr/bin/bash +# PX4 commands need the 'px4-' prefix in bash. +# (px4-alias.sh is expected to be in the PATH) +source px4-alias.sh + # navio config for a quad uorb start -param load +if [ -f eeprom/parameters ] +then + param load +fi param set SYS_AUTOSTART 4001 param set MAV_BROADCAST 1 param set MAV_TYPE 2 @@ -27,9 +35,14 @@ mc_att_control start mavlink start -x -u 14556 -r 1000000 mavlink stream -u 14556 -s HIGHRES_IMU -r 50 mavlink stream -u 14556 -s ATTITUDE -r 50 -mavlink start -x -d /dev/ttyUSB0 -mavlink stream -d /dev/ttyUSB0 -s HIGHRES_IMU -r 50 -mavlink stream -d /dev/ttyUSB0 -s ATTITUDE -r 50 + +if [ -f /dev/ttyUSB0 ] +then + mavlink start -x -d /dev/ttyUSB0 + mavlink stream -d /dev/ttyUSB0 -s HIGHRES_IMU -r 50 + mavlink stream -d /dev/ttyUSB0 -s ATTITUDE -r 50 +fi + navio_sysfs_rc_in start linux_pwm_out start logger start -t -b 200 diff --git a/posix-configs/rpi/px4_fw.config b/posix-configs/rpi/px4_fw.config index 8e7a0269f5..b759ee22f7 100644 --- a/posix-configs/rpi/px4_fw.config +++ b/posix-configs/rpi/px4_fw.config @@ -1,3 +1,8 @@ +#!/usr/bin/bash +# PX4 commands need the 'px4-' prefix in bash. +# (px4-alias.sh is expected to be in the PATH) +source px4-alias.sh + # navio config for FW uorb start diff --git a/posix-configs/rpi/px4_hil.config b/posix-configs/rpi/px4_hil.config index b20f1ec1ba..961a410c9c 100644 --- a/posix-configs/rpi/px4_hil.config +++ b/posix-configs/rpi/px4_hil.config @@ -1,3 +1,8 @@ +#!/usr/bin/bash +# PX4 commands need the 'px4-' prefix in bash. +# (px4-alias.sh is expected to be in the PATH) +source px4-alias.sh + # HITL configuration # connect to it with jMAVSim: # ./Tools/jmavsim_run.sh -q -i -p 14577 -r 250 diff --git a/posix-configs/rpi/px4_no_shield.config b/posix-configs/rpi/px4_no_shield.config index df0274a6f0..75649c3de1 100644 --- a/posix-configs/rpi/px4_no_shield.config +++ b/posix-configs/rpi/px4_no_shield.config @@ -1,3 +1,8 @@ +#!/usr/bin/bash +# PX4 commands need the 'px4-' prefix in bash. +# (px4-alias.sh is expected to be in the PATH) +source px4-alias.sh + # config for a quad without any shield: # - u-blox GPS connected via UART # - PWM output using PCA9685 via I2C