Added rc.mavlink_override to test the new parameters with sitl

This commit is contained in:
garfieldG
2021-02-25 02:30:30 -08:00
committed by David Sidrane
parent 3cd9b3c2cf
commit 8db37225d6
5 changed files with 38 additions and 2 deletions

View File

@@ -36,4 +36,5 @@ add_subdirectory(airframes)
px4_add_romfs_files(
rc.replay
rcS
rc.mavlink_override
)

View File

@@ -0,0 +1,30 @@
#!/bin/sh
. px4-alias.sh
# using parameters to open mavlink channels
for i in 0 1 2
do
if param greater MAV_${i}_BROADCAST 0
then
set MAV_ARGS "-u p:MAV_${i}_UDP_PRT -o p:MAV_${i}_REMOTE_PRT -m p:MAV_${i}_MODE -r p:MAV_${i}_RATE"
if param compare MAV_${i}_BROADCAST 1
then
set MAV_ARGS "${MAV_ARGS} -p"
fi
if param compare MAV_${i}_BROADCAST 2
then
set MAV_ARGS "${MAV_ARGS} -c"
fi
if param compare MAV_${i}_FORWARD 1
then
set MAV_ARGS "${MAV_ARGS} -f"
fi
mavlink start ${MAV_ARGS}
echo "Starting mavlink with command: mavlink start ${MAV_ARGS}"
fi
done

View File

@@ -262,7 +262,7 @@ else
mavlink start -x -u $udp_onboard_payload_port_local -r 4000 -f -m onboard -o $udp_onboard_payload_port_remote -p
# Onboard link to gimbal
mavlink start -x -u $udp_onboard_gimbal_port_local -r 400000 -m gimbal -o $udp_onboard_gimbal_port_remote
mavlink start -x -u $udp_onboard_gimbal_port_local -r 400000 -m gimbal -o $udp_onboard_gimbal_port_remote -p
fi
# execute autostart post script if any

View File

@@ -7,6 +7,7 @@ px4_add_board(
LABEL default
EMBEDDED_METADATA parameters
TESTING
ETHERNET
DRIVERS
#barometer # all available barometer drivers
#batt_smbus

View File

@@ -11,6 +11,10 @@ serial_config:
then
set MAV_ARGS "${MAV_ARGS} -p"
fi
if param compare MAV_${i}_BROADCAST 2
then
set MAV_ARGS "${MAV_ARGS} -c"
fi
fi
if param compare MAV_${i}_FORWARD 1
then