UR机械臂学习(5-3):驱动ur机械臂实物——问题及解决

问题1 Could not find a package configuration file

问题1.1 ur_client_library

在这里插入图片描述

  Could not find a package configuration file provided by "ur_client_library"
  with any of the following names:

    ur_client_libraryConfig.cmake
    ur_client_library-config.cmake

  Add the installation prefix of "ur_client_library" to CMAKE_PREFIX_PATH or
  set "ur_client_library_DIR" to a directory containing one of the above
  files.  If "ur_client_library" provides a separate development package or
  SDK, be sure it has been installed.

解决:

注意下划线改为小短线

sudo apt-get install ros-melodic-ur-client-library

问题1.2 industrial_robot_status_interface

在这里插入图片描述

Could not find a package configuration file provided by
  "industrial_robot_status_interface" with any of the following names:

    industrial_robot_status_interfaceConfig.cmake
    industrial_robot_status_interface-config.cmake

  Add the installation prefix of "industrial_robot_status_interface" to
  CMAKE_PREFIX_PATH or set "industrial_robot_status_interface_DIR" to a
  directory containing one of the above files.  If
  "industrial_robot_status_interface" provides a separate development package
  or SDK, be sure it has been installed.

解决:

sudo apt-get install ros-melodic-industrial-robot-status-interface

问题2 ‘ur_msgs::SetPayload

在这里插入图片描述

 error: ‘ur_msgs::SetPayload::Request {aka struct ur_msgs::SetPayloadRequest_<std::allocator<void> >}’ has no member named ‘mass’

解决:

# 在工作区ur_ws下执行
git clone https://github.com/ros-industrial/ur_msgs.git src/ur_msgs

在这里插入图片描述
会提示有两个ur_msgs,把在universal_robot里面的删了,然后把新的ur_msgs放到universal_robot文件夹里面

问题3 No such file “load_ur3”

在这里插入图片描述
这个问题是在启动ur3_bringup.launch时产生的,因为新版的ur_ros_driverrobot_description_file使用的是load_ur3,但是universal_robot里的description文件夹里的名字是ur3_upload.launch

如下面所示,第11行,说明了要启动的description文件

<?xml version="1.0"?>
<launch>
  <arg name="debug" default="false" doc="Debug flag that will get passed on to ur_common.launch"/>
  <arg name="robot_ip" doc="IP address by which the robot can be reached."/>
  <arg name="reverse_port" default="50001" doc="Port that will be opened by the driver to allow direct communication between the driver and the robot controller."/>
  <arg name="script_sender_port" default="50002" doc="The driver will offer an interface to receive the program's URScript on this port. If the robot cannot connect to this port, `External Control` will stop immediately."/>
  <arg name="tf_prefix" default="" doc="tf_prefix used for the robot."/>
  <arg name="controllers" default="joint_state_controller scaled_pos_joint_traj_controller speed_scaling_state_controller force_torque_sensor_controller" doc="Controllers that are activated by default."/>
  <arg name="stopped_controllers" default="pos_joint_traj_controller joint_group_vel_controller" doc="Controllers that are initally loaded, but not started."/>
  <arg name="controller_config_file" default="$(find ur_robot_driver)/config/ur3_controllers.yaml" doc="Config file used for defining the ROS-Control controllers."/>
  <arg name="robot_description_file" default="$(find ur_description)/launch/load_ur3.launch" doc="Robot description launch file."/>
  <arg name="kinematics_config" default="$(find ur_description)/config/ur3/default_kinematics.yaml" doc="Kinematics config file used for calibration correction. This will be used to verify the robot's calibration is matching the robot_description."/>
  <arg name="headless_mode" default="false" doc="Automatically send URScript to robot to execute. On e-Series this does require the robot to be in 'remote-control' mode. With this, the URCap is not needed on the robot."/>

  <include file="$(find ur_robot_driver)/launch/ur_common.launch" pass_all_args="true">
    <arg name="use_tool_communication" value="false"/>
  </include>
</launch>

改/home/guyue/ur_ws/src/universal_robot/Universal_Robots_ROS_Driver/ur_robot_driver/launch的ur3_bringup.launch文件
load_ur3改为ur3_upload.launch

解决:
解决这个问题最正确的方法是删了现在的文件夹,建新的工作区,然后按照我下面这篇文章去重新下载一遍

还有一种方式是就在现有的这个文件夹内更新ur_description文件夹
下载地址:https://github.com/fmauch/universal_robot/tree/calibration_devel
注意分支是calibration_devel

只更新ur_description文件夹我不知道可不可以,我是把全部分支都git下来了
然后catkin_make的时候会报错,我把提示重复的文件夹删除了

问题4 could not have their rosdep keys resolved

to system dependencies
在这里插入图片描述

在运行rosdep install --from-paths src --ignore-src -y之后

ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies (ROS distro is not set. Make sure `ROS_DISTRO` environment variable is set, or use `--rosdistro` option to specify the distro, e.g. `--rosdistro indigo`):

解决:
在最开始说明ros版本

source /opt/ros/melodic/setup.bash

问题5 Action client not connected: scaled_pos_traj_controller/follow_joint_trajectory

在这里插入图片描述

[ WARN] [1624863539.203489625, 57.864000000]: Waiting for scaled_pos_joint_traj_controller/follow_joint_trajectory to come up
[ WARN] [1624863545.212986404, 63.864000000]: Waiting for scaled_pos_joint_traj_controller/follow_joint_trajectory to come up
[ERROR] [1624863551.221038108, 69.865000000]: Action client not connected: scaled_pos_joint_traj_controller/follow_joint_trajectory

解决:

这个是个很大的坑。

首先要确定的是在/home/guyue/ur_ws/src/fmauch_universal_robot/ur3_moveit_config/config下的ros_controllers.yaml
name需要为scaled_pos_traj_controller,因为如果不是这个名字,是无法驱动实物机械臂的。

下面说原因:
看下面这张图,bringup启动的时候,他启动的是scaled_pos_traj_controller控制器

在这里插入图片描述

然后再回来说为什么启动gazebo,然后再启动moveit的时候会报这个错

看下面这张图

在这里插入图片描述
/home/guyue/ur_ws/src/fmauch_universal_robot/ur3_moveit_config/config下的ros_controllers.yaml

/home/guyue/ur_ws/src/fmauch_universal_robot/ur_gazebo/config下的ur3_controllers.yaml

这两个文件夹对这个控制器的名字不一样

现在有两种思路

  • 一种是把这两个文件里关于控制器的名称改为一样的
  • 另一种是在某个文件里把这两个控制器连接在一起

💐 先说第一种思路:

❤ 如果把moveit下面的ros_controllers.yaml里的scaled_pos_traj_controller改为pos_traj_controller

gazebo和所有仿真都正常,但在驱动实物时又会出现问题,因为ur_ros_driver驱动里面所有控制器的名字都是scaled_pos_traj_controller

❤ 而如果把gazebo下面的ur3_controllers.yaml里的pos_traj_controller改为scaled_pos_traj_controller

在启动gazebo时就会报错,因为/home/guyue/ur_ws/src/fmauch_universal_robot/ur_gazebo/launch文件夹下的ur3_bringup.launch也同样将这个控制器的名字命名为pos_traj_controller

如果说ur3_controllers.yamlur3_bringup.launch里的名字都修改,启动gazebo是不报错了,但启动moveit时还是会报最开始的那个错误。

💐 所以,我们因当采取的是第二种思路:

也就是修改两者的连接文件

我们在moveit中启动的是ur3_moveit_planning_execution.launchl文件,所以从这个文件开始看起。
在这个里面就提到了如果sim参数为true,就连接两个控制器,但是这里面对于gazebo的名字为arm_controller,而不是现在所使用的pos_traj_controller,所以问题应该就出现在这里了。

所以,最后应该是修改/home/guyue/ur_ws/src/fmauch_universal_robot/ur3_moveit_config/launch下的ur3_moveit_planning_execution.launchl

修改后应该如下图所示

在这里插入图片描述
因为gazebo和moveit里的分别是

# moveit
controller_list:
- name: "scaled_pos_joint_traj_controller"
  action_ns: follow_joint_trajectory
  type: FollowJointTrajectory
  joints:
    - shoulder_pan_joint
    - shoulder_lift_joint
    - elbow_joint
    - wrist_1_joint
    - wrist_2_joint
    - wrist_3_joint

# gazebo
pos_joint_traj_controller:
  type: position_controllers/JointTrajectoryController
  joints: &robot_joints
    - shoulder_pan_joint
    - shoulder_lift_joint
    - elbow_joint
    - wrist_1_joint
    - wrist_2_joint
    - wrist_3_joint

所以修改ur3_moveit_planning_execution.launchl

<remap if="$(arg sim)" from="/scaled_pos_joint_traj_controller/follow_joint_trajectory" to="/pos_joint_traj_controller/follow_joint_trajectory"/>

最后,因为ur的安装包和驱动一直在更新,所以如果这种方法也没用了,可以注意下面几个文件里控制器的名称是否一致

  • gazebo里的文件

    • /home/guyue/ur_ws/src/fmauch_universal_robot/ur_gazebo/config文件夹下的ur3_controllers.yaml
    • /home/guyue/ur_ws/src/fmauch_universal_robot/ur_gazebo/launch文件夹下的ur3_bringup.launch
  • moveit的文件

    • /home/guyue/ur_ws/src/fmauch_universal_robot/ur3_moveit_config/config文件夹下的ros_controllers.yaml
    • /home/guyue/ur_ws/src/fmauch_universal_robot/ur3_moveit_config/launch文件夹下的ur3_moveit_planning_execution.launch

最后的最后,2021年6月下载的fmauch版,moveit的部分不需要修改,只需要修改gazebo部分
也就是说,只驱动真实机械臂,不仿真,是没有任何问题的,不需要任何修改

问题6 could not load controller

在这里插入图片描述参考:https://blog.csdn.net/weixin_43455581/article/details/106331325

sudo apt-get install ros-melodic-ros-control ros-melodic-ros-controllers

sudo apt-get install ros-melodic-force-torque-sensor-controller

问题7 打开的rviz没有画面

问题7.1 rviz没有画面

打开的rviz没有画面
在这里插入图片描述
解决:
https://github.com/UniversalRobots/Universal_Robots_ROS_Driver/issues/403

运行

roslaunch ur3_moveit_config moveit_rviz.launch rviz_config:=$(rospack find ur3_moveit_config)/launch/moveit.rviz

问题7.2 终端不能移动

接下来会发现终端不能移动
在这里插入图片描述
解决:
在下方选择manipilator而不是endeffector
在这里插入图片描述

问题7.3 一直循环动作

然后会发现点击execute后会一直循环动作

解决:
取消动作循环
在这里插入图片描述

问题8 Error in REST request或 Parser error

在运行gazebo时提示[Err] [REST.cc:205] Error in REST request
或者[Err] [ClientConfig.cc:270] Parser error [3]

在这里插入图片描述

在这里插入图片描述
解决:

  • 对于[Err] [ClientConfig.cc:270] Parser error [3](这个删除了,重新运行会再次生成的)
rm .ignition/fuel/config.yaml
  • 对于[Err] [REST.cc:205] Error in REST request
gedit .ignition/fuel/config.yaml

url: https://api.ignitionfuel.org改为 url: https://api.ignitionrobotics.org

问题9 Can’t accept new action goals. Controller is not running.

在规划路径后excu执行时报错
在这里插入图片描述

Can't accept new action goals. Controller is not running.

解决:
这一般应该是示教器的问题
参考<bots/Universal_Robots_ROS_Driver/issues/4>
如果示教器正常运行,会出现

[ INFO] [1624885305.373017515]: Robot requested program
[ INFO] [1624885305.373077772]: Sent program to robot
[ INFO] [1624885305.839015623]: Robot connected to reverse interface. Ready to receive control commands.

但是我示教器没有问题,是我在问题4那里把moveit下面的ros_controllers.yaml里的scaled_pos_traj_controller改为了pos_traj_controller
改回来就好了

问题10 ‘rqt_joint_trajectory_controller’ not found

在这里插入图片描述

[rospack] Error: package 'rqt_joint_trajectory_controller' not found

解决:
安装

sudo apt-get install ros-melodic-rqt-joint-trajectory-controller ros-melodic-control-msgs ros-melodic-controller-manager-msgs ros-melodic-rospy ros-melodic-rqt-gui ros-melodic-rqt-gui-py ros-melodic-trajectory-msgs

先运行roscore,然后rosrun检查rqt中是否已经存在rqt_joint_trajectory_controller,如果找不到,输入以下代码:

rosrun rqt_joint_trajectory_controller rqt_joint_trajectory_controller --force-discover

然后就可以看到rqt_joint_trajectory_controller界面显示在桌面上。重新打开仿真系统(我正在用的是RViz),呼出rqt,即可以在Plugins->RobotTools上找到轨迹控制器。

问题11 rqt没有关节滑动条

在这里插入图片描述
解决:
下载rqt_controller_manager

sudo apt-get install ros-<your-distro>-rqt-controller-manager

选择controller manager nscontroller
然后点击红色按钮启动,就可以了
在这里插入图片描述

问题12 Group ‘’ not found in model ‘ur3_robot’

在运行roslaunch ur3_moveit_config moveit_rviz.launch rviz_config:=$(rospack find ur3_moveit_config)/launch/moveit.rviz时报错

[ERROR] [1625037821.612121722, 39.742000000]: Group '' not found in model 'ur3_robot'

在这里插入图片描述解决:
好像是个偶然事件,关掉重新运行rviz就好了

  • 23
    点赞
  • 106
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
要将Robotiq-2F85夹爪连接到UR5e机械臂的法兰盘,并使用ROS进行驱动,可以按照以下步骤进行操作: 1. 首先,确保你已经在UR5e机械臂的法兰盘上正确安装了Robotiq-2F85夹爪,并且夹爪的通信和电源已经连接好。 2. 确保你的机器人上已经安装了ROS,并且配置了适当的URDF(Unified Robot Description Format)文件,以描述机械臂的结构和关节信息。 3. 在ROS工作空间中下载并安装robotiq包。可以使用以下命令: ``` $ cd ~/catkin_ws/src $ git clone https://github.com/ros-industrial/robotiq.git $ cd ~/catkin_ws $ catkin_make ``` 4. 进入Robotiq包中的robotiq_ethercat目录,并将其复制到你的UR5e机械臂上。可以使用以下命令: ``` $ cd ~/catkin_ws/src/robotiq/robotiq_ethercat $ scp -r * username@ur5e_ip_address:/path/to/catkin_ws/src/robotiq_ethercat ``` 5. 在UR5e机械臂上,进入robotiq_ethercat目录,并编译EtherCAT驱动程序。可以使用以下命令: ``` $ cd /path/to/catkin_ws/src/robotiq_ethercat $ make ``` 6. 配置EtherCAT驱动程序。你需要编辑robotiq_ethercat.launch文件,将其中的IP地址设置为你的UR5e机械臂的IP地址,并将其他参数根据需要进行调整。 7. 在UR5e机械臂上启动EtherCAT驱动程序。可以使用以下命令: ``` $ cd /path/to/catkin_ws/src/robotiq_ethercat $ sudo ./start_ethercat.sh ``` 8. 在ROS工作空间中创建一个新的功能包,用于控制Robotiq-2F85夹爪。可以使用以下命令: ``` $ cd ~/catkin_ws/src $ catkin_create_pkg robotiq_control rospy ``` 9. 进入功能包目录,创建一个名为"launch"的文件夹,并在该文件夹中创建一个名为"robotiq_control.launch"的launch文件。在launch文件中,配置节点和参数,以启动机器人控制节点和夹爪控制节点。 10. 编译ROS功能包,可以使用以下命令: ``` $ cd ~/catkin_ws $ catkin_make ``` 11. 启动ROS节点,可以使用以下命令: ``` $ roslaunch robotiq_control robotiq_control.launch ``` 现在,你应该能够通过ROS功能包来控制UR5e机械臂法兰盘上的Robotiq-2F85夹爪了。你可以通过发布适当的消息到相关的ROS话题,来控制夹爪的动作。 请注意,以上步骤只是一个基本的指南。实际操作中可能会有其他细节和配置,具体取决于你的机器人和环境。你可以查阅Robotiq和ROS的官方文档,以获取更详细的步骤和示例代码。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值