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

KUKA Use Status and Turn Values with SolveIK

#1
Bit of an odd question, but if I have a list of XYZABC + Status + Turn Kuka poses, is there a way to get corresponding joint values with SolveIK? Or would I basically need to use SolveIK_All() and use the S and T bit values to filter out unwanted configurations?
#2
You should use SolveIK_All on each pose (XYZABC values for KUKA) and iterate through all solutions to find a set of joints that match your status and turn values.

You can calculate the configuration from your joints by using a function like this:
Code:
    def joints_2_conf_str(self,joints):
        confRLF = robot.JointsConfig(joints).list()
        strconf = ""
        if confRLF[2] > 0:
            strconf = strconf + '1'
        else:
            strconf = strconf + '0'
           
        if confRLF[1] == 0:
            strconf = strconf + '1'
        else:
            strconf = strconf + '0'
           
        if confRLF[0] > 0:
            strconf = strconf + '1'
        else:
            strconf = strconf + '0'
       
        return "'B%s'" % strconf   
And you can calculate the turn flags by using a function like this:
Code:
    def joints_2_turn_str(joints):
        if joints is None:
            return "'B000000'"
           
        strturn = ""
        for i in range(len(joints)):
            if joints[i] < 0:
                strturn = '1' + strturn
            else:
                strturn = '0' + strturn
        return "'B%s'" % strturn 
  




Users browsing this thread:
1 Guest(s)