Files
2026-07-23 17:55:52 +08:00

25 lines
739 B
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# 本机启动左手 O6 MuJoCo 仿真(ROS2 用系统 Python,依赖从 venv/user site 补齐)
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$ROOT"
# ROS2
# shellcheck disable=SC1091
source /opt/ros/jazzy/setup.bash
# shellcheck disable=SC1091
source "$ROOT/install/setup.bash"
# 多机通信
export ROS_DOMAIN_ID="${ROS_DOMAIN_ID:-30}"
export ROS_LOCALHOST_ONLY=0
# ros2 launch 走系统 python3;把 venv 的 site-packages 挂上(含 mujoco/PyQt5
VENV_SITE="$ROOT/venv/lib/python3.12/site-packages"
if [[ -d "$VENV_SITE" ]]; then
export PYTHONPATH="$VENV_SITE${PYTHONPATH:+:$PYTHONPATH}"
fi
exec ros2 launch linker_hand_mujoco_ros2 linker_hand_mujoco_ros2.launch.py "$@"