RobotStudio event

Help understanding CalculateInverseKinematics for Kinect project

Nocu
Nocu
edited April 2015 in RobotStudio
I need help understanding a method for mechanism, namely CalculateInverseKinematics(RsTarget, RsToolData, Boolean, Double[]). I'm receiving data from a kinect which delivers
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;

image
Example of distance in x-, y-, z-axis between the
dot and red marked hand

Best Answers

Answers

  • I don't know if you can use the Calcinversekinematics - but why don't just send the x,y,z to the virtual controller and then calculate the next position as follows (in psedo code):

    1) Wait for data from PC(analyzed kinect data)
    2) Calc current robtarget
    3) add the X,Y,Z
    4) Move to new Target

    And do these 4 steps in a loop.

    If you implement it in C# and using Robotstudio, you won't be able to send the data to a real robot etc :) ?

    Lars


    Lars Glud
    Danrob A/S
  • You could be right DanLars, as I said I'm still a beginner in robotstudio programming with C# so still looking for all methods ;) Could you possibly give an example of how I can do like your example and/or there's anything I can look up in the RobotStudio 6.0 SDK reference manual?

    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 :D

    Thanks for the fast reply!

    Best regards, Arvid
  • 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.

    Hi Niklas!

    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