当前位置: 代码迷 >> 综合 >> Franka Emika Panda机械臂规划路径时,rviz中手爪显示碰撞
  详细解决方案

Franka Emika Panda机械臂规划路径时,rviz中手爪显示碰撞

热度:28   发布时间:2023-10-22 02:25:13.0

【Franka Emika Panda连接真实机械臂(二)】
本文是对上文的一些补充。
前文中的franka_ros功能包和panda_moveit_config功能包是分别在不同的工作空间编译的,所以在控制真实机械臂的过程中,不得不按照【Franka Emika Panda连接真实机械臂(二)】中所描述的那样,先后启动不同的控制节点。运行

roslaunch panda_moveit_config panda_control_moveit_rviz.launch robot_ip:=172.16.0.2 load_gripper:=true

按照常理来说,应该可以直接控制机械臂,但是现实情况是报错,现实找不到franka_control的包。后来通过查阅官方文档,发现franka_ros功能包和panda_moveit_config功能包本来是在一起的,后来panda_moveit_config功能包被单独拿出来放在了ros_planning路径下。
所以赶紧把franka_ros功能包和panda_moveit_config功能包放在一个工作空间里编译,没有问题,运行panda_control_moveit_rviz.launch也出现了rviz,但是却显示手爪和末端碰撞。
仔细阅读了urdf文件,
franka_ros/franka_description/robots/下的hand.urdf.xacro、panda_arm.urdf.xacro melodic版本都有改动。
Franka Emika Panda机械臂规划路径时,rviz中手爪显示碰撞这里显示碰撞的原因就是多了这句safety_distance=“0.03”。但是这句现在又不能去掉。
解决办法:

cd ~/catkin_franka/src/panda_moveit_config/config
gedit panda_arm.xacro

文档后面多加了两句。disable_collisions是设置不检测这两个关节之间的碰撞。

 <disable_collisions link1="panda_link0" link2="panda_link1" reason="Adjacent" /><disable_collisions link1="panda_link0" link2="panda_link2" reason="Never" /><disable_collisions link1="panda_link0" link2="panda_link3" reason="Never" /><disable_collisions link1="panda_link0" link2="panda_link4" reason="Never" /><disable_collisions link1="panda_link1" link2="panda_link2" reason="Adjacent" /><disable_collisions link1="panda_link1" link2="panda_link3" reason="Default" /><disable_collisions link1="panda_link1" link2="panda_link4" reason="Never" /><disable_collisions link1="panda_link2" link2="panda_link3" reason="Adjacent" /><disable_collisions link1="panda_link2" link2="panda_link4" reason="Never" /><disable_collisions link1="panda_link3" link2="panda_link4" reason="Adjacent" /><disable_collisions link1="panda_link3" link2="panda_link6" reason="Never" /><disable_collisions link1="panda_link4" link2="panda_link5" reason="Adjacent" /><disable_collisions link1="panda_link4" link2="panda_link6" reason="Never" /><disable_collisions link1="panda_link4" link2="panda_link7" reason="Never" /><disable_collisions link1="panda_link4" link2="panda_link8" reason="Never" /><disable_collisions link1="panda_link5" link2="panda_link6" reason="Adjacent" /><disable_collisions link1="panda_link6" link2="panda_link7" reason="Adjacent" /><disable_collisions link1="panda_link6" link2="panda_link8" reason="Default" /><disable_collisions link1="panda_link7" link2="panda_link8" reason="Adjacent" />

这样就大功告成了,可以直接运行一个launch文件控制panda机械臂了。