主界面要直接下发夹爪并看仿真,再开夹爪页会把相机和触觉挡住。开口、力度和旋转收到左栏,壳体、抱闸、手指改成对比色,黑指在深色底上会看不见。臂清单从 site.yaml 读,界面不再写死哪一台。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+39
-4
@@ -8,10 +8,45 @@ ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
# shellcheck disable=SC1091
|
||||
source "${ROOT}/scripts/env.sh"
|
||||
export PYTHONPATH="${ROOT}/src/arm_application${PYTHONPATH:+:${PYTHONPATH}}"
|
||||
if [[ -z "${DISPLAY:-}" && -S /tmp/.X11-unix/X1 ]]; then
|
||||
export DISPLAY=:1
|
||||
# 屏幕跟当前登录会话走。这台工控机是 :1,别的 Linux 桌面常常是 :0。
|
||||
if [[ -n "${DISPLAY:-}" ]]; then
|
||||
_disp="${DISPLAY#:}"
|
||||
_disp="${_disp%%.*}"
|
||||
if [[ ! -S "/tmp/.X11-unix/X${_disp}" ]]; then
|
||||
unset DISPLAY
|
||||
fi
|
||||
unset _disp
|
||||
fi
|
||||
if [[ -z "${XAUTHORITY:-}" && -r "/run/user/$(id -u)/gdm/Xauthority" ]]; then
|
||||
export XAUTHORITY="/run/user/$(id -u)/gdm/Xauthority"
|
||||
if [[ -z "${DISPLAY:-}" ]]; then
|
||||
_seat="$(who | awk -v u="$(id -un)" '$1==u && $2 ~ /^:/ {print $2; exit}')"
|
||||
_seat="${_seat%%.*}"
|
||||
_n="${_seat#:}"
|
||||
if [[ -n "${_n}" && -S "/tmp/.X11-unix/X${_n}" ]]; then
|
||||
export DISPLAY="${_seat}"
|
||||
else
|
||||
for _sock in /tmp/.X11-unix/X*; do
|
||||
if [[ -S "${_sock}" ]]; then
|
||||
export DISPLAY=":${_sock##*/X}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
unset _seat _n _sock
|
||||
fi
|
||||
# 有真实屏幕时不要留在 offscreen,否则 OpenGL 窗口起不来,模型也不会画到显卡上。
|
||||
if [[ "${QT_QPA_PLATFORM:-}" == "offscreen" && -n "${DISPLAY:-}" ]]; then
|
||||
_disp="${DISPLAY#:}"
|
||||
_disp="${_disp%%.*}"
|
||||
if [[ -S "/tmp/.X11-unix/X${_disp}" ]]; then
|
||||
unset QT_QPA_PLATFORM
|
||||
fi
|
||||
unset _disp
|
||||
fi
|
||||
if [[ -z "${XAUTHORITY:-}" ]]; then
|
||||
if [[ -r "${HOME}/.Xauthority" ]]; then
|
||||
export XAUTHORITY="${HOME}/.Xauthority"
|
||||
elif [[ -r "/run/user/$(id -u)/gdm/Xauthority" ]]; then
|
||||
export XAUTHORITY="/run/user/$(id -u)/gdm/Xauthority"
|
||||
fi
|
||||
fi
|
||||
exec python3 -m arm_application.operator_app
|
||||
|
||||
Reference in New Issue
Block a user