RoboDK Forum
How to correctly setup targets?- 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: How to correctly setup targets? (/Thread-How-to-correctly-setup-targets)

Pages: 1 2


RE: How to correctly setup targets?-sancelot-10-29-2020

I have the same kind of problem.

I know which robot configuration (F/N U/D T/B) I have to apply to my FANUC robot targets. I am unable to set it up with the robodk api.

Resulting in bad robot moving.

for reference
https://github.com/RoboDK/RoboDK-API/issues/56


RE: How to correctly setup targets?-Albert-10-30-2020

I replied to the thread on GitHub with an example to pick a joint solution based on a desired configuration. I'm also pasting the example here:

Code:
# Retrieve all solutions for a given pose:
all_solutions = robot.SolveIK_All(pose, toolpose, framepose)
joints = []

# Iterate through each solution
for j in all_solutions:
# Retrieve flags as a list for each solution
conf_RLF = robot.JointsConfig(j).list()

# Breakdown of flags:
rear = conf_RLF[0] # 1 if Rear , 0 if Front
lower = conf_RLF[1] # 1 if Lower, 0 if Upper (elbow)
flip = conf_RLF[2] # 1 if Flip , 0 if Non flip (Flip is usually when Joint 5 is negative)

# Look for a solution with Front and Elbow up configuration
#if conf_RLF[0:2] == [0,0]:
如果后= = 0和低= = 0:
print("Solution found!")
joints = j
break


We'll be updating the documentation in the upcoming days to also show this example.


RE: How to correctly setup targets?-SamuelEStreamline-07-30-2022

I there a way to modify a joint target from the API by moving the cartesian coordinates without knowing what the final robot joints will be?


RE: How to correctly setup targets?-Albert-07-31-2022

Yes, you can recalculate the target joints by first making the target a Cartesian target, let RoboDK recalculate the joints and then change it to a Joint Target.

This example shows the concept:
Code:
target.setAsCartesianTarget()
target.setPose(new_pose)
target.setParam("Recalculate")
target.setAsJointTarget()
new_joints = target.Joints()



RE: How to correctly setup targets?-SamuelEStreamline-08-02-2022

(07-31-2022, 07:54 AM)Albert Wrote:Yes, you can recalculate the target joints by first making the target a Cartesian target, let RoboDK recalculate the joints and then change it to a Joint Target.

This example shows the concept:
Code:
target.setAsCartesianTarget()
target.setPose(new_pose)
target.setParam("Recalculate")
target.setAsJointTarget()
new_joints = target.Joints()

This is wonderful! Thank you so much Albert!