用moveit生成配置文件后,启动roslaunch arm4 demo_gazebo.com
报错,如下:
spawner: error: too few arguments
XmbTextListToTextProperty result code -2
XmbTextListToTextProperty result code -2
[controller_spawner-4] process has died [pid 26682, exit code 2, cmd /opt/ros/melodic/lib/controller_manager/spawner __name:=controller_spawner __log:=/home/will/.ros/log/44dc526e-8146-11eb-9ec2-b8ca3a8092a4/controller_spawner-4.log].
log file: /home/will/.ros/log/44dc526e-8146-11eb-9ec2-b8ca3a8092a4/controller_spawner-4*.log
后来检查了一下,是由于URDF
文件有问题引起的,原来的URDF
文件是由Solidworks生成的,在base_link
中会添加物理属性,格式如下。但是有时运行gazebo
的时候又提示说不能在base link
中添加inertial
的属性,我就把这部分给去掉,把xyz数值写到origin里面,这就造成了错误。实际用源文件就是对的。
<robot
name="arm4">
<link
name="base_link">
<inertial>
<origin
xyz="-0.035038 0.021271 0.26621"
rpy="0 0 0" />
<mass
value="9.7716" />
<inertia
ixx="0.027565"
ixy="-7.594E-06"
ixz="-2.442E-05"
iyy="0.01906"
iyz="4.9006E-05"
izz="0.04123" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
记录一下,以后遇到这种error,也有可能是URDF
文件有问题。