1.urdf中的关节无法加载到gazebo
[error]:This robot has a joint named “joint_1” which is not in the gazebo model.
原因:urdf的link标签下的惯性设置问题
已解决,参考:https://answers.ros.org/question/238899/this-robot-has-a-joint-named-joint_1-which-is-not-in-the-gazebo-model/
2.urdf的标签缺少hardware_interface/
[ WARN] [1592977254.131172803, 0.157000000]: Deprecated syntax, please prepend ‘hardware_interface/’ to ‘PositionJointInterface’ within the tag in joint ‘shoulder_pan_joint’.
已解决。
提示已经很明显了,把下面的标签
<hardwareInterface>PositionJointInterface</hardwareInterface>
换成这个:
<hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
3.没有指定pid
No p gain specified for pid
已解决,参考:
1.https://answers.ros.org/question/293830/what-is-the-fix-for-no-p-gain-specified-for-pid-namespace-gazebo_ros_controlpid_gainsback_right_wheel_joint-ros-melodic/
2.http://www.dtmao.cc/news_show_494301.shtml
3.https://www.pianshen.com/article/44461332312/
虽然3个都差不多但还是建议都打开看看
4.urdf文件和python编码冲突导致无法加载参数服务器
UnicodeEncodeError: ‘ascii’ codec can’t encode characters in position 0-1: ordinal not in range
urdf采用UTF-8的编码方式,而python默认采用ascll码
已解决
参考(一个是原因,一个是解决办法):
https://www.cnblogs.com/excellentlhw/p/10916953.html
https://blog.csdn.net/weixin_39221360/article/details/79525341
解决方法有三种:
1.在命令行修改,仅本会话有效:
1)通过>>>sys.getdefaultencoding()查看当前编码(若报错,先执行>>>import sys >>>reload(sys));
2)通过>>>sys.setdefaultencoding('utf8')设置编码
2.较繁琐,最有效
1)在程序文件中以下三句
import sys
reload(sys)
sys.setdefaultencoding('utf8')
3.修改Python本环境(推荐)
在Python的Lib\site-packages文件夹下新建一个sitecustomize.py文件,内容为:
#coding=utf8
import sys
reload(sys)
sys.setdefaultencoding('utf8')
重启Python解释器,发现编码已被设置为utf8,与方案二同效;这是因为系统在Python启动的时候,
自行调用该文件,设置系统的默认编码,而不需要每次都手动加上解决代码,属于一劳永逸的解决方法。
亲测第三种有效,附上寻找python安装目录下的Python的Lib\site-packages目录的方法:
方法一:
$ echo $PYTHONPATH
方法二:
$ python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"
我是在方法一的安装地址中创建sitecustomize.py成功修改了python的编码方式,在方法二的地址中创建则没有成功。
参考:https://blog.csdn.net/leafrenchleaf/article/details/84013529
5.base_link之inertia问题
[ WARN] : The root link base_link has an inertia specified in the URDF, but KDL does not support a root link with an inertia. As a workaround, you can add an extra dummy link to your URDF.
参考如下
<link name="base_link">
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://minibot_description/meshes/mb_4wheels/base_link.STL" />
</geometry>
<material
name="">
<color
rgba="0 0.50196 1 1" />
</material>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://minibot_description/meshes/mb_4wheels/base_link.STL" />
</geometry>
</collision>
</link>
<joint name="inertial_joint" type="fixed">
<parent link="base_link"/>
<child link="main_mass"/>
<origin xyz="0 0 0 " rpy="0 0 0"/>
</joint>
<link name="main_mass" type="fixed">
<inertial>
<origin
xyz="-0.00063415 0.00050377 0.011118"
rpy="0 0 0" />
<mass
value="2.9032" />
<inertia
ixx="0.005"
ixy="0.001"
ixz="0.005"
iyy="0.001"
iyz="0.001"
izz="0.005"
/>
</inertial>
</link>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)