Realtime UR connection #306
-
|
I'm trying to get the robot actual TCP position from a UR robot from grasshopper using robots. I have seen some previous posts here which use the URReal class which is deprecated. So I tried to implement it using the URRealTimeDataExchange class. I managed to connect to the robot and get some values in return, but all the values are always 0. For instance, the code below returns a array of 6 values in the TCPPosition output: [0,0,0,0,0,0] `private void RunScript( |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
|
I would change this so that the URRealTimeDataExchange instance is a field rather than a local variable inside RunScript. Initialize it only once and run the component on a loop with a timer, without reinitializing it on every call to RunScript. |
Beta Was this translation helpful? Give feedback.
-
|
Thank you very much for your help! I'd really like to explore your solution
— perhaps I can build upon it or adapt it to my needs.
At the moment, even a start with a 100–200 ms delay is something I can work
with, and from there, I’ll see if it truly fits my requirements.
Would it be possible for you to share your source code or provide more
detailed information? I’d really appreciate any insights you can offer.
Kind regards,
Ame
…On Thu, Apr 24, 2025 at 8:32 PM filipejsbrandao ***@***.***> wrote:
My application did not demand 10ms. I was working around 100 to 200ms.
Even so there was a state machine with a few if conditions to solve the
problems @KonradJuenger <https://github.com/KonradJuenger> just
mentioned. There are also other things I bumped into. Some tools also use
the RTDE interface, in my case the VGC10 gripper. My application was
running for a few weeks, and I got a few instances where this would cause
the robot to have an emergency stop.
—
Reply to this email directly, view it on GitHub
<#306 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A4VUZWAD2JTTYJ3FVSS422D23E34HAVCNFSM6AAAAABUNGR2SSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTEOJTHEZDKOI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
Thanks for the advice. I have done as you suggested but I'm still only getting [0,0,0,0,0,0] as TCP position. Here is how the code looks:
`public class Script_Instance : GH_ScriptInstance
{
// Persistent fields
private URRealTimeDataExchange urRTDE; // Persistent RTDE connection
private bool isConnected = false; // Connection status
private List lastTCPPosition; // Store last successful TCP position
private List logs = new List(); // Log messages