roboticstoolbox-python 1.4.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (610) hide show
  1. roboticstoolbox/__init__.py +107 -0
  2. roboticstoolbox/backends/Connector.py +113 -0
  3. roboticstoolbox/backends/Dynamixel/README.md +9 -0
  4. roboticstoolbox/backends/Dynamixel/dynamixel.json +581 -0
  5. roboticstoolbox/backends/Dynamixel/dynamixel_io.py +450 -0
  6. roboticstoolbox/backends/Dynamixel/dynamixel_sdk/LICENSE +201 -0
  7. roboticstoolbox/backends/Dynamixel/dynamixel_sdk/README.md +28 -0
  8. roboticstoolbox/backends/Dynamixel/dynamixel_sdk/ReleaseNote.md +181 -0
  9. roboticstoolbox/backends/Dynamixel/dynamixel_sdk/__init__.py +27 -0
  10. roboticstoolbox/backends/Dynamixel/dynamixel_sdk/group_bulk_read.py +163 -0
  11. roboticstoolbox/backends/Dynamixel/dynamixel_sdk/group_bulk_write.py +109 -0
  12. roboticstoolbox/backends/Dynamixel/dynamixel_sdk/group_sync_read.py +166 -0
  13. roboticstoolbox/backends/Dynamixel/dynamixel_sdk/group_sync_write.py +99 -0
  14. roboticstoolbox/backends/Dynamixel/dynamixel_sdk/packet_handler.py +33 -0
  15. roboticstoolbox/backends/Dynamixel/dynamixel_sdk/port_handler.py +155 -0
  16. roboticstoolbox/backends/Dynamixel/dynamixel_sdk/protocol1_packet_handler.py +548 -0
  17. roboticstoolbox/backends/Dynamixel/dynamixel_sdk/protocol2_packet_handler.py +1080 -0
  18. roboticstoolbox/backends/Dynamixel/dynamixel_sdk/robotis_def.py +75 -0
  19. roboticstoolbox/backends/Dynamixel/dyndata.py +121 -0
  20. roboticstoolbox/backends/PyPlot/EllipsePlot.py +256 -0
  21. roboticstoolbox/backends/PyPlot/PyPlot.py +778 -0
  22. roboticstoolbox/backends/PyPlot/PyPlot2.py +537 -0
  23. roboticstoolbox/backends/PyPlot/README.md +67 -0
  24. roboticstoolbox/backends/PyPlot/RobotPlot.py +247 -0
  25. roboticstoolbox/backends/PyPlot/RobotPlot2.py +123 -0
  26. roboticstoolbox/backends/PyPlot/__init__.py +4 -0
  27. roboticstoolbox/backends/ROS/ROS.py +129 -0
  28. roboticstoolbox/backends/ROS/__init__.py +3 -0
  29. roboticstoolbox/backends/__init__.py +39 -0
  30. roboticstoolbox/backends/swift/__init__.py +165 -0
  31. roboticstoolbox/bin/__init__.py +0 -0
  32. roboticstoolbox/bin/_bintools.py +61 -0
  33. roboticstoolbox/bin/rtbtool.py +404 -0
  34. roboticstoolbox/blocks/Icons/250x250/armplot.png +0 -0
  35. roboticstoolbox/blocks/Icons/250x250/bicycle.png +0 -0
  36. roboticstoolbox/blocks/Icons/250x250/camera.png +0 -0
  37. roboticstoolbox/blocks/Icons/250x250/circlepath.png +0 -0
  38. roboticstoolbox/blocks/Icons/250x250/coriolis.png +0 -0
  39. roboticstoolbox/blocks/Icons/250x250/ctraj.png +0 -0
  40. roboticstoolbox/blocks/Icons/250x250/delta2tr.png +0 -0
  41. roboticstoolbox/blocks/Icons/250x250/diffsteer.png +0 -0
  42. roboticstoolbox/blocks/Icons/250x250/fdyn.png +0 -0
  43. roboticstoolbox/blocks/Icons/250x250/fdynx.png +0 -0
  44. roboticstoolbox/blocks/Icons/250x250/fkine.png +0 -0
  45. roboticstoolbox/blocks/Icons/250x250/gravload.png +0 -0
  46. roboticstoolbox/blocks/Icons/250x250/idyn.png +0 -0
  47. roboticstoolbox/blocks/Icons/250x250/idynx.png +0 -0
  48. roboticstoolbox/blocks/Icons/250x250/ikine.png +0 -0
  49. roboticstoolbox/blocks/Icons/250x250/inertia.png +0 -0
  50. roboticstoolbox/blocks/Icons/250x250/jacobian.png +0 -0
  51. roboticstoolbox/blocks/Icons/250x250/jtraj.png +0 -0
  52. roboticstoolbox/blocks/Icons/250x250/lspb.png +0 -0
  53. roboticstoolbox/blocks/Icons/250x250/multirotor.png +0 -0
  54. roboticstoolbox/blocks/Icons/250x250/multirotormixer.png +0 -0
  55. roboticstoolbox/blocks/Icons/250x250/multirotorplot.png +0 -0
  56. roboticstoolbox/blocks/Icons/250x250/point2tr.png +0 -0
  57. roboticstoolbox/blocks/Icons/250x250/tr2delta.png +0 -0
  58. roboticstoolbox/blocks/Icons/250x250/tr2t.png +0 -0
  59. roboticstoolbox/blocks/Icons/250x250/unicycle.png +0 -0
  60. roboticstoolbox/blocks/Icons/250x250/vehicleplot.png +0 -0
  61. roboticstoolbox/blocks/Icons/50x50/armplot.png +0 -0
  62. roboticstoolbox/blocks/Icons/50x50/bicycle.png +0 -0
  63. roboticstoolbox/blocks/Icons/50x50/camera.png +0 -0
  64. roboticstoolbox/blocks/Icons/50x50/circlepath.png +0 -0
  65. roboticstoolbox/blocks/Icons/50x50/coriolis.png +0 -0
  66. roboticstoolbox/blocks/Icons/50x50/delta2tr.png +0 -0
  67. roboticstoolbox/blocks/Icons/50x50/diffsteer.png +0 -0
  68. roboticstoolbox/blocks/Icons/50x50/fdyn.png +0 -0
  69. roboticstoolbox/blocks/Icons/50x50/fdynx.png +0 -0
  70. roboticstoolbox/blocks/Icons/50x50/fkine.png +0 -0
  71. roboticstoolbox/blocks/Icons/50x50/gravload.png +0 -0
  72. roboticstoolbox/blocks/Icons/50x50/idyn.png +0 -0
  73. roboticstoolbox/blocks/Icons/50x50/idynx.png +0 -0
  74. roboticstoolbox/blocks/Icons/50x50/ikine.png +0 -0
  75. roboticstoolbox/blocks/Icons/50x50/inertia.png +0 -0
  76. roboticstoolbox/blocks/Icons/50x50/jacobian.png +0 -0
  77. roboticstoolbox/blocks/Icons/50x50/jtraj.png +0 -0
  78. roboticstoolbox/blocks/Icons/50x50/lspb.png +0 -0
  79. roboticstoolbox/blocks/Icons/50x50/multirotor.png +0 -0
  80. roboticstoolbox/blocks/Icons/50x50/multirotormixer.png +0 -0
  81. roboticstoolbox/blocks/Icons/50x50/multirotorplot.png +0 -0
  82. roboticstoolbox/blocks/Icons/50x50/point2tr.png +0 -0
  83. roboticstoolbox/blocks/Icons/50x50/tr2delta.png +0 -0
  84. roboticstoolbox/blocks/Icons/50x50/tr2t.png +0 -0
  85. roboticstoolbox/blocks/Icons/50x50/unicycle.png +0 -0
  86. roboticstoolbox/blocks/Icons/50x50/vehicleplot.png +0 -0
  87. roboticstoolbox/blocks/Icons/armplot.png +0 -0
  88. roboticstoolbox/blocks/Icons/bicycle.png +0 -0
  89. roboticstoolbox/blocks/Icons/camera.png +0 -0
  90. roboticstoolbox/blocks/Icons/circlepath.png +0 -0
  91. roboticstoolbox/blocks/Icons/coriolis.png +0 -0
  92. roboticstoolbox/blocks/Icons/ctraj.png +0 -0
  93. roboticstoolbox/blocks/Icons/delta2tr.png +0 -0
  94. roboticstoolbox/blocks/Icons/diffsteer.png +0 -0
  95. roboticstoolbox/blocks/Icons/fdyn.png +0 -0
  96. roboticstoolbox/blocks/Icons/fdynx.png +0 -0
  97. roboticstoolbox/blocks/Icons/fkine.png +0 -0
  98. roboticstoolbox/blocks/Icons/gravload.png +0 -0
  99. roboticstoolbox/blocks/Icons/idyn.png +0 -0
  100. roboticstoolbox/blocks/Icons/idynx.png +0 -0
  101. roboticstoolbox/blocks/Icons/ikine.png +0 -0
  102. roboticstoolbox/blocks/Icons/inertia.png +0 -0
  103. roboticstoolbox/blocks/Icons/jacobian.png +0 -0
  104. roboticstoolbox/blocks/Icons/jtraj.png +0 -0
  105. roboticstoolbox/blocks/Icons/lspb.png +0 -0
  106. roboticstoolbox/blocks/Icons/multirotor.png +0 -0
  107. roboticstoolbox/blocks/Icons/multirotormixer.png +0 -0
  108. roboticstoolbox/blocks/Icons/multirotorplot.png +0 -0
  109. roboticstoolbox/blocks/Icons/point2tr.png +0 -0
  110. roboticstoolbox/blocks/Icons/tr2delta.png +0 -0
  111. roboticstoolbox/blocks/Icons/tr2t.png +0 -0
  112. roboticstoolbox/blocks/Icons/unicycle.png +0 -0
  113. roboticstoolbox/blocks/Icons/vehicleplot.png +0 -0
  114. roboticstoolbox/blocks/README.md +43 -0
  115. roboticstoolbox/blocks/__init__.py +6 -0
  116. roboticstoolbox/blocks/arm.py +1591 -0
  117. roboticstoolbox/blocks/mobile.py +522 -0
  118. roboticstoolbox/blocks/quad_model.py +132 -0
  119. roboticstoolbox/blocks/spatial.py +245 -0
  120. roboticstoolbox/blocks/uav.py +949 -0
  121. roboticstoolbox/demo/__init__.py +0 -0
  122. roboticstoolbox/demo/eigdemo.py +112 -0
  123. roboticstoolbox/demo/tripleangledemo.py +239 -0
  124. roboticstoolbox/demo/twistdemo.py +175 -0
  125. roboticstoolbox/ets/ET.py +439 -0
  126. roboticstoolbox/ets/ET2.py +179 -0
  127. roboticstoolbox/ets/ETS.py +2013 -0
  128. roboticstoolbox/ets/ETS2.py +449 -0
  129. roboticstoolbox/ets/_ET.py +668 -0
  130. roboticstoolbox/ets/_ETS.py +781 -0
  131. roboticstoolbox/ets/__init__.py +11 -0
  132. roboticstoolbox/ets/cpp-extensions/Eigen/Cholesky +45 -0
  133. roboticstoolbox/ets/cpp-extensions/Eigen/CholmodSupport +48 -0
  134. roboticstoolbox/ets/cpp-extensions/Eigen/Core +384 -0
  135. roboticstoolbox/ets/cpp-extensions/Eigen/Dense +7 -0
  136. roboticstoolbox/ets/cpp-extensions/Eigen/Eigen +2 -0
  137. roboticstoolbox/ets/cpp-extensions/Eigen/Eigenvalues +60 -0
  138. roboticstoolbox/ets/cpp-extensions/Eigen/Geometry +59 -0
  139. roboticstoolbox/ets/cpp-extensions/Eigen/Householder +29 -0
  140. roboticstoolbox/ets/cpp-extensions/Eigen/IterativeLinearSolvers +48 -0
  141. roboticstoolbox/ets/cpp-extensions/Eigen/Jacobi +32 -0
  142. roboticstoolbox/ets/cpp-extensions/Eigen/KLUSupport +41 -0
  143. roboticstoolbox/ets/cpp-extensions/Eigen/LU +47 -0
  144. roboticstoolbox/ets/cpp-extensions/Eigen/MetisSupport +35 -0
  145. roboticstoolbox/ets/cpp-extensions/Eigen/OrderingMethods +70 -0
  146. roboticstoolbox/ets/cpp-extensions/Eigen/PaStiXSupport +49 -0
  147. roboticstoolbox/ets/cpp-extensions/Eigen/PardisoSupport +35 -0
  148. roboticstoolbox/ets/cpp-extensions/Eigen/QR +50 -0
  149. roboticstoolbox/ets/cpp-extensions/Eigen/QtAlignedMalloc +39 -0
  150. roboticstoolbox/ets/cpp-extensions/Eigen/SPQRSupport +34 -0
  151. roboticstoolbox/ets/cpp-extensions/Eigen/SVD +50 -0
  152. roboticstoolbox/ets/cpp-extensions/Eigen/Sparse +34 -0
  153. roboticstoolbox/ets/cpp-extensions/Eigen/SparseCholesky +37 -0
  154. roboticstoolbox/ets/cpp-extensions/Eigen/SparseCore +69 -0
  155. roboticstoolbox/ets/cpp-extensions/Eigen/SparseLU +50 -0
  156. roboticstoolbox/ets/cpp-extensions/Eigen/SparseQR +36 -0
  157. roboticstoolbox/ets/cpp-extensions/Eigen/StdDeque +27 -0
  158. roboticstoolbox/ets/cpp-extensions/Eigen/StdList +26 -0
  159. roboticstoolbox/ets/cpp-extensions/Eigen/StdVector +27 -0
  160. roboticstoolbox/ets/cpp-extensions/Eigen/SuperLUSupport +64 -0
  161. roboticstoolbox/ets/cpp-extensions/Eigen/UmfPackSupport +40 -0
  162. roboticstoolbox/ets/cpp-extensions/Eigen/src/Cholesky/LDLT.h +688 -0
  163. roboticstoolbox/ets/cpp-extensions/Eigen/src/Cholesky/LLT.h +558 -0
  164. roboticstoolbox/ets/cpp-extensions/Eigen/src/Cholesky/LLT_LAPACKE.h +99 -0
  165. roboticstoolbox/ets/cpp-extensions/Eigen/src/CholmodSupport/CholmodSupport.h +682 -0
  166. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/ArithmeticSequence.h +413 -0
  167. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/Array.h +417 -0
  168. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/ArrayBase.h +226 -0
  169. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/ArrayWrapper.h +209 -0
  170. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/Assign.h +90 -0
  171. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/AssignEvaluator.h +1010 -0
  172. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/Assign_MKL.h +178 -0
  173. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/BandMatrix.h +353 -0
  174. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/Block.h +448 -0
  175. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/BooleanRedux.h +162 -0
  176. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/CommaInitializer.h +164 -0
  177. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/ConditionEstimator.h +175 -0
  178. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/CoreEvaluators.h +1741 -0
  179. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/CoreIterators.h +132 -0
  180. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/CwiseBinaryOp.h +183 -0
  181. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/CwiseNullaryOp.h +1001 -0
  182. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/CwiseTernaryOp.h +197 -0
  183. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/CwiseUnaryOp.h +103 -0
  184. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/CwiseUnaryView.h +132 -0
  185. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/DenseBase.h +701 -0
  186. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/DenseCoeffsBase.h +685 -0
  187. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/DenseStorage.h +652 -0
  188. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/Diagonal.h +258 -0
  189. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/DiagonalMatrix.h +391 -0
  190. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/DiagonalProduct.h +28 -0
  191. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/Dot.h +318 -0
  192. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/EigenBase.h +160 -0
  193. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/ForceAlignedAccess.h +150 -0
  194. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/Fuzzy.h +155 -0
  195. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/GeneralProduct.h +465 -0
  196. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/GenericPacketMath.h +1040 -0
  197. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/GlobalFunctions.h +194 -0
  198. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/IO.h +258 -0
  199. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/IndexedView.h +237 -0
  200. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/Inverse.h +117 -0
  201. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/Map.h +171 -0
  202. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/MapBase.h +310 -0
  203. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/MathFunctions.h +2057 -0
  204. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/MathFunctionsImpl.h +200 -0
  205. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/Matrix.h +565 -0
  206. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/MatrixBase.h +547 -0
  207. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/NestByValue.h +85 -0
  208. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/NoAlias.h +109 -0
  209. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/NumTraits.h +335 -0
  210. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/PartialReduxEvaluator.h +232 -0
  211. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/PermutationMatrix.h +605 -0
  212. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/PlainObjectBase.h +1128 -0
  213. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/Product.h +191 -0
  214. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/ProductEvaluators.h +1179 -0
  215. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/Random.h +218 -0
  216. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/Redux.h +515 -0
  217. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/Ref.h +381 -0
  218. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/Replicate.h +142 -0
  219. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/Reshaped.h +454 -0
  220. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/ReturnByValue.h +119 -0
  221. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/Reverse.h +217 -0
  222. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/Select.h +164 -0
  223. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/SelfAdjointView.h +365 -0
  224. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/SelfCwiseBinaryOp.h +47 -0
  225. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/Solve.h +188 -0
  226. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/SolveTriangular.h +235 -0
  227. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/SolverBase.h +168 -0
  228. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/StableNorm.h +251 -0
  229. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/StlIterators.h +463 -0
  230. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/Stride.h +116 -0
  231. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/Swap.h +68 -0
  232. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/Transpose.h +464 -0
  233. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/Transpositions.h +386 -0
  234. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/TriangularMatrix.h +1001 -0
  235. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/VectorBlock.h +96 -0
  236. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/VectorwiseOp.h +784 -0
  237. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/Visitor.h +381 -0
  238. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/AVX/Complex.h +372 -0
  239. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/AVX/MathFunctions.h +228 -0
  240. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/AVX/PacketMath.h +1574 -0
  241. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/AVX/TypeCasting.h +115 -0
  242. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/AVX512/Complex.h +422 -0
  243. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/AVX512/MathFunctions.h +362 -0
  244. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/AVX512/PacketMath.h +2303 -0
  245. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/AVX512/TypeCasting.h +89 -0
  246. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/AltiVec/Complex.h +417 -0
  247. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/AltiVec/MathFunctions.h +90 -0
  248. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/AltiVec/MatrixProduct.h +2937 -0
  249. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/AltiVec/MatrixProductCommon.h +221 -0
  250. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h +629 -0
  251. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/AltiVec/PacketMath.h +2711 -0
  252. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/CUDA/Complex.h +258 -0
  253. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/Default/BFloat16.h +700 -0
  254. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/Default/ConjHelper.h +117 -0
  255. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +1649 -0
  256. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h +110 -0
  257. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/Default/Half.h +942 -0
  258. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/Default/Settings.h +49 -0
  259. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/Default/TypeCasting.h +120 -0
  260. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/GPU/MathFunctions.h +103 -0
  261. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/GPU/PacketMath.h +1685 -0
  262. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/GPU/TypeCasting.h +80 -0
  263. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/HIP/hcc/math_constants.h +23 -0
  264. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/MSA/Complex.h +648 -0
  265. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/MSA/MathFunctions.h +387 -0
  266. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/MSA/PacketMath.h +1233 -0
  267. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/NEON/Complex.h +584 -0
  268. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/NEON/GeneralBlockPanelKernel.h +183 -0
  269. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/NEON/MathFunctions.h +75 -0
  270. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/NEON/PacketMath.h +4587 -0
  271. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/NEON/TypeCasting.h +1419 -0
  272. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/SSE/Complex.h +351 -0
  273. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/SSE/MathFunctions.h +199 -0
  274. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/SSE/PacketMath.h +1505 -0
  275. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/SSE/TypeCasting.h +142 -0
  276. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/SVE/MathFunctions.h +44 -0
  277. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/SVE/PacketMath.h +752 -0
  278. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/SVE/TypeCasting.h +49 -0
  279. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/SYCL/InteropHeaders.h +232 -0
  280. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/SYCL/MathFunctions.h +301 -0
  281. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/SYCL/PacketMath.h +670 -0
  282. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/SYCL/SyclMemoryModel.h +694 -0
  283. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/SYCL/TypeCasting.h +85 -0
  284. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/ZVector/Complex.h +426 -0
  285. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/ZVector/MathFunctions.h +233 -0
  286. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/arch/ZVector/PacketMath.h +1060 -0
  287. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/functors/AssignmentFunctors.h +177 -0
  288. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/functors/BinaryFunctors.h +541 -0
  289. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/functors/NullaryFunctors.h +189 -0
  290. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/functors/StlFunctors.h +166 -0
  291. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/functors/TernaryFunctors.h +25 -0
  292. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/functors/UnaryFunctors.h +1131 -0
  293. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/products/GeneralBlockPanelKernel.h +2645 -0
  294. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/products/GeneralMatrixMatrix.h +517 -0
  295. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h +317 -0
  296. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h +145 -0
  297. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/products/GeneralMatrixMatrix_BLAS.h +124 -0
  298. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/products/GeneralMatrixVector.h +518 -0
  299. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/products/GeneralMatrixVector_BLAS.h +136 -0
  300. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/products/Parallelizer.h +180 -0
  301. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +544 -0
  302. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/products/SelfadjointMatrixMatrix_BLAS.h +295 -0
  303. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/products/SelfadjointMatrixVector.h +262 -0
  304. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/products/SelfadjointMatrixVector_BLAS.h +118 -0
  305. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/products/SelfadjointProduct.h +133 -0
  306. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/products/SelfadjointRank2Update.h +94 -0
  307. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/products/TriangularMatrixMatrix.h +472 -0
  308. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/products/TriangularMatrixMatrix_BLAS.h +317 -0
  309. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/products/TriangularMatrixVector.h +350 -0
  310. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/products/TriangularMatrixVector_BLAS.h +255 -0
  311. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/products/TriangularSolverMatrix.h +337 -0
  312. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/products/TriangularSolverMatrix_BLAS.h +167 -0
  313. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/products/TriangularSolverVector.h +148 -0
  314. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/util/BlasUtil.h +583 -0
  315. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/util/ConfigureVectorization.h +512 -0
  316. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/util/Constants.h +563 -0
  317. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/util/DisableStupidWarnings.h +106 -0
  318. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/util/ForwardDeclarations.h +322 -0
  319. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/util/IndexedViewHelper.h +186 -0
  320. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/util/IntegralConstant.h +272 -0
  321. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/util/MKL_support.h +137 -0
  322. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/util/Macros.h +1464 -0
  323. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/util/Memory.h +1163 -0
  324. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/util/Meta.h +812 -0
  325. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/util/NonMPL2.h +3 -0
  326. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/util/ReenableStupidWarnings.h +31 -0
  327. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/util/ReshapedHelper.h +51 -0
  328. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/util/StaticAssert.h +221 -0
  329. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/util/SymbolicIndex.h +293 -0
  330. roboticstoolbox/ets/cpp-extensions/Eigen/src/Core/util/XprHelper.h +856 -0
  331. roboticstoolbox/ets/cpp-extensions/Eigen/src/Eigenvalues/ComplexEigenSolver.h +346 -0
  332. roboticstoolbox/ets/cpp-extensions/Eigen/src/Eigenvalues/ComplexSchur.h +462 -0
  333. roboticstoolbox/ets/cpp-extensions/Eigen/src/Eigenvalues/ComplexSchur_LAPACKE.h +91 -0
  334. roboticstoolbox/ets/cpp-extensions/Eigen/src/Eigenvalues/EigenSolver.h +622 -0
  335. roboticstoolbox/ets/cpp-extensions/Eigen/src/Eigenvalues/GeneralizedEigenSolver.h +418 -0
  336. roboticstoolbox/ets/cpp-extensions/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h +226 -0
  337. roboticstoolbox/ets/cpp-extensions/Eigen/src/Eigenvalues/HessenbergDecomposition.h +374 -0
  338. roboticstoolbox/ets/cpp-extensions/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h +158 -0
  339. roboticstoolbox/ets/cpp-extensions/Eigen/src/Eigenvalues/RealQZ.h +657 -0
  340. roboticstoolbox/ets/cpp-extensions/Eigen/src/Eigenvalues/RealSchur.h +558 -0
  341. roboticstoolbox/ets/cpp-extensions/Eigen/src/Eigenvalues/RealSchur_LAPACKE.h +77 -0
  342. roboticstoolbox/ets/cpp-extensions/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +904 -0
  343. roboticstoolbox/ets/cpp-extensions/Eigen/src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h +87 -0
  344. roboticstoolbox/ets/cpp-extensions/Eigen/src/Eigenvalues/Tridiagonalization.h +561 -0
  345. roboticstoolbox/ets/cpp-extensions/Eigen/src/Geometry/AlignedBox.h +486 -0
  346. roboticstoolbox/ets/cpp-extensions/Eigen/src/Geometry/AngleAxis.h +247 -0
  347. roboticstoolbox/ets/cpp-extensions/Eigen/src/Geometry/EulerAngles.h +114 -0
  348. roboticstoolbox/ets/cpp-extensions/Eigen/src/Geometry/Homogeneous.h +501 -0
  349. roboticstoolbox/ets/cpp-extensions/Eigen/src/Geometry/Hyperplane.h +282 -0
  350. roboticstoolbox/ets/cpp-extensions/Eigen/src/Geometry/OrthoMethods.h +235 -0
  351. roboticstoolbox/ets/cpp-extensions/Eigen/src/Geometry/ParametrizedLine.h +232 -0
  352. roboticstoolbox/ets/cpp-extensions/Eigen/src/Geometry/Quaternion.h +870 -0
  353. roboticstoolbox/ets/cpp-extensions/Eigen/src/Geometry/Rotation2D.h +199 -0
  354. roboticstoolbox/ets/cpp-extensions/Eigen/src/Geometry/RotationBase.h +206 -0
  355. roboticstoolbox/ets/cpp-extensions/Eigen/src/Geometry/Scaling.h +188 -0
  356. roboticstoolbox/ets/cpp-extensions/Eigen/src/Geometry/Transform.h +1563 -0
  357. roboticstoolbox/ets/cpp-extensions/Eigen/src/Geometry/Translation.h +202 -0
  358. roboticstoolbox/ets/cpp-extensions/Eigen/src/Geometry/Umeyama.h +166 -0
  359. roboticstoolbox/ets/cpp-extensions/Eigen/src/Geometry/arch/Geometry_SIMD.h +168 -0
  360. roboticstoolbox/ets/cpp-extensions/Eigen/src/Householder/BlockHouseholder.h +110 -0
  361. roboticstoolbox/ets/cpp-extensions/Eigen/src/Householder/Householder.h +176 -0
  362. roboticstoolbox/ets/cpp-extensions/Eigen/src/Householder/HouseholderSequence.h +545 -0
  363. roboticstoolbox/ets/cpp-extensions/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h +226 -0
  364. roboticstoolbox/ets/cpp-extensions/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +212 -0
  365. roboticstoolbox/ets/cpp-extensions/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +229 -0
  366. roboticstoolbox/ets/cpp-extensions/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h +394 -0
  367. roboticstoolbox/ets/cpp-extensions/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h +453 -0
  368. roboticstoolbox/ets/cpp-extensions/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +444 -0
  369. roboticstoolbox/ets/cpp-extensions/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h +198 -0
  370. roboticstoolbox/ets/cpp-extensions/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h +117 -0
  371. roboticstoolbox/ets/cpp-extensions/Eigen/src/Jacobi/Jacobi.h +483 -0
  372. roboticstoolbox/ets/cpp-extensions/Eigen/src/KLUSupport/KLUSupport.h +358 -0
  373. roboticstoolbox/ets/cpp-extensions/Eigen/src/LU/Determinant.h +117 -0
  374. roboticstoolbox/ets/cpp-extensions/Eigen/src/LU/FullPivLU.h +877 -0
  375. roboticstoolbox/ets/cpp-extensions/Eigen/src/LU/InverseImpl.h +432 -0
  376. roboticstoolbox/ets/cpp-extensions/Eigen/src/LU/PartialPivLU.h +624 -0
  377. roboticstoolbox/ets/cpp-extensions/Eigen/src/LU/PartialPivLU_LAPACKE.h +83 -0
  378. roboticstoolbox/ets/cpp-extensions/Eigen/src/LU/arch/InverseSize4.h +351 -0
  379. roboticstoolbox/ets/cpp-extensions/Eigen/src/MetisSupport/MetisSupport.h +137 -0
  380. roboticstoolbox/ets/cpp-extensions/Eigen/src/OrderingMethods/Amd.h +435 -0
  381. roboticstoolbox/ets/cpp-extensions/Eigen/src/OrderingMethods/Eigen_Colamd.h +1863 -0
  382. roboticstoolbox/ets/cpp-extensions/Eigen/src/OrderingMethods/Ordering.h +153 -0
  383. roboticstoolbox/ets/cpp-extensions/Eigen/src/PaStiXSupport/PaStiXSupport.h +678 -0
  384. roboticstoolbox/ets/cpp-extensions/Eigen/src/PardisoSupport/PardisoSupport.h +545 -0
  385. roboticstoolbox/ets/cpp-extensions/Eigen/src/QR/ColPivHouseholderQR.h +674 -0
  386. roboticstoolbox/ets/cpp-extensions/Eigen/src/QR/ColPivHouseholderQR_LAPACKE.h +97 -0
  387. roboticstoolbox/ets/cpp-extensions/Eigen/src/QR/CompleteOrthogonalDecomposition.h +635 -0
  388. roboticstoolbox/ets/cpp-extensions/Eigen/src/QR/FullPivHouseholderQR.h +713 -0
  389. roboticstoolbox/ets/cpp-extensions/Eigen/src/QR/HouseholderQR.h +434 -0
  390. roboticstoolbox/ets/cpp-extensions/Eigen/src/QR/HouseholderQR_LAPACKE.h +68 -0
  391. roboticstoolbox/ets/cpp-extensions/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h +335 -0
  392. roboticstoolbox/ets/cpp-extensions/Eigen/src/SVD/BDCSVD.h +1366 -0
  393. roboticstoolbox/ets/cpp-extensions/Eigen/src/SVD/JacobiSVD.h +812 -0
  394. roboticstoolbox/ets/cpp-extensions/Eigen/src/SVD/JacobiSVD_LAPACKE.h +91 -0
  395. roboticstoolbox/ets/cpp-extensions/Eigen/src/SVD/SVDBase.h +376 -0
  396. roboticstoolbox/ets/cpp-extensions/Eigen/src/SVD/UpperBidiagonalization.h +414 -0
  397. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseCholesky/SimplicialCholesky.h +697 -0
  398. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h +174 -0
  399. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseCore/AmbiVector.h +378 -0
  400. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseCore/CompressedStorage.h +274 -0
  401. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +352 -0
  402. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseCore/MappedSparseMatrix.h +67 -0
  403. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseCore/SparseAssign.h +270 -0
  404. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseCore/SparseBlock.h +571 -0
  405. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseCore/SparseColEtree.h +206 -0
  406. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseCore/SparseCompressedBase.h +370 -0
  407. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +722 -0
  408. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseCore/SparseCwiseUnaryOp.h +150 -0
  409. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseCore/SparseDenseProduct.h +342 -0
  410. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseCore/SparseDiagonalProduct.h +138 -0
  411. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseCore/SparseDot.h +98 -0
  412. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseCore/SparseFuzzy.h +29 -0
  413. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseCore/SparseMap.h +305 -0
  414. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseCore/SparseMatrix.h +1518 -0
  415. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseCore/SparseMatrixBase.h +398 -0
  416. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseCore/SparsePermutation.h +178 -0
  417. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseCore/SparseProduct.h +181 -0
  418. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseCore/SparseRedux.h +49 -0
  419. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseCore/SparseRef.h +397 -0
  420. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseCore/SparseSelfAdjointView.h +659 -0
  421. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseCore/SparseSolverBase.h +124 -0
  422. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseCore/SparseSparseProductWithPruning.h +198 -0
  423. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseCore/SparseTranspose.h +92 -0
  424. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseCore/SparseTriangularView.h +189 -0
  425. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseCore/SparseUtil.h +186 -0
  426. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseCore/SparseVector.h +478 -0
  427. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseCore/SparseView.h +254 -0
  428. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseCore/TriangularSolver.h +315 -0
  429. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseLU/SparseLU.h +923 -0
  430. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseLU/SparseLUImpl.h +66 -0
  431. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseLU/SparseLU_Memory.h +226 -0
  432. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseLU/SparseLU_Structs.h +110 -0
  433. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h +375 -0
  434. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseLU/SparseLU_Utils.h +80 -0
  435. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseLU/SparseLU_column_bmod.h +181 -0
  436. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseLU/SparseLU_column_dfs.h +179 -0
  437. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseLU/SparseLU_copy_to_ucol.h +107 -0
  438. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseLU/SparseLU_gemm_kernel.h +280 -0
  439. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseLU/SparseLU_heap_relax_snode.h +126 -0
  440. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseLU/SparseLU_kernel_bmod.h +130 -0
  441. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseLU/SparseLU_panel_bmod.h +223 -0
  442. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseLU/SparseLU_panel_dfs.h +258 -0
  443. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseLU/SparseLU_pivotL.h +137 -0
  444. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseLU/SparseLU_pruneL.h +136 -0
  445. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseLU/SparseLU_relax_snode.h +83 -0
  446. roboticstoolbox/ets/cpp-extensions/Eigen/src/SparseQR/SparseQR.h +758 -0
  447. roboticstoolbox/ets/cpp-extensions/Eigen/src/StlSupport/StdDeque.h +116 -0
  448. roboticstoolbox/ets/cpp-extensions/Eigen/src/StlSupport/StdList.h +106 -0
  449. roboticstoolbox/ets/cpp-extensions/Eigen/src/StlSupport/StdVector.h +131 -0
  450. roboticstoolbox/ets/cpp-extensions/Eigen/src/StlSupport/details.h +84 -0
  451. roboticstoolbox/ets/cpp-extensions/Eigen/src/SuperLUSupport/SuperLUSupport.h +1025 -0
  452. roboticstoolbox/ets/cpp-extensions/Eigen/src/UmfPackSupport/UmfPackSupport.h +642 -0
  453. roboticstoolbox/ets/cpp-extensions/Eigen/src/misc/Image.h +82 -0
  454. roboticstoolbox/ets/cpp-extensions/Eigen/src/misc/Kernel.h +79 -0
  455. roboticstoolbox/ets/cpp-extensions/Eigen/src/misc/RealSvd2x2.h +55 -0
  456. roboticstoolbox/ets/cpp-extensions/Eigen/src/misc/blas.h +440 -0
  457. roboticstoolbox/ets/cpp-extensions/Eigen/src/misc/lapack.h +152 -0
  458. roboticstoolbox/ets/cpp-extensions/Eigen/src/misc/lapacke.h +16292 -0
  459. roboticstoolbox/ets/cpp-extensions/Eigen/src/misc/lapacke_mangling.h +17 -0
  460. roboticstoolbox/ets/cpp-extensions/Eigen/src/plugins/ArrayCwiseBinaryOps.h +358 -0
  461. roboticstoolbox/ets/cpp-extensions/Eigen/src/plugins/ArrayCwiseUnaryOps.h +696 -0
  462. roboticstoolbox/ets/cpp-extensions/Eigen/src/plugins/BlockMethods.h +1442 -0
  463. roboticstoolbox/ets/cpp-extensions/Eigen/src/plugins/CommonCwiseBinaryOps.h +115 -0
  464. roboticstoolbox/ets/cpp-extensions/Eigen/src/plugins/CommonCwiseUnaryOps.h +177 -0
  465. roboticstoolbox/ets/cpp-extensions/Eigen/src/plugins/IndexedViewMethods.h +262 -0
  466. roboticstoolbox/ets/cpp-extensions/Eigen/src/plugins/MatrixCwiseBinaryOps.h +152 -0
  467. roboticstoolbox/ets/cpp-extensions/Eigen/src/plugins/MatrixCwiseUnaryOps.h +95 -0
  468. roboticstoolbox/ets/cpp-extensions/Eigen/src/plugins/ReshapedMethods.h +149 -0
  469. roboticstoolbox/ets/cpp-extensions/README.md +73 -0
  470. roboticstoolbox/ets/cpp-extensions/fknm_nb.cpp +534 -0
  471. roboticstoolbox/ets/cpp-extensions/ik.cpp +301 -0
  472. roboticstoolbox/ets/cpp-extensions/ik.h +59 -0
  473. roboticstoolbox/ets/cpp-extensions/linalg.cpp +316 -0
  474. roboticstoolbox/ets/cpp-extensions/linalg.h +64 -0
  475. roboticstoolbox/ets/cpp-extensions/methods.cpp +372 -0
  476. roboticstoolbox/ets/cpp-extensions/methods.h +32 -0
  477. roboticstoolbox/ets/cpp-extensions/structs.cpp +24 -0
  478. roboticstoolbox/ets/cpp-extensions/structs.h +62 -0
  479. roboticstoolbox/ets/fknm.py +366 -0
  480. roboticstoolbox/mobile/Animations.py +485 -0
  481. roboticstoolbox/mobile/Bug2.py +455 -0
  482. roboticstoolbox/mobile/CurvaturePolyPlanner.py +179 -0
  483. roboticstoolbox/mobile/DistanceTransformPlanner.py +395 -0
  484. roboticstoolbox/mobile/DstarPlanner.py +591 -0
  485. roboticstoolbox/mobile/DubinsPlanner.py +474 -0
  486. roboticstoolbox/mobile/EKF.py +1617 -0
  487. roboticstoolbox/mobile/LatticePlanner.py +419 -0
  488. roboticstoolbox/mobile/OccGrid.py +613 -0
  489. roboticstoolbox/mobile/PRMPlanner.py +348 -0
  490. roboticstoolbox/mobile/ParticleFilter.py +706 -0
  491. roboticstoolbox/mobile/PlannerBase.py +1009 -0
  492. roboticstoolbox/mobile/PoseGraph.py +544 -0
  493. roboticstoolbox/mobile/QuinticPolyPlanner.py +349 -0
  494. roboticstoolbox/mobile/RRTPlanner.py +359 -0
  495. roboticstoolbox/mobile/ReedsSheppPlanner.py +545 -0
  496. roboticstoolbox/mobile/Vehicle.py +1909 -0
  497. roboticstoolbox/mobile/__init__.py +194 -0
  498. roboticstoolbox/mobile/drivers.py +397 -0
  499. roboticstoolbox/mobile/landmarkmap.py +181 -0
  500. roboticstoolbox/mobile/sensors.py +789 -0
  501. roboticstoolbox/models/DH/AL5D.py +121 -0
  502. roboticstoolbox/models/DH/Ball.py +87 -0
  503. roboticstoolbox/models/DH/Baxter.py +91 -0
  504. roboticstoolbox/models/DH/Cobra600.py +63 -0
  505. roboticstoolbox/models/DH/Coil.py +80 -0
  506. roboticstoolbox/models/DH/Hyper.py +81 -0
  507. roboticstoolbox/models/DH/Hyper3d.py +83 -0
  508. roboticstoolbox/models/DH/IRB140.py +159 -0
  509. roboticstoolbox/models/DH/Jaco.py +102 -0
  510. roboticstoolbox/models/DH/KR5.py +112 -0
  511. roboticstoolbox/models/DH/LWR4.py +80 -0
  512. roboticstoolbox/models/DH/Mico.py +102 -0
  513. roboticstoolbox/models/DH/Orion5.py +91 -0
  514. roboticstoolbox/models/DH/P8.py +80 -0
  515. roboticstoolbox/models/DH/Panda.py +213 -0
  516. roboticstoolbox/models/DH/Planar2.py +69 -0
  517. roboticstoolbox/models/DH/Planar3.py +51 -0
  518. roboticstoolbox/models/DH/Puma560.py +326 -0
  519. roboticstoolbox/models/DH/README.md +216 -0
  520. roboticstoolbox/models/DH/Sawyer.py +85 -0
  521. roboticstoolbox/models/DH/Stanford.py +147 -0
  522. roboticstoolbox/models/DH/TwoLink.py +153 -0
  523. roboticstoolbox/models/DH/UR10.py +124 -0
  524. roboticstoolbox/models/DH/UR3.py +98 -0
  525. roboticstoolbox/models/DH/UR5.py +98 -0
  526. roboticstoolbox/models/DH/Uprighttl.py +24 -0
  527. roboticstoolbox/models/DH/__init__.py +52 -0
  528. roboticstoolbox/models/ETS/Frankie.py +90 -0
  529. roboticstoolbox/models/ETS/GenericSeven.py +54 -0
  530. roboticstoolbox/models/ETS/Omni.py +74 -0
  531. roboticstoolbox/models/ETS/Panda.py +69 -0
  532. roboticstoolbox/models/ETS/Planar2.py +49 -0
  533. roboticstoolbox/models/ETS/Planar_Y.py +65 -0
  534. roboticstoolbox/models/ETS/Puma560.py +70 -0
  535. roboticstoolbox/models/ETS/XYPanda.py +84 -0
  536. roboticstoolbox/models/ETS/__init__.py +20 -0
  537. roboticstoolbox/models/README.md +9 -0
  538. roboticstoolbox/models/URDF/AL5D.py +45 -0
  539. roboticstoolbox/models/URDF/Fetch.py +96 -0
  540. roboticstoolbox/models/URDF/Frankie.py +67 -0
  541. roboticstoolbox/models/URDF/FrankieOmni.py +94 -0
  542. roboticstoolbox/models/URDF/Jaco.py +49 -0
  543. roboticstoolbox/models/URDF/KinovaGen3.py +63 -0
  544. roboticstoolbox/models/URDF/LBR.py +57 -0
  545. roboticstoolbox/models/URDF/PR2.py +66 -0
  546. roboticstoolbox/models/URDF/Panda.py +60 -0
  547. roboticstoolbox/models/URDF/Puma560.py +90 -0
  548. roboticstoolbox/models/URDF/UR10.py +43 -0
  549. roboticstoolbox/models/URDF/UR3.py +43 -0
  550. roboticstoolbox/models/URDF/UR5.py +64 -0
  551. roboticstoolbox/models/URDF/URDFRobot.py +402 -0
  552. roboticstoolbox/models/URDF/Valkyrie.py +110 -0
  553. roboticstoolbox/models/URDF/YuMi.py +107 -0
  554. roboticstoolbox/models/URDF/__init__.py +51 -0
  555. roboticstoolbox/models/URDF/px100.py +48 -0
  556. roboticstoolbox/models/URDF/px150.py +48 -0
  557. roboticstoolbox/models/URDF/rx150.py +48 -0
  558. roboticstoolbox/models/URDF/rx200.py +48 -0
  559. roboticstoolbox/models/URDF/vx300.py +48 -0
  560. roboticstoolbox/models/URDF/vx300s.py +48 -0
  561. roboticstoolbox/models/URDF/wx200.py +48 -0
  562. roboticstoolbox/models/URDF/wx250.py +48 -0
  563. roboticstoolbox/models/URDF/wx250s.py +48 -0
  564. roboticstoolbox/models/__init__.py +7 -0
  565. roboticstoolbox/models/catalog.py +226 -0
  566. roboticstoolbox/robot/BaseRobot.py +2589 -0
  567. roboticstoolbox/robot/DHFactor.py +522 -0
  568. roboticstoolbox/robot/DHLink.py +949 -0
  569. roboticstoolbox/robot/DHRobot.py +2591 -0
  570. roboticstoolbox/robot/Dynamics.py +1537 -0
  571. roboticstoolbox/robot/ELink.py +23 -0
  572. roboticstoolbox/robot/ERobot.py +25 -0
  573. roboticstoolbox/robot/Gripper.py +242 -0
  574. roboticstoolbox/robot/IK.py +1378 -0
  575. roboticstoolbox/robot/Link.py +1557 -0
  576. roboticstoolbox/robot/PoERobot.py +352 -0
  577. roboticstoolbox/robot/Robot.py +2157 -0
  578. roboticstoolbox/robot/RobotKinematics.py +1505 -0
  579. roboticstoolbox/robot/RobotPlottingMPL.py +355 -0
  580. roboticstoolbox/robot/RobotProto.py +156 -0
  581. roboticstoolbox/robot/__init__.py +57 -0
  582. roboticstoolbox/robot/cpp-extensions/README.md +29 -0
  583. roboticstoolbox/robot/cpp-extensions/frne.h +96 -0
  584. roboticstoolbox/robot/cpp-extensions/frne_nb.cpp +237 -0
  585. roboticstoolbox/robot/cpp-extensions/ne.c +495 -0
  586. roboticstoolbox/robot/cpp-extensions/vmath.c +163 -0
  587. roboticstoolbox/robot/cpp-extensions/vmath.h +32 -0
  588. roboticstoolbox/robot/frne.py +51 -0
  589. roboticstoolbox/tools/DHFactor.py +375 -0
  590. roboticstoolbox/tools/Ticker.py +53 -0
  591. roboticstoolbox/tools/__init__.py +54 -0
  592. roboticstoolbox/tools/data.py +187 -0
  593. roboticstoolbox/tools/jsingu.py +51 -0
  594. roboticstoolbox/tools/null.py +48 -0
  595. roboticstoolbox/tools/numerical.py +96 -0
  596. roboticstoolbox/tools/p_servo.py +108 -0
  597. roboticstoolbox/tools/params.py +11 -0
  598. roboticstoolbox/tools/plot.py +109 -0
  599. roboticstoolbox/tools/trajectory.py +1152 -0
  600. roboticstoolbox/tools/types.py +13 -0
  601. roboticstoolbox/tools/urdf/__init__.py +45 -0
  602. roboticstoolbox/tools/urdf/tests/data/ur5.urdf +341 -0
  603. roboticstoolbox/tools/urdf/tests/test_urdf.py +116 -0
  604. roboticstoolbox/tools/urdf/urdf.py +1930 -0
  605. roboticstoolbox/tools/urdf/utils.py +50 -0
  606. roboticstoolbox_python-1.4.0.dist-info/METADATA +664 -0
  607. roboticstoolbox_python-1.4.0.dist-info/RECORD +610 -0
  608. roboticstoolbox_python-1.4.0.dist-info/WHEEL +5 -0
  609. roboticstoolbox_python-1.4.0.dist-info/entry_points.txt +6 -0
  610. roboticstoolbox_python-1.4.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,1378 @@
1
+ #!/usr/bin/env python
2
+
3
+ """
4
+ @author Jesse Haviland
5
+ """
6
+
7
+ import numpy as np
8
+ from abc import ABC, abstractmethod
9
+ from typing import Tuple, cast
10
+ import roboticstoolbox as rtb
11
+ from dataclasses import dataclass
12
+ from spatialmath import SE3
13
+ from roboticstoolbox.tools.types import ArrayLike, NDArray
14
+
15
+
16
+ try:
17
+ import qpsolvers as qp
18
+
19
+ _qp = True
20
+ except ImportError: # pragma nocover
21
+ _qp = False
22
+
23
+
24
+ @dataclass
25
+ class IKSolution:
26
+ """
27
+ A dataclass for representing an IK solution
28
+
29
+ Attributes
30
+ ----------
31
+ q
32
+ The joint coordinates of the solution (ndarray). Note that these
33
+ will not be valid if failed to find a solution
34
+ success
35
+ True if a valid solution was found
36
+ iterations
37
+ How many iterations were performed
38
+ searches
39
+ How many searches were performed
40
+ residual
41
+ The final error value from the cost function
42
+ reason
43
+ The reason the IK problem failed if applicable
44
+
45
+
46
+ .. versionchanged:: 1.0.3
47
+ Added IKSolution dataclass to replace the IKsolution named tuple
48
+
49
+ """
50
+
51
+ q: np.ndarray
52
+ success: bool
53
+ iterations: int = 0
54
+ searches: int = 0
55
+ residual: float = 0.0
56
+ reason: str = ""
57
+
58
+ def __iter__(self):
59
+ return iter(
60
+ (
61
+ self.q,
62
+ self.success,
63
+ self.iterations,
64
+ self.searches,
65
+ self.residual,
66
+ self.reason,
67
+ )
68
+ )
69
+
70
+ def __str__(self):
71
+ if self.q is not None:
72
+ q_str = np.array2string(
73
+ self.q,
74
+ separator=", ",
75
+ formatter={
76
+ "float": lambda x: "{:.4g}".format(0 if abs(x) < 1e-6 else x)
77
+ },
78
+ ) # np.round(self.q, 4)
79
+ else:
80
+ q_str = None
81
+
82
+ if self.iterations == 0 and self.searches == 0:
83
+ # Check for analytic
84
+ if self.success:
85
+ return f"IKSolution: q={q_str}, success=True"
86
+ else:
87
+ return f"IKSolution: q={q_str}, success=False, reason={self.reason}"
88
+ else:
89
+ # Otherwise it is a numeric solution
90
+ if self.success:
91
+ return (
92
+ f"IKSolution: q={q_str}, success=True,"
93
+ f" iterations={self.iterations}, searches={self.searches},"
94
+ f" residual={self.residual:.3g}"
95
+ )
96
+ else:
97
+ return (
98
+ f"IKSolution: q={q_str}, success=False, reason={self.reason},"
99
+ f" iterations={self.iterations}, searches={self.searches},"
100
+ f" residual={np.round(self.residual, 4):.3g}"
101
+ )
102
+
103
+
104
+ class IKSolver(ABC):
105
+ r"""
106
+ An abstract super class for numerical inverse kinematics (IK)
107
+
108
+ This class provides basic functionality to perform numerical IK. Superclasses
109
+ can inherit this class and implement the `solve` method and redefine any other
110
+ methods necessary.
111
+
112
+ :param name: The name of the IK algorithm
113
+ :param ilimit: How many iterations are allowed within a search before a new search
114
+ is started
115
+ :param slimit: How many searches are allowed before being deemed unsuccessful
116
+ :param tol: Maximum allowed residual error E, where
117
+ :math:`E = \tfrac{1}{2} \vec{e}^\top \mat{W}_e \vec{e}` is a *quadratic* form
118
+ in the 6-vector angle-axis pose error :math:`\vec{e}` (see :meth:`error`).
119
+ Because `E` is quadratic, `tol` does not bound the linear-scale position/
120
+ orientation error directly — with the default unit weighting, components of
121
+ :math:`\vec{e}` are only guaranteed to be within roughly
122
+ :math:`\sqrt{2 \cdot \text{tol}}` (e.g. `tol=1e-6` guarantees pose error on
123
+ the order of 1e-3, not 1e-6). Pick `tol` accordingly if you need a specific
124
+ linear-scale accuracy
125
+ :param mask: A 6 vector which assigns weights to Cartesian degrees-of-freedom
126
+ error priority
127
+ :param joint_limits: Reject solutions with joint limit violations
128
+ :param seed: A seed for the private RNG used to generate random joint coordinate
129
+ vectors
130
+
131
+ .. seealso::
132
+
133
+ :class:`IK_NR` Implements this class using the Newton-Raphson method
134
+
135
+ :class:`IK_GN` Implements this class using the Gauss-Newton method
136
+
137
+ :class:`IK_LM` Implements this class using the Levemberg-Marquadt method
138
+
139
+ :class:`IK_QP` Implements this class using a quadratic programming approach
140
+
141
+ .. versionchanged:: 1.0.3
142
+ Added the abstract super class IKSolver
143
+
144
+ """
145
+
146
+ def __init__(
147
+ self,
148
+ name: str = "IK Solver",
149
+ ilimit: int = 30,
150
+ slimit: int = 100,
151
+ tol: float = 1e-6,
152
+ mask: ArrayLike | None = None,
153
+ joint_limits: bool = True,
154
+ seed: int | None = None,
155
+ ):
156
+ # Solver parameters
157
+ self.name = name
158
+ self.slimit = slimit
159
+ self.ilimit = ilimit
160
+ self.tol = tol
161
+
162
+ # Random number generator
163
+ self._private_random = np.random.default_rng(seed=seed)
164
+
165
+ if mask is None:
166
+ mask = np.ones(6)
167
+
168
+ self.We = np.diag(mask) # type: ignore
169
+ self.joint_limits = joint_limits
170
+
171
+ def solve(
172
+ self,
173
+ ets: "rtb.ETS",
174
+ Tep: SE3 | np.ndarray,
175
+ q0: ArrayLike | None = None,
176
+ ) -> IKSolution:
177
+ """
178
+ Solves the IK problem
179
+
180
+ :param ets: The ETS representing the manipulators kinematics
181
+ :param Tep: The desired end-effector pose
182
+ :param q0: The initial joint coordinate vector
183
+ :returns: An IKSolution containing joint coordinates ``q``, ``success`` flag,
184
+ ``iterations``, ``searches``, ``residual`` error value, and ``reason``
185
+ string if applicable
186
+ :rtype: IKSolution
187
+
188
+ This method will attempt to solve the IK problem and obtain joint coordinates
189
+ which result the the end-effector pose `Tep`.
190
+ """
191
+ # Get the largest jindex in the ETS. If this is greater than ETS.n
192
+ # then we need to pad the q vector with zeros
193
+ max_jindex: int = 0
194
+
195
+ for j in ets.joints():
196
+ if j.jindex > max_jindex: # type: ignore
197
+ max_jindex = j.jindex # type: ignore
198
+
199
+ q0_method = np.zeros((self.slimit, max_jindex + 1))
200
+
201
+ if q0 is None:
202
+ q0_method[:, ets.jindices] = self._random_q(ets, self.slimit)
203
+
204
+ elif not isinstance(q0, np.ndarray):
205
+ q0 = np.array(q0)
206
+
207
+ if q0 is not None and q0.ndim == 1:
208
+ q0_method[:, ets.jindices] = self._random_q(ets, self.slimit)
209
+
210
+ q0_method[0, ets.jindices] = q0
211
+
212
+ if q0 is not None and q0.ndim == 2:
213
+ q0_method[:, ets.jindices] = self._random_q(ets, self.slimit)
214
+
215
+ q0_method[: q0.shape[0], ets.jindices] = q0
216
+
217
+ q0 = q0_method
218
+
219
+ traj = False
220
+
221
+ methTep: np.ndarray
222
+
223
+ if isinstance(Tep, SE3):
224
+ if len(Tep) > 1:
225
+ traj = True
226
+ methTep = np.empty((len(Tep), 4, 4))
227
+
228
+ for i, T in enumerate(Tep):
229
+ methTep[i] = T.A
230
+ else:
231
+ methTep = cast(NDArray, Tep.A)
232
+ elif Tep.ndim == 3:
233
+ traj = True
234
+ methTep = Tep
235
+ elif Tep.shape != (4, 4):
236
+ raise ValueError("Tep must be a 4x4 SE3 matrix")
237
+ else:
238
+ methTep = Tep
239
+
240
+ if traj:
241
+ q = np.empty((methTep.shape[0], ets.n))
242
+ success = True
243
+ interations = 0
244
+ searches = 0
245
+ residual = np.inf
246
+ reason = ""
247
+
248
+ for i, T in enumerate(methTep):
249
+ sol = self._solve(ets, T, q0)
250
+ q[i] = sol.q
251
+ if not sol.success:
252
+ success = False
253
+ reason = sol.reason
254
+ interations += sol.iterations
255
+ searches += sol.searches
256
+
257
+ if sol.residual < residual:
258
+ residual = sol.residual
259
+
260
+ return IKSolution(
261
+ q=q,
262
+ success=success,
263
+ iterations=interations,
264
+ searches=searches,
265
+ residual=residual,
266
+ reason=reason,
267
+ )
268
+
269
+ else:
270
+ sol = self._solve(ets, methTep, q0)
271
+
272
+ return sol
273
+
274
+ def _solve(self, ets: "rtb.ETS", Tep: np.ndarray, q0: np.ndarray) -> IKSolution:
275
+ # Iteration count
276
+ i = 0
277
+ total_i = 0
278
+
279
+ # Error flags
280
+ found_with_limits = False
281
+ linalg_error = 0
282
+
283
+ # Initialise variables
284
+ E = 0.0
285
+ q = q0[0]
286
+
287
+ for search in range(self.slimit):
288
+ q = q0[search].copy()
289
+ i = 0
290
+
291
+ while i < self.ilimit:
292
+ i += 1
293
+
294
+ # step() reports E for q as it was *before* this iteration's
295
+ # update. An undamped update (GN/NR) can overshoot, so if E is
296
+ # already below tol we must return this pre-step q, not the
297
+ # mutated one step() hands back - otherwise we can report
298
+ # success with a q whose actual residual is far above tol.
299
+ q_prev = q.copy()
300
+
301
+ # Attempt a step
302
+ try:
303
+ E, q[ets.jindices] = self.step(ets, Tep, q)
304
+
305
+ except np.linalg.LinAlgError:
306
+ # Abandon search and try again
307
+ linalg_error += 1
308
+ break
309
+
310
+ # Check if we have arrived
311
+ if E < self.tol:
312
+ q = q_prev
313
+
314
+ # Wrap q to be within +- 180 deg
315
+ # If your robot has larger than 180 deg range on a joint
316
+ # this line should be modified in incorporate the extra range
317
+ q = (q + np.pi) % (2 * np.pi) - np.pi
318
+
319
+ # Check if we have violated joint limits
320
+ jl_valid = self._check_jl(ets, q)
321
+
322
+ if not jl_valid and self.joint_limits:
323
+ # Abandon search and try again
324
+ found_with_limits = True
325
+ break
326
+ else:
327
+ return IKSolution(
328
+ q=q[ets.jindices],
329
+ success=True,
330
+ iterations=total_i + i,
331
+ searches=search + 1,
332
+ residual=E,
333
+ reason="Success",
334
+ )
335
+ total_i += i
336
+
337
+ # If we make it here, then we have failed
338
+ reason = "iteration and search limit reached"
339
+
340
+ if linalg_error:
341
+ reason += f", {linalg_error} numpy.LinAlgError encountered"
342
+
343
+ if found_with_limits:
344
+ reason += ", solution found but violates joint limits"
345
+
346
+ return IKSolution(
347
+ q=q,
348
+ success=False,
349
+ iterations=total_i,
350
+ searches=self.slimit,
351
+ residual=E,
352
+ reason=reason,
353
+ )
354
+
355
+ def error(self, Te: np.ndarray, Tep: np.ndarray) -> Tuple[np.ndarray, float]:
356
+ r"""
357
+ Calculates the error between Te and Tep
358
+
359
+ :param Te: The current end-effector pose
360
+ :param Tep: The desired end-effector pose
361
+ :returns: Tuple of ``(e, E)`` where ``e`` is the angle-axis error (6 vector)
362
+ and ``E`` is the quadratic error weighted by We
363
+ :rtype: tuple[numpy.ndarray, float]
364
+
365
+ Calculates the angle-axis error between current end-effector pose Te and
366
+ the desired end-effector pose Tep. Also calculates the quadratic error E
367
+ which is weighted by the diagonal matrix We.
368
+
369
+ .. math::
370
+
371
+ E = \frac{1}{2} \vec{e}^{\top} \mat{W}_e \vec{e}
372
+
373
+ where :math:`\vec{e} \in \mathbb{R}^6` is the angle-axis error.
374
+ """
375
+ e = rtb.angle_axis(Te, Tep)
376
+ E = float(0.5 * e @ self.We @ e)
377
+
378
+ return e, E
379
+
380
+ @abstractmethod
381
+ def step(
382
+ self, ets: "rtb.ETS", Tep: np.ndarray, q: np.ndarray
383
+ ) -> Tuple[float, np.ndarray]:
384
+ """
385
+ Abstract step method
386
+
387
+ :param ets: The ETS representing the manipulators kinematics
388
+ :param Tep: The desired end-effector pose
389
+ :param q: The current joint coordinate vector
390
+ :raises numpy.LinAlgError: If a step is impossible due to a linear algebra error
391
+ :returns: Tuple of ``(E, q)`` where ``E`` is the new error value and ``q`` is
392
+ the new joint coordinate vector
393
+ :rtype: tuple[float, numpy.ndarray]
394
+
395
+ Superclasses will implement this method to perform a step of the
396
+ implemented IK algorithm.
397
+ """
398
+ pass # pragma: nocover
399
+
400
+ def _random_q(self, ets: "rtb.ETS", i: int = 1) -> np.ndarray:
401
+ """
402
+ Generate a random valid joint configuration using a private RNG
403
+
404
+ :param ets: The ETS representing the manipulators kinematics
405
+ :param i: number of configurations to generate
406
+ :returns: An ``i x n`` ndarray of random valid joint configurations, where n
407
+ is the number of joints in the ``ets``
408
+ :rtype: numpy.ndarray
409
+
410
+ Generates a random q vector within the joint limits defined by ``ets.qlim``.
411
+ """
412
+
413
+ if i == 1:
414
+ q = np.zeros((1, ets.n))
415
+
416
+ for i in range(ets.n):
417
+ q[0, i] = self._private_random.uniform(ets.qlim[0, i], ets.qlim[1, i])
418
+
419
+ else:
420
+ q = np.zeros((i, ets.n))
421
+
422
+ for j in range(i):
423
+ for i in range(ets.n):
424
+ q[j, i] = self._private_random.uniform(
425
+ ets.qlim[0, i], ets.qlim[1, i]
426
+ )
427
+
428
+ return q
429
+
430
+ def _check_jl(self, ets: "rtb.ETS", q: np.ndarray) -> bool:
431
+ """
432
+ Checks if the joints are within their respective limits
433
+
434
+ :param ets: the ETS
435
+ :param q: the current joint coordinate vector
436
+ :returns: True if joints within feasible limits otherwise False
437
+ :rtype: bool
438
+
439
+ """
440
+
441
+ # Loop through the joints in the ETS
442
+ for i in range(ets.n):
443
+ # Get the corresponding joint limits
444
+ ql0 = ets.qlim[0, i]
445
+ ql1 = ets.qlim[1, i]
446
+
447
+ # Check if q exceeds the limits
448
+ if q[i] < ql0 or q[i] > ql1:
449
+ return False
450
+
451
+ # If we make it here, all the joints are fine
452
+ return True
453
+
454
+
455
+ def _null_Σ(ets: "rtb.ETS", q: NDArray, ps: float, pi: NDArray | float):
456
+ """
457
+ Formulates a relationship between joint limits and the joint velocity.
458
+ When this is projected into the null-space of the differential kinematics
459
+ to attempt to avoid exceeding joint limits
460
+
461
+ :param q: The joint coordinates of the robot
462
+ :param ps: The minimum angle/distance (in radians or metres) in which the joint is
463
+ allowed to approach to its limit
464
+ :param pi: The influence angle/distance (in radians or metres) in which the velocity
465
+ damper becomes active
466
+
467
+ :return: Σ
468
+ """
469
+
470
+ if isinstance(pi, float) or isinstance(pi, int):
471
+ pi = pi * np.ones(ets.n)
472
+
473
+ # Add cost to going in the direction of joint limits, if they are within
474
+ # the influence distance
475
+ Σ = np.zeros((ets.n, 1))
476
+
477
+ for i in range(ets.n):
478
+ qi = q[i]
479
+ ql0 = ets.qlim[0, i]
480
+ ql1 = ets.qlim[1, i]
481
+
482
+ if qi - ql0 <= pi[i]:
483
+ Σ[i, 0] = -np.power(((qi - ql0) - pi[i]), 2) / np.power((ps - pi[i]), 2)
484
+ if ql1 - qi <= pi[i]:
485
+ Σ[i, 0] = np.power(((ql1 - qi) - pi[i]), 2) / np.power((ps - pi[i]), 2)
486
+
487
+ return -Σ
488
+
489
+
490
+ def _calc_qnull(
491
+ ets: "rtb.ETS",
492
+ q: np.ndarray,
493
+ J: np.ndarray,
494
+ λΣ: float,
495
+ λm: float,
496
+ ps: float,
497
+ pi: np.ndarray | float,
498
+ ):
499
+ """
500
+ Calculates the desired null-space motion according to the gains λΣ and λm.
501
+ This is a helper method that is used within the `step` method of an IK solver
502
+
503
+ :return: qnull - the desired null-space motion
504
+ """
505
+
506
+ qnull_grad = np.zeros(ets.n)
507
+ qnull = np.zeros(ets.n)
508
+
509
+ # Add the joint limit avoidance if the gain is above 0
510
+ if λΣ > 0:
511
+ Σ = _null_Σ(ets, q, ps, pi)
512
+ qnull_grad += (1.0 / λΣ * Σ).flatten()
513
+
514
+ # Add the manipulability maximisation if the gain is above 0
515
+ if λm > 0:
516
+ Jm = ets.jacobm(q)
517
+ qnull_grad += (1.0 / λm * Jm).flatten()
518
+
519
+ # Calculate the null-space motion
520
+ if λΣ > 0 or λm > 0:
521
+ null_space = np.eye(ets.n) - np.linalg.pinv(J) @ J
522
+ qnull = null_space @ qnull_grad
523
+
524
+ return qnull.flatten()
525
+
526
+
527
+ class IK_NR(IKSolver):
528
+ r"""
529
+ Newton-Raphson Numerical Inverse Kinematics Solver
530
+
531
+ A class which provides functionality to perform numerical inverse kinematics (IK)
532
+ using the Newton-Raphson method. See `step` method for mathematical description.
533
+
534
+ .. note::
535
+
536
+ When using this class with redundant robots (>6 DoF), `pinv` must be set to `True`
537
+
538
+ :param name: The name of the IK algorithm
539
+ :param ilimit: How many iterations are allowed within a search before a new search
540
+ is started
541
+ :param slimit: How many searches are allowed before being deemed unsuccessful
542
+ :param tol: Maximum allowed residual error E, where
543
+ :math:`E = \tfrac{1}{2} \vec{e}^\top \mat{W}_e \vec{e}` is a *quadratic* form
544
+ in the 6-vector angle-axis pose error :math:`\vec{e}` (see :meth:`error`).
545
+ Because `E` is quadratic, `tol` does not bound the linear-scale position/
546
+ orientation error directly — with the default unit weighting, components of
547
+ :math:`\vec{e}` are only guaranteed to be within roughly
548
+ :math:`\sqrt{2 \cdot \text{tol}}` (e.g. `tol=1e-6` guarantees pose error on
549
+ the order of 1e-3, not 1e-6). Pick `tol` accordingly if you need a specific
550
+ linear-scale accuracy
551
+ :param mask: A 6 vector which assigns weights to Cartesian degrees-of-freedom
552
+ error priority
553
+ :param joint_limits: Reject solutions with joint limit violations
554
+ :param seed: A seed for the private RNG used to generate random joint coordinate
555
+ vectors
556
+ :param pinv: If True, will use the pseudoinverse in the `step` method instead of
557
+ the normal inverse
558
+ :param kq: The gain for joint limit avoidance. Setting to 0.0 will remove this
559
+ completely from the solution
560
+ :param km: The gain for maximisation. Setting to 0.0 will remove this completely
561
+ from the solution
562
+ :param ps: The minimum angle/distance (in radians or metres) in which the joint is
563
+ allowed to approach to its limit
564
+ :param pi: The influence angle/distance (in radians or metres) in null space motion
565
+ becomes active
566
+
567
+ Example::
568
+
569
+ The following example gets the ``ets`` of a ``panda`` robot object, instantiates
570
+ the IK_NR solver class using default parameters, makes a goal pose ``Tep``,
571
+ and then solves for the joint coordinates which result in the pose ``Tep``
572
+ using the ``solve`` method.
573
+
574
+ .. runblock:: pycon
575
+ >>> import roboticstoolbox as rtb
576
+ >>> panda = rtb.models.Panda().ets()
577
+ >>> solver = rtb.IK_NR(pinv=True)
578
+ >>> Tep = panda.fkine([0, -0.3, 0, -2.2, 0, 2, 0.7854])
579
+ >>> solver.solve(panda, Tep)
580
+
581
+ .. rubric:: Notes
582
+
583
+ When using the NR method, the initial joint coordinates :math:`q_0`, should correspond
584
+ to a non-singular manipulator pose, since it uses the manipulator Jacobian. When the
585
+ the problem is solvable, it converges very quickly. However, this method frequently
586
+ fails to converge on the goal.
587
+
588
+ This class supports null-space motion to assist with maximising manipulability and
589
+ avoiding joint limits. These are enabled by setting kq and km to non-zero values.
590
+
591
+ .. rubric:: References
592
+
593
+ - J. Haviland, and P. Corke. "Manipulator Differential Kinematics Part I:
594
+ Kinematics, Velocity, and Applications." arXiv preprint arXiv:2207.01796 (2022).
595
+ - J. Haviland, and P. Corke. "Manipulator Differential Kinematics Part II:
596
+ Acceleration and Advanced Applications." arXiv preprint arXiv:2207.01794 (2022).
597
+
598
+ .. seealso::
599
+
600
+ :class:`IKSolver` An abstract super class for numerical IK solvers
601
+
602
+ :class:`IK_GN` Implements the IKSolver class using the Gauss-Newton method
603
+
604
+ :class:`IK_LM` Implements the IKSolver class using the Levemberg-Marquadt method
605
+
606
+ :class:`IK_QP` Implements the IKSolver class using a quadratic programming approach
607
+
608
+ .. versionchanged:: 1.0.3
609
+ Added the Newton-Raphson IK solver class
610
+
611
+ """
612
+
613
+ def __init__(
614
+ self,
615
+ name: str = "IK Solver",
616
+ ilimit: int = 30,
617
+ slimit: int = 100,
618
+ tol: float = 1e-6,
619
+ mask: ArrayLike | None = None,
620
+ joint_limits: bool = True,
621
+ seed: int | None = None,
622
+ pinv: bool = False,
623
+ kq: float = 0.0,
624
+ km: float = 0.0,
625
+ ps: float = 0.0,
626
+ pi: np.ndarray | float = 0.3,
627
+ **kwargs,
628
+ ):
629
+ super().__init__(
630
+ name=name,
631
+ ilimit=ilimit,
632
+ slimit=slimit,
633
+ tol=tol,
634
+ mask=mask,
635
+ joint_limits=joint_limits,
636
+ seed=seed,
637
+ **kwargs,
638
+ )
639
+
640
+ self.pinv = pinv
641
+ self.kq = kq
642
+ self.km = km
643
+ self.ps = ps
644
+ self.pi = pi
645
+
646
+ self.name = f"NR (pinv={pinv})"
647
+
648
+ if self.kq > 0.0:
649
+ self.name += " Σ"
650
+
651
+ if self.km > 0.0:
652
+ self.name += " Jm"
653
+
654
+ def step(
655
+ self, ets: "rtb.ETS", Tep: np.ndarray, q: np.ndarray
656
+ ) -> Tuple[float, np.ndarray]:
657
+ r"""
658
+ Performs a single iteration of the Newton-Raphson optimisation method
659
+
660
+ :param ets: The ETS representing the manipulators kinematics
661
+ :param Tep: The desired end-effector pose
662
+ :param q: The current joint coordinate vector
663
+ :raises numpy.LinAlgError: If a step is impossible due to a linear algebra error
664
+ :returns: Tuple of ``(E, q)`` where ``E`` is the new error value and ``q`` is
665
+ the new joint coordinate vector
666
+ :rtype: tuple[float, numpy.ndarray]
667
+
668
+ .. math::
669
+
670
+ \vec{q}_{k+1} = \vec{q}_k + {^0\mat{J}(\vec{q}_k)}^{-1} \vec{e}_k
671
+
672
+ """
673
+
674
+ Te = ets.eval(q)
675
+ e, E = self.error(Te, Tep)
676
+
677
+ J = ets.jacob0(q)
678
+
679
+ # Null-space motion
680
+ qnull = _calc_qnull(
681
+ ets=ets, q=q, J=J, λΣ=self.kq, λm=self.km, ps=self.ps, pi=self.pi
682
+ )
683
+
684
+ if self.pinv:
685
+ q[ets.jindices] += np.linalg.pinv(J) @ e + qnull
686
+ else:
687
+ q[ets.jindices] += np.linalg.inv(J) @ e + qnull
688
+
689
+ return E, q[ets.jindices]
690
+
691
+
692
+ class IK_LM(IKSolver):
693
+ r"""
694
+ Levemberg-Marquadt Numerical Inverse Kinematics Solver
695
+
696
+ A class which provides functionality to perform numerical inverse kinematics (IK)
697
+ using the Levemberg-Marquadt method. See ``step`` method for mathematical description.
698
+
699
+ :param name: The name of the IK algorithm
700
+ :param ilimit: How many iterations are allowed within a search before a new search
701
+ is started
702
+ :param slimit: How many searches are allowed before being deemed unsuccessful
703
+ :param tol: Maximum allowed residual error E, where
704
+ :math:`E = \tfrac{1}{2} \vec{e}^\top \mat{W}_e \vec{e}` is a *quadratic* form
705
+ in the 6-vector angle-axis pose error :math:`\vec{e}` (see :meth:`error`).
706
+ Because `E` is quadratic, `tol` does not bound the linear-scale position/
707
+ orientation error directly — with the default unit weighting, components of
708
+ :math:`\vec{e}` are only guaranteed to be within roughly
709
+ :math:`\sqrt{2 \cdot \text{tol}}` (e.g. `tol=1e-6` guarantees pose error on
710
+ the order of 1e-3, not 1e-6). Pick `tol` accordingly if you need a specific
711
+ linear-scale accuracy
712
+ :param mask: A 6 vector which assigns weights to Cartesian degrees-of-freedom
713
+ error priority
714
+ :param joint_limits: Reject solutions with joint limit violations
715
+ :param seed: A seed for the private RNG used to generate random joint coordinate
716
+ vectors
717
+ :param k: Sets the gain value for the damping matrix Wn in the ``step`` method. See
718
+ notes
719
+ :param method: One of "chan", "sugihara" or "wampler". Defines which method is used
720
+ to calculate the damping matrix Wn in the ``step`` method
721
+ :param kq: The gain for joint limit avoidance. Setting to 0.0 will remove this
722
+ completely from the solution
723
+ :param km: The gain for maximisation. Setting to 0.0 will remove this completely
724
+ from the solution
725
+ :param ps: The minimum angle/distance (in radians or metres) in which the joint is
726
+ allowed to approach to its limit
727
+ :param pi: The influence angle/distance (in radians or metres) in null space motion
728
+ becomes active
729
+
730
+ Example::
731
+
732
+ The following example gets the ``ets`` of a ``panda`` robot object, instantiates
733
+ the IK_LM solver class using default parameters, makes a goal pose ``Tep``,
734
+ and then solves for the joint coordinates which result in the pose ``Tep``
735
+ using the `solve` method.
736
+
737
+ .. runblock:: pycon
738
+ >>> import roboticstoolbox as rtb
739
+ >>> panda = rtb.models.Panda().ets()
740
+ >>> solver = rtb.IK_LM()
741
+ >>> Tep = panda.fkine([0, -0.3, 0, -2.2, 0, 2, 0.7854])
742
+ >>> solver.solve(panda, Tep)
743
+
744
+ .. rubric:: Notes
745
+
746
+ The value for the ``k`` kwarg will depend on the ``method`` chosen and the arm you are
747
+ using. Use the following as a rough guide ``chan, k = 1.0 - 0.01``,
748
+ ``wampler, k = 0.01 - 0.0001``, and ``sugihara, k = 0.1 - 0.0001``
749
+
750
+ When using the this method, the initial joint coordinates :math:`q_0`, should correspond
751
+ to a non-singular manipulator pose, since it uses the manipulator Jacobian.
752
+
753
+ This class supports null-space motion to assist with maximising manipulability and
754
+ avoiding joint limits. These are enabled by setting kq and km to non-zero values.
755
+
756
+ .. rubric:: References
757
+
758
+ - J. Haviland, and P. Corke. "Manipulator Differential Kinematics Part I:
759
+ Kinematics, Velocity, and Applications." arXiv preprint arXiv:2207.01796 (2022).
760
+ - J. Haviland, and P. Corke. "Manipulator Differential Kinematics Part II:
761
+ Acceleration and Advanced Applications." arXiv preprint arXiv:2207.01794 (2022).
762
+
763
+ .. seealso::
764
+
765
+ :class:`IKSolver` An abstract super class for numerical IK solvers
766
+
767
+ :class:`IK_NR` Implements the IKSolver class using the Newton-Raphson method
768
+
769
+ :class:`IK_GN` Implements the IKSolver class using the Gauss-Newton method
770
+
771
+ :class:`IK_QP` Implements the IKSolver class using a quadratic programming approach
772
+
773
+ .. versionchanged:: 1.0.3
774
+ Added the Levemberg-Marquadt IK solver class
775
+
776
+ """
777
+
778
+ def __init__(
779
+ self,
780
+ name: str = "IK Solver",
781
+ ilimit: int = 30,
782
+ slimit: int = 100,
783
+ tol: float = 1e-6,
784
+ mask: ArrayLike | None = None,
785
+ joint_limits: bool = True,
786
+ seed: int | None = None,
787
+ k: float = 1.0,
788
+ method="chan",
789
+ kq: float = 0.0,
790
+ km: float = 0.0,
791
+ ps: float = 0.0,
792
+ pi: np.ndarray | float = 0.3,
793
+ **kwargs,
794
+ ):
795
+ super().__init__(
796
+ name=name,
797
+ ilimit=ilimit,
798
+ slimit=slimit,
799
+ tol=tol,
800
+ mask=mask,
801
+ joint_limits=joint_limits,
802
+ seed=seed,
803
+ **kwargs,
804
+ )
805
+
806
+ if method.lower().startswith("sugi"):
807
+ self.method = 1
808
+ method_name = "Sugihara"
809
+ elif method.lower().startswith("wamp"):
810
+ self.method = 2
811
+ method_name = "Wampler"
812
+ else:
813
+ self.method = 0
814
+ method_name = "Chan"
815
+
816
+ self.k = k
817
+ self.kq = kq
818
+ self.km = km
819
+ self.ps = ps
820
+ self.pi = pi
821
+
822
+ self.name = f"LM ({method_name} λ={k})"
823
+
824
+ if self.kq > 0.0:
825
+ self.name += " Σ"
826
+
827
+ if self.km > 0.0:
828
+ self.name += " Jm"
829
+
830
+ def step(self, ets: "rtb.ETS", Tep: np.ndarray, q: np.ndarray):
831
+ r"""
832
+ Performs a single iteration of the Levenberg-Marquadt optimisation
833
+
834
+ :param ets: The ETS representing the manipulators kinematics
835
+ :param Tep: The desired end-effector pose
836
+ :param q: The current joint coordinate vector
837
+ :raises numpy.LinAlgError: If a step is impossible due to a linear algebra error
838
+ :returns: Tuple of ``(E, q)`` where ``E`` is the new error value and ``q`` is
839
+ the new joint coordinate vector
840
+ :rtype: tuple[float, numpy.ndarray]
841
+
842
+ The operation is defined by the choice of `method` when instantiating the class.
843
+
844
+ The next step is defined as
845
+
846
+ .. math::
847
+ \vec{q}_{k+1}
848
+ &=
849
+ \vec{q}_k +
850
+ \left(
851
+ \mat{A}_k
852
+ \right)^{-1}
853
+ \bf{g}_k \\
854
+ %
855
+ \mat{A}_k
856
+ &=
857
+ {\mat{J}(\vec{q}_k)}^\top
858
+ \mat{W}_e \
859
+ {\mat{J}(\vec{q}_k)}
860
+ +
861
+ \mat{W}_n
862
+
863
+ where :math:`\mat{W}_n = \text{diag}(\vec{w_n})(\vec{w_n} \in \mathbb{R}^n_{>0})` is a
864
+ diagonal damping matrix. The damping matrix ensures that :math:`\mat{A}_k` is
865
+ non-singular and positive definite. The performance of the LM method largely depends
866
+ on the choice of :math:`\mat{W}_n`.
867
+
868
+ **Chan's Method**
869
+
870
+ Chan proposed
871
+
872
+ .. math::
873
+ \mat{W}_n
874
+ =
875
+ λ E_k \mat{1}_n
876
+
877
+ where λ is a constant which reportedly does not have much influence on performance.
878
+ Use the kwarg `k` to adjust the weighting term λ.
879
+
880
+ **Sugihara's Method**
881
+
882
+ Sugihara proposed
883
+
884
+ .. math::
885
+ \mat{W}_n
886
+ =
887
+ E_k \mat{1}_n + \text{diag}(\hat{\vec{w}}_n)
888
+
889
+ where :math:`\hat{\vec{w}}_n \in \mathbb{R}^n`, :math:`\hat{w}_{n_i} = l^2 \sim 0.01 l^2`,
890
+ and :math:`l` is the length of a typical link within the manipulator. We provide the
891
+ variable `k` as a kwarg to adjust the value of :math:`w_n`.
892
+
893
+ **Wampler's Method**
894
+
895
+ Wampler proposed :math:`\vec{w_n}` to be a constant. This is set through the `k` kwarg.
896
+ """
897
+
898
+ Te = ets.eval(q)
899
+ e, E = self.error(Te, Tep)
900
+
901
+ if self.method == 1:
902
+ # Sugihara's method
903
+ Wn = E * np.eye(ets.n) + self.k * np.eye(ets.n)
904
+ elif self.method == 2:
905
+ # Wampler's method
906
+ Wn = self.k * np.eye(ets.n)
907
+ else:
908
+ # Chan's method
909
+ Wn = self.k * E * np.eye(ets.n)
910
+
911
+ J = ets.jacob0(q)
912
+ g = J.T @ self.We @ e
913
+
914
+ # Null-space motion
915
+ qnull = _calc_qnull(
916
+ ets=ets, q=q, J=J, λΣ=self.kq, λm=self.km, ps=self.ps, pi=self.pi
917
+ )
918
+
919
+ q[ets.jindices] += np.linalg.inv(J.T @ self.We @ J + Wn) @ g + qnull
920
+
921
+ return E, q[ets.jindices]
922
+
923
+
924
+ class IK_GN(IKSolver):
925
+ r"""
926
+ Gauss-Newton Numerical Inverse Kinematics Solver
927
+
928
+ A class which provides functionality to perform numerical inverse kinematics (IK)
929
+ using the Gauss-Newton method. See `step` method for mathematical description.
930
+
931
+ .. note::
932
+
933
+ When using this class with redundant robots (>6 DoF), ``pinv`` must be set to ``True``
934
+
935
+ :param name: The name of the IK algorithm
936
+ :param ilimit: How many iterations are allowed within a search before a new search
937
+ is started
938
+ :param slimit: How many searches are allowed before being deemed unsuccessful
939
+ :param tol: Maximum allowed residual error E, where
940
+ :math:`E = \tfrac{1}{2} \vec{e}^\top \mat{W}_e \vec{e}` is a *quadratic* form
941
+ in the 6-vector angle-axis pose error :math:`\vec{e}` (see :meth:`error`).
942
+ Because `E` is quadratic, `tol` does not bound the linear-scale position/
943
+ orientation error directly — with the default unit weighting, components of
944
+ :math:`\vec{e}` are only guaranteed to be within roughly
945
+ :math:`\sqrt{2 \cdot \text{tol}}` (e.g. `tol=1e-6` guarantees pose error on
946
+ the order of 1e-3, not 1e-6). Pick `tol` accordingly if you need a specific
947
+ linear-scale accuracy
948
+ :param mask: A 6 vector which assigns weights to Cartesian degrees-of-freedom
949
+ error priority
950
+ :param joint_limits: Reject solutions with joint limit violations
951
+ :param seed: A seed for the private RNG used to generate random joint coordinate
952
+ vectors
953
+ :param pinv: If True, will use the pseudoinverse in the `step` method instead of
954
+ the normal inverse
955
+ :param kq: The gain for joint limit avoidance. Setting to 0.0 will remove this
956
+ completely from the solution
957
+ :param km: The gain for maximisation. Setting to 0.0 will remove this completely
958
+ from the solution
959
+ :param ps: The minimum angle/distance (in radians or metres) in which the joint is
960
+ allowed to approach to its limit
961
+ :param pi: The influence angle/distance (in radians or metres) in null space motion
962
+ becomes active
963
+
964
+ Example::
965
+
966
+ The following example gets the ``ets`` of a ``panda`` robot object, instantiates
967
+ the `IK_GN` solver class using default parameters, makes a goal pose ``Tep``,
968
+ and then solves for the joint coordinates which result in the pose ``Tep``
969
+ using the `solve` method.
970
+
971
+ .. runblock:: pycon
972
+ >>> import roboticstoolbox as rtb
973
+ >>> panda = rtb.models.Panda().ets()
974
+ >>> solver = rtb.IK_GN(pinv=True)
975
+ >>> Tep = panda.fkine([0, -0.3, 0, -2.2, 0, 2, 0.7854])
976
+ >>> solver.solve(panda, Tep)
977
+
978
+ .. rubric:: Notes
979
+
980
+ When using the this method, the initial joint coordinates :math:`q_0`, should correspond
981
+ to a non-singular manipulator pose, since it uses the manipulator Jacobian. When the
982
+ the problem is solvable, it converges very quickly.
983
+
984
+ This class supports null-space motion to assist with maximising manipulability and
985
+ avoiding joint limits. These are enabled by setting kq and km to non-zero values.
986
+
987
+ .. rubric:: References
988
+
989
+ - J. Haviland, and P. Corke. "Manipulator Differential Kinematics Part I:
990
+ Kinematics, Velocity, and Applications." arXiv preprint arXiv:2207.01796 (2022).
991
+ - J. Haviland, and P. Corke. "Manipulator Differential Kinematics Part II:
992
+ Acceleration and Advanced Applications." arXiv preprint arXiv:2207.01794 (2022).
993
+
994
+ .. seealso::
995
+
996
+ :class:`IKSolver` An abstract super class for numerical IK solvers
997
+
998
+ :class:`IK_NR` Implements IKSolver using the Newton-Raphson method
999
+
1000
+ :class:`IK_LM` Implements IKSolver using the Levemberg-Marquadt method
1001
+
1002
+ :class:`IK_QP` Implements IKSolver using a quadratic programming approach
1003
+
1004
+ .. versionchanged:: 1.0.3
1005
+ Added the Gauss-Newton IK solver class
1006
+
1007
+ """
1008
+
1009
+ def __init__(
1010
+ self,
1011
+ name: str = "IK Solver",
1012
+ ilimit: int = 30,
1013
+ slimit: int = 100,
1014
+ tol: float = 1e-6,
1015
+ mask: ArrayLike | None = None,
1016
+ joint_limits: bool = True,
1017
+ seed: int | None = None,
1018
+ pinv: bool = False,
1019
+ kq: float = 0.0,
1020
+ km: float = 0.0,
1021
+ ps: float = 0.0,
1022
+ pi: np.ndarray | float = 0.3,
1023
+ **kwargs,
1024
+ ):
1025
+ super().__init__(
1026
+ name=name,
1027
+ ilimit=ilimit,
1028
+ slimit=slimit,
1029
+ tol=tol,
1030
+ mask=mask,
1031
+ joint_limits=joint_limits,
1032
+ seed=seed,
1033
+ **kwargs,
1034
+ )
1035
+
1036
+ self.pinv = pinv
1037
+ self.kq = kq
1038
+ self.km = km
1039
+ self.ps = ps
1040
+ self.pi = pi
1041
+
1042
+ self.name = f"GN (pinv={pinv})"
1043
+
1044
+ if self.kq > 0.0:
1045
+ self.name += " Σ"
1046
+
1047
+ if self.km > 0.0:
1048
+ self.name += " Jm"
1049
+
1050
+ def step(
1051
+ self, ets: "rtb.ETS", Tep: np.ndarray, q: np.ndarray
1052
+ ) -> Tuple[float, np.ndarray]:
1053
+ r"""
1054
+ Performs a single iteration of the Gauss-Newton optimisation method
1055
+
1056
+ :param ets: The ETS representing the manipulators kinematics
1057
+ :param Tep: The desired end-effector pose
1058
+ :param q: The current joint coordinate vector
1059
+ :raises numpy.LinAlgError: If a step is impossible due to a linear algebra error
1060
+ :returns: Tuple of ``(E, q)`` where ``E`` is the new error value and ``q`` is
1061
+ the new joint coordinate vector
1062
+ :rtype: tuple[float, numpy.ndarray]
1063
+
1064
+ The next step is defined as
1065
+
1066
+ .. math::
1067
+
1068
+ \vec{q}_{k+1} &= \vec{q}_k +
1069
+ \left(
1070
+ {\mat{J}(\vec{q}_k)}^\top
1071
+ \mat{W}_e \
1072
+ {\mat{J}(\vec{q}_k)}
1073
+ \right)^{-1}
1074
+ \bf{g}_k \\
1075
+ \bf{g}_k &=
1076
+ {\mat{J}(\vec{q}_k)}^\top
1077
+ \mat{W}_e
1078
+ \vec{e}_k
1079
+
1080
+ where :math:`\mat{J} = {^0\mat{J}}` is the base-frame manipulator Jacobian. If
1081
+ :math:`\mat{J}(\vec{q}_k)` is non-singular, and :math:`\mat{W}_e = \mat{1}_n`, then
1082
+ the above provides the pseudoinverse solution. However, if :math:`\mat{J}(\vec{q}_k)`
1083
+ is singular, the above can not be computed and the GN solution is infeasible.
1084
+ """
1085
+
1086
+ Te = ets.eval(q)
1087
+ e, E = self.error(Te, Tep)
1088
+
1089
+ J = ets.jacob0(q)
1090
+
1091
+ # Null-space motion
1092
+ qnull = _calc_qnull(
1093
+ ets=ets, q=q, J=J, λΣ=self.kq, λm=self.km, ps=self.ps, pi=self.pi
1094
+ )
1095
+
1096
+ if self.pinv:
1097
+ q[ets.jindices] += np.linalg.pinv(J) @ e + qnull
1098
+ else:
1099
+ q[ets.jindices] += np.linalg.inv(J) @ e + qnull
1100
+
1101
+ return E, q[ets.jindices]
1102
+
1103
+
1104
+ class IK_QP(IKSolver):
1105
+ r"""
1106
+ Quadratic Progamming Numerical Inverse Kinematics Solver
1107
+
1108
+ A class which provides functionality to perform numerical inverse kinematics (IK)
1109
+ using a quadratic progamming approach. See `step` method for mathematical
1110
+ description.
1111
+
1112
+ :param name: The name of the IK algorithm
1113
+ :param ilimit: How many iterations are allowed within a search before a new search
1114
+ is started
1115
+ :param slimit: How many searches are allowed before being deemed unsuccessful
1116
+ :param tol: Maximum allowed residual error E, where
1117
+ :math:`E = \tfrac{1}{2} \vec{e}^\top \mat{W}_e \vec{e}` is a *quadratic* form
1118
+ in the 6-vector angle-axis pose error :math:`\vec{e}` (see :meth:`error`).
1119
+ Because `E` is quadratic, `tol` does not bound the linear-scale position/
1120
+ orientation error directly — with the default unit weighting, components of
1121
+ :math:`\vec{e}` are only guaranteed to be within roughly
1122
+ :math:`\sqrt{2 \cdot \text{tol}}` (e.g. `tol=1e-6` guarantees pose error on
1123
+ the order of 1e-3, not 1e-6). Pick `tol` accordingly if you need a specific
1124
+ linear-scale accuracy
1125
+ :param mask: A 6 vector which assigns weights to Cartesian degrees-of-freedom
1126
+ error priority
1127
+ :param joint_limits: Reject solutions with joint limit violations
1128
+ :param seed: A seed for the private RNG used to generate random joint coordinate
1129
+ vectors
1130
+ :param kj: A gain for joint velocity norm minimisation
1131
+ :param ks: A gain which adjusts the cost of slack (intentional error)
1132
+ :param kq: The gain for joint limit avoidance. Setting to 0.0 will remove this
1133
+ completely from the solution
1134
+ :param km: The gain for maximisation. Setting to 0.0 will remove this completely
1135
+ from the solution
1136
+ :param ps: The minimum angle/distance (in radians or metres) in which the joint is
1137
+ allowed to approach to its limit
1138
+ :param pi: The influence angle/distance (in radians or metres) in null space motion
1139
+ becomes active
1140
+ :raises ImportError: If the package ``qpsolvers`` is not installed
1141
+
1142
+ Example::
1143
+
1144
+ The following example gets the ``ets`` of a ``panda`` robot object, instantiates
1145
+ the `IK_QP` solver class using default parameters, makes a goal pose ``Tep``,
1146
+ and then solves for the joint coordinates which result in the pose ``Tep``
1147
+ using the `solve` method.
1148
+
1149
+ .. runblock:: pycon
1150
+ >>> import roboticstoolbox as rtb
1151
+ >>> panda = rtb.models.Panda().ets()
1152
+ >>> solver = rtb.IK_QP()
1153
+ >>> Tep = panda.fkine([0, -0.3, 0, -2.2, 0, 2, 0.7854])
1154
+ >>> solver.solve(panda, Tep)
1155
+
1156
+ .. rubric:: Notes
1157
+
1158
+ When using the this method, the initial joint coordinates :math:`q_0`, should correspond
1159
+ to a non-singular manipulator pose, since it uses the manipulator Jacobian. When the
1160
+ the problem is solvable, it converges very quickly.
1161
+
1162
+ .. rubric:: References
1163
+
1164
+ - J. Haviland, and P. Corke. "Manipulator Differential Kinematics Part II:
1165
+ Acceleration and Advanced Applications." arXiv preprint arXiv:2207.01794 (2022).
1166
+
1167
+ .. seealso::
1168
+
1169
+ :class:`IKSolver` An abstract super class for numerical IK solvers
1170
+
1171
+ :class:`IK_NR` Implements IKSolver class using the Newton-Raphson method
1172
+
1173
+ :class:`IK_GN` Implements IKSolver class using the Gauss-Newton method
1174
+
1175
+ :class:`IK_LM` Implements IKSolver class using the Levemberg-Marquadt method
1176
+
1177
+ .. versionchanged:: 1.0.3
1178
+ Added the Quadratic Programming IK solver class
1179
+
1180
+ """
1181
+
1182
+ def __init__(
1183
+ self,
1184
+ name: str = "IK Solver",
1185
+ ilimit: int = 30,
1186
+ slimit: int = 100,
1187
+ tol: float = 1e-6,
1188
+ mask: ArrayLike | None = None,
1189
+ joint_limits: bool = True,
1190
+ seed: int | None = None,
1191
+ kj=0.01,
1192
+ ks=1.0,
1193
+ kq: float = 0.0,
1194
+ km: float = 0.0,
1195
+ ps: float = 0.0,
1196
+ pi: np.ndarray | float = 0.3,
1197
+ **kwargs,
1198
+ ):
1199
+ if not _qp: # pragma: nocover
1200
+ raise ImportError(
1201
+ "the package qpsolvers is required for this class. \nInstall using 'pip"
1202
+ " install qpsolvers'"
1203
+ )
1204
+
1205
+ super().__init__(
1206
+ name=name,
1207
+ ilimit=ilimit,
1208
+ slimit=slimit,
1209
+ tol=tol,
1210
+ mask=mask,
1211
+ joint_limits=joint_limits,
1212
+ seed=seed,
1213
+ **kwargs,
1214
+ )
1215
+
1216
+ self.kj = kj
1217
+ self.ks = ks
1218
+ self.kq = kq
1219
+ self.km = km
1220
+ self.ps = ps
1221
+ self.pi = pi
1222
+
1223
+ self.name = "QP)"
1224
+
1225
+ if self.kq > 0.0:
1226
+ self.name += " Σ"
1227
+
1228
+ if self.km > 0.0:
1229
+ self.name += " Jm"
1230
+
1231
+ def step(
1232
+ self, ets: "rtb.ETS", Tep: np.ndarray, q: np.ndarray
1233
+ ) -> Tuple[float, np.ndarray]:
1234
+ r"""
1235
+ Performs a single iteration of the QP optimisation method
1236
+
1237
+ :param ets: The ETS representing the manipulators kinematics
1238
+ :param Tep: The desired end-effector pose
1239
+ :param q: The current joint coordinate vector
1240
+ :raises numpy.LinAlgError: If a step is impossible due to a linear algebra error
1241
+ :returns: Tuple of ``(E, q)`` where ``E`` is the new error value and ``q`` is
1242
+ the new joint coordinate vector
1243
+ :rtype: tuple[float, numpy.ndarray]
1244
+
1245
+ The next step is defined as
1246
+
1247
+ .. math::
1248
+
1249
+ \vec{q}_{k+1} = \vec{q}_{k} + \dot{\vec{q}}.
1250
+
1251
+ where the QP is defined as
1252
+
1253
+ .. math::
1254
+
1255
+ \min_x \quad f_o(\vec{x}) &= \frac{1}{2} \vec{x}^\top \mathcal{Q} \vec{x}+ \mathcal{C}^\top \vec{x}, \\
1256
+ \text{subject to} \quad \mathcal{J} \vec{x} &= \vec{\nu}, \\
1257
+ \mathcal{A} \vec{x} &\leq \mathcal{B}, \\
1258
+ \vec{x}^- &\leq \vec{x} \leq \vec{x}^+
1259
+
1260
+ with
1261
+
1262
+ .. math::
1263
+
1264
+ \vec{x} &=
1265
+ \begin{pmatrix}
1266
+ \dvec{q} \\ \vec{\delta}
1267
+ \end{pmatrix} \in \mathbb{R}^{(n+6)} \\
1268
+ \mathcal{Q} &=
1269
+ \begin{pmatrix}
1270
+ \lambda_q \mat{1}_{n} & \mathbf{0}_{6 \times 6} \\ \mathbf{0}_{n \times n} & \lambda_\delta \mat{1}_{6}
1271
+ \end{pmatrix} \in \mathbb{R}^{(n+6) \times (n+6)} \\
1272
+ \mathcal{J} &=
1273
+ \begin{pmatrix}
1274
+ \mat{J}(\vec{q}) & \mat{1}_{6}
1275
+ \end{pmatrix} \in \mathbb{R}^{6 \times (n+6)} \\
1276
+ \mathcal{C} &=
1277
+ \begin{pmatrix}
1278
+ \mat{J}_m \\ \bf{0}_{6 \times 1}
1279
+ \end{pmatrix} \in \mathbb{R}^{(n + 6)} \\
1280
+ \mathcal{A} &=
1281
+ \begin{pmatrix}
1282
+ \mat{1}_{n \times n + 6} \\
1283
+ \end{pmatrix} \in \mathbb{R}^{(l + n) \times (n + 6)} \\
1284
+ \mathcal{B} &=
1285
+ \eta
1286
+ \begin{pmatrix}
1287
+ \frac{\rho_0 - \rho_s}
1288
+ {\rho_i - \rho_s} \\
1289
+ \vdots \\
1290
+ \frac{\rho_n - \rho_s}
1291
+ {\rho_i - \rho_s}
1292
+ \end{pmatrix} \in \mathbb{R}^{n} \\
1293
+ \vec{x}^{-, +} &=
1294
+ \begin{pmatrix}
1295
+ \dvec{q}^{-, +} \\
1296
+ \vec{\delta}^{-, +}
1297
+ \end{pmatrix} \in \mathbb{R}^{(n+6)},
1298
+
1299
+ where :math:`\vec{\delta} \in \mathbb{R}^6` is the slack vector,
1300
+ :math:`\lambda_\delta \in \mathbb{R}^+` is a gain term which adjusts the
1301
+ cost of the norm of the slack vector in the optimiser,
1302
+ :math:`\dvec{q}^{-,+}` are the minimum and maximum joint velocities, and
1303
+ :math:`\dvec{\delta}^{-,+}` are the minimum and maximum slack velocities.
1304
+
1305
+ """
1306
+
1307
+ Te = ets.eval(q)
1308
+ e, E = self.error(Te, Tep)
1309
+ J = ets.jacob0(q)
1310
+
1311
+ if isinstance(self.pi, float) or isinstance(self.pi, int):
1312
+ self.pi = self.pi * np.ones(ets.n)
1313
+
1314
+ # Quadratic component of objective function
1315
+ Q = np.eye(ets.n + 6)
1316
+
1317
+ # Joint velocity component of Q
1318
+ Q[: ets.n, : ets.n] *= self.kj
1319
+
1320
+ # Slack component of Q
1321
+ Q[ets.n :, ets.n :] = self.ks * (1 / np.sum(np.abs(e))) * np.eye(6)
1322
+
1323
+ # The equality contraints
1324
+ Aeq = np.concatenate((J, np.eye(6)), axis=1)
1325
+ beq = e.reshape((6,))
1326
+
1327
+ # The inequality constraints for joint limit avoidance
1328
+ if self.kq > 0.0:
1329
+ Ain = np.zeros((ets.n + 6, ets.n + 6))
1330
+ bin = np.zeros(ets.n + 6)
1331
+
1332
+ # Form the joint limit velocity damper
1333
+ Ain_l = np.zeros((ets.n, ets.n))
1334
+ Bin_l = np.zeros(ets.n)
1335
+
1336
+ for i in range(ets.n):
1337
+ ql0 = ets.qlim[0, i]
1338
+ ql1 = ets.qlim[1, i]
1339
+
1340
+ if ql1 - q[i] <= self.pi[i]:
1341
+ Bin_l[i] = ((ql1 - q[i]) - self.ps) / (self.pi[i] - self.ps)
1342
+ Ain_l[i, i] = 1
1343
+
1344
+ if q[i] - ql0 <= self.pi[i]:
1345
+ Bin_l[i] = -(((ql0 - q[i]) + self.ps) / (self.pi[i] - self.ps))
1346
+ Ain_l[i, i] = -1
1347
+
1348
+ Ain[: ets.n, : ets.n] = Ain_l
1349
+ bin[: ets.n] = (1.0 / self.kq) * Bin_l
1350
+ else:
1351
+ Ain = None
1352
+ bin = None
1353
+
1354
+ # Manipulability maximisation
1355
+ if self.km > 0.0:
1356
+ Jm = ets.jacobm(q).reshape((ets.n,))
1357
+ c = np.concatenate(((1.0 / self.km) * -Jm, np.zeros(6)))
1358
+ else:
1359
+ c = np.zeros(ets.n + 6)
1360
+
1361
+ xd = qp.solve_qp(Q, c, Ain, bin, Aeq, beq, lb=None, ub=None, solver="quadprog")
1362
+
1363
+ if xd is None: # pragma: nocover
1364
+ raise np.linalg.LinAlgError("QP Unsolvable")
1365
+
1366
+ q += xd[: ets.n]
1367
+
1368
+ return E, q
1369
+
1370
+
1371
+ if __name__ == "__main__": # pragma nocover
1372
+ sol = IKSolution(
1373
+ np.array([1, 2, 3]), success=True, iterations=10, searches=100, residual=0.1
1374
+ )
1375
+
1376
+ a, b, c, d, e = sol
1377
+
1378
+ print(a, b, c, d, e)