Ubuntu下使用ROS moveit 连接ABB机器人

环境:Ubuntu16.04+ROS-kinetic(ROSPC)  

          Windows10+RobotStudio6.07(ROBOTPC)

          我用了两台电脑,一台是WIN10用VMWare装了虚拟机ubuntu,另一台是WIN10。

          也可以只用一台电脑,只要内存够大,运行效果ok就可以,在这台电脑上Windows中用VMWare装虚拟机Ubuntu,然后在Windows中装Robot Studio6.07(现在是6.08了,6.0以上版本应该都ok,以下版本我没试过),在Ubuntu里装ROS(Ubuntu和ROS版本要对应,比如16.04对应kinetic版的ROS)。

         如果你用的是真实机器人,那就只需要ROSPC,因为机器人本身就是ROBOTPC。

        仿真用的是ABB irb2400,这是ROS官方支持的型号,不需要自己生成配置文件

         原理类的东西,这里不多说了。

一:安装ROS

参考官方维基:http://wiki.ros.org/cn/kinetic/Installation/Ubuntu

二:设置虚拟机网络(没用虚拟机的可以跳过这一步)

这一步的目的是固定ubuntu的IP地址,利用桥接模式,使它和主机在同一个子网下,我这里用的是以太网的ip,用无线局域网的应该也可以。

扫描二维码关注公众号,回复: 5737425 查看本文章

打开VMWare->编辑虚拟机设置->网络适配器->桥接模式:

编辑->虚拟网络编辑器->选择你要桥接到的网络,我选择的是我的以太网卡,把DHCP关掉:

进入ubuntu->编辑有线连接1->编辑

IPV4设置->方法:手动->然后添加一个地址和你的以太网(或无线局域网)在同一个网段即可,可用ipconfig在WIN10上查看

设置完成之后,断开重连,打开终端用ifconfig查看当前Ubuntu IP:

可以尝试一下ping你的ROBOTPC,如果成功就可以进行下一步。

注意:ROBOTPC得和ROSPC在同一个网段下。

三:在RobotStudio下仿真(用真实机器人的可以跳过这一步)

参考官方教程:http://wiki.ros.org/abb/Tutorials/RobotStudio

重要的是要加入616-1 PC-interface和623-1 MultiTasking选项

四:在机器人端配置rapid代码,运行ABB-server

参考官方教程:http://wiki.ros.org/abb/Tutorials

比较重要的是,socket设置的ip要改成ROBOTPC的ip.

五:在Ubuntu上下载abb配置包,用ROS调用:

先创建一个文件夹,叫 catkin_ws,作为工作区,底下要有src文件夹:

参考:http://wiki.ros.org/abb_experimental

   1 cd /path/to/catkin_ws/src
   2 
   3 # retrieve the latest development version of industrial_core. If you'd rather
   4 # use the latest released version, replace 'kinetic-devel' with 'kinetic'
   5 git clone -b kinetic-devel https://github.com/ros-industrial/industrial_core.git
   6 
   7 # retrieve the latest development version of abb and abb_experimental
   8 # NOTE: you MUST use the '-devel' version of abb
   9 git clone -b kinetic-devel https://github.com/ros-industrial/abb.git
  10 git clone -b kinetic-devel https://github.com/ros-industrial/abb_experimental.git
  11 
  12 cd /path/to/catkin_ws
  13 
  14 # checking dependencies
  15 rosdep install --from-paths src --ignore-src --rosdistro kinetic
  16 
  17 # building
  18 catkin_make
  19 
  20 # source this workspace (only if you don't have any others)
  21 source /path/to/catkin_ws/devel/setup.bash

在ROSPC能ping通ROBOTPC和ROBOTPC启动ABB server的前提下,

进入src中放abb_irb2400_moveit_config文件的文件夹(应该是cd /path/to/catkin_ws/src/abb),执行下一指令:

roslaunch abb_irb2400_moveit_config moveit_planning_execution.launch sim:=false robot_ip:=192.168.249.100

设置的robot_ip就是ROBOTPC的IP地址。
如果成功的话在ROBOTPC端,就能看到connection提示,然后你在ROSPC弹出的rviz上进行操作,就可以控制ROBOTPC上仿真的机器人或者真实的机器人了。

祝顺利。

猜你喜欢

转载自blog.csdn.net/spy14414/article/details/85629208
今日推荐