Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python API MoveJ joint values dont change
#1
Hello,

I am new to robotics and RoboDK so this might be a stupid question, but i cant seem to figure out how to correctly use movej with the python api. It works as first glance but when i look into the robot programm all the joint values are the same.

when im refering to targets that i made in robodk with RDK.Item it works somehow.
Here is my code - im working with kuka robot: 

Code:
robot = RDK.Item('KUKA KR 10 R1100 sixx', ITEM_TYPE_ROBOT)
prog = RDK.Item('ProgGeneriert', ITEM_TYPE_PROGRAM)
frame = RDK.Item('KUKA KR 10 R1100 sixx Base', ITEM_TYPE_FRAME)

Target = RDK.AddTarget('Target ', frame)
XYZABC = [500, -700, 1000, 0, 0, 0]
Pose = KUKA_2_Pose(XYZABC)
Target.setPose(Pose)
prog.MoveJ(Target)

Target2 = RDK.AddTarget('Target2', frame)
XYZABC2 = [600, -800, 1000, 0, 0, 0]
Pose2 = KUKA_2_Pose(XYZABC2)
Target2.setPose(Pose2)
prog.MoveJ(Target2)

When i generate the robot Programm the joint values are always the same (see attachment)
I hope someone can find whats wrong - thanks in advance!

Regards,
René


Attached Files Thumbnail(s)
   
#2
You are using a Cartesian Target with a MoveJ. Can you try with the following at the end?

prog.setParam('RecalculateTargets')
prog.Update()

The best approach would be to use SolveIK to set the joints on the Target instead.
Find useful information about RoboDK and its features by visiting our Online Documentation and by watching tutorials on our YouTube Channel.
#3
(10-06-2022, 11:43 AM)Sam Wrote: You are using a Cartesian Target with a MoveJ. Can you try with the following at the end?

prog.setParam('RecalculateTargets')
prog.Update()

The best approach would be to use SolveIK to set the joints on the Target instead.

This worked - thanks a lot!

Regards,
René
  




Users browsing this thread:
1 Guest(s)