Help understanding CalculateInverseKinematics for Kinect project

calculations of a distance between two targets in x-, y-, z-axis (in meters) and I want to use that direction and distance to guide a virtual robot. You can see a picture of an example at the bottom what the Kinect does, it calculates the distance between the pink dot and the center of the red marked hand. I want the pink dot to represent the virtual robot tcp's current position and the marked hand is the direction and distance I want the virtual robot to travel to.
So my following questions are: Can I use CalculateInverseKinematics mentioned above to achieve this? If so, could someone explain how it works thoroughly and how I should use it, as I'm a beginner in programming in C# for RobotStudio.
Each axis and its calculated distance is separately sent to another class for processing the data:
// Send calculated distance to the KinectData class for processing
myKinectData.DistanceX = calcDistanceX;
myKinectData.DistanceY = calcDistanceY;
myKinectData.DistanceZ = calcDistanceZ;

Example of distance in x-, y-, z-axis between the
dot and red marked hand
Best Answers
-
Niklas Skoglund Sweden admin
Hi Arvid,
Lars is right, the method CalculateInverseKinematics of RobotStudio SDK is intended to be used when testing for example reachability in a simulation environment. You can use related APIs to set the joint values of a virtual robot in the simulation environment.
Example:
RobotStudio has a function "Check reachability". You specify a robtarget and we check if the robot can move to it with a given configuration. If successful the robot model in the 3D window moves its TCP to this position in order to indicate that its possible. If you like this position you create a robtarget in the RAPID program and this program can be executed and further verified by the Virtual Controller, and then transferred to the real robot.
The use of CalcInverseKinematics and SetJointValues has nothing to do with moving a real robot using RAPID, or moving a virtual robot using RAPID.
Of course you may find a use for CalcInverseKinematics which is different from the above example. I just want to help you avoid spending lots of time to do something that only works in the simulation environment and cannot be transferred to the real robot.
I think you should look into Lars suggestion. You can develop the RAPID program and the PC SDK program on your PC. The Virtual robot will move according to the input from PC SDK and you can see this on the Online Monitor in RobotStudio.
Lets see if we "agree" on the concepts before digging into the details.
-
Niklas Skoglund Sweden admin
Hi again Arvid,
take a look at this post:
Have you tried to build a "hello world" PC SDK application? Then you can try the above code.
Here are some samples:
Answers
Danrob A/S
I think if I could connect it to a Controller through RobotStudio, it is highly possible to send data to a real robot and move it, that's my end goal anyhow
Thanks for the fast reply!
Best regards, Arvid
I believe I'm starting to understand and it may be best if I'm doing it in the way you two are trying to explain. Hope you maybe can guide as this is my first project working with PC SDK towards RobotStudio! And thanks again for the reply!
Best regards, Arvid