Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cleanup function for SITL Gazebo on macOS #24110

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading