mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-27 18:27:05 +08:00
ekf2 replay: refactor to use unified rcS scripts
This commit is contained in:
@@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/bash
|
||||||
|
|
||||||
|
# EKF2 replay script
|
||||||
|
|
||||||
|
publisher_rules_file="orb_publisher.rules"
|
||||||
|
cat <<EOF > "$publisher_rules_file"
|
||||||
|
restrict_topics: sensor_combined, vehicle_gps_position, vehicle_land_detected
|
||||||
|
module: replay
|
||||||
|
ignore_others: false
|
||||||
|
EOF
|
||||||
|
|
||||||
|
uorb start
|
||||||
|
param set SDLOG_DIRS_MAX 7
|
||||||
|
|
||||||
|
ekf2 start -r
|
||||||
|
logger start -f -t -b 1000 -p vehicle_attitude
|
||||||
|
sleep 0.2
|
||||||
|
replay start
|
||||||
@@ -4,6 +4,17 @@
|
|||||||
# (px4-alias.sh is expected to be in the PATH)
|
# (px4-alias.sh is expected to be in the PATH)
|
||||||
source px4-alias.sh
|
source px4-alias.sh
|
||||||
|
|
||||||
|
# Main SITL startup script
|
||||||
|
|
||||||
|
|
||||||
|
# check for ekf2 replay
|
||||||
|
if [ "$replay_mode" == "ekf2" ]
|
||||||
|
then
|
||||||
|
sh etc/init.d-posix/rc.replay
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# TODO: In the future we want to share rc.autostart with NuttX
|
# TODO: In the future we want to share rc.autostart with NuttX
|
||||||
#source rc.autostart
|
#source rc.autostart
|
||||||
|
|
||||||
@@ -119,11 +130,11 @@ mc_att_control start
|
|||||||
# infrastructure already available on NuttX.
|
# infrastructure already available on NuttX.
|
||||||
if param compare SYS_AUTOSTART 10016
|
if param compare SYS_AUTOSTART 10016
|
||||||
then
|
then
|
||||||
source etc/init.d-posix/10016_iris
|
sh etc/init.d-posix/10016_iris
|
||||||
|
|
||||||
elif param compare SYS_AUTOSTART 6011
|
elif param compare SYS_AUTOSTART 6011
|
||||||
then
|
then
|
||||||
source etc/init.d-posix/6011_typhoon_h480
|
sh etc/init.d-posix/6011_typhoon_h480
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -36,19 +36,6 @@ then
|
|||||||
model="iris"
|
model="iris"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# check replay mode
|
|
||||||
if [ "$replay_mode" == "ekf2" ]
|
|
||||||
then
|
|
||||||
model="iris_replay"
|
|
||||||
# create the publisher rules
|
|
||||||
publisher_rules_file="$rootfs/orb_publisher.rules"
|
|
||||||
cat <<EOF > "$publisher_rules_file"
|
|
||||||
restrict_topics: sensor_combined, vehicle_gps_position, vehicle_land_detected
|
|
||||||
module: replay
|
|
||||||
ignore_others: false
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$#" -lt 7 ]
|
if [ "$#" -lt 7 ]
|
||||||
then
|
then
|
||||||
echo usage: sitl_run.sh sitl_bin rcS_path debugger program model src_path build_path
|
echo usage: sitl_run.sh sitl_bin rcS_path debugger program model src_path build_path
|
||||||
|
|||||||
@@ -15,6 +15,15 @@ set() {
|
|||||||
# alternative method with an alias:
|
# alternative method with an alias:
|
||||||
# alias set='f(){ set -- "$1=$2"; eval "$1"; unset -f f; }; eval f'
|
# alias set='f(){ set -- "$1=$2"; eval "$1"; unset -f f; }; eval f'
|
||||||
|
|
||||||
|
# Execute another shell script.
|
||||||
|
# $1: Path to the script, (optionally starts with /, to match with the NuttX
|
||||||
|
# scripts)
|
||||||
|
sh() {
|
||||||
|
script="$1"
|
||||||
|
[[ "$script" != /* ]] && script="/$script"
|
||||||
|
source "$(pwd)$script"
|
||||||
|
}
|
||||||
|
|
||||||
# Don't stop on errors.
|
# Don't stop on errors.
|
||||||
#set -e
|
#set -e
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
#!/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 set SDLOG_DIRS_MAX 7
|
|
||||||
|
|
||||||
ekf2 start -r
|
|
||||||
logger start -f -t -b 1000 -p vehicle_attitude
|
|
||||||
sleep 0.2
|
|
||||||
replay start
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user