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

How to correctly setup targets?

#11
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
#12
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]:
   if rear == 0 and lower == 0:
       print("Solution found!")
       joints = j
       break


We'll be updating the documentation in the upcoming days to also show this example.
#13
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?
#14
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()
#15
(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!
  




Users browsing this thread:
1 Guest(s)