roboticstoolbox-python 1.3.0__cp312-cp312-win_amd64.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 (673) hide show
  1. roboticstoolbox/__init__.py +104 -0
  2. roboticstoolbox/backends/Connector.py +107 -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 +253 -0
  21. roboticstoolbox/backends/PyPlot/PyPlot.py +769 -0
  22. roboticstoolbox/backends/PyPlot/PyPlot2.py +526 -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 +26 -0
  31. roboticstoolbox/bin/__init__.py +0 -0
  32. roboticstoolbox/bin/rtbtool.py +307 -0
  33. roboticstoolbox/blocks/Icons/250x250/armplot.png +0 -0
  34. roboticstoolbox/blocks/Icons/250x250/bicycle.png +0 -0
  35. roboticstoolbox/blocks/Icons/250x250/camera.png +0 -0
  36. roboticstoolbox/blocks/Icons/250x250/circlepath.png +0 -0
  37. roboticstoolbox/blocks/Icons/250x250/coriolis.png +0 -0
  38. roboticstoolbox/blocks/Icons/250x250/ctraj.png +0 -0
  39. roboticstoolbox/blocks/Icons/250x250/delta2tr.png +0 -0
  40. roboticstoolbox/blocks/Icons/250x250/diffsteer.png +0 -0
  41. roboticstoolbox/blocks/Icons/250x250/fdyn.png +0 -0
  42. roboticstoolbox/blocks/Icons/250x250/fdynx.png +0 -0
  43. roboticstoolbox/blocks/Icons/250x250/fkine.png +0 -0
  44. roboticstoolbox/blocks/Icons/250x250/gravload.png +0 -0
  45. roboticstoolbox/blocks/Icons/250x250/idyn.png +0 -0
  46. roboticstoolbox/blocks/Icons/250x250/idynx.png +0 -0
  47. roboticstoolbox/blocks/Icons/250x250/ikine.png +0 -0
  48. roboticstoolbox/blocks/Icons/250x250/inertia.png +0 -0
  49. roboticstoolbox/blocks/Icons/250x250/jacobian.png +0 -0
  50. roboticstoolbox/blocks/Icons/250x250/jtraj.png +0 -0
  51. roboticstoolbox/blocks/Icons/250x250/lspb.png +0 -0
  52. roboticstoolbox/blocks/Icons/250x250/multirotor.png +0 -0
  53. roboticstoolbox/blocks/Icons/250x250/multirotormixer.png +0 -0
  54. roboticstoolbox/blocks/Icons/250x250/multirotorplot.png +0 -0
  55. roboticstoolbox/blocks/Icons/250x250/point2tr.png +0 -0
  56. roboticstoolbox/blocks/Icons/250x250/tr2delta.png +0 -0
  57. roboticstoolbox/blocks/Icons/250x250/tr2t.png +0 -0
  58. roboticstoolbox/blocks/Icons/250x250/unicycle.png +0 -0
  59. roboticstoolbox/blocks/Icons/250x250/vehicleplot.png +0 -0
  60. roboticstoolbox/blocks/Icons/50x50/armplot.png +0 -0
  61. roboticstoolbox/blocks/Icons/50x50/bicycle.png +0 -0
  62. roboticstoolbox/blocks/Icons/50x50/camera.png +0 -0
  63. roboticstoolbox/blocks/Icons/50x50/circlepath.png +0 -0
  64. roboticstoolbox/blocks/Icons/50x50/coriolis.png +0 -0
  65. roboticstoolbox/blocks/Icons/50x50/delta2tr.png +0 -0
  66. roboticstoolbox/blocks/Icons/50x50/diffsteer.png +0 -0
  67. roboticstoolbox/blocks/Icons/50x50/fdyn.png +0 -0
  68. roboticstoolbox/blocks/Icons/50x50/fdynx.png +0 -0
  69. roboticstoolbox/blocks/Icons/50x50/fkine.png +0 -0
  70. roboticstoolbox/blocks/Icons/50x50/gravload.png +0 -0
  71. roboticstoolbox/blocks/Icons/50x50/idyn.png +0 -0
  72. roboticstoolbox/blocks/Icons/50x50/idynx.png +0 -0
  73. roboticstoolbox/blocks/Icons/50x50/ikine.png +0 -0
  74. roboticstoolbox/blocks/Icons/50x50/inertia.png +0 -0
  75. roboticstoolbox/blocks/Icons/50x50/jacobian.png +0 -0
  76. roboticstoolbox/blocks/Icons/50x50/jtraj.png +0 -0
  77. roboticstoolbox/blocks/Icons/50x50/lspb.png +0 -0
  78. roboticstoolbox/blocks/Icons/50x50/multirotor.png +0 -0
  79. roboticstoolbox/blocks/Icons/50x50/multirotormixer.png +0 -0
  80. roboticstoolbox/blocks/Icons/50x50/multirotorplot.png +0 -0
  81. roboticstoolbox/blocks/Icons/50x50/point2tr.png +0 -0
  82. roboticstoolbox/blocks/Icons/50x50/tr2delta.png +0 -0
  83. roboticstoolbox/blocks/Icons/50x50/tr2t.png +0 -0
  84. roboticstoolbox/blocks/Icons/50x50/unicycle.png +0 -0
  85. roboticstoolbox/blocks/Icons/50x50/vehicleplot.png +0 -0
  86. roboticstoolbox/blocks/Icons/armplot.png +0 -0
  87. roboticstoolbox/blocks/Icons/bicycle.png +0 -0
  88. roboticstoolbox/blocks/Icons/camera.png +0 -0
  89. roboticstoolbox/blocks/Icons/circlepath.png +0 -0
  90. roboticstoolbox/blocks/Icons/coriolis.png +0 -0
  91. roboticstoolbox/blocks/Icons/ctraj.png +0 -0
  92. roboticstoolbox/blocks/Icons/delta2tr.png +0 -0
  93. roboticstoolbox/blocks/Icons/diffsteer.png +0 -0
  94. roboticstoolbox/blocks/Icons/fdyn.png +0 -0
  95. roboticstoolbox/blocks/Icons/fdynx.png +0 -0
  96. roboticstoolbox/blocks/Icons/fkine.png +0 -0
  97. roboticstoolbox/blocks/Icons/gravload.png +0 -0
  98. roboticstoolbox/blocks/Icons/idyn.png +0 -0
  99. roboticstoolbox/blocks/Icons/idynx.png +0 -0
  100. roboticstoolbox/blocks/Icons/ikine.png +0 -0
  101. roboticstoolbox/blocks/Icons/inertia.png +0 -0
  102. roboticstoolbox/blocks/Icons/jacobian.png +0 -0
  103. roboticstoolbox/blocks/Icons/jtraj.png +0 -0
  104. roboticstoolbox/blocks/Icons/lspb.png +0 -0
  105. roboticstoolbox/blocks/Icons/multirotor.png +0 -0
  106. roboticstoolbox/blocks/Icons/multirotormixer.png +0 -0
  107. roboticstoolbox/blocks/Icons/multirotorplot.png +0 -0
  108. roboticstoolbox/blocks/Icons/point2tr.png +0 -0
  109. roboticstoolbox/blocks/Icons/tr2delta.png +0 -0
  110. roboticstoolbox/blocks/Icons/tr2t.png +0 -0
  111. roboticstoolbox/blocks/Icons/unicycle.png +0 -0
  112. roboticstoolbox/blocks/Icons/vehicleplot.png +0 -0
  113. roboticstoolbox/blocks/README.md +43 -0
  114. roboticstoolbox/blocks/__init__.py +6 -0
  115. roboticstoolbox/blocks/arm.py +1587 -0
  116. roboticstoolbox/blocks/mobile.py +500 -0
  117. roboticstoolbox/blocks/quad_model.py +132 -0
  118. roboticstoolbox/blocks/spatial.py +245 -0
  119. roboticstoolbox/blocks/uav.py +949 -0
  120. roboticstoolbox/core/Eigen/Cholesky +45 -0
  121. roboticstoolbox/core/Eigen/CholmodSupport +48 -0
  122. roboticstoolbox/core/Eigen/Core +384 -0
  123. roboticstoolbox/core/Eigen/Dense +7 -0
  124. roboticstoolbox/core/Eigen/Eigen +2 -0
  125. roboticstoolbox/core/Eigen/Eigenvalues +60 -0
  126. roboticstoolbox/core/Eigen/Geometry +59 -0
  127. roboticstoolbox/core/Eigen/Householder +29 -0
  128. roboticstoolbox/core/Eigen/IterativeLinearSolvers +48 -0
  129. roboticstoolbox/core/Eigen/Jacobi +32 -0
  130. roboticstoolbox/core/Eigen/KLUSupport +41 -0
  131. roboticstoolbox/core/Eigen/LU +47 -0
  132. roboticstoolbox/core/Eigen/MetisSupport +35 -0
  133. roboticstoolbox/core/Eigen/OrderingMethods +70 -0
  134. roboticstoolbox/core/Eigen/PaStiXSupport +49 -0
  135. roboticstoolbox/core/Eigen/PardisoSupport +35 -0
  136. roboticstoolbox/core/Eigen/QR +50 -0
  137. roboticstoolbox/core/Eigen/QtAlignedMalloc +39 -0
  138. roboticstoolbox/core/Eigen/SPQRSupport +34 -0
  139. roboticstoolbox/core/Eigen/SVD +50 -0
  140. roboticstoolbox/core/Eigen/Sparse +34 -0
  141. roboticstoolbox/core/Eigen/SparseCholesky +37 -0
  142. roboticstoolbox/core/Eigen/SparseCore +69 -0
  143. roboticstoolbox/core/Eigen/SparseLU +50 -0
  144. roboticstoolbox/core/Eigen/SparseQR +36 -0
  145. roboticstoolbox/core/Eigen/StdDeque +27 -0
  146. roboticstoolbox/core/Eigen/StdList +26 -0
  147. roboticstoolbox/core/Eigen/StdVector +27 -0
  148. roboticstoolbox/core/Eigen/SuperLUSupport +64 -0
  149. roboticstoolbox/core/Eigen/UmfPackSupport +40 -0
  150. roboticstoolbox/core/Eigen/src/Cholesky/LDLT.h +688 -0
  151. roboticstoolbox/core/Eigen/src/Cholesky/LLT.h +558 -0
  152. roboticstoolbox/core/Eigen/src/Cholesky/LLT_LAPACKE.h +99 -0
  153. roboticstoolbox/core/Eigen/src/CholmodSupport/CholmodSupport.h +682 -0
  154. roboticstoolbox/core/Eigen/src/Core/ArithmeticSequence.h +413 -0
  155. roboticstoolbox/core/Eigen/src/Core/Array.h +417 -0
  156. roboticstoolbox/core/Eigen/src/Core/ArrayBase.h +226 -0
  157. roboticstoolbox/core/Eigen/src/Core/ArrayWrapper.h +209 -0
  158. roboticstoolbox/core/Eigen/src/Core/Assign.h +90 -0
  159. roboticstoolbox/core/Eigen/src/Core/AssignEvaluator.h +1010 -0
  160. roboticstoolbox/core/Eigen/src/Core/Assign_MKL.h +178 -0
  161. roboticstoolbox/core/Eigen/src/Core/BandMatrix.h +353 -0
  162. roboticstoolbox/core/Eigen/src/Core/Block.h +448 -0
  163. roboticstoolbox/core/Eigen/src/Core/BooleanRedux.h +162 -0
  164. roboticstoolbox/core/Eigen/src/Core/CommaInitializer.h +164 -0
  165. roboticstoolbox/core/Eigen/src/Core/ConditionEstimator.h +175 -0
  166. roboticstoolbox/core/Eigen/src/Core/CoreEvaluators.h +1741 -0
  167. roboticstoolbox/core/Eigen/src/Core/CoreIterators.h +132 -0
  168. roboticstoolbox/core/Eigen/src/Core/CwiseBinaryOp.h +183 -0
  169. roboticstoolbox/core/Eigen/src/Core/CwiseNullaryOp.h +1001 -0
  170. roboticstoolbox/core/Eigen/src/Core/CwiseTernaryOp.h +197 -0
  171. roboticstoolbox/core/Eigen/src/Core/CwiseUnaryOp.h +103 -0
  172. roboticstoolbox/core/Eigen/src/Core/CwiseUnaryView.h +132 -0
  173. roboticstoolbox/core/Eigen/src/Core/DenseBase.h +701 -0
  174. roboticstoolbox/core/Eigen/src/Core/DenseCoeffsBase.h +685 -0
  175. roboticstoolbox/core/Eigen/src/Core/DenseStorage.h +652 -0
  176. roboticstoolbox/core/Eigen/src/Core/Diagonal.h +258 -0
  177. roboticstoolbox/core/Eigen/src/Core/DiagonalMatrix.h +391 -0
  178. roboticstoolbox/core/Eigen/src/Core/DiagonalProduct.h +28 -0
  179. roboticstoolbox/core/Eigen/src/Core/Dot.h +318 -0
  180. roboticstoolbox/core/Eigen/src/Core/EigenBase.h +160 -0
  181. roboticstoolbox/core/Eigen/src/Core/ForceAlignedAccess.h +150 -0
  182. roboticstoolbox/core/Eigen/src/Core/Fuzzy.h +155 -0
  183. roboticstoolbox/core/Eigen/src/Core/GeneralProduct.h +465 -0
  184. roboticstoolbox/core/Eigen/src/Core/GenericPacketMath.h +1040 -0
  185. roboticstoolbox/core/Eigen/src/Core/GlobalFunctions.h +194 -0
  186. roboticstoolbox/core/Eigen/src/Core/IO.h +258 -0
  187. roboticstoolbox/core/Eigen/src/Core/IndexedView.h +237 -0
  188. roboticstoolbox/core/Eigen/src/Core/Inverse.h +117 -0
  189. roboticstoolbox/core/Eigen/src/Core/Map.h +171 -0
  190. roboticstoolbox/core/Eigen/src/Core/MapBase.h +310 -0
  191. roboticstoolbox/core/Eigen/src/Core/MathFunctions.h +2057 -0
  192. roboticstoolbox/core/Eigen/src/Core/MathFunctionsImpl.h +200 -0
  193. roboticstoolbox/core/Eigen/src/Core/Matrix.h +565 -0
  194. roboticstoolbox/core/Eigen/src/Core/MatrixBase.h +547 -0
  195. roboticstoolbox/core/Eigen/src/Core/NestByValue.h +85 -0
  196. roboticstoolbox/core/Eigen/src/Core/NoAlias.h +109 -0
  197. roboticstoolbox/core/Eigen/src/Core/NumTraits.h +335 -0
  198. roboticstoolbox/core/Eigen/src/Core/PartialReduxEvaluator.h +232 -0
  199. roboticstoolbox/core/Eigen/src/Core/PermutationMatrix.h +605 -0
  200. roboticstoolbox/core/Eigen/src/Core/PlainObjectBase.h +1128 -0
  201. roboticstoolbox/core/Eigen/src/Core/Product.h +191 -0
  202. roboticstoolbox/core/Eigen/src/Core/ProductEvaluators.h +1179 -0
  203. roboticstoolbox/core/Eigen/src/Core/Random.h +218 -0
  204. roboticstoolbox/core/Eigen/src/Core/Redux.h +515 -0
  205. roboticstoolbox/core/Eigen/src/Core/Ref.h +381 -0
  206. roboticstoolbox/core/Eigen/src/Core/Replicate.h +142 -0
  207. roboticstoolbox/core/Eigen/src/Core/Reshaped.h +454 -0
  208. roboticstoolbox/core/Eigen/src/Core/ReturnByValue.h +119 -0
  209. roboticstoolbox/core/Eigen/src/Core/Reverse.h +217 -0
  210. roboticstoolbox/core/Eigen/src/Core/Select.h +164 -0
  211. roboticstoolbox/core/Eigen/src/Core/SelfAdjointView.h +365 -0
  212. roboticstoolbox/core/Eigen/src/Core/SelfCwiseBinaryOp.h +47 -0
  213. roboticstoolbox/core/Eigen/src/Core/Solve.h +188 -0
  214. roboticstoolbox/core/Eigen/src/Core/SolveTriangular.h +235 -0
  215. roboticstoolbox/core/Eigen/src/Core/SolverBase.h +168 -0
  216. roboticstoolbox/core/Eigen/src/Core/StableNorm.h +251 -0
  217. roboticstoolbox/core/Eigen/src/Core/StlIterators.h +463 -0
  218. roboticstoolbox/core/Eigen/src/Core/Stride.h +116 -0
  219. roboticstoolbox/core/Eigen/src/Core/Swap.h +68 -0
  220. roboticstoolbox/core/Eigen/src/Core/Transpose.h +464 -0
  221. roboticstoolbox/core/Eigen/src/Core/Transpositions.h +386 -0
  222. roboticstoolbox/core/Eigen/src/Core/TriangularMatrix.h +1001 -0
  223. roboticstoolbox/core/Eigen/src/Core/VectorBlock.h +96 -0
  224. roboticstoolbox/core/Eigen/src/Core/VectorwiseOp.h +784 -0
  225. roboticstoolbox/core/Eigen/src/Core/Visitor.h +381 -0
  226. roboticstoolbox/core/Eigen/src/Core/arch/AVX/Complex.h +372 -0
  227. roboticstoolbox/core/Eigen/src/Core/arch/AVX/MathFunctions.h +228 -0
  228. roboticstoolbox/core/Eigen/src/Core/arch/AVX/PacketMath.h +1574 -0
  229. roboticstoolbox/core/Eigen/src/Core/arch/AVX/TypeCasting.h +115 -0
  230. roboticstoolbox/core/Eigen/src/Core/arch/AVX512/Complex.h +422 -0
  231. roboticstoolbox/core/Eigen/src/Core/arch/AVX512/MathFunctions.h +362 -0
  232. roboticstoolbox/core/Eigen/src/Core/arch/AVX512/PacketMath.h +2303 -0
  233. roboticstoolbox/core/Eigen/src/Core/arch/AVX512/TypeCasting.h +89 -0
  234. roboticstoolbox/core/Eigen/src/Core/arch/AltiVec/Complex.h +417 -0
  235. roboticstoolbox/core/Eigen/src/Core/arch/AltiVec/MathFunctions.h +90 -0
  236. roboticstoolbox/core/Eigen/src/Core/arch/AltiVec/MatrixProduct.h +2937 -0
  237. roboticstoolbox/core/Eigen/src/Core/arch/AltiVec/MatrixProductCommon.h +221 -0
  238. roboticstoolbox/core/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h +629 -0
  239. roboticstoolbox/core/Eigen/src/Core/arch/AltiVec/PacketMath.h +2711 -0
  240. roboticstoolbox/core/Eigen/src/Core/arch/CUDA/Complex.h +258 -0
  241. roboticstoolbox/core/Eigen/src/Core/arch/Default/BFloat16.h +700 -0
  242. roboticstoolbox/core/Eigen/src/Core/arch/Default/ConjHelper.h +117 -0
  243. roboticstoolbox/core/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +1649 -0
  244. roboticstoolbox/core/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h +110 -0
  245. roboticstoolbox/core/Eigen/src/Core/arch/Default/Half.h +942 -0
  246. roboticstoolbox/core/Eigen/src/Core/arch/Default/Settings.h +49 -0
  247. roboticstoolbox/core/Eigen/src/Core/arch/Default/TypeCasting.h +120 -0
  248. roboticstoolbox/core/Eigen/src/Core/arch/GPU/MathFunctions.h +103 -0
  249. roboticstoolbox/core/Eigen/src/Core/arch/GPU/PacketMath.h +1685 -0
  250. roboticstoolbox/core/Eigen/src/Core/arch/GPU/TypeCasting.h +80 -0
  251. roboticstoolbox/core/Eigen/src/Core/arch/HIP/hcc/math_constants.h +23 -0
  252. roboticstoolbox/core/Eigen/src/Core/arch/MSA/Complex.h +648 -0
  253. roboticstoolbox/core/Eigen/src/Core/arch/MSA/MathFunctions.h +387 -0
  254. roboticstoolbox/core/Eigen/src/Core/arch/MSA/PacketMath.h +1233 -0
  255. roboticstoolbox/core/Eigen/src/Core/arch/NEON/Complex.h +584 -0
  256. roboticstoolbox/core/Eigen/src/Core/arch/NEON/GeneralBlockPanelKernel.h +183 -0
  257. roboticstoolbox/core/Eigen/src/Core/arch/NEON/MathFunctions.h +75 -0
  258. roboticstoolbox/core/Eigen/src/Core/arch/NEON/PacketMath.h +4587 -0
  259. roboticstoolbox/core/Eigen/src/Core/arch/NEON/TypeCasting.h +1419 -0
  260. roboticstoolbox/core/Eigen/src/Core/arch/SSE/Complex.h +351 -0
  261. roboticstoolbox/core/Eigen/src/Core/arch/SSE/MathFunctions.h +199 -0
  262. roboticstoolbox/core/Eigen/src/Core/arch/SSE/PacketMath.h +1505 -0
  263. roboticstoolbox/core/Eigen/src/Core/arch/SSE/TypeCasting.h +142 -0
  264. roboticstoolbox/core/Eigen/src/Core/arch/SVE/MathFunctions.h +44 -0
  265. roboticstoolbox/core/Eigen/src/Core/arch/SVE/PacketMath.h +752 -0
  266. roboticstoolbox/core/Eigen/src/Core/arch/SVE/TypeCasting.h +49 -0
  267. roboticstoolbox/core/Eigen/src/Core/arch/SYCL/InteropHeaders.h +232 -0
  268. roboticstoolbox/core/Eigen/src/Core/arch/SYCL/MathFunctions.h +301 -0
  269. roboticstoolbox/core/Eigen/src/Core/arch/SYCL/PacketMath.h +670 -0
  270. roboticstoolbox/core/Eigen/src/Core/arch/SYCL/SyclMemoryModel.h +694 -0
  271. roboticstoolbox/core/Eigen/src/Core/arch/SYCL/TypeCasting.h +85 -0
  272. roboticstoolbox/core/Eigen/src/Core/arch/ZVector/Complex.h +426 -0
  273. roboticstoolbox/core/Eigen/src/Core/arch/ZVector/MathFunctions.h +233 -0
  274. roboticstoolbox/core/Eigen/src/Core/arch/ZVector/PacketMath.h +1060 -0
  275. roboticstoolbox/core/Eigen/src/Core/functors/AssignmentFunctors.h +177 -0
  276. roboticstoolbox/core/Eigen/src/Core/functors/BinaryFunctors.h +541 -0
  277. roboticstoolbox/core/Eigen/src/Core/functors/NullaryFunctors.h +189 -0
  278. roboticstoolbox/core/Eigen/src/Core/functors/StlFunctors.h +166 -0
  279. roboticstoolbox/core/Eigen/src/Core/functors/TernaryFunctors.h +25 -0
  280. roboticstoolbox/core/Eigen/src/Core/functors/UnaryFunctors.h +1131 -0
  281. roboticstoolbox/core/Eigen/src/Core/products/GeneralBlockPanelKernel.h +2645 -0
  282. roboticstoolbox/core/Eigen/src/Core/products/GeneralMatrixMatrix.h +517 -0
  283. roboticstoolbox/core/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h +317 -0
  284. roboticstoolbox/core/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h +145 -0
  285. roboticstoolbox/core/Eigen/src/Core/products/GeneralMatrixMatrix_BLAS.h +124 -0
  286. roboticstoolbox/core/Eigen/src/Core/products/GeneralMatrixVector.h +518 -0
  287. roboticstoolbox/core/Eigen/src/Core/products/GeneralMatrixVector_BLAS.h +136 -0
  288. roboticstoolbox/core/Eigen/src/Core/products/Parallelizer.h +180 -0
  289. roboticstoolbox/core/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +544 -0
  290. roboticstoolbox/core/Eigen/src/Core/products/SelfadjointMatrixMatrix_BLAS.h +295 -0
  291. roboticstoolbox/core/Eigen/src/Core/products/SelfadjointMatrixVector.h +262 -0
  292. roboticstoolbox/core/Eigen/src/Core/products/SelfadjointMatrixVector_BLAS.h +118 -0
  293. roboticstoolbox/core/Eigen/src/Core/products/SelfadjointProduct.h +133 -0
  294. roboticstoolbox/core/Eigen/src/Core/products/SelfadjointRank2Update.h +94 -0
  295. roboticstoolbox/core/Eigen/src/Core/products/TriangularMatrixMatrix.h +472 -0
  296. roboticstoolbox/core/Eigen/src/Core/products/TriangularMatrixMatrix_BLAS.h +317 -0
  297. roboticstoolbox/core/Eigen/src/Core/products/TriangularMatrixVector.h +350 -0
  298. roboticstoolbox/core/Eigen/src/Core/products/TriangularMatrixVector_BLAS.h +255 -0
  299. roboticstoolbox/core/Eigen/src/Core/products/TriangularSolverMatrix.h +337 -0
  300. roboticstoolbox/core/Eigen/src/Core/products/TriangularSolverMatrix_BLAS.h +167 -0
  301. roboticstoolbox/core/Eigen/src/Core/products/TriangularSolverVector.h +148 -0
  302. roboticstoolbox/core/Eigen/src/Core/util/BlasUtil.h +583 -0
  303. roboticstoolbox/core/Eigen/src/Core/util/ConfigureVectorization.h +512 -0
  304. roboticstoolbox/core/Eigen/src/Core/util/Constants.h +563 -0
  305. roboticstoolbox/core/Eigen/src/Core/util/DisableStupidWarnings.h +106 -0
  306. roboticstoolbox/core/Eigen/src/Core/util/ForwardDeclarations.h +322 -0
  307. roboticstoolbox/core/Eigen/src/Core/util/IndexedViewHelper.h +186 -0
  308. roboticstoolbox/core/Eigen/src/Core/util/IntegralConstant.h +272 -0
  309. roboticstoolbox/core/Eigen/src/Core/util/MKL_support.h +137 -0
  310. roboticstoolbox/core/Eigen/src/Core/util/Macros.h +1464 -0
  311. roboticstoolbox/core/Eigen/src/Core/util/Memory.h +1163 -0
  312. roboticstoolbox/core/Eigen/src/Core/util/Meta.h +812 -0
  313. roboticstoolbox/core/Eigen/src/Core/util/NonMPL2.h +3 -0
  314. roboticstoolbox/core/Eigen/src/Core/util/ReenableStupidWarnings.h +31 -0
  315. roboticstoolbox/core/Eigen/src/Core/util/ReshapedHelper.h +51 -0
  316. roboticstoolbox/core/Eigen/src/Core/util/StaticAssert.h +221 -0
  317. roboticstoolbox/core/Eigen/src/Core/util/SymbolicIndex.h +293 -0
  318. roboticstoolbox/core/Eigen/src/Core/util/XprHelper.h +856 -0
  319. roboticstoolbox/core/Eigen/src/Eigenvalues/ComplexEigenSolver.h +346 -0
  320. roboticstoolbox/core/Eigen/src/Eigenvalues/ComplexSchur.h +462 -0
  321. roboticstoolbox/core/Eigen/src/Eigenvalues/ComplexSchur_LAPACKE.h +91 -0
  322. roboticstoolbox/core/Eigen/src/Eigenvalues/EigenSolver.h +622 -0
  323. roboticstoolbox/core/Eigen/src/Eigenvalues/GeneralizedEigenSolver.h +418 -0
  324. roboticstoolbox/core/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h +226 -0
  325. roboticstoolbox/core/Eigen/src/Eigenvalues/HessenbergDecomposition.h +374 -0
  326. roboticstoolbox/core/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h +158 -0
  327. roboticstoolbox/core/Eigen/src/Eigenvalues/RealQZ.h +657 -0
  328. roboticstoolbox/core/Eigen/src/Eigenvalues/RealSchur.h +558 -0
  329. roboticstoolbox/core/Eigen/src/Eigenvalues/RealSchur_LAPACKE.h +77 -0
  330. roboticstoolbox/core/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +904 -0
  331. roboticstoolbox/core/Eigen/src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h +87 -0
  332. roboticstoolbox/core/Eigen/src/Eigenvalues/Tridiagonalization.h +561 -0
  333. roboticstoolbox/core/Eigen/src/Geometry/AlignedBox.h +486 -0
  334. roboticstoolbox/core/Eigen/src/Geometry/AngleAxis.h +247 -0
  335. roboticstoolbox/core/Eigen/src/Geometry/EulerAngles.h +114 -0
  336. roboticstoolbox/core/Eigen/src/Geometry/Homogeneous.h +501 -0
  337. roboticstoolbox/core/Eigen/src/Geometry/Hyperplane.h +282 -0
  338. roboticstoolbox/core/Eigen/src/Geometry/OrthoMethods.h +235 -0
  339. roboticstoolbox/core/Eigen/src/Geometry/ParametrizedLine.h +232 -0
  340. roboticstoolbox/core/Eigen/src/Geometry/Quaternion.h +870 -0
  341. roboticstoolbox/core/Eigen/src/Geometry/Rotation2D.h +199 -0
  342. roboticstoolbox/core/Eigen/src/Geometry/RotationBase.h +206 -0
  343. roboticstoolbox/core/Eigen/src/Geometry/Scaling.h +188 -0
  344. roboticstoolbox/core/Eigen/src/Geometry/Transform.h +1563 -0
  345. roboticstoolbox/core/Eigen/src/Geometry/Translation.h +202 -0
  346. roboticstoolbox/core/Eigen/src/Geometry/Umeyama.h +166 -0
  347. roboticstoolbox/core/Eigen/src/Geometry/arch/Geometry_SIMD.h +168 -0
  348. roboticstoolbox/core/Eigen/src/Householder/BlockHouseholder.h +110 -0
  349. roboticstoolbox/core/Eigen/src/Householder/Householder.h +176 -0
  350. roboticstoolbox/core/Eigen/src/Householder/HouseholderSequence.h +545 -0
  351. roboticstoolbox/core/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h +226 -0
  352. roboticstoolbox/core/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +212 -0
  353. roboticstoolbox/core/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +229 -0
  354. roboticstoolbox/core/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h +394 -0
  355. roboticstoolbox/core/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h +453 -0
  356. roboticstoolbox/core/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +444 -0
  357. roboticstoolbox/core/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h +198 -0
  358. roboticstoolbox/core/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h +117 -0
  359. roboticstoolbox/core/Eigen/src/Jacobi/Jacobi.h +483 -0
  360. roboticstoolbox/core/Eigen/src/KLUSupport/KLUSupport.h +358 -0
  361. roboticstoolbox/core/Eigen/src/LU/Determinant.h +117 -0
  362. roboticstoolbox/core/Eigen/src/LU/FullPivLU.h +877 -0
  363. roboticstoolbox/core/Eigen/src/LU/InverseImpl.h +432 -0
  364. roboticstoolbox/core/Eigen/src/LU/PartialPivLU.h +624 -0
  365. roboticstoolbox/core/Eigen/src/LU/PartialPivLU_LAPACKE.h +83 -0
  366. roboticstoolbox/core/Eigen/src/LU/arch/InverseSize4.h +351 -0
  367. roboticstoolbox/core/Eigen/src/MetisSupport/MetisSupport.h +137 -0
  368. roboticstoolbox/core/Eigen/src/OrderingMethods/Amd.h +435 -0
  369. roboticstoolbox/core/Eigen/src/OrderingMethods/Eigen_Colamd.h +1863 -0
  370. roboticstoolbox/core/Eigen/src/OrderingMethods/Ordering.h +153 -0
  371. roboticstoolbox/core/Eigen/src/PaStiXSupport/PaStiXSupport.h +678 -0
  372. roboticstoolbox/core/Eigen/src/PardisoSupport/PardisoSupport.h +545 -0
  373. roboticstoolbox/core/Eigen/src/QR/ColPivHouseholderQR.h +674 -0
  374. roboticstoolbox/core/Eigen/src/QR/ColPivHouseholderQR_LAPACKE.h +97 -0
  375. roboticstoolbox/core/Eigen/src/QR/CompleteOrthogonalDecomposition.h +635 -0
  376. roboticstoolbox/core/Eigen/src/QR/FullPivHouseholderQR.h +713 -0
  377. roboticstoolbox/core/Eigen/src/QR/HouseholderQR.h +434 -0
  378. roboticstoolbox/core/Eigen/src/QR/HouseholderQR_LAPACKE.h +68 -0
  379. roboticstoolbox/core/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h +335 -0
  380. roboticstoolbox/core/Eigen/src/SVD/BDCSVD.h +1366 -0
  381. roboticstoolbox/core/Eigen/src/SVD/JacobiSVD.h +812 -0
  382. roboticstoolbox/core/Eigen/src/SVD/JacobiSVD_LAPACKE.h +91 -0
  383. roboticstoolbox/core/Eigen/src/SVD/SVDBase.h +376 -0
  384. roboticstoolbox/core/Eigen/src/SVD/UpperBidiagonalization.h +414 -0
  385. roboticstoolbox/core/Eigen/src/SparseCholesky/SimplicialCholesky.h +697 -0
  386. roboticstoolbox/core/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h +174 -0
  387. roboticstoolbox/core/Eigen/src/SparseCore/AmbiVector.h +378 -0
  388. roboticstoolbox/core/Eigen/src/SparseCore/CompressedStorage.h +274 -0
  389. roboticstoolbox/core/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +352 -0
  390. roboticstoolbox/core/Eigen/src/SparseCore/MappedSparseMatrix.h +67 -0
  391. roboticstoolbox/core/Eigen/src/SparseCore/SparseAssign.h +270 -0
  392. roboticstoolbox/core/Eigen/src/SparseCore/SparseBlock.h +571 -0
  393. roboticstoolbox/core/Eigen/src/SparseCore/SparseColEtree.h +206 -0
  394. roboticstoolbox/core/Eigen/src/SparseCore/SparseCompressedBase.h +370 -0
  395. roboticstoolbox/core/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +722 -0
  396. roboticstoolbox/core/Eigen/src/SparseCore/SparseCwiseUnaryOp.h +150 -0
  397. roboticstoolbox/core/Eigen/src/SparseCore/SparseDenseProduct.h +342 -0
  398. roboticstoolbox/core/Eigen/src/SparseCore/SparseDiagonalProduct.h +138 -0
  399. roboticstoolbox/core/Eigen/src/SparseCore/SparseDot.h +98 -0
  400. roboticstoolbox/core/Eigen/src/SparseCore/SparseFuzzy.h +29 -0
  401. roboticstoolbox/core/Eigen/src/SparseCore/SparseMap.h +305 -0
  402. roboticstoolbox/core/Eigen/src/SparseCore/SparseMatrix.h +1518 -0
  403. roboticstoolbox/core/Eigen/src/SparseCore/SparseMatrixBase.h +398 -0
  404. roboticstoolbox/core/Eigen/src/SparseCore/SparsePermutation.h +178 -0
  405. roboticstoolbox/core/Eigen/src/SparseCore/SparseProduct.h +181 -0
  406. roboticstoolbox/core/Eigen/src/SparseCore/SparseRedux.h +49 -0
  407. roboticstoolbox/core/Eigen/src/SparseCore/SparseRef.h +397 -0
  408. roboticstoolbox/core/Eigen/src/SparseCore/SparseSelfAdjointView.h +659 -0
  409. roboticstoolbox/core/Eigen/src/SparseCore/SparseSolverBase.h +124 -0
  410. roboticstoolbox/core/Eigen/src/SparseCore/SparseSparseProductWithPruning.h +198 -0
  411. roboticstoolbox/core/Eigen/src/SparseCore/SparseTranspose.h +92 -0
  412. roboticstoolbox/core/Eigen/src/SparseCore/SparseTriangularView.h +189 -0
  413. roboticstoolbox/core/Eigen/src/SparseCore/SparseUtil.h +186 -0
  414. roboticstoolbox/core/Eigen/src/SparseCore/SparseVector.h +478 -0
  415. roboticstoolbox/core/Eigen/src/SparseCore/SparseView.h +254 -0
  416. roboticstoolbox/core/Eigen/src/SparseCore/TriangularSolver.h +315 -0
  417. roboticstoolbox/core/Eigen/src/SparseLU/SparseLU.h +923 -0
  418. roboticstoolbox/core/Eigen/src/SparseLU/SparseLUImpl.h +66 -0
  419. roboticstoolbox/core/Eigen/src/SparseLU/SparseLU_Memory.h +226 -0
  420. roboticstoolbox/core/Eigen/src/SparseLU/SparseLU_Structs.h +110 -0
  421. roboticstoolbox/core/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h +375 -0
  422. roboticstoolbox/core/Eigen/src/SparseLU/SparseLU_Utils.h +80 -0
  423. roboticstoolbox/core/Eigen/src/SparseLU/SparseLU_column_bmod.h +181 -0
  424. roboticstoolbox/core/Eigen/src/SparseLU/SparseLU_column_dfs.h +179 -0
  425. roboticstoolbox/core/Eigen/src/SparseLU/SparseLU_copy_to_ucol.h +107 -0
  426. roboticstoolbox/core/Eigen/src/SparseLU/SparseLU_gemm_kernel.h +280 -0
  427. roboticstoolbox/core/Eigen/src/SparseLU/SparseLU_heap_relax_snode.h +126 -0
  428. roboticstoolbox/core/Eigen/src/SparseLU/SparseLU_kernel_bmod.h +130 -0
  429. roboticstoolbox/core/Eigen/src/SparseLU/SparseLU_panel_bmod.h +223 -0
  430. roboticstoolbox/core/Eigen/src/SparseLU/SparseLU_panel_dfs.h +258 -0
  431. roboticstoolbox/core/Eigen/src/SparseLU/SparseLU_pivotL.h +137 -0
  432. roboticstoolbox/core/Eigen/src/SparseLU/SparseLU_pruneL.h +136 -0
  433. roboticstoolbox/core/Eigen/src/SparseLU/SparseLU_relax_snode.h +83 -0
  434. roboticstoolbox/core/Eigen/src/SparseQR/SparseQR.h +758 -0
  435. roboticstoolbox/core/Eigen/src/StlSupport/StdDeque.h +116 -0
  436. roboticstoolbox/core/Eigen/src/StlSupport/StdList.h +106 -0
  437. roboticstoolbox/core/Eigen/src/StlSupport/StdVector.h +131 -0
  438. roboticstoolbox/core/Eigen/src/StlSupport/details.h +84 -0
  439. roboticstoolbox/core/Eigen/src/SuperLUSupport/SuperLUSupport.h +1025 -0
  440. roboticstoolbox/core/Eigen/src/UmfPackSupport/UmfPackSupport.h +642 -0
  441. roboticstoolbox/core/Eigen/src/misc/Image.h +82 -0
  442. roboticstoolbox/core/Eigen/src/misc/Kernel.h +79 -0
  443. roboticstoolbox/core/Eigen/src/misc/RealSvd2x2.h +55 -0
  444. roboticstoolbox/core/Eigen/src/misc/blas.h +440 -0
  445. roboticstoolbox/core/Eigen/src/misc/lapack.h +152 -0
  446. roboticstoolbox/core/Eigen/src/misc/lapacke.h +16292 -0
  447. roboticstoolbox/core/Eigen/src/misc/lapacke_mangling.h +17 -0
  448. roboticstoolbox/core/Eigen/src/plugins/ArrayCwiseBinaryOps.h +358 -0
  449. roboticstoolbox/core/Eigen/src/plugins/ArrayCwiseUnaryOps.h +696 -0
  450. roboticstoolbox/core/Eigen/src/plugins/BlockMethods.h +1442 -0
  451. roboticstoolbox/core/Eigen/src/plugins/CommonCwiseBinaryOps.h +115 -0
  452. roboticstoolbox/core/Eigen/src/plugins/CommonCwiseUnaryOps.h +177 -0
  453. roboticstoolbox/core/Eigen/src/plugins/IndexedViewMethods.h +262 -0
  454. roboticstoolbox/core/Eigen/src/plugins/MatrixCwiseBinaryOps.h +152 -0
  455. roboticstoolbox/core/Eigen/src/plugins/MatrixCwiseUnaryOps.h +95 -0
  456. roboticstoolbox/core/Eigen/src/plugins/ReshapedMethods.h +149 -0
  457. roboticstoolbox/core/fknm.cpp +1557 -0
  458. roboticstoolbox/core/fknm.h +55 -0
  459. roboticstoolbox/core/frne.c +351 -0
  460. roboticstoolbox/core/frne.h +96 -0
  461. roboticstoolbox/core/ik.cpp +301 -0
  462. roboticstoolbox/core/ik.h +59 -0
  463. roboticstoolbox/core/linalg.cpp +316 -0
  464. roboticstoolbox/core/linalg.h +64 -0
  465. roboticstoolbox/core/methods.cpp +372 -0
  466. roboticstoolbox/core/methods.h +32 -0
  467. roboticstoolbox/core/ne.c +493 -0
  468. roboticstoolbox/core/structs.cpp +24 -0
  469. roboticstoolbox/core/structs.h +62 -0
  470. roboticstoolbox/core/vmath.c +163 -0
  471. roboticstoolbox/core/vmath.h +32 -0
  472. roboticstoolbox/fknm.cp312-win_amd64.pyd +0 -0
  473. roboticstoolbox/frne.cp312-win_amd64.pyd +0 -0
  474. roboticstoolbox/mobile/Animations.py +485 -0
  475. roboticstoolbox/mobile/Bug2.py +455 -0
  476. roboticstoolbox/mobile/CurvaturePolyPlanner.py +179 -0
  477. roboticstoolbox/mobile/DistanceTransformPlanner.py +395 -0
  478. roboticstoolbox/mobile/DstarPlanner.py +591 -0
  479. roboticstoolbox/mobile/DubinsPlanner.py +474 -0
  480. roboticstoolbox/mobile/EKF.py +1617 -0
  481. roboticstoolbox/mobile/LatticePlanner.py +419 -0
  482. roboticstoolbox/mobile/OccGrid.py +613 -0
  483. roboticstoolbox/mobile/PRMPlanner.py +348 -0
  484. roboticstoolbox/mobile/ParticleFilter.py +706 -0
  485. roboticstoolbox/mobile/PlannerBase.py +1009 -0
  486. roboticstoolbox/mobile/PoseGraph.py +544 -0
  487. roboticstoolbox/mobile/QuinticPolyPlanner.py +349 -0
  488. roboticstoolbox/mobile/RRTPlanner.py +359 -0
  489. roboticstoolbox/mobile/ReedsSheppPlanner.py +545 -0
  490. roboticstoolbox/mobile/Vehicle.py +1909 -0
  491. roboticstoolbox/mobile/__init__.py +193 -0
  492. roboticstoolbox/mobile/drivers.py +390 -0
  493. roboticstoolbox/mobile/landmarkmap.py +181 -0
  494. roboticstoolbox/mobile/sensors.py +771 -0
  495. roboticstoolbox/models/DH/AL5D.py +121 -0
  496. roboticstoolbox/models/DH/Ball.py +87 -0
  497. roboticstoolbox/models/DH/Baxter.py +91 -0
  498. roboticstoolbox/models/DH/Cobra600.py +63 -0
  499. roboticstoolbox/models/DH/Coil.py +80 -0
  500. roboticstoolbox/models/DH/Hyper.py +83 -0
  501. roboticstoolbox/models/DH/Hyper3d.py +85 -0
  502. roboticstoolbox/models/DH/IRB140.py +159 -0
  503. roboticstoolbox/models/DH/Jaco.py +102 -0
  504. roboticstoolbox/models/DH/KR5.py +112 -0
  505. roboticstoolbox/models/DH/LWR4.py +85 -0
  506. roboticstoolbox/models/DH/Mico.py +102 -0
  507. roboticstoolbox/models/DH/Orion5.py +91 -0
  508. roboticstoolbox/models/DH/P8.py +80 -0
  509. roboticstoolbox/models/DH/Panda.py +178 -0
  510. roboticstoolbox/models/DH/Planar2.py +69 -0
  511. roboticstoolbox/models/DH/Planar3.py +51 -0
  512. roboticstoolbox/models/DH/Puma560.py +326 -0
  513. roboticstoolbox/models/DH/README.md +216 -0
  514. roboticstoolbox/models/DH/Sawyer.py +85 -0
  515. roboticstoolbox/models/DH/Stanford.py +147 -0
  516. roboticstoolbox/models/DH/TwoLink.py +109 -0
  517. roboticstoolbox/models/DH/UR10.py +124 -0
  518. roboticstoolbox/models/DH/UR3.py +98 -0
  519. roboticstoolbox/models/DH/UR5.py +98 -0
  520. roboticstoolbox/models/DH/Uprighttl.py +24 -0
  521. roboticstoolbox/models/DH/__init__.py +52 -0
  522. roboticstoolbox/models/ETS/Frankie.py +90 -0
  523. roboticstoolbox/models/ETS/GenericSeven.py +54 -0
  524. roboticstoolbox/models/ETS/Omni.py +74 -0
  525. roboticstoolbox/models/ETS/Panda.py +69 -0
  526. roboticstoolbox/models/ETS/Planar2.py +49 -0
  527. roboticstoolbox/models/ETS/Planar_Y.py +65 -0
  528. roboticstoolbox/models/ETS/Puma560.py +69 -0
  529. roboticstoolbox/models/ETS/XYPanda.py +84 -0
  530. roboticstoolbox/models/ETS/__init__.py +20 -0
  531. roboticstoolbox/models/README.md +9 -0
  532. roboticstoolbox/models/URDF/AL5D.py +54 -0
  533. roboticstoolbox/models/URDF/Fetch.py +70 -0
  534. roboticstoolbox/models/URDF/FetchCamera.py +71 -0
  535. roboticstoolbox/models/URDF/Frankie.py +75 -0
  536. roboticstoolbox/models/URDF/FrankieOmni.py +94 -0
  537. roboticstoolbox/models/URDF/KinovaGen3.py +71 -0
  538. roboticstoolbox/models/URDF/LBR.py +59 -0
  539. roboticstoolbox/models/URDF/Mico.py +68 -0
  540. roboticstoolbox/models/URDF/PR2.py +64 -0
  541. roboticstoolbox/models/URDF/Panda.py +67 -0
  542. roboticstoolbox/models/URDF/Puma560.py +97 -0
  543. roboticstoolbox/models/URDF/UR10.py +53 -0
  544. roboticstoolbox/models/URDF/UR3.py +53 -0
  545. roboticstoolbox/models/URDF/UR5.py +74 -0
  546. roboticstoolbox/models/URDF/Valkyrie.py +84 -0
  547. roboticstoolbox/models/URDF/YuMi.py +109 -0
  548. roboticstoolbox/models/URDF/__init__.py +53 -0
  549. roboticstoolbox/models/URDF/px100.py +56 -0
  550. roboticstoolbox/models/URDF/px150.py +56 -0
  551. roboticstoolbox/models/URDF/rx150.py +56 -0
  552. roboticstoolbox/models/URDF/rx200.py +56 -0
  553. roboticstoolbox/models/URDF/vx300.py +56 -0
  554. roboticstoolbox/models/URDF/vx300s.py +56 -0
  555. roboticstoolbox/models/URDF/wx200.py +56 -0
  556. roboticstoolbox/models/URDF/wx250.py +56 -0
  557. roboticstoolbox/models/URDF/wx250s.py +56 -0
  558. roboticstoolbox/models/__init__.py +7 -0
  559. roboticstoolbox/models/list.py +119 -0
  560. roboticstoolbox/robot/BaseRobot.py +3133 -0
  561. roboticstoolbox/robot/DHFactor.py +522 -0
  562. roboticstoolbox/robot/DHLink.py +981 -0
  563. roboticstoolbox/robot/DHRobot.py +2520 -0
  564. roboticstoolbox/robot/Dynamics.py +1620 -0
  565. roboticstoolbox/robot/ELink.py +23 -0
  566. roboticstoolbox/robot/ERobot.py +25 -0
  567. roboticstoolbox/robot/ET.py +1097 -0
  568. roboticstoolbox/robot/ETS.py +3542 -0
  569. roboticstoolbox/robot/Gripper.py +282 -0
  570. roboticstoolbox/robot/IK.py +1522 -0
  571. roboticstoolbox/robot/Link.py +1698 -0
  572. roboticstoolbox/robot/PoERobot.py +348 -0
  573. roboticstoolbox/robot/Robot.py +2100 -0
  574. roboticstoolbox/robot/RobotKinematics.py +1725 -0
  575. roboticstoolbox/robot/RobotProto.py +92 -0
  576. roboticstoolbox/robot/__init__.py +54 -0
  577. roboticstoolbox/tools/DHFactor.py +375 -0
  578. roboticstoolbox/tools/Ticker.py +53 -0
  579. roboticstoolbox/tools/__init__.py +54 -0
  580. roboticstoolbox/tools/data.py +187 -0
  581. roboticstoolbox/tools/jsingu.py +51 -0
  582. roboticstoolbox/tools/null.py +48 -0
  583. roboticstoolbox/tools/numerical.py +96 -0
  584. roboticstoolbox/tools/p_servo.py +106 -0
  585. roboticstoolbox/tools/params.py +11 -0
  586. roboticstoolbox/tools/plot.py +109 -0
  587. roboticstoolbox/tools/trajectory.py +1152 -0
  588. roboticstoolbox/tools/types.py +13 -0
  589. roboticstoolbox/tools/urdf/__init__.py +45 -0
  590. roboticstoolbox/tools/urdf/tests/data/ur5.urdf +341 -0
  591. roboticstoolbox/tools/urdf/tests/test_urdf.py +116 -0
  592. roboticstoolbox/tools/urdf/urdf.py +1976 -0
  593. roboticstoolbox/tools/urdf/utils.py +50 -0
  594. roboticstoolbox/tools/xacro/__init__.py +1148 -0
  595. roboticstoolbox/tools/xacro/cli.py +128 -0
  596. roboticstoolbox/tools/xacro/color.py +66 -0
  597. roboticstoolbox/tools/xacro/tests/CMakeLists.txt +4 -0
  598. roboticstoolbox/tools/xacro/tests/broken.xacro +1 -0
  599. roboticstoolbox/tools/xacro/tests/emoji.xacro +5 -0
  600. roboticstoolbox/tools/xacro/tests/include1.xacro +4 -0
  601. roboticstoolbox/tools/xacro/tests/include1.xml +1 -0
  602. roboticstoolbox/tools/xacro/tests/include2.xacro +4 -0
  603. roboticstoolbox/tools/xacro/tests/include2.xml +1 -0
  604. roboticstoolbox/tools/xacro/tests/robots/README +4 -0
  605. roboticstoolbox/tools/xacro/tests/robots/pr2/base_v0/base.gazebo.xacro +59 -0
  606. roboticstoolbox/tools/xacro/tests/robots/pr2/base_v0/base.transmission.xacro +24 -0
  607. roboticstoolbox/tools/xacro/tests/robots/pr2/base_v0/base.urdf.xacro +264 -0
  608. roboticstoolbox/tools/xacro/tests/robots/pr2/common.xacro +71 -0
  609. roboticstoolbox/tools/xacro/tests/robots/pr2/forearm_v0/forearm.gazebo.xacro +36 -0
  610. roboticstoolbox/tools/xacro/tests/robots/pr2/forearm_v0/forearm.transmission.xacro +20 -0
  611. roboticstoolbox/tools/xacro/tests/robots/pr2/forearm_v0/forearm.urdf.xacro +130 -0
  612. roboticstoolbox/tools/xacro/tests/robots/pr2/gazebo/gazebo.urdf.xacro +24 -0
  613. roboticstoolbox/tools/xacro/tests/robots/pr2/gripper_v0/gripper.gazebo.xacro +288 -0
  614. roboticstoolbox/tools/xacro/tests/robots/pr2/gripper_v0/gripper.transmission.xacro +50 -0
  615. roboticstoolbox/tools/xacro/tests/robots/pr2/gripper_v0/gripper.urdf.xacro +374 -0
  616. roboticstoolbox/tools/xacro/tests/robots/pr2/head_v0/head.gazebo.xacro +16 -0
  617. roboticstoolbox/tools/xacro/tests/robots/pr2/head_v0/head.transmission.xacro +34 -0
  618. roboticstoolbox/tools/xacro/tests/robots/pr2/head_v0/head.urdf.xacro +147 -0
  619. roboticstoolbox/tools/xacro/tests/robots/pr2/materials.urdf.xacro +52 -0
  620. roboticstoolbox/tools/xacro/tests/robots/pr2/pr2.urdf.xacro +157 -0
  621. roboticstoolbox/tools/xacro/tests/robots/pr2/pr2_1.11.4.xml +3781 -0
  622. roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/double_stereo_camera.gazebo.xacro +16 -0
  623. roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/double_stereo_camera.urdf.xacro +61 -0
  624. roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/head_sensor_package.gazebo.xacro +20 -0
  625. roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/head_sensor_package.urdf.xacro +63 -0
  626. roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/hokuyo_lx30_laser.gazebo.xacro +39 -0
  627. roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/hokuyo_lx30_laser.urdf.xacro +27 -0
  628. roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/kinect_camera.gazebo.xacro +87 -0
  629. roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/kinect_camera.urdf.xacro +55 -0
  630. roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/kinect_prosilica_camera.gazebo.xacro +193 -0
  631. roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/kinect_prosilica_camera.urdf.xacro +181 -0
  632. roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/microstrain_3dmgx2_imu.gazebo.xacro +20 -0
  633. roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/microstrain_3dmgx2_imu.urdf.xacro +25 -0
  634. roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/projector_wg6802418.gazebo.xacro +31 -0
  635. roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/projector_wg6802418.urdf.xacro +42 -0
  636. roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/prosilica_gc2450_camera.gazebo.xacro +43 -0
  637. roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/prosilica_gc2450_camera.urdf.xacro +49 -0
  638. roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/stereo_camera.gazebo.xacro +23 -0
  639. roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/stereo_camera.urdf.xacro +71 -0
  640. roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/wge100_camera.gazebo.xacro +46 -0
  641. roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/wge100_camera.urdf.xacro +47 -0
  642. roboticstoolbox/tools/xacro/tests/robots/pr2/shoulder_v0/shoulder.gazebo.xacro +40 -0
  643. roboticstoolbox/tools/xacro/tests/robots/pr2/shoulder_v0/shoulder.transmission.xacro +35 -0
  644. roboticstoolbox/tools/xacro/tests/robots/pr2/shoulder_v0/shoulder.urdf.xacro +167 -0
  645. roboticstoolbox/tools/xacro/tests/robots/pr2/tilting_laser_v0/tilting_laser.gazebo.xacro +11 -0
  646. roboticstoolbox/tools/xacro/tests/robots/pr2/tilting_laser_v0/tilting_laser.transmission.xacro +14 -0
  647. roboticstoolbox/tools/xacro/tests/robots/pr2/tilting_laser_v0/tilting_laser.urdf.xacro +60 -0
  648. roboticstoolbox/tools/xacro/tests/robots/pr2/torso_v0/torso.gazebo.xacro +37 -0
  649. roboticstoolbox/tools/xacro/tests/robots/pr2/torso_v0/torso.transmission.xacro +22 -0
  650. roboticstoolbox/tools/xacro/tests/robots/pr2/torso_v0/torso.urdf.xacro +122 -0
  651. roboticstoolbox/tools/xacro/tests/robots/pr2/upper_arm_v0/upper_arm.gazebo.xacro +39 -0
  652. roboticstoolbox/tools/xacro/tests/robots/pr2/upper_arm_v0/upper_arm.transmission.xacro +28 -0
  653. roboticstoolbox/tools/xacro/tests/robots/pr2/upper_arm_v0/upper_arm.urdf.xacro +173 -0
  654. roboticstoolbox/tools/xacro/tests/settings.yaml +9 -0
  655. roboticstoolbox/tools/xacro/tests/subdir/foo.xacro +3 -0
  656. roboticstoolbox/tools/xacro/tests/subdir/include-recursive.xacro +5 -0
  657. roboticstoolbox/tools/xacro/tests/subdir/include1.xml +1 -0
  658. roboticstoolbox/tools/xacro/tests/test_xacro.py +1418 -0
  659. roboticstoolbox/tools/xacro/xmlutils.py +152 -0
  660. roboticstoolbox_python-1.3.0.dist-info/METADATA +552 -0
  661. roboticstoolbox_python-1.3.0.dist-info/RECORD +673 -0
  662. roboticstoolbox_python-1.3.0.dist-info/WHEEL +5 -0
  663. roboticstoolbox_python-1.3.0.dist-info/entry_points.txt +6 -0
  664. roboticstoolbox_python-1.3.0.dist-info/licenses/LICENSE +21 -0
  665. spatialgeometry/__init__.py +32 -0
  666. spatialgeometry/geom/CollisionShape.py +419 -0
  667. spatialgeometry/geom/SceneGroup.py +26 -0
  668. spatialgeometry/geom/SceneNode.py +315 -0
  669. spatialgeometry/geom/Shape.py +420 -0
  670. spatialgeometry/geom/__init__.py +26 -0
  671. spatialgeometry/scene.py +107 -0
  672. spatialgeometry/tools/__init__.py +0 -0
  673. spatialgeometry/tools/stdout_supress.py +302 -0
@@ -0,0 +1,1587 @@
1
+ import numpy as np
2
+ from math import sin, cos, pi
3
+
4
+ # import matplotlib.pyplot as plt
5
+ import time
6
+ from spatialmath import SE3
7
+ import spatialmath.base as smb
8
+
9
+ from bdsim.block_types import GraphicsBlock, ContinuousBlock, FunctionBlock, SourceBlock
10
+
11
+
12
+ from roboticstoolbox import quintic_func, trapezoidal_func
13
+
14
+ """
15
+ Robot blocks:
16
+ - have inputs and outputs
17
+ - are a subclass of ``FunctionBlock`` |rarr| ``Block`` for kinematics and have no states
18
+ - are a subclass of ``ContinuousBlock`` |rarr| ``Block`` for dynamics and have states
19
+
20
+ """
21
+ # The constructor of each class ``MyClass`` with a ``@block`` decorator becomes a method ``MYCLASS()`` of the BlockDiagram instance.
22
+
23
+
24
+ # ------------------------------------------------------------------------ #
25
+ class FKine(FunctionBlock):
26
+ r"""
27
+ :blockname:`FKINE`
28
+
29
+ Robot arm forward kinematics.
30
+
31
+ :inputs: 1
32
+ :outputs: 1
33
+ :states: 0
34
+
35
+ .. list-table::
36
+ :header-rows: 1
37
+
38
+ * - Port type
39
+ - Port number
40
+ - Types
41
+ - Description
42
+ * - Input
43
+ - 0
44
+ - ndarray(N)
45
+ - :math:`\mathit{q}`
46
+ * - Output
47
+ - 0
48
+ - SE3
49
+ - :math:`\mathbf{T}`
50
+
51
+ Compute the end-effector pose as an SE(3) object as a function of the input joint
52
+ configuration.
53
+
54
+ :seealso: :meth:`~roboticstoolbox.robot.Robot.Robot.fkine`
55
+ """
56
+
57
+ nin = 1
58
+ nout = 1
59
+ inlabels = ("q",)
60
+ outlabels = ("T",)
61
+
62
+ def __init__(self, robot=None, args={}, **blockargs):
63
+ """
64
+ :param ``*inputs``: Optional incoming connections
65
+ :type ``*inputs``: Block or Plug
66
+ :param robot: Robot model, defaults to None
67
+ :type robot: Robot subclass, optional
68
+ :param args: Options for fkine, defaults to {}
69
+ :type args: dict, optional
70
+ :param blockargs: |BlockOptions|
71
+ :type blockargs: dict
72
+ """
73
+ if robot is None:
74
+ raise ValueError("robot is not defined")
75
+
76
+ super().__init__(**blockargs)
77
+ # self.type = "forward-kinematics"
78
+
79
+ self.robot = robot
80
+ self.args = args
81
+
82
+ self.inport_names(("q",))
83
+ self.outport_names(("T",))
84
+
85
+ def output(self, t, inports, x):
86
+ q = inports[0]
87
+ return [self.robot.fkine(q, **self.args)]
88
+
89
+
90
+ # ------------------------------------------------------------------------ #
91
+
92
+
93
+ class IKine(FunctionBlock):
94
+ r"""
95
+ :blockname:`IKINE`
96
+
97
+ Robot arm inverse kinematics.
98
+
99
+ :inputs: 1
100
+ :outputs: 1
101
+ :states: 0
102
+
103
+ .. list-table::
104
+ :header-rows: 1
105
+
106
+ * - Port type
107
+ - Port number
108
+ - Types
109
+ - Description
110
+ * - Input
111
+ - 0
112
+ - SE3
113
+ - :math:`\mathbf{T}`
114
+ * - Output
115
+ - 0
116
+ - ndarray(N)
117
+ - :math:`\mathit{q}`
118
+
119
+ Compute joint configuration required to achieve end-effector pose input as
120
+ an SE(3) object.
121
+
122
+ :note: The solution may not exist and is not unique. The solution will depend
123
+ on the initial joint configuration ``q0``.
124
+
125
+ :seealso: :meth:`~roboticstoolbox.robot.Robot.Robot.ik_LM`
126
+ """
127
+
128
+ nin = 1
129
+ nout = 1
130
+ inlabels = ("T",)
131
+ outlabels = ("q",)
132
+
133
+ def __init__(
134
+ self,
135
+ robot=None,
136
+ q0=None,
137
+ useprevious=True,
138
+ ik=None,
139
+ args={},
140
+ seed=None,
141
+ **blockargs,
142
+ ):
143
+ """
144
+ :param robot: Robot model, defaults to None
145
+ :type robot: Robot subclass, optional
146
+ :param q0: Initial joint angles, defaults to None
147
+ :type q0: array_like(n), optional
148
+ :param useprevious: Use previous IK solution as q0, defaults to True
149
+ :type useprevious: bool, optional
150
+ :param ik: Specify an IK function, defaults to "LM"
151
+ :type ik: str
152
+ :param args: Options passed to IK function
153
+ :type args: dict
154
+ :param seed: random seed for solution
155
+ :type seed: int
156
+ :param blockargs: |BlockOptions|
157
+ :type blockargs: dict
158
+ """
159
+ if robot is None:
160
+ raise ValueError("robot is not defined")
161
+
162
+ super().__init__(**blockargs)
163
+ # self.type = "inverse-kinematics"
164
+
165
+ self.robot = robot
166
+ self.q0 = q0
167
+ self.qprev = q0
168
+ self.useprevious = useprevious
169
+ if ik is None:
170
+ ik = robot.ikine_LM
171
+ self.ik = ik
172
+ self.args = args
173
+ self.seed = 0
174
+
175
+ self.inport_names(("T",))
176
+ self.outport_names(("q",))
177
+
178
+ def start(self):
179
+ super().start()
180
+ if self.useprevious:
181
+ self.qprev = self.q0
182
+
183
+ def output(self, t, inports, x):
184
+ if self.useprevious:
185
+ q0 = self.qprev
186
+ else:
187
+ q0 = self.q0
188
+
189
+ sol = self.ik(inports[0], q0=q0, seed=self.seed, **self.args)
190
+
191
+ if not sol.success:
192
+ raise RuntimeError("inverse kinematic failure for pose", inports[0])
193
+
194
+ if self.useprevious:
195
+ self.qprev = sol.q
196
+
197
+ return [sol.q]
198
+
199
+
200
+ # ------------------------------------------------------------------------ #
201
+
202
+
203
+ class Jacobian(FunctionBlock):
204
+ r"""
205
+ :blockname:`JACOBIAN`
206
+
207
+ Robot arm Jacobian matrix.
208
+
209
+ :inputs: 1
210
+ :outputs: 1
211
+ :states: 0
212
+
213
+ .. list-table::
214
+ :header-rows: 1
215
+
216
+ * - Port type
217
+ - Port number
218
+ - Types
219
+ - Description
220
+ * - Input
221
+ - 0
222
+ - ndarray(N)
223
+ - :math:`\mathit{q}`
224
+ * - Output
225
+ - 0
226
+ - ndarray(N,N)
227
+ - :math:`\mathbf{J}`
228
+
229
+ Compute the Jacobian matrix as a function of the input joint configuration. The
230
+ Jacobian can be computed in the world or end-effector frame, for spatial or
231
+ analytical velocity, and its inverse, damped inverse or transpose can be returned.
232
+
233
+ :seealso: :meth:`~roboticstoolbox.robot.Robot.Robot.jacob0`
234
+ :meth:`~roboticstoolbox.robot.Robot.Robot.jacobe`
235
+ :meth:`~roboticstoolbox.robot.Robot.Robot.jacob0_analytical`
236
+ """
237
+
238
+ nin = 1
239
+ nout = 1
240
+ inlabels = ("q",)
241
+ outlabels = ("J",)
242
+
243
+ def __init__(
244
+ self,
245
+ robot,
246
+ frame="0",
247
+ representation=None,
248
+ inverse=False,
249
+ pinv=False,
250
+ damping=None,
251
+ transpose=False,
252
+ **blockargs,
253
+ ):
254
+ """
255
+ :param robot: Robot model
256
+ :type robot: Robot subclass
257
+ :param frame: Frame to compute Jacobian for, one of: "0" [default], "e"
258
+ :type frame: str, optional
259
+ :param representation: representation for analytical Jacobian
260
+ :type representation: str, optional
261
+ :param inverse: output inverse of Jacobian, defaults to False
262
+ :type inverse: bool, optional
263
+ :param pinv: output pseudo-inverse of Jacobian, defaults to False
264
+ :type pinv: bool, optional
265
+ :param damping: damping term for inverse, defaults to None
266
+ :type damping: float or array_like(N)
267
+ :param transpose: output transpose of Jacobian, defaults to False
268
+ :type transpose: bool, optional
269
+ :param blockargs: |BlockOptions|
270
+ :type blockargs: dict
271
+
272
+ If an inverse is requested and ``damping`` is not None it is added to the
273
+ diagonal of the Jacobian prior to the inversion. If a scalar is provided it is
274
+ added to each element of the diagonal, otherwise an N-vector is assumed.
275
+
276
+ .. note::
277
+ - Only one of ``inverse`` or ``pinv`` can be True
278
+ - ``inverse`` or ``pinv`` can be used in conjunction with ``transpose``
279
+ - ``inverse`` requires that the Jacobian is square
280
+ - If ``inverse`` is True and the Jacobian is singular a runtime
281
+ error will occur.
282
+ """
283
+ if robot is None:
284
+ raise ValueError("robot is not defined")
285
+
286
+ super().__init__(**blockargs)
287
+
288
+ self.robot = robot
289
+
290
+ if frame in (0, "0"):
291
+ if representation is None:
292
+ self.jfunc = robot.jacob0
293
+ else:
294
+ self.jfunc = lambda q: robot.jacob0_analytical(
295
+ q, representation=representation
296
+ )
297
+ elif frame == "e":
298
+ if representation is None:
299
+ self.jfunc = robot.jacobe
300
+ else:
301
+ raise ValueError("cannot compute analytical Jacobian in EE frame")
302
+ else:
303
+ raise ValueError("unknown frame")
304
+
305
+ if inverse and robot.n != 6:
306
+ raise ValueError("cannot invert a non square Jacobian")
307
+ if inverse and pinv:
308
+ raise ValueError("can only set one of inverse and pinv")
309
+ self.inverse = inverse
310
+ self.pinv = pinv
311
+ self.damping = damping
312
+ self.transpose = transpose
313
+ self.representation = representation
314
+
315
+ self.inport_names(("q",))
316
+ self.outport_names(("J",))
317
+
318
+ def output(self, t, inports, x):
319
+ q = inports[0]
320
+
321
+ J = self.jfunc(q)
322
+
323
+ # add damping term if given
324
+ if (self.inverse or self.pinv) and self.damping is not None:
325
+ D = np.zeros(J.shape)
326
+ np.fill_diagonal(D, self.damping)
327
+ J = J + D
328
+
329
+ # optionally invert the Jacobian
330
+ if self.inverse:
331
+ J = np.linalg.inv(J)
332
+ if self.pinv:
333
+ J = np.linalg.pinv(J)
334
+
335
+ # optionally transpose the Jacobian
336
+ if self.transpose:
337
+ J = J.T
338
+ return [J]
339
+
340
+
341
+ # ------------------------------------------------------------------------ #
342
+
343
+
344
+ class ArmPlot(GraphicsBlock):
345
+ r"""
346
+ :blockname:`ARMPLOT`
347
+
348
+ Plot robot arm.
349
+
350
+ :inputs: 1 [ndarray(N)]
351
+ :outputs: 0
352
+ :states: 0
353
+
354
+ :inputs: 1
355
+ :outputs: 0
356
+ :states: 0
357
+
358
+ .. list-table::
359
+ :header-rows: 1
360
+
361
+ * - Port type
362
+ - Port number
363
+ - Types
364
+ - Description
365
+ * - Input
366
+ - 0
367
+ - ndarray(N)
368
+ - :math:`\mathit{q}`, joint configuration
369
+ * - Output
370
+
371
+ Create a robot animation using the robot's ``plot`` method.
372
+
373
+ :seealso: :meth:`~roboticstoolbox.robot.Robot.Robot.plot`
374
+ """
375
+
376
+ nin = 1
377
+ nout = 0
378
+ inlabels = ("q",)
379
+ PLOT3D = True
380
+
381
+ def __init__(self, robot=None, q0=None, backend=None, **blockargs):
382
+ """
383
+ :param robot: Robot model
384
+ :type robot: Robot subclass
385
+ :param q0: initial joint angles, defaults to None
386
+ :type q0: ndarray(N)
387
+ :param backend: RTB backend name, defaults to 'pyplot'
388
+ :type backend: str, optional
389
+ :param blockargs: |BlockOptions|
390
+ :type blockargs: dict
391
+ """
392
+ if robot is None:
393
+ raise ValueError("robot is not defined")
394
+
395
+ super().__init__(**blockargs)
396
+ self.inport_names(("q",))
397
+
398
+ if q0 is None:
399
+ q0 = np.zeros((robot.n,))
400
+ self.robot = robot
401
+ self.backend = backend
402
+ self.q0 = q0
403
+ self.env = None
404
+
405
+ def start(self, simstate):
406
+ # create the plot
407
+ # super().reset()
408
+ # if state.options.graphics:
409
+ super().start(simstate)
410
+
411
+ if not self._enabled:
412
+ return
413
+
414
+ assert self.fig is not None
415
+ assert self.ax is not None
416
+ self.env = self.robot.plot(
417
+ self.q0,
418
+ backend=self.backend,
419
+ fig=self.fig,
420
+ ax=self.ax,
421
+ block=False,
422
+ )
423
+
424
+ def step(self, t, inports):
425
+ if not self._enabled:
426
+ return
427
+
428
+ # update the robot plot
429
+ self.robot.q = inports[0]
430
+ self.env.step()
431
+
432
+ super().step(t, inports)
433
+
434
+
435
+ # ======================================================================== #
436
+
437
+
438
+ class JTraj(SourceBlock):
439
+ r"""
440
+ :blockname:`JTRAJ`
441
+
442
+ Joint-space trajectory
443
+
444
+ :inputs: 0
445
+ :outputs: 3
446
+ :states: 0
447
+
448
+ .. list-table::
449
+ :header-rows: 1
450
+
451
+ * - Port type
452
+ - Port number
453
+ - Types
454
+ - Description
455
+ * - Output
456
+ - 0
457
+ - ndarray
458
+ - :math:`q(s)`
459
+ * - Output
460
+ - 1
461
+ - ndarray
462
+ - :math:`\dot{q}(s)`
463
+ * - Output
464
+ - 2
465
+ - ndarray
466
+ - :math:`\ddot{q}(s)`
467
+
468
+ Outputs a joint space trajectory where the joint coordinates vary from ``q0`` to
469
+ ``qf`` over the course of the simulation. A quintic (5th order) polynomial is used
470
+ with default zero boundary conditions for velocity and acceleration.
471
+
472
+ :seealso: :func:`~roboticstoolbox.tools.trajectory.ctraj`
473
+ :func:`~roboticstoolbox.tools.trajectory.xplot`
474
+ :func:`~roboticstoolbox.tools.trajectory.jtraj`
475
+ """
476
+
477
+ nin = 0
478
+ nout = 3
479
+ outlabels = ("q", "qd", "qdd")
480
+
481
+ def __init__(self, q0, qf, qd0=None, qdf=None, T=None, **blockargs):
482
+ """
483
+
484
+ :param q0: initial joint coordinate
485
+ :type q0: array_like(n)
486
+ :param qf: final joint coordinate
487
+ :type qf: array_like(n)
488
+ :param T: time vector or number of steps, defaults to None
489
+ :type T: array_like or int, optional
490
+ :param qd0: initial velocity, defaults to None
491
+ :type qd0: array_like(n), optional
492
+ :param qdf: final velocity, defaults to None
493
+ :type qdf: array_like(n), optional
494
+ :param blockargs: |BlockOptions|
495
+ :type blockargs: dict
496
+ """
497
+ super().__init__(**blockargs)
498
+ self.outport_names(
499
+ (
500
+ "q",
501
+ "qd",
502
+ "qdd",
503
+ )
504
+ )
505
+
506
+ q0 = smb.getvector(q0)
507
+ qf = smb.getvector(qf)
508
+
509
+ if not len(q0) == len(qf):
510
+ raise ValueError("q0 and q1 must be same size")
511
+
512
+ if qd0 is None:
513
+ qd0 = np.zeros(q0.shape)
514
+ else:
515
+ qd0 = getvector(qd0)
516
+ if not len(qd0) == len(q0):
517
+ raise ValueError("qd0 has wrong size")
518
+ if qdf is None:
519
+ qdf = np.zeros(q0.shape)
520
+ else:
521
+ qd1 = getvector(qdf)
522
+ if not len(qd1) == len(q0):
523
+ raise ValueError("qd1 has wrong size")
524
+
525
+ self.q0 = q0
526
+ self.qf = qf
527
+ self.qd0 = qd0
528
+ self.qdf = qf
529
+
530
+ self.coeffs = None # indicate that coefficients have not been computed yet
531
+
532
+ self.T = T
533
+
534
+ def start(self, simstate):
535
+ if self.T is None:
536
+ # use simulation tmax
537
+ self.T = simstate.tf
538
+
539
+ tscal = self.T
540
+ self.tscal = tscal
541
+
542
+ q0 = self.q0
543
+ qf = self.qf
544
+ qd0 = self.qd0
545
+ qdf = self.qdf
546
+
547
+ # compute the polynomial coefficients
548
+ A = 6 * (qf - q0) - 3 * (qdf + qd0) * tscal
549
+ B = -15 * (qf - q0) + (8 * qd0 + 7 * qdf) * tscal
550
+ C = 10 * (qf - q0) - (6 * qd0 + 4 * qdf) * tscal
551
+ E = qd0 * tscal
552
+ F = q0
553
+
554
+ self.coeffs = np.array([A, B, C, np.zeros(A.shape), E, F])
555
+ self.dcoeffs = np.array(
556
+ [np.zeros(A.shape), 5 * A, 4 * B, 3 * C, np.zeros(A.shape), E]
557
+ )
558
+ self.ddcoeffs = np.array(
559
+ [
560
+ np.zeros(A.shape),
561
+ np.zeros(A.shape),
562
+ 20 * A,
563
+ 12 * B,
564
+ 6 * C,
565
+ np.zeros(A.shape),
566
+ ]
567
+ )
568
+
569
+ def output(self, t, inports, x):
570
+ if self.coeffs is None:
571
+ # called from compile before start() is called
572
+ n = len(self.q0)
573
+ return [np.zeros(n), np.zeros(n), np.zeros(n)]
574
+
575
+ tscal = self.tscal
576
+ ts = t / tscal
577
+ tt = np.array([ts**5, ts**4, ts**3, ts**2, ts, 1]).T
578
+
579
+ qt = tt @ self.coeffs
580
+
581
+ # compute velocity
582
+ qdt = tt @ self.dcoeffs / tscal
583
+
584
+ # compute acceleration
585
+ qddt = tt @ self.ddcoeffs / tscal**2
586
+
587
+ return [qt, qdt, qddt]
588
+
589
+
590
+ # ------------------------------------------------------------------------ #
591
+
592
+
593
+ class CTraj(SourceBlock):
594
+ r"""
595
+ :blockname:`CTRAJ`
596
+
597
+ Task space trajectory
598
+
599
+ :inputs: 0
600
+ :outputs: 1
601
+ :states: 0
602
+
603
+ .. list-table::
604
+ :header-rows: 1
605
+
606
+ * - Port type
607
+ - Port number
608
+ - Types
609
+ - Description
610
+ * - Output
611
+ - 0
612
+ - SE3
613
+ - :math:`\mathbf{T}(t)`
614
+
615
+ The block outputs a pose that varies smoothly from ``T1`` to ``T2`` over
616
+ the course of ``T`` seconds.
617
+
618
+ If ``T`` is not given it defaults to the simulation time.
619
+
620
+ If ``trapezoidal`` is True then a trapezoidal motion profile is used along the path
621
+ to provide initial acceleration and final deceleration. Otherwise,
622
+ motion is at constant velocity.
623
+
624
+ :seealso: :meth:`~spatialmath.pose3d.SE3.interp`
625
+ :func:`~roboticstoolbox.tools.trajectory.ctraj`
626
+ :func:`~roboticstoolbox.tools.trajectory.xplot`
627
+ :func:`~roboticstoolbox.tools.trajectory.jtraj`
628
+ """
629
+
630
+ nin = 0
631
+ nout = 1
632
+ outlabels = ("T",)
633
+
634
+ def __init__(self, T1, T2, T, trapezoidal=True, **blockargs):
635
+ """
636
+ :param T1: initial pose
637
+ :type T1: SE3
638
+ :param T2: final pose
639
+ :type T2: SE3
640
+ :param T: motion time
641
+ :type T: float
642
+ :param trapezoidal: Use LSPB motion profile along the path
643
+ :type trapezoidal: bool
644
+ :param blockargs: |BlockOptions|
645
+ :type blockargs: dict
646
+ """
647
+
648
+ # TODO
649
+ # flag to rotate the frame rather than just translate it
650
+ super().__init__(**blockargs)
651
+
652
+ self.T1 = T1
653
+ self.T2 = T2
654
+ self.T = T
655
+ self.trapezoidal = trapezoidal
656
+
657
+ def start(self, simstate):
658
+ if self.T is None:
659
+ self.T = simstate.T
660
+ if self.trapezoidal:
661
+ self.trapezoidalfunc = trapezoidal_func(0.0, 1.0, self.T)
662
+
663
+ def output(self, t, inports, x):
664
+ if self.trapezoidal:
665
+ s = self.trapezoidalfunc(t)
666
+ else:
667
+ s = np.min(t / self.T, 1.0)
668
+
669
+ return [self.T1.interp(self.T2, s)]
670
+
671
+
672
+ # ------------------------------------------------------------------------ #
673
+
674
+
675
+ class CirclePath(SourceBlock):
676
+ r"""
677
+ :blockname:`CIRCLEPATH`
678
+
679
+ Circular motion.
680
+
681
+ :inputs: 0 or 1
682
+ :outputs: 1
683
+ :states: 0
684
+
685
+ .. list-table::
686
+ :header-rows: 1
687
+
688
+ * - Port type
689
+ - Port number
690
+ - Types
691
+ - Description
692
+ * - Output
693
+ - 0
694
+ - ndarray(3) or SE3
695
+ - :math:`\mathit{p}(t)` or :math:`\mathbf{T}(t)`
696
+
697
+ The block outputs the coordinates of a point moving in a circle of
698
+ radius ``r`` centred at ``centre`` and parallel to the xy-plane.
699
+
700
+ By default the output is a 3-vector :math:`(x, y, z)` but if
701
+ ``pose`` is an ``SE3`` instance the output is a copy of that pose with
702
+ its translation set to the coordinate of the moving point. This is the
703
+ motion of a frame with fixed orientation following a circular path.
704
+ """
705
+
706
+ nin = 0
707
+ nout = 1
708
+
709
+ def __init__(
710
+ self,
711
+ radius: float = 1,
712
+ centre=(0, 0, 0),
713
+ pose=None,
714
+ frequency: float = 1,
715
+ unit: str = "rps",
716
+ phase: float | None = None,
717
+ **blockargs,
718
+ ):
719
+ """
720
+ :param radius: radius of circle, defaults to 1
721
+ :type radius: float
722
+ :param centre: center of circle, defaults to [0,0,0]
723
+ :type centre: array_like(3)
724
+ :param pose: SE3 pose of output, defaults to None
725
+ :type pose: SE3
726
+ :param frequency: rotational frequency, defaults to 1
727
+ :type frequency: float
728
+ :param unit: unit for frequency, one of: 'rps' [default], 'rad'
729
+ :type unit: str
730
+ :param phase: phase
731
+ :type phase: float
732
+ :param blockargs: |BlockOptions|
733
+ :type blockargs: dict
734
+ """
735
+ if phase is None:
736
+ phase = 0
737
+
738
+ # TODO
739
+ # flag to rotate the frame rather than just translate it
740
+ super().__init__(**blockargs)
741
+
742
+ if unit == "rps":
743
+ omega = frequency * 2 * pi
744
+ phase = phase * 2 * pi
745
+ elif unit == "rad":
746
+ omega = frequency
747
+
748
+ # Redundant assignment, commented for LGTM
749
+ # phase = phase
750
+ else:
751
+ raise ValueError("bad units: rps or rad")
752
+
753
+ self.radius = radius
754
+ assert len(centre) == 3, "centre must be a 3 vector"
755
+ self.centre = centre
756
+ self.pose = pose
757
+ self.omega = omega
758
+ self.phase = phase
759
+
760
+ self.outport_names(("y",))
761
+
762
+ def output(self, t, inports, x):
763
+ theta = t * self.omega + self.phase
764
+ x = self.radius * cos(theta) + self.centre[0]
765
+ y = self.radius * sin(theta) + self.centre[1]
766
+ p = (x, y, self.centre[2])
767
+
768
+ if self.pose is not None:
769
+ pp = SE3.Rt(self.pose.R, p)
770
+ p = pp
771
+
772
+ return [p]
773
+
774
+
775
+ class Trapezoidal(SourceBlock):
776
+ r"""
777
+ :blockname:`Trapezoidal`
778
+
779
+ Trapezoidal scalar trajectory
780
+
781
+ :inputs: 0
782
+ :outputs: 3
783
+ :states: 0
784
+
785
+ .. list-table::
786
+ :header-rows: 1
787
+
788
+ * - Port type
789
+ - Port number
790
+ - Types
791
+ - Description
792
+ * - Output
793
+ - 0
794
+ - float
795
+ - :math:`q(t)`
796
+ * - Output
797
+ - 1
798
+ - float
799
+ - :math:`\dot{q}(t)`
800
+ * - Output
801
+ - 2
802
+ - float
803
+ - :math:`\ddot{q}(t)`
804
+
805
+
806
+ Scalar trapezoidal trajectory that varies from ``q0`` to ``qf`` over the
807
+ simulation period.
808
+
809
+ :seealso: :func:`ctraj`, :func:`qplot`, :func:`~SerialLink.jtraj`
810
+ """
811
+
812
+ nin = 0
813
+ nout = 3
814
+ outlabels = ("q", "qd", "qdd")
815
+
816
+ # TODO: change name to Trapezoidal, check if used anywhere
817
+
818
+ def __init__(self, q0, qf, V=None, T=None, **blockargs):
819
+ """
820
+ Compute a joint-space trajectory
821
+
822
+ :param q0: initial joint coordinate
823
+ :type q0: float
824
+ :param qf: final joint coordinate
825
+ :type qf: float
826
+ :param T: maximum time, defaults to None
827
+ :type T: float, optional
828
+ :param blockargs: |BlockOptions|
829
+ :type blockargs: dict
830
+
831
+ If ``T`` is given the value ``qf`` is reached at this time. This can be
832
+ less or greater than the simulation time.
833
+ """
834
+ super().__init__(nout=3, **blockargs)
835
+ self.T = T
836
+ self.q0 = q0
837
+ self.qf = qf
838
+
839
+ def start(self, simstate):
840
+ if self.T is None:
841
+ self.T = simstate.T
842
+ self.trapezoidalfunc = trapezoidal_func(self.q0, self.qf, self.T)
843
+
844
+ def output(self, t, inports, x):
845
+ return list(self.trapezoidalfunc(t))
846
+
847
+
848
+ # ------------------------------------------------------------------------ #
849
+
850
+
851
+ class Traj(FunctionBlock):
852
+ r"""
853
+ :blockname:`TRAJ`
854
+
855
+ Vector trajectory
856
+
857
+ :inputs: 0 or 1
858
+ :outputs: 3
859
+ :states: 0
860
+
861
+ .. list-table::
862
+ :header-rows: 1
863
+
864
+ * - Port type
865
+ - Port number
866
+ - Types
867
+ - Description
868
+ * - Input
869
+ - 0
870
+ - float
871
+ - :math:`s \in [0, 1]` distance along trajectory.
872
+ * - Output
873
+ - 0
874
+ - ndarray
875
+ - :math:`y(s)`
876
+ * - Output
877
+ - 1
878
+ - ndarray
879
+ - :math:`\dot{y}(s)`
880
+ * - Output
881
+ - 2
882
+ - ndarray
883
+ - :math:`\ddot{y}(s)`
884
+
885
+ Generates a vector trajectory using a trapezoidal or quintic
886
+ polynomial profile that varies from ``y0`` to ``yf``
887
+
888
+ The distance along the trajectory is either:
889
+
890
+ - a linear function from 0 to ``T`` or maximum simulation time
891
+ - the value [0, 1] given on inport port.
892
+
893
+ :seealso: :func:`spatialmath.base.mtraj`
894
+ """
895
+
896
+ nin = -1
897
+ nout = 3
898
+ outlabels = ("q",)
899
+
900
+ # TODO: this needs work, need better description of what this does for
901
+ # time-based case
902
+
903
+ def __init__(self, y0=0, yf=1, T=None, time=False, traj="trapezoidal", **blockargs):
904
+ """
905
+ :param y0: initial value, defaults to 0
906
+ :type y0: array_like(m), optional
907
+ :param yf: final value, defaults to 1
908
+ :type yf: array_like(m), optional
909
+ :param T: maximum time, defaults to None
910
+ :type T: float, optional
911
+ :param time: x is simulation time, defaults to False
912
+ :type time: bool, optional
913
+ :param traj: trajectory type, one of: 'trapezoidal' [default], 'quintic'
914
+ :type traj: str, optional
915
+ :param blockargs: |BlockOptions|
916
+ :type blockargs: dict
917
+ """
918
+ self.time = time
919
+ if time:
920
+ # function of time in simulation
921
+ nin = 0
922
+ blockclass = "source"
923
+ else:
924
+ # function of input port
925
+ nin = 1
926
+ blockclass = "function"
927
+
928
+ super().__init__(nin=nin, blockclass=blockclass, **blockargs)
929
+
930
+ y0 = smb.getvector(y0)
931
+ yf = smb.getvector(yf)
932
+ assert len(y0) == len(yf), "y0 and yf must have same length"
933
+
934
+ self.y0 = y0
935
+ self.yf = yf
936
+ self.time = time
937
+ self.T = T
938
+ self.traj = traj
939
+
940
+ self.outport_names(("y", "yd", "ydd"))
941
+
942
+ def start(self, simstate):
943
+ # if self.time:
944
+ # assert self.x[0] <= 0, "interpolation not defined for t=0"
945
+ # assert self.x[-1] >= simstate.T, "interpolation not defined for t=T"
946
+
947
+ if self.traj == "trapezoidal":
948
+ trajfunc = trapezoidal_func
949
+ elif self.traj == "quintic":
950
+ trajfunc = quintic_func
951
+
952
+ self.trajfuncs = []
953
+
954
+ if self.time:
955
+ # time based
956
+ if self.T is not None:
957
+ xmax = self.T
958
+ else:
959
+ xmax = simstate.T
960
+ else:
961
+ # input based
962
+ xmax = 1
963
+ self.xmax = xmax
964
+
965
+ for i in range(len(self.y0)):
966
+ self.trajfuncs.append(trajfunc(self.y0[i], self.yf[i], xmax))
967
+
968
+ def output(self, t, inports, x):
969
+ if not self.time:
970
+ t = inports[0]
971
+
972
+ assert t >= 0, "interpolation not defined for x<0"
973
+ assert t <= self.xmax, "interpolation not defined for x>" + str(self.xmax)
974
+
975
+ out = []
976
+ for i in range(len(self.y0)):
977
+ out.append(self.trajfuncs[i](t))
978
+
979
+ # we have a list of tuples out[i][j]
980
+ # i is the timestep, j is y/yd/ydd
981
+ y = [o[0] for o in out]
982
+ yd = [o[1] for o in out]
983
+ ydd = [o[2] for o in out]
984
+
985
+ return [np.hstack(y), np.hstack(yd), np.hstack(ydd)]
986
+
987
+
988
+ # ======================================================================== #
989
+
990
+
991
+ class IDyn(FunctionBlock):
992
+ r"""
993
+ :blockname:`IDYN`
994
+
995
+ Robot arm forward dynamics model.
996
+
997
+ :inputs: 3
998
+ :outputs: 1
999
+ :states: 0
1000
+
1001
+ .. list-table::
1002
+ :header-rows: 1
1003
+
1004
+ * - Port type
1005
+ - Port number
1006
+ - Types
1007
+ - Description
1008
+ * - Input
1009
+ - 0
1010
+ - ndarray(N)
1011
+ - :math:`\mathit{q}`, joint configuration
1012
+ * - Input
1013
+ - 1
1014
+ - ndarray(N)
1015
+ - :math:`\dot{\mathit{q}}`, joint velocity
1016
+ * - Input
1017
+ - 2
1018
+ - ndarray(N)
1019
+ - :math:`\ddot{\mathit{q}}`, joint acceleration
1020
+ * - Output
1021
+ - 0
1022
+ - ndarray(N)
1023
+ - :math:`\mathit{Q}`, generalized joint force
1024
+
1025
+ Compute the generalized joint torques required to achieve the input joint
1026
+ configuration, velocity and acceleration. This uses the recursive Newton-Euler
1027
+ (RNE) algorithm.
1028
+
1029
+ .. todo:: end-effector wrench input, base wrench output, payload input
1030
+
1031
+ :seealso: :meth:`~roboticstoolbox.robot.Robot.Robot.rne`
1032
+ """
1033
+
1034
+ nin = 3
1035
+ nout = 1
1036
+ inlabels = ("q", "qd", "qdd")
1037
+ outlabels = "τ"
1038
+
1039
+ def __init__(self, robot, gravity=None, **blockargs):
1040
+ """
1041
+ :param robot: Robot model
1042
+ :type robot: Robot subclass
1043
+ :param gravity: gravitational acceleration
1044
+ :type gravity: float
1045
+ :param blockargs: |BlockOptions|
1046
+ :type blockargs: dict
1047
+ """
1048
+ if robot is None:
1049
+ raise ValueError("robot is not defined")
1050
+
1051
+ super().__init__(**blockargs)
1052
+ # self.type = "inverse-dynamics"
1053
+
1054
+ self.robot = robot
1055
+ self.gravity = gravity
1056
+
1057
+ # state vector is [q qd]
1058
+
1059
+ self.inport_names(("q", "qd", "qdd"))
1060
+ self.outport_names(("$\tau$",))
1061
+
1062
+ def output(self, t, inports, x):
1063
+ tau = self.robot.rne(inports[0], inports[1], inports[2], gravity=self.gravity)
1064
+ return [tau]
1065
+
1066
+
1067
+ # ------------------------------------------------------------------------ #
1068
+
1069
+
1070
+ class Gravload(FunctionBlock):
1071
+ r"""
1072
+ :blockname:`GRAVLOAD`
1073
+
1074
+ Robot arm gravity load.
1075
+
1076
+ :inputs: 1
1077
+ :outputs: 1
1078
+ :states: 0
1079
+
1080
+ .. list-table::
1081
+ :header-rows: 1
1082
+
1083
+ * - Port type
1084
+ - Port number
1085
+ - Types
1086
+ - Description
1087
+ * - Input
1088
+ - 0
1089
+ - ndarray(N)
1090
+ - :math:`\mathit{q}`, joint configuration
1091
+ * - Output
1092
+ - 0
1093
+ - ndarray(N)
1094
+ - :math:`\mathit{g}`, generalized joint force
1095
+
1096
+ Compute generalized joint forces due to gravity for the input joint
1097
+ configuration.
1098
+
1099
+ :seealso: :meth:`~roboticstoolbox.robot.Robot.Robot.gravload`
1100
+ """
1101
+
1102
+ nin = 1
1103
+ nout = 1
1104
+ inlabels = ("q",)
1105
+ outlabels = "τ"
1106
+
1107
+ def __init__(self, robot, gravity=None, **blockargs):
1108
+ """
1109
+ :param robot: Robot model
1110
+ :type robot: Robot subclass
1111
+ :param gravity: gravitational acceleration
1112
+ :type gravity: float
1113
+ :param blockargs: |BlockOptions|
1114
+ :type blockargs: dict
1115
+ """
1116
+ if robot is None:
1117
+ raise ValueError("robot is not defined")
1118
+
1119
+ super().__init__(**blockargs)
1120
+ # self.type = "gravload"
1121
+
1122
+ self.robot = robot
1123
+ self.gravity = gravity
1124
+ self.inport_names(("q",))
1125
+ self.outport_names(("$\tau$",))
1126
+
1127
+ def output(self, t, inports, x):
1128
+ tau = self.robot.gravload(inports[0], gravity=self.gravity)
1129
+ return [tau]
1130
+
1131
+
1132
+ class Gravload_X(FunctionBlock):
1133
+ r"""
1134
+ :blockname:`GRAVLOAD_X`
1135
+
1136
+ Task-space robot arm gravity wrench.
1137
+
1138
+ :inputs: 1
1139
+ :outputs: 1
1140
+ :states: 0
1141
+
1142
+ .. list-table::
1143
+ :header-rows: 1
1144
+
1145
+ * - Port type
1146
+ - Port number
1147
+ - Types
1148
+ - Description
1149
+ * - Input
1150
+ - 0
1151
+ - ndarray(6)
1152
+ - :math:`\mathit{x}`, end-effector pose
1153
+ * - Output
1154
+ - 0
1155
+ - ndarray(6)
1156
+ - :math:`\mathit{g}_x`, generalized joint force
1157
+
1158
+ Compute end-effector wrench due to gravity for the input end-effector pose.
1159
+
1160
+ :seealso: :meth:`~roboticstoolbox.robot.Robot.Robot.gravload_x`
1161
+ :meth:`~roboticstoolbox.robot.Robot.Robot.gravload`
1162
+ """
1163
+
1164
+ nin = 1
1165
+ nout = 1
1166
+ inlabels = ("q",)
1167
+ outlabels = "w"
1168
+
1169
+ def __init__(self, robot, representation="rpy/xyz", gravity=None, **blockargs):
1170
+ """
1171
+ :param robot: Robot model
1172
+ :type robot: Robot subclass
1173
+ :param representation: task-space representation, defaults to "rpy/xyz"
1174
+ :type representation: str
1175
+ :param gravity: gravitational acceleration
1176
+ :type gravity: float
1177
+ :param blockargs: |BlockOptions|
1178
+ :type blockargs: dict
1179
+ """
1180
+ if robot is None:
1181
+ raise ValueError("robot is not defined")
1182
+
1183
+ super().__init__(**blockargs)
1184
+ # self.type = "gravload-x"
1185
+
1186
+ self.robot = robot
1187
+ self.gravity = gravity
1188
+ self.inport_names(("q",))
1189
+ self.outport_names(("$\tau$",))
1190
+ self.representation = representation
1191
+
1192
+ def output(self, t, inports, x):
1193
+ q = inports[0]
1194
+ w = self.robot.gravload_x(
1195
+ q, representation=self.representation, gravity=self.gravity
1196
+ )
1197
+ return [w]
1198
+
1199
+
1200
+ # ------------------------------------------------------------------------ #
1201
+
1202
+
1203
+ class Inertia(FunctionBlock):
1204
+ r"""
1205
+ :blockname:`INERTIA`
1206
+
1207
+ Robot arm inertia matrix.
1208
+
1209
+ :inputs: 1 [ndarray(N)]
1210
+ :outputs: 3 [ndarray(N,N)]
1211
+ :states: 0
1212
+
1213
+ :inputs: 1
1214
+ :outputs: 1
1215
+ :states: 0
1216
+
1217
+ .. list-table::
1218
+ :header-rows: 1
1219
+
1220
+ * - Port type
1221
+ - Port number
1222
+ - Types
1223
+ - Description
1224
+ * - Input
1225
+ - 0
1226
+ - ndarray
1227
+ - :math:`\mathit{q}`, joint configuration
1228
+ * - Output
1229
+ - 0
1230
+ - ndarray(N,N)
1231
+ - :math:`\mathbf{M}`, mass matrix
1232
+
1233
+ Joint-space inertia matrix (mass matrix) as a function of joint configuration.
1234
+
1235
+ :seealso: :meth:`~roboticstoolbox.robot.Robot.Robot.inertia`
1236
+ """
1237
+
1238
+ nin = 1
1239
+ nout = 1
1240
+ inlabels = ("q",)
1241
+ outlabels = "M"
1242
+
1243
+ def __init__(self, robot, **blockargs):
1244
+ """
1245
+ :param robot: Robot model
1246
+ :type robot: Robot subclass
1247
+ :param blockargs: |BlockOptions|
1248
+ :type blockargs: dict
1249
+ """
1250
+ if robot is None:
1251
+ raise ValueError("robot is not defined")
1252
+
1253
+ super().__init__(**blockargs)
1254
+ # self.type = "inertia"
1255
+
1256
+ self.robot = robot
1257
+ self.inport_names(("q",))
1258
+ self.outport_names(("M",))
1259
+
1260
+ def output(self, t, inports, x):
1261
+ q = inports[0]
1262
+ M = self.robot.inertia(q)
1263
+ return [M]
1264
+
1265
+
1266
+ # ------------------------------------------------------------------------ #
1267
+
1268
+
1269
+ class Inertia_X(FunctionBlock):
1270
+ r"""
1271
+ :blockname:`INERTIA_X`
1272
+
1273
+ Task-space robot arm inertia matrix.
1274
+
1275
+ :inputs: 1
1276
+ :outputs: 1
1277
+ :states: 0
1278
+
1279
+ .. list-table::
1280
+ :header-rows: 1
1281
+
1282
+ * - Port type
1283
+ - Port number
1284
+ - Types
1285
+ - Description
1286
+ * - Input
1287
+ - 0
1288
+ - ndarray(6)
1289
+ - :math:`\mathit{x}`, end-effector pose
1290
+ * - Output
1291
+ - 0
1292
+ - ndarray(6,6)
1293
+ - :math:`\mathbf{M_x}`, task-space mass matrix
1294
+
1295
+ Task-space inertia matrix as a function of end-effector pose.
1296
+
1297
+ :seealso: :meth:`~roboticstoolbox.robot.Robot.Robot.inertia_x`
1298
+ """
1299
+
1300
+ nin = 1
1301
+ nout = 1
1302
+ inlabels = ("q",)
1303
+ outlabels = "M"
1304
+
1305
+ def __init__(self, robot, representation="rpy/xyz", pinv=False, **blockargs):
1306
+ """
1307
+ :param robot: Robot model
1308
+ :type robot: Robot subclass
1309
+ :param representation: task-space representation, defaults to "rpy/xyz"
1310
+ :type representation: str
1311
+ :param blockargs: |BlockOptions|
1312
+ :type blockargs: dict
1313
+ """
1314
+ if robot is None:
1315
+ raise ValueError("robot is not defined")
1316
+
1317
+ super().__init__(**blockargs)
1318
+ # self.type = "inertia-x"
1319
+
1320
+ self.robot = robot
1321
+ self.representation = representation
1322
+ self.pinv = pinv
1323
+ self.inport_names(("q",))
1324
+ self.outport_names(("M",))
1325
+
1326
+ def output(self, t, inports, x):
1327
+ q = inports[0]
1328
+ Mx = self.robot.inertia_x(q, pinv=self.pinv, representation=self.representation)
1329
+ return [Mx]
1330
+
1331
+
1332
+ # ------------------------------------------------------------------------ #
1333
+
1334
+
1335
+ class FDyn(ContinuousBlock):
1336
+ r"""
1337
+ :blockname:`FDYN`
1338
+
1339
+ Robot arm forward dynamics.
1340
+
1341
+ :inputs: 1
1342
+ :outputs: 3
1343
+ :states: 2N
1344
+
1345
+ .. list-table::
1346
+ :header-rows: 1
1347
+
1348
+ * - Port type
1349
+ - Port number
1350
+ - Types
1351
+ - Description
1352
+ * - Input
1353
+ - 0
1354
+ - ndarray(N)
1355
+ - :math:`\mathit{Q}`, generalized joint force
1356
+ * - Output
1357
+ - 0
1358
+ - ndarray(N)
1359
+ - :math:`\mathit{q}`, joint configuration
1360
+ * - Output
1361
+ - 1
1362
+ - ndarray(N)
1363
+ - :math:`\dot{\mathit{q}}`, joint velocity
1364
+ * - Output
1365
+ - 2
1366
+ - ndarray(N)
1367
+ - :math:`\ddot{\mathit{q}}`, joint acceleration
1368
+
1369
+ Compute the manipulator arm forward dynamics in joint space, the joint acceleration
1370
+ for the input configuration and applied joint forces. The acceleration is
1371
+ integrated to obtain joint velocity and joint configuration.
1372
+
1373
+ :seealso: :meth:`~roboticstoolbox.robot.Robot.Robot.fdyn`
1374
+ """
1375
+
1376
+ nin = 1
1377
+ nout = 3
1378
+ outlabels = ("q", "qd", "qdd")
1379
+ inlabels = "τ"
1380
+
1381
+ def __init__(self, robot, q0=None, **blockargs):
1382
+ """
1383
+ :param robot: Robot model
1384
+ :type robot: Robot subclass
1385
+ :param q0: Initial joint configuration
1386
+ :type q0: array_like(n)
1387
+ :param blockargs: |BlockOptions|
1388
+ :type blockargs: dict
1389
+ """
1390
+ if robot is None:
1391
+ raise ValueError("robot is not defined")
1392
+
1393
+ super().__init__(**blockargs)
1394
+ # self.type = "forward-dynamics"
1395
+
1396
+ self.robot = robot
1397
+ self.nstates = robot.n * 2
1398
+
1399
+ # state vector is [q qd]
1400
+
1401
+ self.inport_names(("$\tau$",))
1402
+ self.outport_names(("q", "qd", "qdd"))
1403
+
1404
+ if q0 is None:
1405
+ q0 = np.zeros((robot.n,))
1406
+ else:
1407
+ q0 = smb.getvector(q0, robot.n)
1408
+ self._x0 = np.r_[q0, np.zeros((robot.n,))]
1409
+ self._qdd = None
1410
+
1411
+ def output(self, t, inports, x):
1412
+ n = self.robot.n
1413
+ q = x[:n]
1414
+ qd = x[n:]
1415
+ qdd = self._qdd # from last deriv
1416
+ return [q, qd, qdd]
1417
+
1418
+ def deriv(self, t, inports, x):
1419
+ # return [qd qdd]
1420
+ Q = inports[0]
1421
+ n = self.robot.n
1422
+ assert len(Q) == n, "torque vector wrong size"
1423
+
1424
+ q = x[:n]
1425
+ qd = x[n:]
1426
+ qdd = self.robot.accel(q, qd, Q)
1427
+ self._qdd = qdd
1428
+ return np.r_[qd, qdd]
1429
+
1430
+
1431
+ # ------------------------------------------------------------------------ #
1432
+
1433
+
1434
+ class FDyn_X(ContinuousBlock):
1435
+ r"""
1436
+ :blockname:`FDYN_X`
1437
+
1438
+ Task-space robot arm forward dynamics.
1439
+
1440
+ :inputs: 1
1441
+ :outputs: 3
1442
+ :states: 12
1443
+
1444
+ .. list-table::
1445
+ :header-rows: 1
1446
+
1447
+ * - Port type
1448
+ - Port number
1449
+ - Types
1450
+ - Description
1451
+ * - Input
1452
+ - 0
1453
+ - ndarray(6)
1454
+ - :math:`\mathit{\tau}`, end-effector wrench
1455
+ * - Output
1456
+ - 0
1457
+ - ndarray(6)
1458
+ - :math:`\mathit{x}`, end-effector pose
1459
+ * - Output
1460
+ - 1
1461
+ - ndarray(6)
1462
+ - :math:`\dot{\mathit{x}}`, end-effector velocity
1463
+ * - Output
1464
+ - 2
1465
+ - ndarray(6)
1466
+ - :math:`\dot{\mathit{x}}``, end-effector acceleration
1467
+
1468
+ Compute the manipulator arm forward dynamics in task space, the end-effector
1469
+ acceleration for the input end-effector pose and applied end-effector wrench. The
1470
+ acceleration is integrated to obtain task-space velocity and task-space pose.
1471
+
1472
+ :seealso: :meth:`~roboticstoolbox.robot.Robot.Robot.fdyn_x`
1473
+ """
1474
+
1475
+ nin = 1
1476
+ nout = 5
1477
+ outlabels = ("q", "qd", "x", "xd", "xdd")
1478
+ inlabels = "w"
1479
+
1480
+ def __init__(
1481
+ self,
1482
+ robot,
1483
+ q0=None,
1484
+ gravcomp=False,
1485
+ velcomp=False,
1486
+ representation="rpy/xyz",
1487
+ **blockargs,
1488
+ ):
1489
+ """
1490
+ :param robot: Robot model
1491
+ :type robot: Robot subclass
1492
+ :param q0: Initial joint configuration
1493
+ :type q0: array_like(n)
1494
+ :param gravcomp: perform gravity compensation
1495
+ :type gravcomp: bool
1496
+ :param velcomp: perform velocity term compensation
1497
+ :type velcomp: bool
1498
+ :param representation: task-space representation, defaults to "rpy/xyz"
1499
+ :type representation: str
1500
+
1501
+ :param blockargs: |BlockOptions|
1502
+ :type blockargs: dict
1503
+ """
1504
+ if robot is None:
1505
+ raise ValueError("robot is not defined")
1506
+
1507
+ super().__init__(**blockargs)
1508
+ # self.type = "forward-dynamics-x"
1509
+
1510
+ self.robot = robot
1511
+ self.nstates = robot.n * 2
1512
+ self.gravcomp = gravcomp
1513
+ self.velcomp = velcomp
1514
+ self.representation = representation
1515
+
1516
+ # state vector is [q qd]
1517
+
1518
+ self.inport_names(("w",))
1519
+ self.outport_names(("q", "qd", "x", "xd", "xdd"))
1520
+
1521
+ if q0 is None:
1522
+ q0 = np.zeros((robot.n,))
1523
+ else:
1524
+ q0 = smb.getvector(q0, robot.n)
1525
+ # append qd0, assumed to be zero
1526
+ self._x0 = np.r_[q0, np.zeros((robot.n,))]
1527
+ self._qdd = None
1528
+
1529
+ def output(self, t, inports, x):
1530
+ n = self.robot.n
1531
+ q = x[:n]
1532
+ qd = x[n:]
1533
+ qdd = self._qdd # from last deriv
1534
+
1535
+ T = self.robot.fkine(q)
1536
+ x = smb.tr2x(T.A)
1537
+
1538
+ Ja = self.robot.jacob0_analytical(q, self.representation)
1539
+ xd = Ja @ qd
1540
+ # print(q)
1541
+ # print(qd)
1542
+ # print(xd)
1543
+ # print(Ja)
1544
+ # print()
1545
+
1546
+ if qdd is None:
1547
+ xdd = None
1548
+ else:
1549
+ Ja_dot = self.robot.jacob0_dot(q, qd, J0=Ja)
1550
+ xdd = Ja @ qdd + Ja_dot @ qd
1551
+
1552
+ return [q, qd, x, xd, xdd]
1553
+
1554
+ def deriv(self, t, inports, x):
1555
+ # return [qd qdd]
1556
+
1557
+ # get current joint space state
1558
+ n = self.robot.n
1559
+ q = x[:n]
1560
+ qd = x[n:]
1561
+
1562
+ # compute joint forces
1563
+ w = inports[0]
1564
+ assert len(w) == 6, "wrench vector wrong size"
1565
+ Q = self.robot.jacob0_analytical(q, representation=self.representation).T @ w
1566
+
1567
+ if self.gravcomp or self.velcomp:
1568
+ if self.velcomp:
1569
+ qd_rne = qd
1570
+ else:
1571
+ qd_rne = np.zeros((n,))
1572
+ Q_rne = self.robot.rne(q, qd_rne, np.zeros((n,)))
1573
+ Q += Q_rne
1574
+ qdd = self.robot.accel(q, qd, Q)
1575
+
1576
+ self._qdd = qdd
1577
+ return np.r_[qd, qdd]
1578
+
1579
+
1580
+ if __name__ == "__main__":
1581
+ from pathlib import Path
1582
+
1583
+ exec(
1584
+ open(
1585
+ Path(__file__).parent.parent.parent.absolute() / "tests" / "test_blocks.py"
1586
+ ).read()
1587
+ )