Skip to content

Instantly share code, notes, and snippets.

@dayjaby
Created January 13, 2023 18:08
Show Gist options
  • Save dayjaby/b3346c8d0a12fad4947badf9e994968b to your computer and use it in GitHub Desktop.
Save dayjaby/b3346c8d0a12fad4947badf9e994968b to your computer and use it in GitHub Desktop.
PX4 unit tests
#!/bin/bash
export PX4_SIM_MODEL=unittest
export PX4_START_MODULES=start_modules.rc
# log file without mission and several different main states:
export replay=/home/david/Downloads/07370005-60a6-4a60-8d24-b86849a5c042.ulg
make px4_sitl_unittest
export PX4_BUILD_UNITTEST=$(pwd)/build/px4_sitl_unittest_replay
export PX4_RC_FILE=${PX4_BUILD_UNITTEST}/etc/init.d-posix/start_modules.rc
publisher_rules_file="orb_publisher.rules"
cat <<EOF > "$publisher_rules_file"
restrict_topics: battery_status, manual_control_setpoint, sensor_combined, vehicle_gps_position, vehicle_land_detected, vehicle_local_position, vehicle_global_position
module: replay
ignore_others: false
EOF
cat <<EOT > $PX4_RC_FILE
commander start
replay trystart
logger start -f
EOT
${PX4_BUILD_UNITTEST}/bin/px4 ${PX4_BUILD_UNITTEST}/etc -s etc/init.d-posix/rcS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment