Organize host and robot streaming releases
This commit is contained in:
60
robot/ros2/OmniSocketGo_robot_ros/check-robot-lan.sh
Normal file
60
robot/ros2/OmniSocketGo_robot_ros/check-robot-lan.sh
Normal file
@@ -0,0 +1,60 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
# shellcheck disable=SC1091
|
||||
source "${PROJECT_ROOT}/scripts/dev/load-env.sh"
|
||||
|
||||
failed=0
|
||||
|
||||
check_empty_relay() {
|
||||
local name="$1"
|
||||
local value="${!name:-}"
|
||||
if [[ -n "${value}" ]]; then
|
||||
echo "[FAIL] ${name} must be empty, got: ${value}" >&2
|
||||
failed=1
|
||||
else
|
||||
echo "[ OK ] ${name}=<disabled>"
|
||||
fi
|
||||
}
|
||||
|
||||
check_camera() {
|
||||
local name="$1"
|
||||
local device="$2"
|
||||
if [[ -e "${device}" ]]; then
|
||||
echo "[ OK ] ${name} camera: ${device} -> $(readlink -f "${device}")"
|
||||
else
|
||||
echo "[FAIL] ${name} camera is missing: ${device}" >&2
|
||||
failed=1
|
||||
fi
|
||||
}
|
||||
|
||||
echo "Robot video target: ${OMNI_VIDEO_SERVER_ADDR}"
|
||||
echo "Robot control target: ${OMNI_CONTROL_SERVER_ADDR}"
|
||||
check_empty_relay ROBOT_SIDE_OMNISOCKET_RELAY_VIA
|
||||
check_empty_relay OMNI_VIDEO_RELAY_VIA
|
||||
check_empty_relay OMNI_CONTROL_RELAY_VIA
|
||||
check_camera head "${OMNI_CAMERA_HEAD_DEVICE}"
|
||||
check_camera waist "${OMNI_CAMERA_WAIST_DEVICE}"
|
||||
|
||||
if pkg-config --exists libavformat libavcodec libavutil libswscale; then
|
||||
echo "[ OK ] FFmpeg development libraries"
|
||||
else
|
||||
echo "[FAIL] FFmpeg development libraries are missing" >&2
|
||||
failed=1
|
||||
fi
|
||||
|
||||
if [[ -x "${PROJECT_ROOT}/bin/b_side_omnid" ]]; then
|
||||
echo "[ OK ] bin/b_side_omnid is built"
|
||||
else
|
||||
echo "[WARN] bin/b_side_omnid is not built; run: make b_side_omnid"
|
||||
fi
|
||||
|
||||
server_host="${OMNI_VIDEO_SERVER_ADDR%:*}"
|
||||
if command -v ping >/dev/null 2>&1 && ping -c 1 -W 1 "${server_host}" >/dev/null 2>&1; then
|
||||
echo "[ OK ] computer is reachable: ${server_host}"
|
||||
else
|
||||
echo "[WARN] cannot ping ${server_host}; verify the direct Ethernet addresses"
|
||||
fi
|
||||
|
||||
exit "${failed}"
|
||||
Reference in New Issue
Block a user