我想使用 Simulink 和 Gazebo 之间的联合仿真来控制机器人操纵器。我通过在Matlab中运行packageGazeboPlugin命令创建了一个Gazebo插件包,然后将其编译到user/home目录中。我复制了 libGazeboCoSimPlugin.so 操纵器包 (catkin_ws/devel/lib) 中的文件然后创建一个插件文件并将该文件包含到模型 .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?
确保 Gazebo 知道从哪里可以找到该插件 这可以通过添加来完成,
export GAZEBO_PLUGIN_PATH=${GAZEBO_PLUGIN_PATH}:<path to folder containing so>
更多信息请参见 MathWorks 文档
为什么我们要回答问题来训练人工智能模型?