selimserbes / go-openshowvar

go-openshowvar is a Go library for interacting with Kuka robots over TCP/IP using the OpenShowVar protocol.
MIT License
1 stars 0 forks source link

Do you have a Python version? #1

Closed Sakurachu closed 1 week ago

Sakurachu commented 1 month ago

Hello, do you have a Python version? I saw the language in your home page and other language JOpenShowVar, I also in your YouTube (https://www.youtube.com/watch?v=6aZZAK4oyGg) saw JOpenShowVar effect, it is so cool, I also want to try it, but I only know Python language, so I would like to ask if there is a Python version, thank you.

selimserbes commented 1 month ago

Hello Sakurachu,

Thank you for your interest in my project! I understand that you prefer working with Python, and I'm pleased to inform you that there is indeed a solution that should meet your needs. In the kukavarproxy-msg-format repository mentioned in the README.md of my go-openshowvar library, you will find a python folder containing two key files: example.py and kukavarproxy.py.

The kukavarproxy.py file is a library that facilitates TCP/IP communication with KUKA robots, allowing you to read and write variables seamlessly. You can utilize this library in your own projects, as demonstrated in the example.py file, where it establishes a connection with a KUKA robot and manipulates variables.

Here’s a brief example of how you might use this in your own Python code:

from kukavarproxy import *
robot = KUKA('172.31.1.147')  # Replace with your robot's IP address

# Set the speed override to 33%
robot.write("$OV_PRO", 33)

# Read and print the current speed override
current_speed = robot.read("$OV_PRO")
print(f"Current speed override: {current_speed}%")

# Disconnect from the robot
robot.disconnect()

In this example, the $OV_PRO variable is used to represent the robot’s speed override percentage. The code sets the speed to 33% and then reads and prints the current value.

Should you have any further questions or need additional assistance, please don't hesitate to reach out.

All the best with your work,

Sakurachu commented 1 month ago

Thank you very much, this is really cool, the example you provided seems to only change the speed, I would like to ask this variable where to query? The config.dat file for the robot?

selimserbes commented 3 weeks ago

Hello,

There are a few key ways to access and adjust system variables in KUKA robots:

  1. System Variables: You can find all system variables and their descriptions for KUKA robots on the OpenKUKA website.

  2. KUKA HMI Interface: The HMI interface on the robot’s control unit can be used to monitor and adjust system variables.

If you’re looking for a specific parameter, these resources should help. Feel free to reach out if you need further assistance.

Sakurachu commented 3 weeks ago

Thank you, my friend. I've been busy these past few days working on KUKA robots and didn't notice your reply, for which I apologize. My issue has mostly been resolved now (it seems I ended up using the second solution you suggested—if I had seen your reply earlier, I might have resolved it even faster). I wrote a program in the KUKA HMI and used kukavarproxy to change the values of certain variables, allowing me to control KUKA's movement. However, the motion trajectory using PTP (where the target value is E6POS rather than E6AXIS) is not smooth. Do you have any good solutions for this?

Additionally, based on thekukavarproxy.py from the kukavarproxy-msg-formatrepository you shared, I created a C# version, which I will upload to GitHub soon. I hope to help others in need, just like you. Finally, I sincerely thank you, my friend.

selimserbes commented 2 weeks ago

Hello Sakurachu,

I apologize for the delay in my response; I only saw your message recently due to my busy schedule. I’m glad to hear that your issue has been resolved and that the second solution I suggested worked for you.

Regarding the PTP motion issue, you might consider adjusting the motion profile to achieve smoother trajectories. You can tweak the speed, acceleration, and deceleration parameters to improve the smoothness of the motion. Additionally, exploring interpolation techniques and more precise control commands could also help in achieving a smoother trajectory.

I’m pleased to hear that you’re planning to share the C# version of kukavarproxy on GitHub. That’s a fantastic contribution and will surely be helpful to others. I’m glad I could assist you!