Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

How to get system variables from the KUKA robot

#1
Hello, I have a question about RoboDK API that is receiving KUKA system variables.
Currently, I have succeeded in communicating with KUKA KR C4 robot controller and robodk.
Now I'm going to get the joint angle value or position value of the KUKA robot in the Python environment and output it and apply it to the Kuka model on the robodk.
I understand that Robodk currently has the function of receiving and applying the position by clicking the gui button, but I would like to receive the actual joint angle value or position of the kuka robot using robodk api instead of the button click method.
Is there a way to access kuka's system variables such as $AXIS_ACT with RoboDK API?
Finally, the robot model on Robodk tries to reflect the actual movement of the kuka robot in real time.
I would appreciate it if you could give me an answer to your question.
Thank you, Have a nice day.
#2
You should be able to get and set KUKA system variables using the Driver parameter on a robot with the API.

Example:
Code:
joints_str = robot.setParam("Driver", "GET $AXIS_ACT")
#3
Thank you, Albert!
I have a few additional questions to ask.
I use the 'kukadriver' provided by robodk, and even in this case, do I do it the same as joints_str = robot.setParam ("Driver", "GET $AXIS_ACT")?
Or should I change the "Driver" parameter part of setParam() to another name like "kukadriver" instead of "Driver"?
And where can I find the variables that can fit in the parameters corresponding to "GET $AXIS_ACT"?
Should I use joints_str = robot.setParam ("Driver", "SET $AXIS_ACT") to change $AXIS_ACT?
I looked up the document, but I don't think the parameter description for setParam() came out well.
I would really appreciate it if you could help me again.
#4
The $AXIS_ACT variable is a special KUKA variable to read the current robot joints. You can't set it. However, you can use the SET command for other global variables.

The setParam is a generic function that allows you to send driver-specific commands such as the GET or SET command for KUKA. This $AXIS_ACT variable is only relevant for KUKA as many other global variables that only apply to KUKA controllers.
#5
(03-08-2024, 09:09 AM)Albert Wrote: The $AXIS_ACT variable is a special KUKA variable to read the current robot joints. You can't set it. However, you can use the SET command for other global variables.

The setParam is a generic function that allows you to send driver-specific commands such as the GET or SET command for KUKA. This $AXIS_ACT variable is only relevant for KUKA as many other global variables that only apply to KUKA controllers.

Thank you so musch for your kind reply!
As far as I know, $AXIS_ACT means the joint angle value of the KUKA robot.
Then, if RoboDK is connected to KUKA robot through 'kukadriver', I use robot.setJoints(joint_str), can I apply the joint angle value of KUKA robot to my robot model implemented in robodk?
[ joints_str = robot.setParam ("Driver", "GET $AXIS_ACT") ]
#6
Yes, you should be able to get the current joints of the real robot and set them in RoboDK. If you use the driver this can be done automatically by RoboDK and using the API with most robot drivers. Example:
Code:
robot.Connect()
real_joints = robot.Joints()
Alternatively, you can use the function setJoints in RoboDK to update the joints. Keep in mind that setParam returns a string but you should convert it to an array of values.
  




Users browsing this thread:
1 Guest(s)