工位操作改成桌面窗口:夹爪位置、力度、速度和旋转角可以调,阶段能分步或整体跑,并能软拖拽记点后回到该点。相机预览按窗口一次铺满,不再跟着每帧慢慢放大。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+13
-1
@@ -12,7 +12,9 @@
|
||||
# bash ~/ros2/scripts/run_gripper.sh --arm 91 --cli open
|
||||
# bash ~/ros2/scripts/run_gripper.sh --arm 91 --cli close
|
||||
# bash ~/ros2/scripts/run_gripper.sh --arm 91 --cli rotate 90
|
||||
# bash ~/ros2/scripts/run_gripper.sh --arm 91 --force 40 --speed 20 --cli rotate_by -15
|
||||
# bash ~/ros2/scripts/run_gripper.sh --arm 91 --cli revolutions 2
|
||||
# --force / --speed 写在 --cli 前面,覆盖 site.yaml 里的力度和速度。
|
||||
# bash ~/ros2/scripts/run_gripper.sh --arm 89 # ROS 节点 PGEA
|
||||
# bash ~/ros2/scripts/run_gripper.sh --arm 91 # ROS 节点 RGI
|
||||
# bash ~/ros2/scripts/run_dual_gripper.sh # 两个 ROS 节点都起
|
||||
@@ -21,6 +23,8 @@ set -eo pipefail
|
||||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
CLI=()
|
||||
DUAL=0
|
||||
GRIP_FORCE=""
|
||||
GRIP_SPEED=""
|
||||
|
||||
# shellcheck disable=SC1091
|
||||
source "${ROOT}/scripts/lib/parse_arm_args.sh"
|
||||
@@ -29,6 +33,8 @@ set -- "${PARSE_ARM_REST[@]}"
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
--force) GRIP_FORCE="${2:?}"; shift 2 ;;
|
||||
--speed) GRIP_SPEED="${2:?}"; shift 2 ;;
|
||||
--cli) shift; CLI=("$@"); break ;;
|
||||
--dual) DUAL=1; shift ;;
|
||||
-h|--help) sed -n '2,24p' "$0"; exit 0 ;;
|
||||
@@ -70,11 +76,17 @@ if [[ ${#CLI[@]} -gt 0 ]]; then
|
||||
ARGS=(--arm right --test rotate)
|
||||
if [[ -n "${REST[0]:-}" ]]; then ARGS+=(--angle "${REST[0]}"); fi
|
||||
;;
|
||||
rotate_by)
|
||||
ARGS=(--arm right --test rotate_by)
|
||||
if [[ -n "${REST[0]:-}" ]]; then ARGS+=(--angle "${REST[0]}"); fi
|
||||
;;
|
||||
revolutions)
|
||||
ARGS=(--arm right --test rotate)
|
||||
if [[ -n "${REST[0]:-}" ]]; then ARGS+=(--revolutions "${REST[0]}"); fi
|
||||
;;
|
||||
esac
|
||||
if [[ -n "${GRIP_FORCE}" ]]; then ARGS+=(--force "${GRIP_FORCE}"); fi
|
||||
if [[ -n "${GRIP_SPEED}" ]]; then ARGS+=(--speed "${GRIP_SPEED}"); fi
|
||||
echo "=== DH RGI SN=${SITE_GRIP_SN:-?} ${SITE_GRIP_PORT} arm=${SITE_ROBOT_SHORT_ID:-?} ==="
|
||||
exec python3 -m arm_application.dual_gripper_cli "${ARGS[@]}"
|
||||
fi
|
||||
@@ -84,7 +96,7 @@ if [[ ${#CLI[@]} -gt 0 ]]; then
|
||||
echo "=== DH ${MODEL} SN=${SITE_GRIP_SN:-?} ${PORT} @${BAUD} slave=${SLAVE} ==="
|
||||
exec python3 "${ROOT}/src/arm_application/arm_application/dh_pgea.py" \
|
||||
--port "${PORT}" --baud "${BAUD}" --slave "${SLAVE}" \
|
||||
--force "${SITE_GRIP_FORCE:-50}" --speed "${SITE_GRIP_SPEED:-50}" \
|
||||
--force "${GRIP_FORCE:-${SITE_GRIP_FORCE:-50}}" --speed "${GRIP_SPEED:-${SITE_GRIP_SPEED:-50}}" \
|
||||
--rts "${SITE_GRIP_RS485_RTS:-}" \
|
||||
"${CLI[@]}"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user