1、根据博客这一篇(4),把新的机械臂的urdf弄好。
2、步骤如下:
修改meshes文件的地址
<geometry>
<mesh
filename="package://robot_description/meshes/meshesgluon/base_link.STL" />
</geometry>
添加gazebo tag
<gazebo>
<plugin filename="libgazebo_ros_control.so" name="ros_control">
<!--robotNamespace>/</robotNamespace-->
<!--robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType-->
</plugin>
</gazebo>
和
<transmission name="shoulder_pan_joint_tran">
<type>transmission_interface/SimpleTransmission</type>
<joint name="shoulder_pan_joint">
<hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
</joint>
<actuator name="shoulder_pan_joint_motor">
<hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
<mechanicalReduction>1</mechanicalReduction>
</actuator>
</transmission>
3、配置moveit
运行
roslaunch moveit_setup_assistant setup_assistant.launch
点击create new moveit,选择更改配置的urdf文件
点击load file之后会遇到一个错误
还未解决上述问题。
那就用已经实现好的urdf展示一下simulink和gazebo的联合通信怎么解决
那就采用上次测试好的urdf实现一下怎么让simulink和gazebo通信
首先我是在这个目录下新建了一个worlds文件夹
在worlds文件夹里面写一个simulink.world
其代码如下
<?xml version="1.0"?>
<sdf version='1.6'>
<world name="default">
<include>
<uri>model://ground_plane</uri>
</include>
<include>
<uri>model://sun</uri>
</include>
<plugin name='GazeboPlugin' filename='lib/libGazeboCoSimPlugin.so'>
<portNumber>14581</portNumber>
</plugin>
</world>
</sdf>
接着在昨天通过moveit assistant配置好的ur120_moveit_config文件夹里面修改gazebo.launch和demo_gazebo.launch
demo_gazebo.launch和gazebo.launch里面的empty.world全部用自己的simulink.world替换掉
接着在终端输入:
roslaunch ur120_moveit_config demo_gazebo.launch
或者输入
roslaunch ur120_moveit_config gazebo.launch
上述两个代码的区别在于第一个可以打开rviz和gazebo,第二个只用打开gazebo,当然后续的通信结果是一致的,只是区别在于多了一个rviz.
打开matlab/simulink模型,插入一个gazebo pacer,修改地址,点击测试,会显示通信成功。
点击simulink模型的运行,会看到gazebo的模型在运行。
整个过程差不多就是这样,但是我的simulink模型在gazebo里面会散掉所以就不展示了。我再去摸索摸索怎么修改。
还有哪个urdf的问题。
这个博客的两个问题希望有经验的大佬有解决办法欢迎指导一二!!!谢谢!!
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)