VMware17--Ubuntu20.04--RobotStudio6.08--ROS1--ABB2600*****通讯

1 篇文章 0 订阅

One PC dual system drive ABB

测试虚拟机借助Robotstudio控制ABB
虚拟机(Ubuntu 20.04)
RobotStudio 6.08

①. 安装虚拟机

软件:VMware workstation 17 pro
Ubuntu20.04
(官网下载,*VM版本保持最新)

VM安装Ubuntu
https://www.bilibili.com/video/BV1zt411G7Vn?p=2&vd_source=44172504510f147a27a2b5d4198d56a4

NAT网络中转,网速不好,因此改用桥接网络 在VM“编辑”-“虚拟网络编辑器”内将VMnet改为桥接模式(仅适用于第一次安装VM)
https://zhuanlan.zhihu.com/p/299381456
注意:若重装过VM,则必须完全卸载VM组件,包括注册列表等信息后才可以开启桥接网络: https://www.cnblogs.com/gzu-link-pyu/p/8271467.html

至此虚拟机安装完成。

②. ROS安装
(不适用于国内,国内参考:)

https://zhuanlan.zhihu.com/p/515361781

https://blog.csdn.net/qq_44339029/article/details/120579608 主推

Ubuntu系统版本:Ubuntu20.04.4 LTS
ROS版本:Noetic

  1. 添加ROS源
    在终端输入如下指令,设置sources.list。
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
  1. 添加密钥
    在终端输入如下指令,添加Ros密钥。
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
  1. 安装ROS
    3.1. 在终端输入如下指令,确保软件索引是最新的
sudo apt update

3.2. 在终端输入如下指令,安装桌面完整版Ros。使用aptitude进行安装,比apt的好处在于,可以帮助解决一些软件的依赖问题,如果无法解决,也会给出很好的建议。
安装方法:sudo apt-get install aptitude

sudo aptitude install ros-noetic-desktop-full
  1. 设置环境变量
    在终端输入如下指令,对环境变量进行配置。
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
  1. 初始化rosdep
    输入以下的命令,先对其初始化一下
sudo rosdep init

如果出现以下界面,直接跳到环境变量设置

Wrote /etc/ros/rosdep/sources.list.d/20-default.list
Recommended: please run

	rosdep update

如果

sudo: rosdep: command not found

输入以下命令

sudo apt install python3-rosdep2

再输入sudo rosdep init命令试试,成功则跳转环境变量设置,如果

ERROR: default sources list file already exists: /etc/ros /rosdep/sources.list.d/20-default.listPlease delete if you wish to re-initialize

输入以下命令:

sudo rm /etc/ros/rosdep/sources.list.d/20-default.list

到这里再输入sudo rosdep init

  1. 设置环境变量
    输入下面的这行代码,注意到底是melodic还是noetic或者是kinetic是由你的ubuntu的版本决定的,我的ubuntu是20.04版本的,对应的是noetic
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc

7.安装rosinstall
输入以下命令:

sudo apt install python3-rosinstall python3-rosinstall-generator python3-wstool
  1. 验证ROS是否安装成功
    验证一下,输入以下命令:
roscore

如果出现了以下的问题:Command ‘roscore’ not found, but can be installed with:sudo apt install python3-roslaunch,按照提示输入sudo apt install python3-roslaunch命令并执行,

如果出现了文件未安装,说明之前的安装没有安装全
输入以下命令,把没安装的安装一下就好了(如果显示有几个安装包无法下载,是因为网络的原因重新输入以下命令就行了)

sudo apt install ros-noetic-desktop-full

输入以下命令:

source /opt/ros/noetic/setup.bash

到这里再输入roscore看一下,若安装成功会显示如下界面:

juniper@D:~$ roscore
... logging to /home/juniper/.ros/log/16244c48-7603-11ed-b8f3-83dc7583895e/roslaunch-D-37323.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://D:42791/
ros_comm version 1.15.15


SUMMARY
========

PARAMETERS
 * /rosdistro: noetic
 * /rosversion: 1.15.15

NODES

auto-starting new master
process[master]: started with pid [37331]
ROS_MASTER_URI=http://D:11311/

setting /run_id to 16244c48-7603-11ed-b8f3-83dc7583895e
process[rosout-1]: started with pid [37341]
started core service [/rosout]

至此ROS安装成功

对安装不全的说明

rosrun turtlesim turtlesim_node

Command 'rosrun' not found, but can be installed with:

sudo apt install rosbash

juniper@D:~$ sudo apt install rosbash
[sudo] password for juniper: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 rosbash : Depends: catkin but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
juniper@D:~$ ^C
juniper@D:~$ sudo apt install ros-noetic-rosbash
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
Unpacking ros-noetic-ros-tutorials (0.10.2-1focal.20221124.030412) ...
Setting up ros-noetic-rospy-tutorials (0.10.2-1focal.20221124.024607) ...
Setting up ros-noetic-turtlesim (0.10.2-1focal.20221124.022341) ...
Setting up ros-noetic-ros-tutorials (0.10.2-1focal.20221124.030412) ...
juniper@D:~$ rosrun turtlesim turtlesim_node
[ INFO] [1670985659.879490206]: Starting turtlesim with node name /turtlesim
[ INFO] [1670985659.883196148]: Spawning turtle [turtle1] at x=[5.544445], y=[5.544445], theta=[0.000000]
juniper@D:~$ 

#其他包
sudo apt-get install ros-kinetic-rqt-graph

对20.04版本python版本的说明

https://itsfoss.com/python-not-found-ubuntu/

Link python3 as python
You can create a permanent alias in your .bashrc file like this:

alias python='python3'
This way, you can run the python command and your system runs python3.

It will work in most cases unless some program expects to run /usr/bin/python. Now, you may create symlink between /usr/bin/python and /usr/bin/python3 but there exists a simpler option for Ubuntu users.

For Ubuntu 20.04 and higher versions, you have a package that does all link creation automatically if you install the python-is-python3 package. This is what the original error message has also suggested.

sudo apt install python-is-python3
install python is python3 ubuntu
You can see that symlinks have been created and you can use the python command (which actually runs python3) without any issues.

checking python ubuntu
I hope this clears the air on the Python package in Ubuntu. Let me know if you have any questions

③. 安装RobotStudio 6.08
官方文档

http://wiki.ros.org/abb_driver/Tutorials/InstallServer

版本6.08与版本6.07 对官方提供的driver有区别,待确定。

官网工作环境创建有问题,

④. 两个系统间的通讯

虚拟机 与 宿主机 之间通信方式,两种方式:桥接 和 NAT。
通讯路线

不确定是哪一种尝试成功的,与系统版本有关, WIN11 或与 VMnet 有 BUG ,待确定
最终改为桥接,莫名其妙双系统均ping过,原因未知。

⑤. RobotStudio创建工作站

1.打开robot studio,并建立新的空工作站。
(!!记住空工作站的路径,后续要用到!!)

2.从ABB模型库导入机械臂模型
(因为目前ROS支持的ABB机械臂种类不全,所以先看一下自己的机械臂型号支不支持,不支持的话啥教程也不行了~)

3.建立机器人系统
(这块的重点就是加入:616-1 PC接口和623-1多任务

  1. 将ROS驱动程序的RAPID文件放在创建的手臂的控制器上。
    (1)转到 文档 \ RobotStudio \ Systems并选择与工作站名称相对应的文件夹。
    (2)打开HOME目录。
    (3)创建一个名为ROS的新目录。
    (4)复制 abb_common / rapid

(https://github.com/ros-industrial/abb/tree/hydro-devel/abb_common/rapid)

(Hydro和更早版本)或 abb_driver / rapid

(https://github.com/ros-industrial/abb/tree/indigo-devel/abb_driver/rapid)

(Indigo和更高版本)目录中的所有文件,并将它们放在新创建的ROS目录中。

5.修改刚才放在~ \ Home \ ROS 目录下的 ROS_socket.sys
(就是将自己的IPv4地址换上)

5.1查找自己的IP地址:
(1)在Windows下WIN+R
(2)在运行里输入“cmd”打开终端
(3 )在命令行输入“ipconfig”,然后点击键盘回车

!!!注意:千万记得在防火墙中开启abb仿真控制器权限,否则是无法通讯的,即使ping通了也不行

5.2打开刚才放在~ \ Home \ ROS 目录下的 ROS_socket.sys

IF(SocketGetStatus(server_socket)= SOCKET_CREATED)SocketBind server_socket,GetSysInfo(\ LanIp),port;

改为自己PC的地址

IF(SocketGetStatus(server_socket)= SOCKET_CREATED)SocketBind server_socket,“158.132.107.103”,port;

6.打开示教器,调整为手动模式

7.创建Task
8.创建信号
9.将信号连接到系统输出
10. 将模块加载到任务

7-10避免出错参考官网配置

(ROS
WIKI的教程http://wiki.ros.org/action/show/abb_driver/Tutorials?action=show&redirect=abb%2FTutorials)

  1. 建立Robotstudio和ROS的通信

11.1设置运行模式为 “连续”

11.2重启控制器

11.3重启后首先将六个文件同步到工作站!!!

然后打开示教器,然后调节为手动模式,并且使能,再点击PP 移至Main,再点击运行按钮。

此时:会自动弹出程序消息,waiting for connection

与此同时,程序指针应该指向 “WaitTime 0.05; ! Throttle loop while waiting for new command”

Robotstudio PC端配置完毕

⑥. Ubuntu 工作空间搭建

打开终端,在虚拟机连网状态
安装cktain tool

sudo apt-get install python-catkin-tools

创建工作区

mkdir -p ~/catkin_ws/src 
cd ~/catkin_ws
git clone -b kinetic-devel https://github.com/ros-industrial/abb.git src/abb 
git clone -b kinetic-devel https://github.com/ros-industrial/abb_experimental.git src/abb_experimental
rosdep update
rosdep install --from-paths src/ --ignore-src --rosdistro melodic
catkin build

检查工作区是否成功,如果缺失log文件夹,则执行以下。
第一次总是不成功,不清楚为啥!

catkin init
catkin clean
catkin build
source devel/setup.bash

⑦. 运行测试

在终端1输入:

cd catkin_ws
source devel/setup.bash
roscore

在终端2输入:

cd catkin_ws
source devel/setup.bash
roslaunch abb_irb2600_moveit_config moveit_planning_execution.launch sim:=false robot_ip:=158.132.107.103

如果出错的话,可能是缺少配置选项,运行

rosdep install --from-paths src --ignore-src -r -y

测试窗口

写 ABB_irb2600 ROS驱动

参考

https://github.com/ros-industrial/abb_experimental

irb120驱动

在官方提供的工作空间内添加

abb_irb2600_gazebo
abb_irb2600_moveit_config

其中abb_irb2600_support官方已经提供

参照irb120内的文件,编写irb2600

…文件太多了,不记了。。。

[ WARN] [1671091391.006852382]: Falling back to using the move_group node's namespace (deprecated Melodic behavior).
[ INFO] [1671091391.010351775]: Loading robot model 'abb_irb2600_12_165'...
[ WARN] [1671091391.055590792]: Kinematics solver doesn't support #attempts anymore, but only a timeout.
Please remove the parameter '/robot_description_kinematics/manipulator/kinematics_solver_attempts' from your configuration.

[ERROR] [1671091391.135014569]: Could not find the planner configuration 'None' on the param server

[ WARN] [1671091394.845622535]: Kinematics solver doesn't support #attempts anymore, but only a timeout.
Please remove the parameter '/rviz_D_10054_3901896072199591817/manipulator/kinematics_solver_attempts' from your configuration.

[ERROR] [1671091610.870696156]: Could not find parameter for database plugin name

错误太魔性。。。Google吧

安装

https://github.com/ros-industrial/abb_robot_driver

准备

前提条件是已经成功安装完ROS、catkin、vcstool工具,这些功能包在安装ROS时基本都有安装,没安装的按README.md进行安装,需要注意的是,这些功能包的安装指令会针对不同的Ubuntu与ROS有所不同,注意指令的使用

安装

# Change to the root of the Catkin workspace.
cd $HOME/catkin_ws
mkdir -p src

# Use vcstool to clone all required repositories into the 'src' space.
vcs import src --input https://github.com/ros-industrial/abb_robot_driver/raw/master/pkgs.repos

# Check build dependencies.
# First update the local rosdep database.
rosdep update

# And then ask rosdep to install any missing dependencies for us.
# NOTE: This may install additional packages, depending on the software installed
#       on the machine. Be sure to check each command rosdep wants to run.
rosdep install --from-paths src --ignore-src --rosdistro noetic
# noetic是我的版本


# Finally build the workspace (using catkin_tools).
catkin build
有神经网络环境的会出错,需要加上编译版本
catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python3

If no errors were reported as part of the catkin build command, the build has succeeded and the driver should now be usable.

Activating the Workspace
Finally, activate the workspace to get access to the packages just built:

$ source $HOME/catkin_ws/devel/setup.bash
  • 0
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值