Go to file
lgv 1e3466c1e6 feat(motor): add TCHL EtherCAT support and separate vendor operations
Add the TC600E TR motor, PDO mapping, configuration, vendor documents, and
real-motor examples for profile and cyclic position and velocity control.
Share EtherCAT motor conversion, cyclic batch commands, and feedback with
EYOU while supporting configurable CSP velocity feedforward objects and
rated-torque per-mille commands and feedback.

Keep common CiA402 state transitions, mode selection, motion commands, and
profile parameter SDO writes in Cia402Protocol. Move complete vendor limit,
zero calibration, brake, and TCHL enable timing workflows into independent
adapters, with Motor delegating each operation to its owner. Update TI5,
MuJoCo, the motor manager, and arm initialization for the revised interfaces.

Preserve the configured mode during torqueOn and use only the standard
6/7/F enable sequence. Keep PP set-point acknowledgement in position
commands and initialize EtherCAT arm modes before enabling axes.

Validation: built cmvr_es and all three affected real-motor test targets;
listed their tests without running hardware cases. Offline checks covered
CiA402 and vendor enable, calibration, failure cleanup, and PP handshakes.
Code whitespace checks passed; the vendor XML is preserved verbatim.
No real motors were operated during verification.
2026-10-19 15:53:25 +08:00
.vscode feat: add touch app 2026-03-17 15:59:25 +08:00
assets feat: fix google test 2026-02-27 16:31:37 +08:00
cmake fix(ethercat): align bundled userspace and kernel modules 2026-10-19 15:52:59 +08:00
cmvr-es feat(motor): add TCHL EtherCAT support and separate vendor operations 2026-10-19 15:53:25 +08:00
data feat(arm): add collision-aware planning and refactor motion control 2026-10-13 09:18:06 +08:00
dependency fix(ethercat): align bundled userspace and kernel modules 2026-10-19 15:52:59 +08:00
docs feat(motor): add TCHL EtherCAT support and separate vendor operations 2026-10-19 15:53:25 +08:00
model feat(touch): add eye-to-hand PBVS MuJoCo support 2026-09-09 17:28:24 +08:00
protos feat(motor): add TCHL EtherCAT support and separate vendor operations 2026-10-19 15:53:25 +08:00
python refactor:Refactor all the code 2026-06-24 15:45:54 +08:00
script feat(arm): add collision-aware planning and refactor motion control 2026-10-13 09:18:06 +08:00
scripts feat(collision): add collision primitive generation tools 2026-07-27 15:39:54 +08:00
tools verify active arm motion before stop all tests 2026-09-17 17:57:15 +08:00
.aiignore fix: readme 2026-02-05 17:31:18 +08:00
.codex feat: add px 6ax gen3 as touch pressure sensor 2026-05-08 16:58:52 +08:00
.gitignore feat: add proto config for camera&hand&micophone 2026-01-21 16:30:13 +08:00
.gitmodules feat:add eye hand calibration and pose follow 2025-08-22 16:57:29 +08:00
CMakeLists.txt feat: add camera audio and QUIC streaming 2026-09-20 13:58:20 +08:00
compile_commands.json feat: add px 6ax gen3 as touch pressure sensor 2026-05-08 16:58:52 +08:00
LICENSE feat:add eye hand calibration and pose follow 2025-08-22 16:57:29 +08:00
MUJOCO_LOG.TXT feat:add pbvs touch 2026-09-15 10:42:56 +08:00
README.md fix(ethercat): align bundled userspace and kernel modules 2026-10-19 15:52:59 +08:00
request.txt feat(arm): add collision-aware planning and refactor motion control 2026-10-13 09:18:06 +08:00

CMVR-ES

简介

CMVR-ES 工程。

机械臂已提供独立的 OMPL RRTConnect 关节路径规划模块,构建与使用方式见 RRTConnect 接入说明。MotorRobotArm::moveP 已接入路径规划、 五次 B 样条平滑、运动限值校验与碰撞复检,并按控制周期下发电机指令。

运行时自碰撞监测位于 cmvr-es/safety/self_collision:SelfCollisionMonitor 通过 RobotArm 接口读取反馈、触发保护停止并协调恢复,碰撞计算仍由 algorithms/collision_detection 中的 CollisionChecker 完成。 SelfCollisionTask 仅绑定机械臂和转发周期调度;Monitor 不创建线程,恢复调用期间 须继续周期检测。现有 self_collision_task 配置格式保持不变。

安装

1. 拉取 Git 子模块

git submodule update --init --recursive

2. 安装系统依赖

# 基础工具
sudo apt-get update
sudo apt install -y build-essential cmake git pkg-config patchelf libboost-all-dev libssl-dev

# OpenCV
sudo apt install -y \
  libjpeg-dev libpng-dev libtiff-dev \
  libavcodec-dev libavformat-dev libswscale-dev \
  libv4l-dev libxvidcore-dev libx264-dev \
  libgtk-3-dev

# PulseAudio
sudo apt-get install libpulse-dev

# OpenGL
sudo apt-get install libgl1-mesa-dev

# GLFW
sudo apt-get install libglfw3-dev

# Assimp
sudo apt-get install libassimp-dev

# visp
sudo apt-get install -y libx11-dev liblapack-dev libzbar-dev libpthread-stubs0-dev libdc1394-dev nlohmann-json3-dev

# RealSense
sudo apt-get install -y \
  libusb-1.0-0-dev libudev-dev \
  libglu1-mesa-dev
  
# Matplot++
sudo apt install gnuplot-qt

3. 配置 IgH EtherCAT

工程已内置 IgH EtherCAT 1.7.0 的 userspace 文件:

dependency/x86/third_party/ethercat/v1.7.0

当前依赖的源码提交和配套内核版本记录在该目录的 BUILDINFO.txt 中。 目录中保留的其他内核版本模块不代表与当前 userspace 兼容。

先设置本机路径:

export CMVR_ES_ROOT=/path/to/cmvr-es
export IGH_ETHERCAT_ROOT=$CMVR_ES_ROOT/dependency/x86/third_party/ethercat/v1.7.0

安装当前内核的 header:

sudo apt-get update
sudo apt-get install -y linux-headers-$(uname -r)

只有在内置 userspace(libethercat.so、ecrt.h)与 EtherCAT 内核模块来自 同一个源码提交,并且模块对应当前内核版本时,才可以直接安装到系统:

sudo mkdir -p /lib/modules/$(uname -r)/ethercat
sudo cp -r $IGH_ETHERCAT_ROOT/lib/modules/$(uname -r)/ethercat/* /lib/modules/$(uname -r)/ethercat/
sudo depmod

不能只根据 uname -r 和 IgH 1.7.0 版本号判断兼容性。同一个稳定分支的不同 提交也可能使用不同的 ioctl 数据结构,混用后会出现 Failed to create slave config: Inappropriate ioctl for device。如果无法确认 userspace 和内核模块来自同一提交,或者 $IGH_ETHERCAT_ROOT/lib/modules/$(uname -r) 不存在, 需要在这台机器上使用同一份源码重新编译安装 IgH EtherCAT:

sudo apt-get update
sudo apt-get install -y \
  build-essential autoconf automake libtool pkg-config git \
  linux-headers-$(uname -r)

cd /tmp
git clone --branch stable-1.7 --depth 1 https://gitlab.com/etherlab.org/ethercat.git ethercat-stable-1.7
cd ethercat-stable-1.7
git rev-parse HEAD  # 记录本次 userspace 和内核模块共同使用的提交

./bootstrap
./configure \
  --prefix=$IGH_ETHERCAT_ROOT \
  --libdir=$IGH_ETHERCAT_ROOT/lib \
  --includedir=$IGH_ETHERCAT_ROOT/include \
  --sysconfdir=$IGH_ETHERCAT_ROOT/etc \
  --with-systemdsystemunitdir=$IGH_ETHERCAT_ROOT/lib/systemd/system \
  --enable-generic \
  --with-linux-dir=/lib/modules/$(uname -r)/build

make -j$(nproc) all modules
make install
sudo make modules_install
sudo depmod

其中,make install 会更新 $IGH_ETHERCAT_ROOT 下的用户态库、头文件和工具, 也会覆盖该目录中的默认配置文件;已有网卡配置应先备份并在安装后恢复。 sudo make modules_install 会更新 /lib/modules/$(uname -r)/ethercat 下的 ec_master.ko、ec_generic.ko 等内核模块。已加载的模块需要通过下方启动脚本 停止并重新加载后才会使用新文件;执行前应退出正在占用主站的应用。

安装完成后,检查用户态库与内核模块中的“创建 slave config” ioctl 编号。 使用 libethercat.so.1 符号链接,避免把实际库文件名固定为旧的 1.2.0:

objdump -d --disassemble=ecrt_master_slave_config "$IGH_ETHERCAT_ROOT/lib/libethercat.so.1" \
  | rg -o -m1 '\$0x[cC][0-9a-fA-F]+a423'

objdump -d "/lib/modules/$(uname -r)/ethercat/master/ec_master.ko" \
  | rg -o -m1 '\$0x[cC][0-9a-fA-F]+a423'

两条命令的输出必须完全一致。编号不同说明 ABI 不兼容,不能启动 EtherCAT 应用; 编号一致是必要检查,仍需保证用户态和内核模块来自同一源码提交。

启动 EtherCAT。eno1 换成实际连接 EtherCAT 从站的网卡:

sudo script/ethercat/start_ethercat.sh eno1

脚本会写入内置 IgH 配置文件:

$IGH_ETHERCAT_ROOT/etc/ethercat.conf

脚本会把该网卡的 MAC 写到 MASTER0_DEVICE,使用 DEVICE_MODULES="generic",把网卡从 NetworkManager 断开,并通过 ethercatctl -c 启动 IgH master。

查看状态:

script/ethercat/status_ethercat.sh

$IGH_ETHERCAT_ROOT/bin/ethercat master
$IGH_ETHERCAT_ROOT/bin/ethercat slaves
$IGH_ETHERCAT_ROOT/bin/ethercat pdos

停止 EtherCAT:

sudo script/ethercat/stop_ethercat.sh eno1
sudo script/ethercat/stop_ethercat.sh eno1 --restore-network