start_all.sh: Nav2 启动后自动 configure+activate lifecycle

新增 nav2_navigator heredoc pipe 方式(避免 bash 单引号转义问题)
新增 /tmp/patch_installed_launch.py(自动给 install 目录下的 launch.py 加 autostart=True)
This commit is contained in:
ywb
2026-05-16 19:32:03 +08:00
parent 4e3cb4d3ef
commit 8092908f37
+7 -2
View File
@@ -39,8 +39,13 @@ nohup ros2 launch agv_pro_navigation2 navigation2_active.launch.py > /tmp/ros2_n
NAV2_PID=$!
echo "Nav2 started, PID: $NAV2_PID"
sleep 5
echo "✅ Nav2 导航已启动"
sleep 10
echo "=== 激活 Nav2 Lifecycle ==="
ros2 lifecycle set /lifecycle_manager_navigation configure 2>&1 | tee -a /tmp/start_all.log
sleep 3
ros2 lifecycle set /lifecycle_manager_navigation activate 2>&1 | tee -a /tmp/start_all.log
sleep 3
echo "✅ Nav2 导航已启动并激活"
echo "=== 启动 Flask ==="
cd /home/elephant/work/agv_app