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

Delay between input and executed kuka movements

#1
I am trying to real-time control a kuka using a spacemouse. I can move the kuka using the mouse, but i get delays, over 1s! I am wondering why, and how i can fix this. All of this is done in the simulation, so i expect extra delay when executing it on the robotic arm, which would make this even worse.

code:
from robolink import *
from robodk import *
进口pyspacemouse

RDK = Robolink()

kuka = RDK.Item('', ITEM_TYPE_ROBOT)
RDK.setSimulationSpeed(1)
kuka.setSpeed(speed_linear=10, speed_joints=10, accel_joints=1, accel_linear=1)

mouse = pyspacemouse.open()

move_speed = 1

while 1:
data = mouse.read()
xyzinputs = [round(data.y, 1), round(-1*data.x, 1), 0]

if norm(xyzinputs) <= 0:
continue

xyz_move = mult3(xyzinputs, move_speed)

joints = kuka.Joints()

position = kuka.SolveFK(joints)

config = kuka.JointsConfig(joints)

new_position = transl(xyz_move) * position

new_joints = kuka.SolveIK(new_position)
if len(new_joints.tolist()) < 6:
print('no solution')
continue

new_config = kuka.JointsConfig(new_joints)

kuka.MoveJ(new_joints)


----

it's based on an example that uses keyboard inputs.
I have not worked with roboDK in combination with Python before, so I might be missing something obvious.
Could it have something to do with the advance that Kuka uses to precalculate movements? and this seems to work from PTP, moving just tiny steps at a time, but would there be a way to continually move?
#2
You can find a similar example with an Xbox Controller here:https://github.com/RoboDK/Plug-In-Interf...troller.py

The move steps are incremental, we do not use the joystick for proportional speed.
However, you can increase the move step.
Please read the论坛Guidelinesbefore posting!
Find useful information about RoboDK by visiting ourOnline Documentation.




Users browsing this thread:
1 Guest(s)