MatLab与Gazebo的联合仿真



我想使用Simulink和Gazebo之间的联合仿真来控制一个机器人机械手。我在Matlab中运行packageGazeboPlugin命令创建了一个Gazebo插件包,然后在user/home目录下进行编译。我复制了libGazeboCoSimPlugin.so操作器包中的文件(catkin_ws/devel/lib)然后创建一个插件文件,并将该文件包含到model .xacro文件中:

plugin file:

<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文档

最新更新