CalculateInverseKinematics in PC SDK
cerver
✭
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
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
0
Comments
-
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).0
-
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?
0 -
You can do something like this:
<div> ! write<br></div><div> PERS bool bCalculatePCSDK := TRUE;<br></div><div> PERS robtarget TargetPCSDK := [[1000,0,400],[0,1,0,0],[0,0,0,0],[9e9,9e9,9e9,9e9,9e9,9e9]];<br></div><div> <br></div><div> ! read<br></div><div> PERS num StatusPCSDK := 0;<br></div><div> PERS jointtarget JointPCSDK := [[0,25.8278,29.6756,0,34.4967,180],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];<br></div><div> <br></div><div> PROC main()<br></div><div> VAR errnum nErrorNum;<br></div><div> <br></div><div> WHILE TRUE DO<br></div><div> IF bCalculatePCSDK THEN<br></div><div> JointPCSDK := CalcJointT(TargetPCSDK, tool0\ErrorNumber:=nErrorNum);<br></div><div> IF nErrorNum = ERR_ROBLIMIT THEN<br></div><div> StatusPCSDK := -1;<br></div><div> ELSEIF nErrorNum = ERR_OUTSIDE_REACH THEN<br></div><div> StatusPCSDK := -2;<br></div><div> ELSE<br></div><div> StatusPCSDK := 0;<br></div><div> ENDIF<br></div><div> bCalculatePCSDK := FALSE;<br></div><div> ENDIF<br></div><div> ENDWHILE<br> ENDPROC</div>
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.
0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 316 IRC5
- 61 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 800 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings