2. Joint debugging of ROS and ABB1600 robot (Robostudio simulation)

1 Introduction

This tutorial uses the simulated ABB1600 robot as the main body of the robot to realize the connection and use of ROS.

Simulation experiment conditions
1. A router or switch
2. A computer with windows system
3. A computer with Ubuntu system

2. Use Robostudio to create a virtual robot (please ignore the physical robot)

2.1 Create a robot

Step1: Open Robostudio, File->New->Empty Workstation Solution, as shown in the figure below, click Create after completing the settings.
insert image description here

step2: Basic -> robot model library, select robot 1600
insert image description here
step3: click OK
insert image description here

step4: Import the robot successfully

insert image description here

2.2 Virtual control cabinet

step1: Basic -> Robot System -> New System


step2: As shown in the figure below, select the RoboWare version number and robot model, check the custom option, and click OK.
insert image description here
step3: The system will jump to this interface.
insert image description here
step4: Here we need to choose two options to open, click on Communication 616-1 PC Interface and Engineering Tools 623-1 Multitasking
insert image description here
insert image description here
step5: The following are the options we open by default: the language can be changed to Chinese in the first item .
insert image description here
Step6: After completing the above settings, click OK and wait for roboStudio to complete the creation of the control cabinet.
After the creation is complete, you can see that there are some data parameters in the controller.
insert image description here
step7: Create a ROS folder in the Home folder

insert image description here

**step8:**Here, you need to enable the permission of Robostudio in the firewall on the windows side.
insert image description here

2.3 Copy files to robot virtual control cabinet

**step1:** Download the robot file from github, find the abb_driver/rapid folder, and copy the folder in the rapid directory to the robot controller. blue cloud download
insert image description here

The files that need to be copied are as follows, and their functions are:

ROS_common.sys             所有文件共享的全局变量和数据类型
ROS_socket.sys             套接字处理和simple_message实现
ROS_messages.sys           特定消息类型的实现
ROS_stateServer.mod        广播关节位置和状态数据
ROS_motionServer.mod       接收机器人运动命令
ROS_motion.mod             向机器人发出运动指令

Copy these 6 files to the ROS folder created above.

**INSERT PICTURE DESCRIPTION HERE**
**step2:** Open ROS_socket.sys and change the following lines:

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

Replace GetSysInfo(\LanIp) with your computer's IP address. The IP address of my computer in the router is 192.168.1.101, and the IP address must use English double quotation marks . That is, replace it with
the IP address of the viewing computer

IF (SocketGetStatus(server_socket) = SOCKET_CREATED) SocketBind server_socket,192.168.1.101, port;

2.4 Create a task

Open the virtual robot created by RoboStudio

Open Configuration->Controller->Task, and create a new Task. The details of the creation are shown in the figure, in no particular order.

Name Type Trust Level Entry Motion Task
ROS_StateServer SEMISTATIC NoSafety main NO
ROS_MotionServer SEMISTATIC SysStop main NO
T_ROB1 NORMAL main YES

As shown below:
insert image description here

insert image description here

Note:
1. The T_ROB1 motion task may already exist on your controller.
2. If T_ROB1 has an existing motion control module, you may need to rename the main() routine in ROS_Motion.mod to ROS_main(). In this case, set the entry point of the T_ROB1 task to ROS_main().
3. For multi-robot controllers, specify the desired robot (eg rob1) for each task
4. SEMISTATIC tasks will be started automatically when the controller starts. They are visible, but not easy to see for troubleshooting. For debugging or development purposes, it may be necessary to set both ROS_*Server tasks to Type=NORMAL.

2.5 Create signal input and output

Open ControllerConfigurationI/O SystemSignal and right click on New Signal

Name Type of Signal
signalExecutionError Digital Output
signalMotionPossible Digital Output
signalMotorOn Digital Output
signalRobotActive Digital Output
signalRobotEStop Digital Output
signalRobotNotMoving Digital Output
signalRosMotionTaskExecuting Digital Output

After the creation is complete, as shown in the figure:
insert image description here

2.6 Connecting Signals to System Outputs

Open ControllerConfigurationI/O SystemSystem Output and right click on New System Output

Signal Name Status Arg 1 Arg 2 Arg 3 Arg 4
signalExecutionError Execution Error N/A T_ROB1 N/A N/A
signalMotionPossible Runchain OK N/A N/A N/A N/A
signalMotorOn Motors On State N/A N/A N/A N/A
signalRobotActive Mechanical Unit Active ROB_1 N/A N/A N/A
signalRobotEStop Emergency Stop N/A N/A N/A N/A
signalRobotNotMoving Mechanical Unit Not Moving ROB_1 N/A N/A N/A
signalRosMotionTaskExecuting Task Executing N/A T_ROB1 N/A N/A

After the creation is shown in the figure:
insert image description here

2.7 Configure modules to tasks

Open ControllerConfigurationControllerAutomatic Loading of Modules and right click on New Automatic Loading of Modules

File Task Installed All Tasks Hidden
HOME:/ROS/ROS_common.sys NO YES NO
HOME:/ROS/ROS_socket.sys NO YES NO
HOME:/ROS/ROS_messages.sys NO YES NO
HOME:/ROS/ROS_stateServer.mod ROS_StateServer NO NO NO
HOME:/ROS/ROS_motionServer.mod ROS_MotionServer NO NO NO
HOME:/ROS/ROS_motion.mod T_ROB1 NO NO NO

After the change, as shown in the figure:
insert image description here

2.8 Some other detailed configurations

In step1, change the operation mode to continuous in RAPID, so that the program module can be executed in a continuous cycle.
insert image description here

step2 robot manual and automatic selection, after the configuration is complete, select automatic or manual start.
Manual configuration
insert image description here
Automatic configuration:
insert image description here

After step3 selection is complete, restart the controller and apply the changes.
Restart the controller
ABB using P-Start → Restart → Advanced → P-Start → OK
insert image description here

2.9 ABB internally starts the ROS connection program

Step1: After the startup is complete, open the teach pendant, you can see something like this:
insert image description here

insert image description here
Start T_ROB1 during the following operations.

step2: Click on the teach pendant -> program editor
insert image description here
step3: Debug -> PP to Main -> start the program button
insert image description here
step4: After the startup is successful, all three tasks are started, and you can wait for ROS to connect to the ABB simulation robot.
insert image description here
A log of output messages can be viewed here.
insert image description here
step5: Here it is recommended to modify the joint speed of the robot.
insert image description here

insert image description here

At this point, you can already wait for the connection of the ROS system.

Guess you like

Origin blog.csdn.net/lqsdddd/article/details/127936647