You need to connect the USB to UART Bridge to the UART1 port of the BeagleBone Blue board. The bridge will allow you to connect to the PX4 Autopilot via QGroundControl or to perform hardware-in-the-loop simulations. The image below shows the setup.
Building PX4 Autopilot v1.14.0
Open a WLS window.
Download and unzip the Arm GNU Toolchain (gcc-arm-8.3-2019.02-x86_64-arm-linux-gnueabihf.tar.xz).
Clone the PX4 Autopilot repository. Make sure you checkout v1.14.0.
Go back to the PX4-autopilot folder and execute the following commands.
export PATH=$PATH:/home/<username>/gcc-arm-8.3-2019.02-x86_64-arm-linux-gnueabihf/bin
make beaglebone_blue_default
During the build process, you should observe the following output.
-- PX4 version: v1.14.0 (1.14.0)
-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.8.10", minimum required is "3")
-- PX4 config file: /home/kboychev/PX4-v1.14.0/PX4-Autopilot/boards/beaglebone/blue/default.px4board
-- PLATFORM posix
-- LINUX_TARGET y
-- TOOLCHAIN arm-linux-gnueabihf
-- ARCHITECTURE cortex-a8
-- ROMFSROOT px4fmu_common
-- ROOTFSDIR .
-- TESTING y
-- SERIAL_GPS1 /dev/ttyS2
-- SERIAL_TEL1 /dev/ttyS1
-- SERIAL_TEL2 /dev/ttyS5
-- PX4 config: beaglebone_blue_default
-- PX4 platform: posix
-- PX4 lockstep: disabled
-- The CXX compiler identification is GNU 8.3.0
-- The C compiler identification is GNU 8.3.0
-- The ASM compiler identification is GNU
-- Found assembler: /home/kboychev/gcc-arm-8.3-2019.02-x86_64-arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
-- Check for working CXX compiler: /home/kboychev/gcc-arm-8.3-2019.02-x86_64-arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++
-- Check for working CXX compiler: /home/kboychev/gcc-arm-8.3-2019.02-x86_64-arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: /home/kboychev/gcc-arm-8.3-2019.02-x86_64-arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
-- Check for working C compiler: /home/kboychev/gcc-arm-8.3-2019.02-x86_64-arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- cmake build type: RelWithDebInfo
-- Could NOT find Java (missing: Java_JAVA_EXECUTABLE Java_JAR_EXECUTABLE Java_JAVAC_EXECUTABLE Java_JAVAH_EXECUTABLE Java_JAVADOC_EXECUTABLE)
-- ROMFS: ROMFS/px4fmu_common
-- ROMFS: Adding boards/beaglebone/blue/init/rc.board_defaults -> /etc/init.d/rc.board_defaults
Architecture: amd64
==> CPACK_INSTALL_PREFIX = @DEB_INSTALL_PREFIX@
-- Configuring done
-- Generating done
-- Build files have been written to: /home/kboychev/PX4-v1.14.0/PX4-Autopilot/build/beaglebone_blue_default
[0/1002] git submodule src/modules/uxrce_dds_client/Micro-XRCE-DDS-Client
[3/1002] git submodule src/drivers/gps/devices
[8/1002] git submodule src/modules/mavlink/mavlink
[18/1002] Performing download step (git clone) for 'librobotcontrol'
-- librobotcontrol download command succeeded. See also /home/kboychev/PX4-v1.14.0/PX4-Autopilot/build/beaglebone_blue_default/librobotcontrol-prefix/src/librobotcontrol-stamp/librobotcontrol-download-*.log
[21/1002] Performing configure step for 'librobotcontrol'
-- librobotcontrol configure command succeeded. See also /home/kboychev/PX4-v1.14.0/PX4-Autopilot/build/beaglebone_blue_default/librobotcontrol-prefix/src/librobotcontrol-stamp/librobotcontrol-configure-*.log
[23/1002] Performing build step for 'librobotcontrol'
-- librobotcontrol build command succeeded. See also /home/kboychev/PX4-v1.14.0/PX4-Autopilot/build/beaglebone_blue_default/librobotcontrol-prefix/src/librobotcontrol-stamp/librobotcontrol-build-*.log
[442/1002] Performing configure step for 'libmicroxrceddsclient_project'
-- libmicroxrceddsclient_project configure command succeeded. See also /home/kboychev/PX4-v1.14.0/PX4-Autopilot/build/beaglebone_blue_default/src/modules/uxrce_dds_client/src/libmicroxrceddsclient_project-stamp/libmicroxrceddsclient_project-configure-*.log
[605/1002] Performing build step for 'libmicroxrceddsclient_project'
-- libmicroxrceddsclient_project build command succeeded. See also /home/kboychev/PX4-v1.14.0/PX4-Autopilot/build/beaglebone_blue_default/src/modules/uxrce_dds_client/src/libmicroxrceddsclient_project-stamp/libmicroxrceddsclient_project-build-*.log
[610/1002] Performing install step for 'libmicroxrceddsclient_project'
-- libmicroxrceddsclient_project install command succeeded. See also /home/kboychev/PX4-v1.14.0/PX4-Autopilot/build/beaglebone_blue_default/src/modules/uxrce_dds_client/src/libmicroxrceddsclient_project-stamp/libmicroxrceddsclient_project-install-*.log
[1002/1002] Linking CXX shared library src/examples/dyn_hello/examples__dyn_hello.px4mod
Once the build is complete, you must upload the binaries to the BeagleBone Blue board. Use the following command to upload the binaries and the configuration files.
Once the binaries and the configuration files are uploaded to the BeagleBone Blue you can SSH into the BeagleBone Blue and run the px4 binary. To SSH into the BeagleBone Blue and run the px4 binary execute the following commands:
ssh debian@192.168.7.2
cd /home/debian/px4-bbblue-v1.14.0
./bin/px4 -s px4.config
The px4.config file
The px4.config file is specific for every board. The px4.config file below is specific to the BeagleBoneBlue board only.
#!/bin/sh
# PX4 commands need the 'px4-' prefix in bash.
# (px4-alias.sh is expected to be in the PATH)
. px4-alias.sh
set REQUESTED_AUTOSTART 2100
set PARAM_FILE eeprom/parameters_"$REQUESTED_AUTOSTART"
set AUTOSTART_FILE etc/init.d/airframes/2100_standard_plane
#Circuit breakers
param set CBRK_SUPPLY_CHK 894281
#Parameters
param select $PARAM_FILE
if [ -f $PARAM_FILE ]
then
if param load
then
echo "[param] Loaded: $PARAM_FILE"
else
echo "[param] FAILED loading $PARAM_FILE"
fi
else
echo "[param] Parameter file not found, creating $PARAM_FILE"
fi
if param compare SYS_AUTOSTART $REQUESTED_AUTOSTART
then
param set SYS_AUTOCONFIG 0
else
param set SYS_AUTOCONFIG 1
param set SYS_AUTOSTART 2100
fi
. "$AUTOSTART_FILE"
if param compare SYS_AUTOCONFIG 1
then
param set SYS_AUTOCONFIG 0
fi
# Board defaults
param set BAT1_V_CHANNEL 5
param set BAT1_V_DIV 11.0
# User-defined params
param set SYS_HITL 0
param set SYS_CTRL_ALLOC 1
# Waypoint storage
dataman start
# Resource load monitor
load_mon start
# RC update
rc_update start
manual_control start
# Sensors
if param compare SYS_HITL 1
then
param set COM_RC_IN_MODE 1
sensors start -h
commander start -h
param set GPS_1_CONFIG 0
else
sleep 1
bmp280 -I -a 0x76 start
sleep 1
mpu9250_i2c -I -a 0x68 start
sleep 1
ak8963 -I -a 0xC start
sleep 1
qmc5883l -X -a 0x0D start
sleep 1
ms4525do -X -a 0x2 start
sleep 1
gps start -d /dev/ttyS5 -b 9600 -p nmea
board_adc start
battery_status start
sensors start
commander start
fi
# Interface (configure outputs)
if param compare SYS_HITL 1
then
pwm_out_sim start -m hil
else
linux_pwm_out start
fi
# FW applications (start standard fixed-wing applications)
ekf2 start &
if param compare SYS_CTRL_ALLOC 1
then
control_allocator start
fi
fw_att_control start
fw_pos_control_l1 start
airspeed_selector start
fw_autotune_attitude_control start
land_detector start fixedwing
# Mavlink
mavlink start -d /dev/ttyS1 -b 921600 -x -Z
# RC input
rc_input start -d /dev/ttyS4
# Navigator
navigator start
# Logger
logger start -t -b 200
# Boot complete
mavlink boot_complete