Add project sources for Mujoco LinkerHand ROS2
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Executable
+29
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env bash
|
||||
# 启动真机 LinkerHand ROS2 SDK(O6 左手 / 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 "$@"
|
||||
Reference in New Issue
Block a user