Getting Variables from a program

Greetings URCommunity,
In older polyscope versions I was able to retrieve a variable from a program I sent via TCP/IP port 30003. For instance,
If I created the program
def program():
global var_1 = “string_test”
halt
end
And if I sent it via 30003 and then used the command getVariable string_test of the Dashboard port (29999) I could get this value. But a robot my company bought a few months ago has a different polyscope/software version and this is no longer possible, the reason for which lies in the fact the variable no longer shows up in the variable section whereas in older robots it does. Thus, it’s as if the variable does not exist.
Can this be reversible?
I look forward to hearing from you
Best regards
Pedro Monforte

Since release 5.13.0 Polyscope rejects global variables from programs started externally.
Check “compatibility notice” in release notes: Release Notes 5.13.0
There are many other ways to get feedback from program ran on the robot.

  • use general purpose variables
  • use xmlrpc, or socket connection to external server

Note that “getvariable” is not on the list of supported dashboard server commands, and is not guaranteed to be backwards compatible.

Thank you very much for your reply. I indeed noticed that the getVariable command was not listed on the Dashboard manual and I came across it by chance in this forum, though it was truly useful.
My issue is the following: my program works in an app which generates a script and sends it to the robot and it’s absolutely necessary to be this way; it can’t be done otherwise.

I suppose thus that general purpose variables are excluded, but is the xmlrpc method possible? I had a quick look over it and it seems to work with Python, C and C++ but not with C# which is the language I’m using. This is also untradeable. The reason I needed this is because I am using a pose_trans and I am finding it difficult to calculate mathematically (I’ve posted about this a few days ago, and people have directed me to related posts, but still I have not managed to get it done)

Thank you again for your collaboration
Best regards
Pedro Monforte

I can’t recommend any xmlrpc server for C#, but quick google gave some hope :wink:
Alternatively simple raw socket server interface could do the job.
Use socket_send_line() with pose, and then parse on C# side.

Thank you for your reply. I seem to find a problem here, nonetheless. I’ll try to elaborate further.
Let’s say I create a program with forty (40) waypoints. These points have their coordinates relative to Base. I then have to create a program in which I will send all these poses via Socket, apply the transformation to a new plane and then re-send them back to my app. I guess this could work but I’ll still try to transform the coordinates mathematically.

The problem I’ve been having is the following: I can transform the X,Y,Z values but not the Rx,Ry,Rz.

This was helpful but only for x,y,z, not rx,ry,rz

Any help is much appreciated
Best regards
PM