Skip to content

Commit

Permalink
Add cleanup function for SITL Gazebo on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
farhangnaderi committed Jan 6, 2025
1 parent 8070a9b commit 854489e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ROMFS/px4fmu_common/init.d-posix/px4-rc.simulator
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
#!/bin/sh
# shellcheck disable=SC2154

# Function to handle cleanup
if [ "$(uname)" = "Darwin" ]; then
cleanup() {
echo "INFO [init] Cleaning up on macOS..."
pkill -f "gz sim" || true # Ignore errors if no process is found
trap - INT TERM # Clear the trap to prevent re-triggering
exit 0 # Exit gracefully
}
fi

# Simulator IMU data provided at 250 Hz
param set-default IMU_INTEG_RATE 250

Expand Down

0 comments on commit 854489e

Please sign in to comment.