参考所有分组,完成尽量多的内容。禁止顺手扩功能 smoke
结论:补齐 Puma560 DH 参数生成器的可执行入口和 LinuxCNC-root 相对 HAL 源约束,锁住 puma560_dh.hal 中 genserkins DH 值到生成输出的映射,不新增 CNC 行为或 smoke 功能。
This commit is contained in:
35
generate-linuxcnc-puma560-dh-parameters.sh
Normal file → Executable file
35
generate-linuxcnc-puma560-dh-parameters.sh
Normal file → Executable file
@@ -7,7 +7,38 @@ cd "$(dirname "$0")"
|
||||
# configs/sim/axis/vismach/puma/puma560_dh.hal setp genserkins.{A,ALPHA,D}-N
|
||||
# values used by LinuxCNC genser/switchkins simulation configs.
|
||||
linuxcnc_root=${LINUXCNC_ROOT:-../linuxcnc}
|
||||
|
||||
usage() {
|
||||
echo "usage: $0 [linuxcnc-root-relative-puma560-dh-hal]" >&2
|
||||
}
|
||||
|
||||
case "${1:-}" in
|
||||
--help|-h)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
--*)
|
||||
usage
|
||||
echo "unknown LinuxCNC puma560 DH generator option: $1" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
if [[ -n "${2:-}" ]]; then
|
||||
usage
|
||||
echo "too many LinuxCNC puma560 DH generator arguments" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
source_path=${1:-configs/sim/axis/vismach/puma/puma560_dh.hal}
|
||||
if [[ "$source_path" = /* || "$source_path" == .. || "$source_path" == ../* || "$source_path" == */.. || "$source_path" == */../* ]]; then
|
||||
echo "LinuxCNC puma560 DH HAL source path must stay LinuxCNC-root relative: $source_path" >&2
|
||||
exit 1
|
||||
fi
|
||||
if [[ "$source_path" != *.hal ]]; then
|
||||
echo "LinuxCNC puma560 DH source must be a HAL file: $source_path" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
source_file="$linuxcnc_root/$source_path"
|
||||
|
||||
if [[ ! -f "$source_file" ]]; then
|
||||
@@ -25,8 +56,8 @@ $1 == "setp" && $2 ~ /^genserkins\.(A|ALPHA|D)-[0-5]$/ {
|
||||
split($2, qualified, ".")
|
||||
split(qualified[2], name_index, "-")
|
||||
name = name_index[1]
|
||||
index = name_index[2] + 0
|
||||
values[name, index] = $3
|
||||
joint_index = name_index[2] + 0
|
||||
values[name, joint_index] = $3
|
||||
}
|
||||
|
||||
END {
|
||||
|
||||
Reference in New Issue
Block a user