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
-
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.
5 -
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:
5
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 robtarget3) add the X,Y,Z4) Move to new TargetAnd 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 ?LarsLars Glud
Danrob A/S0 -
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
Thanks for the fast reply!
Best regards, Arvid
0 -
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.
Hi Niklas!Lets see if we "agree" on the concepts before digging into the details.
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
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)
- 799 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings