ros-industrial / kuka_experimental

Experimental packages for KUKA manipulators within ROS-Industrial (http://wiki.ros.org/kuka_experimental)
Apache License 2.0
265 stars 213 forks source link

Now able to establish connection between KR_C4 and ROS. #182

Closed ranjitkathiriya closed 3 years ago

ranjitkathiriya commented 3 years ago

Hey there,

I am trying to establish a connection between the RSI interface and KUKA KR_20 R1810-2, a KR_C4 controller.

Up till now, I have followed below instructions:

  1. Configuring RSI on the controller.

  2. Problem to set-up RSI interface with KR6 R900 and this answer.

I have set the Ip Address is shown below:

Smart-pad Ip address: Windows 10 OS in a smart pad: 192.168.0.1 Not changed, and not safe to do so. Smartpad virtual5 KLI: 172.31.1.147 Virtual 6: 192.168.1.121 Windows interface is selected. Virtual 7 RSI: 192.168.2.121 Linux PC: 192.168.1.210 windows interface 192.168.2.210 RSI

Selecting User as Administrator in the smart pad and after Minimize HMI (Start-up > Service > Minimize HMI), I window 10 of smart pad I can ping to 192.168.1.121, 192.168.2.121, and 192.168.1.210, but I am not able to ping 192.168.2.210. On the other side, I can ping all the smart-pad addresses, e.g. (172.31.1.147, 192.168.1.121, 192.168.2.121 ).

In ros_rsi_ethernet.xml, I have tried adding both IP addresses of my Linux pc 192.168.2.210 and 192.169.1.210.

In test_params.yml, I have changed the IP address to 192.168.1.210. Further, I have added the below line just before kuks_hardware_interface.

<arg name="model" default="$(find kuka_kr16_support)/urdf/kr16_2.xacro"/>
<param name="robot_description" command="$(find xacro)/xacro $(arg model)" />

This is the output I am getting :

kuka-ai@kukaai-ROG-Zephyrus-G15-GA502IU-GA502IU:~/ws_moveit$ roslaunch kuka_rsi_hw_interface test_hardware_interface.launch sim:=false
... logging to /home/kuka-ai/.ros/log/63f99866-7771-11eb-bd0a-efc131f6c940/roslaunch-kukaai-ROG-Zephyrus-G15-GA502IU-GA502IU-8082.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://kukaai-ROG-Zephyrus-G15-GA502IU-GA502IU:40857/

SUMMARY
========

PARAMETERS
 * /controller_joint_names: ['joint_a1', 'joi...
 * /joint_state_controller/publish_rate: 50
 * /joint_state_controller/type: joint_state_contr...
 * /position_trajectory_controller/action_monitor_rate: 20
 * /position_trajectory_controller/joints: ['joint_a1', 'joi...
 * /position_trajectory_controller/state_publish_rate: 50
 * /position_trajectory_controller/type: position_controll...
 * /robot_description: <?xml version="1....
 * /rosdistro: noetic
 * /rosversion: 1.15.9
 * /rsi/listen_address: 192.168.1.210
 * /rsi/listen_port: 49152

NODES
  /
    controller_spawner (controller_manager/spawner)
    kuka_hardware_interface (kuka_rsi_hw_interface/kuka_hardware_interface_node)
    robot_state_publisher (robot_state_publisher/robot_state_publisher)

ROS_MASTER_URI=http://localhost:11311

process[kuka_hardware_interface-1]: started with pid [8098]
process[controller_spawner-2]: started with pid [8099]
[ INFO] [1614265728.636066787]: Starting hardware interface...
process[robot_state_publisher-3]: started with pid [8101]
[ INFO] [1614265728.647552308]: Loaded kuka_rsi_hardware_interface
[ INFO] [1614265728.650771039]: Setting up RSI server on: (192.168.1.210, 49152)
[ INFO] [1614265728.675373482]: Waiting for robot!
[WARN] [1614265728.882024]: DEPRECATION warning: --shutdown-timeout has no effect.
[INFO] [1614265728.883432]: Controller Spawner: Waiting for service controller_manager/load_controller
[INFO] [1614265728.887354]: Controller Spawner: Waiting for service controller_manager/switch_controller
[INFO] [1614265728.891932]: Controller Spawner: Waiting for service controller_manager/unload_controller
[INFO] [1614265728.896652]: Loading controller: position_trajectory_controller
[INFO] [1614265728.924515]: Loading controller: joint_state_controller
[INFO] [1614265728.929037]: Controller Spawner: Loaded controllers: position_trajectory_controller, joint_state_controller

On the controller side I am getting this error:

WhatsApp Image 2021-02-25 at 3 57 34 PM WhatsApp Image 2021-02-25 at 3 56 25 PM

My configuration is correct? And why am I not able to communicate?

Thanks in advance for your help.

destogl commented 3 years ago

On a first glance your RSI listening address is set wrong in ROS:

/rsi/listen_address: 192.168.1.210

Shouldn't this be 2.210?

ranjitkathiriya commented 3 years ago

Thanks, @destogl, for replying to my answer and I have tried with both IP addresses but I am not able to solve.

I did all things from the scratch again, and I found few points, but I am confused that it a true or wrong.

  1. Whenever I am running my program:

I see this type of behavior: First, it will execute PTP {A1 0, A2 -90, A3 90, A4 0, A5 90, A6 0} this line, and release the play button and play it again then my cursor stops here in HALT. I have checked my file is in the proper location, and I think that this condition is not satisfying

ret = RSI_CREATE("ros_rsi.rsi",CONTID,TRUE)

IF (ret <> RSIOK) THEN

HALT # Over here

ENDIF

I have checked the value of ret from smart-pad and I get below value.

WhatsApp Image 2021-03-08 at 3 45 52 PM

  1. After Halt when I press the play button again, I am getting two warnings:

A. RSI: cannot set any outputs due to operator protection

Originator:KS

(Do we have to turn some operator flag on for this?)

B. RSI_MOVECORR: Motion active

Originator:0

And in Auto mode: all things up till now remain the same but I get this extra warning.

C. Process active

KSS01372

Thanks for helping

ranjitkathiriya commented 3 years ago

It is a controller problem because it was not able to find ros_rsi.rsi file so the controller was giving a flag of 27. I am giving all flags list that can be helpful to others.

This file is there in your controller or smart pad as an RSI.DAT

GLOBAL CONST INT RSIOK=0
GLOBAL CONST INT RSIBAD=1
GLOBAL CONST INT RSIINVARG=2
GLOBAL CONST INT RSINOTIMPL=3
GLOBAL CONST INT RSINOMEMORY=4
GLOBAL CONST INT RSIINVCONT=5
GLOBAL CONST INT RSIINVFILE=6
GLOBAL CONST INT RSIINVPARAMID=7
GLOBAL CONST INT RSIINVPARAM=8
GLOBAL CONST INT RSIINVOBJID=9
GLOBAL CONST INT RSIINVINPIDX=10
GLOBAL CONST INT RSIINVOUTIDX=11
GLOBAL CONST INT RSIHASSUCC=12
GLOBAL CONST INT RSILNKINPOBJID=13
GLOBAL CONST INT RSILNKOUTOBJID=14
GLOBAL CONST INT RSILNKINPIDX=15
GLOBAL CONST INT RSILNKOUTIDX=16
GLOBAL CONST INT RSILNKOCCUP=17
GLOBAL CONST INT RSILNKSIGNAL=18
GLOBAL CONST INT RSINOLNKOBJ=19
GLOBAL CONST INT RSILNKCIRCLE=20
GLOBAL CONST INT RSILNKMAXDEP=21
GLOBAL CONST INT RSINOTLINKED=22
GLOBAL CONST INT RSILNKNEEDED=23
GLOBAL CONST INT RSILNKOUTDISABLED=24
GLOBAL CONST INT RSIDISPREDECESSOR=25
GLOBAL CONST INT RSIMAXENAOBJ=26
GLOBAL CONST INT RSIFILENOTFOUND=27
GLOBAL CONST INT RSIENASUCCESSOR=28
GLOBAL CONST INT RSIBADCAST=29
GLOBAL CONST INT RSIALREADYON=30
GLOBAL CONST INT RSINOTRUNNING=31
GLOBAL CONST INT RSIEXTLIBNOTFOUND=32
GLOBAL CONST INT RSINOCONNECT=33
GLOBAL CONST INT RSITIMEOUT=34
GLOBAL CONST INT RSIUSERERR=100
GLOBAL CONST INT RSITSYS=998
GLOBAL CONST INT RSISPOC=999
gavanderhoorn commented 3 years ago

It is a controller problem because it was not able to find ros_rsi.rsi file so the controller was giving a flag of 27

but aren't you supposed to copy that file to the controller as part of the setup procedure?

ranjitkathiriya commented 3 years ago

copy that file to the controller as part of the setup procedure?

Yes, I did that, but then also I was getting flag 27. After I asked my friend to test in his robot and got a flag of 0, I think this was my controller issue. I think a factory reset will help me to solve this issue.

I am attaching a screenshot of my friend's robot. He is getting the flag 0, RSI OK signal. Note: code altered to check the flags of RSI on tech pad.

P_20210311_103322

ranjitkathiriya commented 3 years ago

Hello @gavanderhoorn , @destogl ,

This issue is this files ros_rsi.rsi.diagram, ros_rsi.rsi, ros_rsi.rsi.xml is written for the old version of RSI which is 3 and below. I am creating the files for the newer version RSI 4+ files for krl -> C4 and will make a pull request.