UR5的安装与配置

1 篇文章 0 订阅

##1.Packages

项目Packages
universal_robotur3_moveit_config,ur_description,ur_kinematics,universal_robot,ur5_moveit_config,ur_driver,ur_modern_driver,ur10_moveit_config,ur_bringup,ur_gazebo,ur_msgs
industrial_coreindustrial_core ,industrial_robot_client,industrial_utils,industrial_deprecated, industrial_robot_simulator,industrial_msgs, industrial_trajectory_filters,simple_message
moveit

##2.安装环境

  • ros-kiinetic

##3.安装
安装MoveIt

sudo apt-get install ros-kinetic-moveit

创建工作空间及下载包

mkdir -p ~/universal_robot/src
cd ~/universal_robot/src
git clone https://github.com/ros-industrial/universal_robot.git
git clone https://github.com/ros-industrial/industrial_core.git

下载ur_modern_driver驱动

cd universal_robot
git clone https://github.com/beta-robots/ur_modern_driver.git

修改驱动文件

gedit ~/universal_robot/src/universal_robot/ur_modern_driver/config/ur5_controllers.yaml

在文件最后添加下面内容

controller_list:
 - name: /vel_based_pos_traj_controller #or /pos_based_pos_traj_controller
   action_ns: follow_joint_trajectory
   type: FollowJointTrajectory
   default: true
   joints:
      - shoulder_pan_joint
      - shoulder_lift_joint
      - elbow_joint
      - wrist_1_joint
      - wrist_2_joint
      - wrist_3_joint

编译

cd ~/universal_robot
catkin_make

##4.测试
要在gazebo和rviz模拟UR5并在模拟中对其进行控制,请首先安装必要的软件包:

sudo apt-get install ros-kinetic-gazebo-ros-pkgs ros-kinetic-gazebo-ros-control
sudo apt-get install ros-kinetic-ur-gazebo ros-kinetic-ur5-moveit-config ros-kinetic-ur-kinematics

打开终端,启动

roslaunch ur_gazebo ur5.launch

打开新终端

roslaunch ur5_moveit_config ur5_moveit_planning_execution.launch sim:=true

再打开一个新终端

roslaunch ur5_moveit_config moveit_rviz.launch config:=true

结果图
gazebo:
这里写图片描述

rviz:
这里写图片描述

通过拖动UR5的末端,按plan可以规划路径,按execute可以使UR5运动,在gazebo上也可以看到运动的图像

这里写图片描述

##5.与实体机器人通讯
要调出真实的机器人,请在用实际硬件地址替换IP_OF_THE_ROBOT后运行以下命令:

roslaunch ur_modern_driver ur5_bringup.launch robot_ip:=IP_OF_THE_ROBOT [reverse_port:=REVERSE_PORT]

为了设置MoveIt!允许运动计划运行的节点

roslaunch ur5_moveit_config ur5_moveit_planning_execution.launch

用于启动包含MoveIt!的配置的RViz!运动规划插件运行:

roslaunch ur5_moveit_config moveit_rviz.launch config:=true

说明:1.使用tool0_controller框架,默认的框架名称是:base和tool0_controller。
2.ur_modern_driver驱动程序目前支持两个位置轨迹控制器; 基于位置和基于速度。它们都通过启动文件加载,但其中只有一个可以同时运行。默认情况下,基于速度的控制器启动。您可以通过调用相应的服务来切换控制器:
rosservice call /universal_robot/controller_manager/switch_controller "start_controllers:

  • ‘vel_based_pos_traj_controller’
    stop_controllers:
  • ‘pos_based_pos_traj_controller’
    strictness: 1"
    或者
    rosservice call /universal_robot/controller_manager/switch_controller ‘{start_controllers: {‘vel_based_pos_traj_controller’}, stop_controllers:: {‘pos_based_pos_traj_controller’},strictness: 1}’
    在启动新控制器之前,请确保在当前正在运行的控制器之前或之后停止,否则将失败。

##6.可能产生的问题
错误1:

universal_robot/ur_modern_driver/src/ur_hardware_interface.cpp:186:22: error: ‘const struct hardware_interface::ControllerInfo’ has no member named ‘hardware_interface’
controller_it->hardware_interface.c_str());

解决方法:
改变ur_hardware_interface.cpp,具体地改变controller_it-> hardware_interface到controller_it->类型
ur_hardware_interface.cpp文件路径为:universal_robot/ur_modern_driver/src/ur_hardware_interface.cpp

更多操作细节请移步UR5的安装与配置

参考链接:
更改后的ur_hardware_interface.cpp

  • 11
    点赞
  • 73
    收藏
    觉得还不错? 一键收藏
  • 6
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值