ROS->UR真实机械臂动起来(ur_modern_driver)

Installation

The following instructions assume that a Catkin workspace has been created at $HOME/catkin_ws and that the source space is at $HOME/catkin_ws/src. Update paths appropriately if they are different on the build machine.

In all other cases the packages will have to be build from sources in a Catkin workspace:

切换行号显示

   1 cd /path/to/catkin_ws/src
   2 
   3 # retrieve the sources (replace '$DISTRO' with the ROS version you are using)
   4 git clone -b $DISTRO-devel https://github.com/ros-industrial/ur_modern_driver.git
    //如果indigo的话需要手动下载到src文件夹下
   5 
   6 cd /path/to/catkin_ws
   7 
   8 # checking dependencies (replace '$DISTRO' with the ROS version you are using)
   9 rosdep update
  10 rosdep install --from-paths src --ignore-src --rosdistro $DISTRO
  11 
  12 # building
  13 catkin build
  //indigo版本的话需要catkin_make
  14 
  15 # source this workspace (careful when also sourcing others)
  16 source /path/to/catkin_ws/devel/setup.bash

The packages can now be used as regular ROS packages.

Usage

if you would like to run this package to connect to the hardware, you only need to run the following launch file.

roslaunch ur_modern_driver urXX_bringup.launch robot_ip:=ROBOT_IP_ADDRESS

//ROBOT_IP_ADDRESS为真实UR控制器IP地址,装ROS的主机要和UR控制器IP在同一网段

 

Where ROBOT_IP_ADDRESS is your UR arm's IP and XX is '5' or '10' depending on your robot. The above launch file makes calls to both roscore and the launch file to the urXX_description so that ROS's parameter server has information on your robot arm. If you do not have your ur_description installed please do so via:

 

sudo apt install ros--ur-description

或者全部安装sudo apt-get install ros-kinetic-ur*

Where is the ROS distribution your machine is running on. You may want to run MoveIt to plan and execute actions on the arm. You can do so by simply entering the following commands after launching ur_modern_driver:

roslaunch urXX_moveit_config ur5_moveit_planning_executing.launch
roslaunch urXX_moveit_config moveit_rviz.launch config:=true

 

在moveit中拖动,单击plan,如果plan可以到达指定位置,则电机execute,则机械臂就会运动。

 

同类文章:

https://blog.csdn.net/fcc_bd_stars/article/details/78150729

UR5机械臂--ROS系统通信建立与实时控制

你可能感兴趣的:(ROS)