Skip to content

踩坑GitHub UniversalRobots/Universal_Robots_ROS2_Driver26 天前

urscript_interface连接失败时CTRL-C无法终止进程 ​

本文由 AI 根据公开内容整理,可能有误,请以原文为准:urscript_interface started with wrong IP cannot be stopped normally(GitHub UniversalRobots/Universal_Robots_ROS2_Driver #838)

状态:有绕过办法

问题 ​

运行 urscript_interface 指定不可达IP时,节点阻塞于TCP重连循环,CTRL-C与SIGTERM均无效,仅SIGKILL可杀进程。虽重试次数现限制为10次,但SIGINT仍被阻塞在 PrimaryClient::start() 中忽略,导致关闭需等待剩余重试结束并抛出未捕获异常。

环境 ​

Universal Robots ROS2 Driver (main分支), UR Client Library, urscript_interface节点, Linux系统

解决办法 ​

  1. 将阻塞式 PrimaryClient::start(10, 10s) 调用移入可join的独立启动工作线程
  2. 保持Topic/Action端点在启动成功前不可用
  3. 注册shutdown回调,在关闭期间调用 PrimaryClient::stop() 并join工作线程
  4. 将重试耗尽导致的启动失败转换为有序非零退出码,避免SIGABRT
  5. 添加无需硬件的loopback回归测试验证信号响应

讨论原作者:@fmauch 等,版权归原作者所有。

来源

本页事实对应的公开页面,以原文为准。

  1. GitHub UniversalRobots/Universal_Robots_ROS2_Driver #838:urscript_interface started with wrong IP cannot be stopped normally访问 2026-10-23