项目作者: 12343954

项目描述 :
Rotary Delta Robot Forward/Inverse Kinematics Calculations ( js , C++ )
高级语言: C++
项目地址: git://github.com/12343954/Rotary-Delta-Robot-Kinematics.git
创建时间: 2021-01-19T05:18:50Z
项目社区:https://github.com/12343954/Rotary-Delta-Robot-Kinematics

开源协议:

下载







Rotary Delta Robot Kinematics ( jsC++C# )

Forward/Inverse Kinematics algorithm for Rotary Delta Robot.

Including Web.jsC++ and C# versions compare, all results are matched!

Features:

  1. Forward/Inverse Kinematics.
  2. Bounds calculation, maxmin values of [xyz] and [abc].
  3. Increment Mode calculation.
  4. ETA recording in debugging mode.


Thanks to:

1. https://www.marginallyclever.com/other/samples/fk-ik-test.html

2. https://github.com/tinkersprojects/Delta-Kinematics-Library (Algorithm is not accurate)

This Library is licensed under a GPLv3 License.


1. Robot Settings






2. API

Functions:

  1. int forward();
  2. int forward(double thetaA, double thetaB, double thetaC);
  3. int inverse();
  4. int inverse(double x0, double y0, double z0);

Returns:

  1. #define no_error 0
  2. #define non_existing_povar_error 1

3. Examples

  1. #include <iostream>
  2. #include "DeltaKinematics.h"
  3. using namespace std;
  4. #define ROBOT_btf 500.0 // base to floor
  5. #define ROBOT_f 63.0 // base radius
  6. #define ROBOT_rf 130.0 // shoulder length
  7. #define ROBOT_re 400.0 // arm length
  8. #define ROBOT_e 35.0 // end effector radius
  9. #define ROBOT_s 3200.0 // steps per turn
  10. //DeltaKinematics DK(500.0, 63.0, 130.0, 400.0, 35.0, 3200.0);
  11. DeltaKinematics DK(ROBOT_btf, ROBOT_f, ROBOT_rf, ROBOT_re, ROBOT_e, ROBOT_s);
  12. void out_print(int error, bool is_inverse);
  13. int main()
  14. {
  15. int error = DK.forward(5.0, 10.0, 15.0);
  16. out_print(error, false);
  17. DK.x = 0;
  18. DK.y = 0;
  19. DK.z = -300;
  20. error = DK.inverse();
  21. out_print(error, true);
  22. error = DK.forward(100.0, 45.0, 45.0);
  23. out_print(error, false);
  24. error = DK.inverse(30, 30, 30);
  25. out_print(error, true);
  26. error = DK.forward(100, 100, 100);
  27. out_print(error, false);
  28. error = DK.forward(130, 130, 130);
  29. out_print(error, false);
  30. error = DK.forward(200, 200, 200);
  31. out_print(error, false);
  32. }
  33. void out_print(int error, bool is_inverse) {
  34. cout << "Result=" << error << "\n";
  35. cout << "OLD: xyz=[" << DK.LastXYZ.x << ", " << DK.LastXYZ.y << ", " << DK.LastXYZ.z << "],"
  36. << " abc=[" << DK.LastABC.a << ", " << DK.LastABC.b << ", " << DK.LastABC.c << "]"
  37. << endl;
  38. if (is_inverse) {
  39. cout << "NEW: DK.xyz=[" << DK.x << ", " << DK.y << ", " << DK.z << "] ==> "
  40. << "DK.abc=[" << DK.a << ", " << DK.b << ", " << DK.c << "]\n\n"
  41. << endl;
  42. }
  43. else {
  44. cout << "NEW: DK.abc=[" << DK.a << ", " << DK.b << ", " << DK.c << "] ==> "
  45. << "DK.xyz=[" << DK.x << ", " << DK.y << ", " << DK.z << "]\n\n"
  46. << endl;
  47. }
  48. }