我想使用 Simulink 和 Gazebo 之间的联合仿真来控制机器人操纵器。我通过在 Matlab 中运行 packageGazeboPlugin 命令创建了一个 Gazebo 插件包,然后在用户/主目录中编译它。我在操纵器包(catkin_ws/devel/lib)中复制了 libGazeboCoSimPlugin.so 文件,然后创建了一个插件文件并将此文件包含到模型 .xacro 文件中:
插件文件:
<robot xmlns:xacro="http://www.ros.org/wiki/xacro">
<!-- Simulink Gazebo Plugin -->
<xacro:macro name="GazeboPlugin">
<gazebo>
<plugin name="GazeboPlugin" filename="libGazeboCoSimPlugin.so"><portNumber>14581</portNumber>
<alwaysOn>true</alwaysOn>
<updateRate>0.0</updateRate>
<bodyName>base_link</bodyName>
<frameId>$(arg base_link_frame)</frameId>
</plugin>
</gazebo>
</xacro:macro>
</robot> ```
but when I use the Gazebo pacer block to test if Gazebo has synchronized or not, I receive "failed to connect to Gazebo plugin".
Do you have any idea what is the problem?