10-30-2020, 01:35 PM
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:
We'll be updating the documentation in the upcoming days to also show this example.
Code:
# Retrieve all solutions for a given pose:
all_solutions = robot.SolveIK_All(pose, toolpose, framepose)
joints = []
#迭代刺ough 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.