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

KUKA real-time move with RoboDK api problem

#1
Hello, I have a question.
I want to get the joint angle value of the robot model implemented on RoboDK and move the actual KUKA robot with that joint angle value, and make this process happen in real time without In this process, I am facing the problem of receiving the joint angle values of the connected KUKA robot and not receiving the joint angle values of the robot model implemented on RoboDK when using robot.Joints() while the connection with the KUKA robot is successful.
I will attach the example code that I wrote.
I would really appreciate it if you could refer to this code and provide a solution.
Have a good day.
Code:
from robodk.robolink import *
from robodk import robomath as rm
import time


if __name__ == "__main__":
    RDK = Robolink()
    robot = RDK.Item('KUKA KR 70 R2100-Meltio')
    tool = robot.Tool()
    turntable = RDK.Item('2DOF Turn-table')
    reference = RDK.Item('Baseline')

    linear_speed = 10
    angular_speed = 180
    joints_speed = 5
    joints_accel = 40
    is_stop = False

    joints = robot.Joints()
    print("Current joint values are:", joints)

    # Connect to the robot using default connetion parameters
    success = robot.Connect()
    print("SUCCESS: " + str(success))

    status, status_msg = robot.ConnectedState()
    print("STATUS: " + str(status))
    print("STATUS_MSG: " + status_msg)
    if status != ROBOTCOM_READY:
        # Stop if the connection did not succeed
        raise Exception("Failed to connect: " + status_msg)

    # init
    robot.setPoseFrame(reference)
    robot.setPoseTool(tool)
    robot.setSpeedJoints(joints_speed)

    while True:
        joints = robot.Joints()
        print("Current joint values are:", joints)
        robot.MoveJ(joints)
        print("Robot MoveJ")
        time.sleep(0.01)
        if is_stop:
            break

    RDK.ShowMessage("Done", True)
#2
Once you are connected to the real robot using the driver, requesting the robot joints (using the Joints function of the API), will retrieve the joints of the real robot.

If you want to retrieve the simulated joints you should use the SimulatorJoints function instead. Example assuming you are connected to the robot:
Code:
# Get the joints of the simulated robot
joints = robot.SimulatorJoints()

# Move the real robot
robot.MoveJ(joints)
#3
(04-08-2024, 07:39 AM)Albert Wrote: Once you are connected to the real robot using the driver, requesting the robot joints (using the Joints function of the API), will retrieve the joints of the real robot.

If you want to retrieve the simulated joints you should use the SimulatorJoints function instead. Example assuming you are connected to the robot:
Code:
# Get the joints of the simulated robot
joints = robot.SimulatorJoints()

# Move the real robot
robot.MoveJ(joints)
Thank you Albert. You've been very helpful.
I have an additional question. I want to make sure that the actual KUKA robot follows the movement of the robot model in the RoboDK simulation in real time. In the ed, I aim to operate the robot model in RoboDK in real time to move the actual KUKA robot.
Is there any feature or api implemented in RoboDK that can help achieve this purpose?
  




Users browsing this thread:
1 Guest(s)