关于Skipping virtual joint 'fixed_base' because its child frame 'base_link' does not match the URDF……

前言

又要重新用ROS了,强迫症发作+在家无聊,就顺便把以前遗留的这个问题也解决下。

问题描述

在使用UR包的时候,会有这个问题:

ros.rosconsole_bridge.console_bridge: Skipping virtual joint ‘fixed_base’ because its child frame ‘base_link’ does not match the URDF frame ‘world’

在github上面好像也很多年了,到现在也没有解决,,还看的头晕。

例如:
https://github.com/ros-industrial/universal_robot/pull/284
https://github.com/ros-industrial/universal_robot/issues/347

没时间的话,直接看解决方法4即可。方法1-3是我的试错记录。

瞎猜的可能原因(事实证明,真的是瞎猜,别看这部分了)

至于原因,理一下virtual joint的作用及URDF与相应的SRDF,就会有大概想法了。

  1. Moveit setup assistant中,virtual jointparent frame 会选择world
  2. 默认UR包中,查看SRDF,会发现parent frame 也是worldchild linkbase_link
  3. 但是在ur5_robot.urdf.xacro中,由如下片段:
  <link name="world" />

  <joint name="world_joint" type="fixed">
    <parent link="world" />
    <child link = "base_link" />
    <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0" />
  </joint>
  1. 这就导致一个问题,两个world会不会起冲突?
    (瞎猜的,我主要还是看这里的link命名成world不爽)

解决方法1

上面问题284里面给了一种方法,就是删去ur5_robot.urdf.xacro里面的片段,再修改一下相应的几个launch文件
我在他的基础上,还修改了gazebo中对应的模型,然后出了两个问题。一个是,gazebo中机器人底座不固定了(这个问题会在方法三中解释);另一个是提示kdl求解器出问题,需要添加一个虚拟杆件或者要取消base link上的惯性标签。

但是如果是需要取消惯性标签,宏命令这里要怎么处理,感觉很麻烦。。

(刚刚注意到这个答主修改了回答已经跟方法二一样了 )
注意到,如果直接使用Moveit setup assistant,就会覆写一些文件
为了避免可能的问题,因此推荐 方法三,也即答主的方法。

解决方法2

反正看把link命名成world不爽,就改这个好了。改这个成功的话,也不用修改launch文件

ur5_robot.urdf.xacro(在ur_description/urdf)中的片段改成:

  <link name="world_v" />

  <joint name="world_v_joint" type="fixed">
    <parent link="world_v" />
    <child link = "base_link" />
    <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0" />
  </joint>

重新用Moveit setup assistant,修改virtual jointparent_frameworld, child_linkworld_v即可。

(我目前还不知道这样修改后生成的文件,是否会影响默认UR包内的其他文件。我是另外创建空白工作空间进行实验的。好像是Moveit setup assistant直接生产的配置文件在使用时会有些问题

最后,打开rviz查看机器人,可以看到Fixed Frame也是修改后的link名。非常明了。
(我忘记查看原来情况下的Fixed Frame名了)
(默认UR包里的,Fixed Frameworld)

roslaunch ur5_moveit_config demo.launch

在这里插入图片描述
(说明:我没有测试过方法二在gazebo中的表现情况)

解决方法3

修改urX_robot.urdf.xacro及相关SRDF
其中,urX_robot.urdf.xacro,按方法二修改。
urX.srdfurX_moveit_config/config,中的child_link改为world_v

 <virtual_joint name="fixed_base" type="fixed" parent_frame="world" child_link="world_v" />

但是,这就造成一个问题,机器人底座不固定。参考链接, 可以看到本应固定的底座在不断移动。

查阅原因,URDF中就是需要一个名为worldlink来固定机器人底座。因此,诞生方法四。

If you would like your URDF model to be permanently attached to the world frame (the ground plane), you must create a “world” link and a joint that fixes it to the base of your model. RRBot accomplishes this with the following:

解决方法4(推荐,无后遗症)

保持urX_robot.urdf.xacro不变,仅修改SRDF为中的virtual_joint下的child_link

<virtual_joint name="fixed_base" type="fixed" parent_frame="world" child_link="world" />

经过之前不断测试,发现child_link可以选择urX_robot.urdf.xacro下的各个link
然后就终于解决了这个问题。

另,需要说明的事,在gazebo中,使用的empty_world,当机械臂构型与Z=0的地面发生碰撞时,就执行报错了(不断抖动)。

[ WARN] [1585016493.340250154, 72.187000000]: Controller  failed with error code PATH_TOLERANCE_VIOLATED
[ WARN] [1585016493.340652594, 72.188000000]: Controller handle  reports status ABORTED
[ INFO] [1585016493.340796763, 72.188000000]: Completed trajectory execution with status ABORTED …

[ INFO] [1585016493.489273731, 72.272000000]: ABORTED: Solution found but controller failed during execution

我的现在的解决方法是,修改urX_robot.urdf.xacro升高机器人位置。
在这里插入图片描述

# 题外话
之所以想要解决这个问题,还有个原因是,以前给UR配置ikfast一直没成功。杆件里面有个world的名称实在是膈应,感觉都是它的锅。
现在配置IKFAST,就没有world这个名称了。当然也配置成功了。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章