feat: 5G自动拨号、软件时钟同步、机器人端控制程序自启。

This commit is contained in:
2026-04-11 16:06:51 +08:00
parent 84e0cc54d2
commit 14ce3d4e1d
18 changed files with 1032 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# shellcheck disable=SC1091
source "${SCRIPT_DIR}/common.sh"
STEP="ros-receiver"
SOCKET_PATH=""
TIMEOUT_SEC=""
while [[ $# -gt 0 ]]; do
case "$1" in
--path)
SOCKET_PATH="$2"
shift 2
;;
--timeout)
TIMEOUT_SEC="$2"
shift 2
;;
--step)
STEP="$2"
shift 2
;;
*)
blitz_log "${STEP}" "wait-socket-arg" "failure" "unknown argument: $1" 2
exit 2
;;
esac
done
blitz_load_boot_env
SOCKET_PATH="${SOCKET_PATH:-${ROBOT_RECEIVER_LOCAL_SOCKET_PATH}}"
TIMEOUT_SEC="${TIMEOUT_SEC:-${BLITZ_ROS_SOCKET_WAIT_SEC}}"
blitz_log "${STEP}" "wait-socket" "start" "path=${SOCKET_PATH} timeout_sec=${TIMEOUT_SEC}" 0
for (( waited=0; waited< TIMEOUT_SEC; waited++ )); do
if [[ -S "${SOCKET_PATH}" ]]; then
blitz_log "${STEP}" "wait-socket" "success" "path=${SOCKET_PATH} waited_sec=${waited}" 0
exit 0
fi
sleep 1
done
blitz_log "${STEP}" "wait-socket" "failure" "path=${SOCKET_PATH} timeout_sec=${TIMEOUT_SEC}" 1
exit 1