Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create code samples #21

Open
jontje opened this issue Sep 6, 2018 · 13 comments
Open

Create code samples #21

jontje opened this issue Sep 6, 2018 · 13 comments
Assignees
Labels

Comments

@jontje
Copy link
Contributor

jontje commented Sep 6, 2018

Create samples to showcase how to use the interface classes, including:

  • C++ code
  • RAPID code (and possibly a RobotStudio Pack&Go file for a simulation setup)
  • Instructions
@jontje jontje added the task label Sep 6, 2018
@jontje jontje self-assigned this Sep 6, 2018
@gonzalocasas
Copy link

Yes, please. Without at least a minimal example, I find it extremely hard to use this library.

@jontje
Copy link
Contributor Author

jontje commented Feb 25, 2019

@gonzalocasas Here are a preview of the examples I am working on: abb_librws_samples.zip

Please note that they are not completely finished/fully explained, so there might be some things missing but the code should at least give you some hints about how to use the library.

I hope this helps!

@gonzalocasas
Copy link

@jontje thanks a lot! yes, this helps a lot!

@rsaltus
Copy link

rsaltus commented May 30, 2019

Hey @jontje, I'm having trouble implementing the abb_librws_samples.zip file you've included in the thread above, maybe you can help out. I'm trying to connect to a Windows machine running RobotStudio virtual controller with RW 6.09 from an external laptop running Ubuntu 14.04 and ROS Indigo. I've tried all of the example files you've included, but cannot get any response from any of them. I've attached a sample output (with IP censored) from the a1_collect_info_node:

[ INFO] [1559253131.475575020]: Using provided IP-address: "---.--.---.--"
[ INFO] [1559253131.475679247]: ========== Collecting info sample ==========
[ INFO] [1559253131.475693087]: 1: Press Enter to collect information

[ INFO] [1559253132.530105635]: Auto mode: unknown
[ INFO] [1559253132.532249484]: Motor on: unknown
[ INFO] [1559253132.546998364]: RAPID running: unknown
[ INFO] [1559253132.561179831]: Current jointtarget: [[0,0,0,0,0,0],[0,0,0,0,0,0]]
[ INFO] [1559253132.563248354]: Current robtarget: [[0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0,0,0]]

I'm pretty sure the RWS Server is running fine on the Windows side, I followed the steps at http://developercenter.robotstudio.com/blobproxy/devcenter/Robot_Web_Services/html/index.html under "Discovery" and received an IP and proper node name. I can also ping between the two computers, and have already established a working EGM connection.

Right now I've tried to implement this using both a barebones VC running RW 6.09 with the sample RAPID code you provided in the abb_librws_samples.zip file, and another VC running the StateMachine Add-In separately. Neither gets any response. One thing I wasn't sure about: do I need to do any setup on the RobotStudio side in order to allow the RWS to access the VC data?

If you have any suggestions, they'd be greatly appreciated.

@gavanderhoorn
Copy link
Member

This is most likely the issue where RWS won't accept requests from a non-local IP. See #47.

@jontje
Copy link
Contributor Author

jontje commented May 31, 2019

Hi @rsaltus,

I think @gavanderhoorn is correct.

Just to verify the issue, then you can try the following:

  • In the Windows machine:

    1. Open a web browser
    2. Go to http://127.0.0.1/rw?debug=1
    3. Log in with "Default User" and "robotics"
    4. If the RWS server is up and running, then you should get a list of RobotWare services
  • In the Ubuntu machine:

    1. Repeat the process above (but replace 127.0.0.1 with the Windows machine's IP)
    2. If you get the response "RAPI Unidentified Error" it means that you connected to the RWS server, but the request was not accepted

As @gavanderhoorn mentioned, you can try the workaround suggested in #47

@rsaltus
Copy link

rsaltus commented Jun 11, 2019

Thanks for your help @gavanderhoorn and @jontje, the issue was exactly like you guys thought. I implemented the proxy server workaround in #47 and it worked like a charm.

@lijianhualeigua
Copy link

Hey @jontje , i download the abb_librws_samples.zip, but not find the RobotStudio Pack&Go file RWSSamplesSolution.rspag in abb_librws_samples file , can you reupdate this abb_librws_samples.zip. Thanks a lot.

@jontje
Copy link
Contributor Author

jontje commented Sep 27, 2019

Hi @lijianhualeigua, here is an updated zip-file: abb_librws_samples.zip

I have added a Pack&Go file based on RobotWare 6.08.01, as well as added some launch files for the different ROS nodes.

I hope this helps! Also, I am currently out-of-office so I might be slow to reply to questions.

@lijianhualeigua
Copy link

Thanks for your help @jontje .

@manuelko
Copy link

manuelko commented Oct 18, 2020

Hello everyone. I do not know if this is the right place to ask?
Here it comes: I do not understand why the robot controller must be in AUTO mode to write to a RAPID variable in example "b1_rapid_data_node"? Is there a way to write to a variable in RAPID, in Manual mode? I can not find any answer after spending hours trying to solve this problem.
Here is my setup:
IRB4600
RobotWare 6.10.02
Hope someone has time to respond to such a relatively old thread.

@jontje
Copy link
Contributor Author

jontje commented Oct 19, 2020

I do not understand why the robot controller must be in AUTO mode to write to a RAPID variable in example "b1_rapid_data_node"?

It isn't really needed to be in AUTO mode, the example assumes AUTO mode since it is easier to test against.

Is there a way to write to a variable in RAPID, in Manual mode?

Yes, but you must request mastership over the RAPID resource or register as a local user.

Last time I tried the request mastership approach, then it didn't work so well. So you could try to use the registerLocalUser(...) method and then use registerRemoteUser(...) to unregister.

@manuelko
Copy link

manuelko commented Oct 19, 2020

Thank you very much for the answer, it is very much appreciated.
After many hours, I have come to the same conclusion.
I have changed this in the b1 example and I can access with the new user. However, the controller behaves the same way as before. I think maybe IRC5 will not let go of ownership when running in Manual mode.
In a way, it makes sense, however, very impractical when I want to send sensor data to a variable through ROS.

Maybe it makes a difference? But I work with the robot itself and not virtual through RobotStudio.

abb::rws::RWSInterface rws_interface(rws_ip_address, "ROS_Machine", "somepass"); rws_interface.registerLocalUser("ROS_Machine","ROS","Lund");

Have also tried with registerRemoteUser, without success

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

6 participants