CalculateInverseKinematics in PC SDK

Is there a way to do a CalculateInverseKinematics on all set of targets through the PC SDK. i want to know the joint rotation and if the target is reachable through a remote program and not from robot studio. If not is there a way to remotely send to robot studio a list of targets and get the joint rotation back and null is the target is not reachable. I know I can do this as an add-in in robot studio, but I need to do this from a sperate application that could talk to robot studio.

I tried even running an instance of robot studio without the gui b opening a station file and connecting to it then trying to do the CalculateInverseKinematics bu no matter what task I sent the station I got “null exception” even though nothing was null

The PC SDK does not provide functions for these calculations. A possible solution is to call RAPID code (with the PC SDK). In this case you can use the RAPID function CalcJointT, which calculates the joint angles from a robtarget. Furthermore, this function can give error constants like ERR_ROBLIMIT (to indicate that at least one axis is outside the joint limits) and ERR_OUTSIDE_REACH (to indicate that the position is outside the robot’s working area).

thanks for the reply. so if i understand you correct i would

have a CalcJointT rapid command in my program

request mastership
get the calJoint line (GetRapidData() )
then loop through each target
edit the calcJointT for each target
run the line ? (would this be Play()??)

what i do not understand is how do i get the result back? would you have an example of this?

You can do something like this:


  ! write

  PERS bool bCalculatePCSDK := TRUE;

  PERS robtarget TargetPCSDK := [[1000,0,400],[0,1,0,0],[0,0,0,0],[9e9,9e9,9e9,9e9,9e9,9e9]];

  

  ! read

  PERS num StatusPCSDK := 0;

  PERS jointtarget JointPCSDK := [[0,25.8278,29.6756,0,34.4967,180],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];

  

  PROC main()

    VAR errnum nErrorNum;

    

    WHILE TRUE DO

      IF bCalculatePCSDK THEN

        JointPCSDK := CalcJointT(TargetPCSDK, tool0\ErrorNumber:=nErrorNum);

        IF nErrorNum = ERR_ROBLIMIT THEN

          StatusPCSDK := -1;

        ELSEIF nErrorNum = ERR_OUTSIDE_REACH THEN

          StatusPCSDK := -2;

        ELSE

          StatusPCSDK := 0;

        ENDIF

        bCalculatePCSDK := FALSE;

      ENDIF

    ENDWHILE
  ENDPROC

With the PC-SDK you can set the robtarget and the bool. The Rapid code will calculate the angles and set the status. Afterwards you can read the status and the jointtarget.