#!/usr/bin/env bash # scripts/clean_ros.sh —— 关停所有 chatter 相关后台进程 # (在调试 launch.sh forever 模式后调用,防止残留进程) pkill -9 -f "ros2 launch" || true pkill -9 -f chatter_publisher || true pkill -9 -f chatter_subscriber || true sleep 1 pgrep -af 'ros2|chatter' || echo "all clean"