RoboDK Forum
Python API MoveJ joint values dont change- Printable Version

+- RoboDK Forum (//www.sinclairbody.com/forum)
+-- Forum: RoboDK (EN) (//www.sinclairbody.com/forum/Forum-RoboDK-EN)
+--- Forum: RoboDK API (//www.sinclairbody.com/forum/Forum-RoboDK-API)
+--- Thread: Python API MoveJ joint values dont change (/Thread-Python-API-MoveJ-joint-values-dont-change)



Python API MoveJ joint values dont change-rene07-10-06-2022

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.

当我我在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é


RE: Python API MoveJ joint values dont change-Sam-10-06-2022

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.


RE: Python API MoveJ joint values dont change-rene07-10-06-2022

(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é