# 自定义webots_ros2_driver插件init执行成功但step方法未被调用

> 原文链接：https://robotics.hellobike.com/pitfalls/2026-05-08-robotics-se-118358
> 频道：pitfalls | 更新日期：2026-05-08 | 标签：auto, stackexchange, ros2
> 核心摘要：用户开发自定义webots_ros2_driver动态插件时init执行成功但step未被调用，排查到是仿真中存在等待外部控制器的机器人导致，调整后解决。

# 自定义webots_ros2_driver插件init执行成功但step方法未被调用

::: v-pre
> 本文由 AI 根据公开内容整理，可能有误，请以原文为准：[Custom dynamic (pluginlib) plugin: init() method executed successfully, step() method ignored](https://robotics.stackexchange.com/questions/118358/custom-dynamic-pluginlib-plugin-init-method-executed-successfully-step-m)（Robotics Stack Exchange #118358）

**状态**：已解决

## 问题

自定义webots_ros2_driver动态插件在URDF中配置后可被实例化，init()方法可正常执行完成，已确认step()方法签名正确、仿真在运行，但step()方法从未被webots_ros_driver调用。

## 环境

使用webots_ros2_driver、ROS2，运行Webots仿真，自定义pluginlib动态插件。

## 解决办法

1. 移除仿真中等待未启动的外部控制器（&lt;extern&gt;）的机器人；或2. 将该机器人的控制器切换为非外部控制器；或3. 为该机器人提供对应的外部控制器。

原问题作者：AmazingWouldBeGreatBut；采纳答案作者：AmazingWouldBeGreatBut。原内容依 CC BY-SA 4.0 授权，本页摘要同样依 CC BY-SA 4.0 授权。
:::

## 原始参考来源 (Sources)

- [Robotics Stack Exchange #118358：Custom dynamic (pluginlib) plugin: init() method executed successfully, step() method ignored](https://robotics.stackexchange.com/questions/118358/custom-dynamic-pluginlib-plugin-init-method-executed-successfully-step-m)