Add project sources for Mujoco LinkerHand ROS2

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
sunxianghui
2026-07-23 17:55:52 +08:00
parent 346a5c50d6
commit 1647241649
400 changed files with 35707 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
# 启动真机 LinkerHand ROS2 SDKO6 左手 / can0
set -eo pipefail
WS="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/linker_hand_ros2_sdk_ws"
# ROS setup.bash 会引用未定义变量,不能开 nounset (-u)
set +u
source /opt/ros/jazzy/setup.bash
source "$WS/install/setup.bash"
set -u
export ROS_DOMAIN_ID="${ROS_DOMAIN_ID:-30}"
export ROS_LOCALHOST_ONLY=0
# 开启 CAN(需 sudo;蓝灯常亮)
if ! ip link show can0 &>/dev/null; then
echo "[warn] 未检测到 can0,请插入 USB-CAN 后执行:"
echo " sudo ip link set can0 up type can bitrate 1000000"
else
if ! ip link show can0 | grep -q 'UP'; then
echo "[info] 尝试拉起 can0 ..."
sudo ip link set can0 up type can bitrate 1000000 || true
fi
fi
echo "启动: ros2 launch linker_hand_ros2_sdk linker_hand.launch.py"
echo "配置: hand_type=left hand_joint=O6 can=can0"
set +u
exec ros2 launch linker_hand_ros2_sdk linker_hand.launch.py "$@"