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.
- roboticstoolbox/__init__.py +104 -0
- roboticstoolbox/backends/Connector.py +107 -0
- roboticstoolbox/backends/Dynamixel/README.md +9 -0
- roboticstoolbox/backends/Dynamixel/dynamixel.json +581 -0
- roboticstoolbox/backends/Dynamixel/dynamixel_io.py +450 -0
- roboticstoolbox/backends/Dynamixel/dynamixel_sdk/LICENSE +201 -0
- roboticstoolbox/backends/Dynamixel/dynamixel_sdk/README.md +28 -0
- roboticstoolbox/backends/Dynamixel/dynamixel_sdk/ReleaseNote.md +181 -0
- roboticstoolbox/backends/Dynamixel/dynamixel_sdk/__init__.py +27 -0
- roboticstoolbox/backends/Dynamixel/dynamixel_sdk/group_bulk_read.py +163 -0
- roboticstoolbox/backends/Dynamixel/dynamixel_sdk/group_bulk_write.py +109 -0
- roboticstoolbox/backends/Dynamixel/dynamixel_sdk/group_sync_read.py +166 -0
- roboticstoolbox/backends/Dynamixel/dynamixel_sdk/group_sync_write.py +99 -0
- roboticstoolbox/backends/Dynamixel/dynamixel_sdk/packet_handler.py +33 -0
- roboticstoolbox/backends/Dynamixel/dynamixel_sdk/port_handler.py +155 -0
- roboticstoolbox/backends/Dynamixel/dynamixel_sdk/protocol1_packet_handler.py +548 -0
- roboticstoolbox/backends/Dynamixel/dynamixel_sdk/protocol2_packet_handler.py +1080 -0
- roboticstoolbox/backends/Dynamixel/dynamixel_sdk/robotis_def.py +75 -0
- roboticstoolbox/backends/Dynamixel/dyndata.py +121 -0
- roboticstoolbox/backends/PyPlot/EllipsePlot.py +253 -0
- roboticstoolbox/backends/PyPlot/PyPlot.py +769 -0
- roboticstoolbox/backends/PyPlot/PyPlot2.py +526 -0
- roboticstoolbox/backends/PyPlot/README.md +67 -0
- roboticstoolbox/backends/PyPlot/RobotPlot.py +247 -0
- roboticstoolbox/backends/PyPlot/RobotPlot2.py +123 -0
- roboticstoolbox/backends/PyPlot/__init__.py +4 -0
- roboticstoolbox/backends/ROS/ROS.py +129 -0
- roboticstoolbox/backends/ROS/__init__.py +3 -0
- roboticstoolbox/backends/__init__.py +39 -0
- roboticstoolbox/backends/swift/__init__.py +26 -0
- roboticstoolbox/bin/__init__.py +0 -0
- roboticstoolbox/bin/rtbtool.py +307 -0
- roboticstoolbox/blocks/Icons/250x250/armplot.png +0 -0
- roboticstoolbox/blocks/Icons/250x250/bicycle.png +0 -0
- roboticstoolbox/blocks/Icons/250x250/camera.png +0 -0
- roboticstoolbox/blocks/Icons/250x250/circlepath.png +0 -0
- roboticstoolbox/blocks/Icons/250x250/coriolis.png +0 -0
- roboticstoolbox/blocks/Icons/250x250/ctraj.png +0 -0
- roboticstoolbox/blocks/Icons/250x250/delta2tr.png +0 -0
- roboticstoolbox/blocks/Icons/250x250/diffsteer.png +0 -0
- roboticstoolbox/blocks/Icons/250x250/fdyn.png +0 -0
- roboticstoolbox/blocks/Icons/250x250/fdynx.png +0 -0
- roboticstoolbox/blocks/Icons/250x250/fkine.png +0 -0
- roboticstoolbox/blocks/Icons/250x250/gravload.png +0 -0
- roboticstoolbox/blocks/Icons/250x250/idyn.png +0 -0
- roboticstoolbox/blocks/Icons/250x250/idynx.png +0 -0
- roboticstoolbox/blocks/Icons/250x250/ikine.png +0 -0
- roboticstoolbox/blocks/Icons/250x250/inertia.png +0 -0
- roboticstoolbox/blocks/Icons/250x250/jacobian.png +0 -0
- roboticstoolbox/blocks/Icons/250x250/jtraj.png +0 -0
- roboticstoolbox/blocks/Icons/250x250/lspb.png +0 -0
- roboticstoolbox/blocks/Icons/250x250/multirotor.png +0 -0
- roboticstoolbox/blocks/Icons/250x250/multirotormixer.png +0 -0
- roboticstoolbox/blocks/Icons/250x250/multirotorplot.png +0 -0
- roboticstoolbox/blocks/Icons/250x250/point2tr.png +0 -0
- roboticstoolbox/blocks/Icons/250x250/tr2delta.png +0 -0
- roboticstoolbox/blocks/Icons/250x250/tr2t.png +0 -0
- roboticstoolbox/blocks/Icons/250x250/unicycle.png +0 -0
- roboticstoolbox/blocks/Icons/250x250/vehicleplot.png +0 -0
- roboticstoolbox/blocks/Icons/50x50/armplot.png +0 -0
- roboticstoolbox/blocks/Icons/50x50/bicycle.png +0 -0
- roboticstoolbox/blocks/Icons/50x50/camera.png +0 -0
- roboticstoolbox/blocks/Icons/50x50/circlepath.png +0 -0
- roboticstoolbox/blocks/Icons/50x50/coriolis.png +0 -0
- roboticstoolbox/blocks/Icons/50x50/delta2tr.png +0 -0
- roboticstoolbox/blocks/Icons/50x50/diffsteer.png +0 -0
- roboticstoolbox/blocks/Icons/50x50/fdyn.png +0 -0
- roboticstoolbox/blocks/Icons/50x50/fdynx.png +0 -0
- roboticstoolbox/blocks/Icons/50x50/fkine.png +0 -0
- roboticstoolbox/blocks/Icons/50x50/gravload.png +0 -0
- roboticstoolbox/blocks/Icons/50x50/idyn.png +0 -0
- roboticstoolbox/blocks/Icons/50x50/idynx.png +0 -0
- roboticstoolbox/blocks/Icons/50x50/ikine.png +0 -0
- roboticstoolbox/blocks/Icons/50x50/inertia.png +0 -0
- roboticstoolbox/blocks/Icons/50x50/jacobian.png +0 -0
- roboticstoolbox/blocks/Icons/50x50/jtraj.png +0 -0
- roboticstoolbox/blocks/Icons/50x50/lspb.png +0 -0
- roboticstoolbox/blocks/Icons/50x50/multirotor.png +0 -0
- roboticstoolbox/blocks/Icons/50x50/multirotormixer.png +0 -0
- roboticstoolbox/blocks/Icons/50x50/multirotorplot.png +0 -0
- roboticstoolbox/blocks/Icons/50x50/point2tr.png +0 -0
- roboticstoolbox/blocks/Icons/50x50/tr2delta.png +0 -0
- roboticstoolbox/blocks/Icons/50x50/tr2t.png +0 -0
- roboticstoolbox/blocks/Icons/50x50/unicycle.png +0 -0
- roboticstoolbox/blocks/Icons/50x50/vehicleplot.png +0 -0
- roboticstoolbox/blocks/Icons/armplot.png +0 -0
- roboticstoolbox/blocks/Icons/bicycle.png +0 -0
- roboticstoolbox/blocks/Icons/camera.png +0 -0
- roboticstoolbox/blocks/Icons/circlepath.png +0 -0
- roboticstoolbox/blocks/Icons/coriolis.png +0 -0
- roboticstoolbox/blocks/Icons/ctraj.png +0 -0
- roboticstoolbox/blocks/Icons/delta2tr.png +0 -0
- roboticstoolbox/blocks/Icons/diffsteer.png +0 -0
- roboticstoolbox/blocks/Icons/fdyn.png +0 -0
- roboticstoolbox/blocks/Icons/fdynx.png +0 -0
- roboticstoolbox/blocks/Icons/fkine.png +0 -0
- roboticstoolbox/blocks/Icons/gravload.png +0 -0
- roboticstoolbox/blocks/Icons/idyn.png +0 -0
- roboticstoolbox/blocks/Icons/idynx.png +0 -0
- roboticstoolbox/blocks/Icons/ikine.png +0 -0
- roboticstoolbox/blocks/Icons/inertia.png +0 -0
- roboticstoolbox/blocks/Icons/jacobian.png +0 -0
- roboticstoolbox/blocks/Icons/jtraj.png +0 -0
- roboticstoolbox/blocks/Icons/lspb.png +0 -0
- roboticstoolbox/blocks/Icons/multirotor.png +0 -0
- roboticstoolbox/blocks/Icons/multirotormixer.png +0 -0
- roboticstoolbox/blocks/Icons/multirotorplot.png +0 -0
- roboticstoolbox/blocks/Icons/point2tr.png +0 -0
- roboticstoolbox/blocks/Icons/tr2delta.png +0 -0
- roboticstoolbox/blocks/Icons/tr2t.png +0 -0
- roboticstoolbox/blocks/Icons/unicycle.png +0 -0
- roboticstoolbox/blocks/Icons/vehicleplot.png +0 -0
- roboticstoolbox/blocks/README.md +43 -0
- roboticstoolbox/blocks/__init__.py +6 -0
- roboticstoolbox/blocks/arm.py +1587 -0
- roboticstoolbox/blocks/mobile.py +500 -0
- roboticstoolbox/blocks/quad_model.py +132 -0
- roboticstoolbox/blocks/spatial.py +245 -0
- roboticstoolbox/blocks/uav.py +949 -0
- roboticstoolbox/core/Eigen/Cholesky +45 -0
- roboticstoolbox/core/Eigen/CholmodSupport +48 -0
- roboticstoolbox/core/Eigen/Core +384 -0
- roboticstoolbox/core/Eigen/Dense +7 -0
- roboticstoolbox/core/Eigen/Eigen +2 -0
- roboticstoolbox/core/Eigen/Eigenvalues +60 -0
- roboticstoolbox/core/Eigen/Geometry +59 -0
- roboticstoolbox/core/Eigen/Householder +29 -0
- roboticstoolbox/core/Eigen/IterativeLinearSolvers +48 -0
- roboticstoolbox/core/Eigen/Jacobi +32 -0
- roboticstoolbox/core/Eigen/KLUSupport +41 -0
- roboticstoolbox/core/Eigen/LU +47 -0
- roboticstoolbox/core/Eigen/MetisSupport +35 -0
- roboticstoolbox/core/Eigen/OrderingMethods +70 -0
- roboticstoolbox/core/Eigen/PaStiXSupport +49 -0
- roboticstoolbox/core/Eigen/PardisoSupport +35 -0
- roboticstoolbox/core/Eigen/QR +50 -0
- roboticstoolbox/core/Eigen/QtAlignedMalloc +39 -0
- roboticstoolbox/core/Eigen/SPQRSupport +34 -0
- roboticstoolbox/core/Eigen/SVD +50 -0
- roboticstoolbox/core/Eigen/Sparse +34 -0
- roboticstoolbox/core/Eigen/SparseCholesky +37 -0
- roboticstoolbox/core/Eigen/SparseCore +69 -0
- roboticstoolbox/core/Eigen/SparseLU +50 -0
- roboticstoolbox/core/Eigen/SparseQR +36 -0
- roboticstoolbox/core/Eigen/StdDeque +27 -0
- roboticstoolbox/core/Eigen/StdList +26 -0
- roboticstoolbox/core/Eigen/StdVector +27 -0
- roboticstoolbox/core/Eigen/SuperLUSupport +64 -0
- roboticstoolbox/core/Eigen/UmfPackSupport +40 -0
- roboticstoolbox/core/Eigen/src/Cholesky/LDLT.h +688 -0
- roboticstoolbox/core/Eigen/src/Cholesky/LLT.h +558 -0
- roboticstoolbox/core/Eigen/src/Cholesky/LLT_LAPACKE.h +99 -0
- roboticstoolbox/core/Eigen/src/CholmodSupport/CholmodSupport.h +682 -0
- roboticstoolbox/core/Eigen/src/Core/ArithmeticSequence.h +413 -0
- roboticstoolbox/core/Eigen/src/Core/Array.h +417 -0
- roboticstoolbox/core/Eigen/src/Core/ArrayBase.h +226 -0
- roboticstoolbox/core/Eigen/src/Core/ArrayWrapper.h +209 -0
- roboticstoolbox/core/Eigen/src/Core/Assign.h +90 -0
- roboticstoolbox/core/Eigen/src/Core/AssignEvaluator.h +1010 -0
- roboticstoolbox/core/Eigen/src/Core/Assign_MKL.h +178 -0
- roboticstoolbox/core/Eigen/src/Core/BandMatrix.h +353 -0
- roboticstoolbox/core/Eigen/src/Core/Block.h +448 -0
- roboticstoolbox/core/Eigen/src/Core/BooleanRedux.h +162 -0
- roboticstoolbox/core/Eigen/src/Core/CommaInitializer.h +164 -0
- roboticstoolbox/core/Eigen/src/Core/ConditionEstimator.h +175 -0
- roboticstoolbox/core/Eigen/src/Core/CoreEvaluators.h +1741 -0
- roboticstoolbox/core/Eigen/src/Core/CoreIterators.h +132 -0
- roboticstoolbox/core/Eigen/src/Core/CwiseBinaryOp.h +183 -0
- roboticstoolbox/core/Eigen/src/Core/CwiseNullaryOp.h +1001 -0
- roboticstoolbox/core/Eigen/src/Core/CwiseTernaryOp.h +197 -0
- roboticstoolbox/core/Eigen/src/Core/CwiseUnaryOp.h +103 -0
- roboticstoolbox/core/Eigen/src/Core/CwiseUnaryView.h +132 -0
- roboticstoolbox/core/Eigen/src/Core/DenseBase.h +701 -0
- roboticstoolbox/core/Eigen/src/Core/DenseCoeffsBase.h +685 -0
- roboticstoolbox/core/Eigen/src/Core/DenseStorage.h +652 -0
- roboticstoolbox/core/Eigen/src/Core/Diagonal.h +258 -0
- roboticstoolbox/core/Eigen/src/Core/DiagonalMatrix.h +391 -0
- roboticstoolbox/core/Eigen/src/Core/DiagonalProduct.h +28 -0
- roboticstoolbox/core/Eigen/src/Core/Dot.h +318 -0
- roboticstoolbox/core/Eigen/src/Core/EigenBase.h +160 -0
- roboticstoolbox/core/Eigen/src/Core/ForceAlignedAccess.h +150 -0
- roboticstoolbox/core/Eigen/src/Core/Fuzzy.h +155 -0
- roboticstoolbox/core/Eigen/src/Core/GeneralProduct.h +465 -0
- roboticstoolbox/core/Eigen/src/Core/GenericPacketMath.h +1040 -0
- roboticstoolbox/core/Eigen/src/Core/GlobalFunctions.h +194 -0
- roboticstoolbox/core/Eigen/src/Core/IO.h +258 -0
- roboticstoolbox/core/Eigen/src/Core/IndexedView.h +237 -0
- roboticstoolbox/core/Eigen/src/Core/Inverse.h +117 -0
- roboticstoolbox/core/Eigen/src/Core/Map.h +171 -0
- roboticstoolbox/core/Eigen/src/Core/MapBase.h +310 -0
- roboticstoolbox/core/Eigen/src/Core/MathFunctions.h +2057 -0
- roboticstoolbox/core/Eigen/src/Core/MathFunctionsImpl.h +200 -0
- roboticstoolbox/core/Eigen/src/Core/Matrix.h +565 -0
- roboticstoolbox/core/Eigen/src/Core/MatrixBase.h +547 -0
- roboticstoolbox/core/Eigen/src/Core/NestByValue.h +85 -0
- roboticstoolbox/core/Eigen/src/Core/NoAlias.h +109 -0
- roboticstoolbox/core/Eigen/src/Core/NumTraits.h +335 -0
- roboticstoolbox/core/Eigen/src/Core/PartialReduxEvaluator.h +232 -0
- roboticstoolbox/core/Eigen/src/Core/PermutationMatrix.h +605 -0
- roboticstoolbox/core/Eigen/src/Core/PlainObjectBase.h +1128 -0
- roboticstoolbox/core/Eigen/src/Core/Product.h +191 -0
- roboticstoolbox/core/Eigen/src/Core/ProductEvaluators.h +1179 -0
- roboticstoolbox/core/Eigen/src/Core/Random.h +218 -0
- roboticstoolbox/core/Eigen/src/Core/Redux.h +515 -0
- roboticstoolbox/core/Eigen/src/Core/Ref.h +381 -0
- roboticstoolbox/core/Eigen/src/Core/Replicate.h +142 -0
- roboticstoolbox/core/Eigen/src/Core/Reshaped.h +454 -0
- roboticstoolbox/core/Eigen/src/Core/ReturnByValue.h +119 -0
- roboticstoolbox/core/Eigen/src/Core/Reverse.h +217 -0
- roboticstoolbox/core/Eigen/src/Core/Select.h +164 -0
- roboticstoolbox/core/Eigen/src/Core/SelfAdjointView.h +365 -0
- roboticstoolbox/core/Eigen/src/Core/SelfCwiseBinaryOp.h +47 -0
- roboticstoolbox/core/Eigen/src/Core/Solve.h +188 -0
- roboticstoolbox/core/Eigen/src/Core/SolveTriangular.h +235 -0
- roboticstoolbox/core/Eigen/src/Core/SolverBase.h +168 -0
- roboticstoolbox/core/Eigen/src/Core/StableNorm.h +251 -0
- roboticstoolbox/core/Eigen/src/Core/StlIterators.h +463 -0
- roboticstoolbox/core/Eigen/src/Core/Stride.h +116 -0
- roboticstoolbox/core/Eigen/src/Core/Swap.h +68 -0
- roboticstoolbox/core/Eigen/src/Core/Transpose.h +464 -0
- roboticstoolbox/core/Eigen/src/Core/Transpositions.h +386 -0
- roboticstoolbox/core/Eigen/src/Core/TriangularMatrix.h +1001 -0
- roboticstoolbox/core/Eigen/src/Core/VectorBlock.h +96 -0
- roboticstoolbox/core/Eigen/src/Core/VectorwiseOp.h +784 -0
- roboticstoolbox/core/Eigen/src/Core/Visitor.h +381 -0
- roboticstoolbox/core/Eigen/src/Core/arch/AVX/Complex.h +372 -0
- roboticstoolbox/core/Eigen/src/Core/arch/AVX/MathFunctions.h +228 -0
- roboticstoolbox/core/Eigen/src/Core/arch/AVX/PacketMath.h +1574 -0
- roboticstoolbox/core/Eigen/src/Core/arch/AVX/TypeCasting.h +115 -0
- roboticstoolbox/core/Eigen/src/Core/arch/AVX512/Complex.h +422 -0
- roboticstoolbox/core/Eigen/src/Core/arch/AVX512/MathFunctions.h +362 -0
- roboticstoolbox/core/Eigen/src/Core/arch/AVX512/PacketMath.h +2303 -0
- roboticstoolbox/core/Eigen/src/Core/arch/AVX512/TypeCasting.h +89 -0
- roboticstoolbox/core/Eigen/src/Core/arch/AltiVec/Complex.h +417 -0
- roboticstoolbox/core/Eigen/src/Core/arch/AltiVec/MathFunctions.h +90 -0
- roboticstoolbox/core/Eigen/src/Core/arch/AltiVec/MatrixProduct.h +2937 -0
- roboticstoolbox/core/Eigen/src/Core/arch/AltiVec/MatrixProductCommon.h +221 -0
- roboticstoolbox/core/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h +629 -0
- roboticstoolbox/core/Eigen/src/Core/arch/AltiVec/PacketMath.h +2711 -0
- roboticstoolbox/core/Eigen/src/Core/arch/CUDA/Complex.h +258 -0
- roboticstoolbox/core/Eigen/src/Core/arch/Default/BFloat16.h +700 -0
- roboticstoolbox/core/Eigen/src/Core/arch/Default/ConjHelper.h +117 -0
- roboticstoolbox/core/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +1649 -0
- roboticstoolbox/core/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h +110 -0
- roboticstoolbox/core/Eigen/src/Core/arch/Default/Half.h +942 -0
- roboticstoolbox/core/Eigen/src/Core/arch/Default/Settings.h +49 -0
- roboticstoolbox/core/Eigen/src/Core/arch/Default/TypeCasting.h +120 -0
- roboticstoolbox/core/Eigen/src/Core/arch/GPU/MathFunctions.h +103 -0
- roboticstoolbox/core/Eigen/src/Core/arch/GPU/PacketMath.h +1685 -0
- roboticstoolbox/core/Eigen/src/Core/arch/GPU/TypeCasting.h +80 -0
- roboticstoolbox/core/Eigen/src/Core/arch/HIP/hcc/math_constants.h +23 -0
- roboticstoolbox/core/Eigen/src/Core/arch/MSA/Complex.h +648 -0
- roboticstoolbox/core/Eigen/src/Core/arch/MSA/MathFunctions.h +387 -0
- roboticstoolbox/core/Eigen/src/Core/arch/MSA/PacketMath.h +1233 -0
- roboticstoolbox/core/Eigen/src/Core/arch/NEON/Complex.h +584 -0
- roboticstoolbox/core/Eigen/src/Core/arch/NEON/GeneralBlockPanelKernel.h +183 -0
- roboticstoolbox/core/Eigen/src/Core/arch/NEON/MathFunctions.h +75 -0
- roboticstoolbox/core/Eigen/src/Core/arch/NEON/PacketMath.h +4587 -0
- roboticstoolbox/core/Eigen/src/Core/arch/NEON/TypeCasting.h +1419 -0
- roboticstoolbox/core/Eigen/src/Core/arch/SSE/Complex.h +351 -0
- roboticstoolbox/core/Eigen/src/Core/arch/SSE/MathFunctions.h +199 -0
- roboticstoolbox/core/Eigen/src/Core/arch/SSE/PacketMath.h +1505 -0
- roboticstoolbox/core/Eigen/src/Core/arch/SSE/TypeCasting.h +142 -0
- roboticstoolbox/core/Eigen/src/Core/arch/SVE/MathFunctions.h +44 -0
- roboticstoolbox/core/Eigen/src/Core/arch/SVE/PacketMath.h +752 -0
- roboticstoolbox/core/Eigen/src/Core/arch/SVE/TypeCasting.h +49 -0
- roboticstoolbox/core/Eigen/src/Core/arch/SYCL/InteropHeaders.h +232 -0
- roboticstoolbox/core/Eigen/src/Core/arch/SYCL/MathFunctions.h +301 -0
- roboticstoolbox/core/Eigen/src/Core/arch/SYCL/PacketMath.h +670 -0
- roboticstoolbox/core/Eigen/src/Core/arch/SYCL/SyclMemoryModel.h +694 -0
- roboticstoolbox/core/Eigen/src/Core/arch/SYCL/TypeCasting.h +85 -0
- roboticstoolbox/core/Eigen/src/Core/arch/ZVector/Complex.h +426 -0
- roboticstoolbox/core/Eigen/src/Core/arch/ZVector/MathFunctions.h +233 -0
- roboticstoolbox/core/Eigen/src/Core/arch/ZVector/PacketMath.h +1060 -0
- roboticstoolbox/core/Eigen/src/Core/functors/AssignmentFunctors.h +177 -0
- roboticstoolbox/core/Eigen/src/Core/functors/BinaryFunctors.h +541 -0
- roboticstoolbox/core/Eigen/src/Core/functors/NullaryFunctors.h +189 -0
- roboticstoolbox/core/Eigen/src/Core/functors/StlFunctors.h +166 -0
- roboticstoolbox/core/Eigen/src/Core/functors/TernaryFunctors.h +25 -0
- roboticstoolbox/core/Eigen/src/Core/functors/UnaryFunctors.h +1131 -0
- roboticstoolbox/core/Eigen/src/Core/products/GeneralBlockPanelKernel.h +2645 -0
- roboticstoolbox/core/Eigen/src/Core/products/GeneralMatrixMatrix.h +517 -0
- roboticstoolbox/core/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h +317 -0
- roboticstoolbox/core/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h +145 -0
- roboticstoolbox/core/Eigen/src/Core/products/GeneralMatrixMatrix_BLAS.h +124 -0
- roboticstoolbox/core/Eigen/src/Core/products/GeneralMatrixVector.h +518 -0
- roboticstoolbox/core/Eigen/src/Core/products/GeneralMatrixVector_BLAS.h +136 -0
- roboticstoolbox/core/Eigen/src/Core/products/Parallelizer.h +180 -0
- roboticstoolbox/core/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +544 -0
- roboticstoolbox/core/Eigen/src/Core/products/SelfadjointMatrixMatrix_BLAS.h +295 -0
- roboticstoolbox/core/Eigen/src/Core/products/SelfadjointMatrixVector.h +262 -0
- roboticstoolbox/core/Eigen/src/Core/products/SelfadjointMatrixVector_BLAS.h +118 -0
- roboticstoolbox/core/Eigen/src/Core/products/SelfadjointProduct.h +133 -0
- roboticstoolbox/core/Eigen/src/Core/products/SelfadjointRank2Update.h +94 -0
- roboticstoolbox/core/Eigen/src/Core/products/TriangularMatrixMatrix.h +472 -0
- roboticstoolbox/core/Eigen/src/Core/products/TriangularMatrixMatrix_BLAS.h +317 -0
- roboticstoolbox/core/Eigen/src/Core/products/TriangularMatrixVector.h +350 -0
- roboticstoolbox/core/Eigen/src/Core/products/TriangularMatrixVector_BLAS.h +255 -0
- roboticstoolbox/core/Eigen/src/Core/products/TriangularSolverMatrix.h +337 -0
- roboticstoolbox/core/Eigen/src/Core/products/TriangularSolverMatrix_BLAS.h +167 -0
- roboticstoolbox/core/Eigen/src/Core/products/TriangularSolverVector.h +148 -0
- roboticstoolbox/core/Eigen/src/Core/util/BlasUtil.h +583 -0
- roboticstoolbox/core/Eigen/src/Core/util/ConfigureVectorization.h +512 -0
- roboticstoolbox/core/Eigen/src/Core/util/Constants.h +563 -0
- roboticstoolbox/core/Eigen/src/Core/util/DisableStupidWarnings.h +106 -0
- roboticstoolbox/core/Eigen/src/Core/util/ForwardDeclarations.h +322 -0
- roboticstoolbox/core/Eigen/src/Core/util/IndexedViewHelper.h +186 -0
- roboticstoolbox/core/Eigen/src/Core/util/IntegralConstant.h +272 -0
- roboticstoolbox/core/Eigen/src/Core/util/MKL_support.h +137 -0
- roboticstoolbox/core/Eigen/src/Core/util/Macros.h +1464 -0
- roboticstoolbox/core/Eigen/src/Core/util/Memory.h +1163 -0
- roboticstoolbox/core/Eigen/src/Core/util/Meta.h +812 -0
- roboticstoolbox/core/Eigen/src/Core/util/NonMPL2.h +3 -0
- roboticstoolbox/core/Eigen/src/Core/util/ReenableStupidWarnings.h +31 -0
- roboticstoolbox/core/Eigen/src/Core/util/ReshapedHelper.h +51 -0
- roboticstoolbox/core/Eigen/src/Core/util/StaticAssert.h +221 -0
- roboticstoolbox/core/Eigen/src/Core/util/SymbolicIndex.h +293 -0
- roboticstoolbox/core/Eigen/src/Core/util/XprHelper.h +856 -0
- roboticstoolbox/core/Eigen/src/Eigenvalues/ComplexEigenSolver.h +346 -0
- roboticstoolbox/core/Eigen/src/Eigenvalues/ComplexSchur.h +462 -0
- roboticstoolbox/core/Eigen/src/Eigenvalues/ComplexSchur_LAPACKE.h +91 -0
- roboticstoolbox/core/Eigen/src/Eigenvalues/EigenSolver.h +622 -0
- roboticstoolbox/core/Eigen/src/Eigenvalues/GeneralizedEigenSolver.h +418 -0
- roboticstoolbox/core/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h +226 -0
- roboticstoolbox/core/Eigen/src/Eigenvalues/HessenbergDecomposition.h +374 -0
- roboticstoolbox/core/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h +158 -0
- roboticstoolbox/core/Eigen/src/Eigenvalues/RealQZ.h +657 -0
- roboticstoolbox/core/Eigen/src/Eigenvalues/RealSchur.h +558 -0
- roboticstoolbox/core/Eigen/src/Eigenvalues/RealSchur_LAPACKE.h +77 -0
- roboticstoolbox/core/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +904 -0
- roboticstoolbox/core/Eigen/src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h +87 -0
- roboticstoolbox/core/Eigen/src/Eigenvalues/Tridiagonalization.h +561 -0
- roboticstoolbox/core/Eigen/src/Geometry/AlignedBox.h +486 -0
- roboticstoolbox/core/Eigen/src/Geometry/AngleAxis.h +247 -0
- roboticstoolbox/core/Eigen/src/Geometry/EulerAngles.h +114 -0
- roboticstoolbox/core/Eigen/src/Geometry/Homogeneous.h +501 -0
- roboticstoolbox/core/Eigen/src/Geometry/Hyperplane.h +282 -0
- roboticstoolbox/core/Eigen/src/Geometry/OrthoMethods.h +235 -0
- roboticstoolbox/core/Eigen/src/Geometry/ParametrizedLine.h +232 -0
- roboticstoolbox/core/Eigen/src/Geometry/Quaternion.h +870 -0
- roboticstoolbox/core/Eigen/src/Geometry/Rotation2D.h +199 -0
- roboticstoolbox/core/Eigen/src/Geometry/RotationBase.h +206 -0
- roboticstoolbox/core/Eigen/src/Geometry/Scaling.h +188 -0
- roboticstoolbox/core/Eigen/src/Geometry/Transform.h +1563 -0
- roboticstoolbox/core/Eigen/src/Geometry/Translation.h +202 -0
- roboticstoolbox/core/Eigen/src/Geometry/Umeyama.h +166 -0
- roboticstoolbox/core/Eigen/src/Geometry/arch/Geometry_SIMD.h +168 -0
- roboticstoolbox/core/Eigen/src/Householder/BlockHouseholder.h +110 -0
- roboticstoolbox/core/Eigen/src/Householder/Householder.h +176 -0
- roboticstoolbox/core/Eigen/src/Householder/HouseholderSequence.h +545 -0
- roboticstoolbox/core/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h +226 -0
- roboticstoolbox/core/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +212 -0
- roboticstoolbox/core/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +229 -0
- roboticstoolbox/core/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h +394 -0
- roboticstoolbox/core/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h +453 -0
- roboticstoolbox/core/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +444 -0
- roboticstoolbox/core/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h +198 -0
- roboticstoolbox/core/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h +117 -0
- roboticstoolbox/core/Eigen/src/Jacobi/Jacobi.h +483 -0
- roboticstoolbox/core/Eigen/src/KLUSupport/KLUSupport.h +358 -0
- roboticstoolbox/core/Eigen/src/LU/Determinant.h +117 -0
- roboticstoolbox/core/Eigen/src/LU/FullPivLU.h +877 -0
- roboticstoolbox/core/Eigen/src/LU/InverseImpl.h +432 -0
- roboticstoolbox/core/Eigen/src/LU/PartialPivLU.h +624 -0
- roboticstoolbox/core/Eigen/src/LU/PartialPivLU_LAPACKE.h +83 -0
- roboticstoolbox/core/Eigen/src/LU/arch/InverseSize4.h +351 -0
- roboticstoolbox/core/Eigen/src/MetisSupport/MetisSupport.h +137 -0
- roboticstoolbox/core/Eigen/src/OrderingMethods/Amd.h +435 -0
- roboticstoolbox/core/Eigen/src/OrderingMethods/Eigen_Colamd.h +1863 -0
- roboticstoolbox/core/Eigen/src/OrderingMethods/Ordering.h +153 -0
- roboticstoolbox/core/Eigen/src/PaStiXSupport/PaStiXSupport.h +678 -0
- roboticstoolbox/core/Eigen/src/PardisoSupport/PardisoSupport.h +545 -0
- roboticstoolbox/core/Eigen/src/QR/ColPivHouseholderQR.h +674 -0
- roboticstoolbox/core/Eigen/src/QR/ColPivHouseholderQR_LAPACKE.h +97 -0
- roboticstoolbox/core/Eigen/src/QR/CompleteOrthogonalDecomposition.h +635 -0
- roboticstoolbox/core/Eigen/src/QR/FullPivHouseholderQR.h +713 -0
- roboticstoolbox/core/Eigen/src/QR/HouseholderQR.h +434 -0
- roboticstoolbox/core/Eigen/src/QR/HouseholderQR_LAPACKE.h +68 -0
- roboticstoolbox/core/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h +335 -0
- roboticstoolbox/core/Eigen/src/SVD/BDCSVD.h +1366 -0
- roboticstoolbox/core/Eigen/src/SVD/JacobiSVD.h +812 -0
- roboticstoolbox/core/Eigen/src/SVD/JacobiSVD_LAPACKE.h +91 -0
- roboticstoolbox/core/Eigen/src/SVD/SVDBase.h +376 -0
- roboticstoolbox/core/Eigen/src/SVD/UpperBidiagonalization.h +414 -0
- roboticstoolbox/core/Eigen/src/SparseCholesky/SimplicialCholesky.h +697 -0
- roboticstoolbox/core/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h +174 -0
- roboticstoolbox/core/Eigen/src/SparseCore/AmbiVector.h +378 -0
- roboticstoolbox/core/Eigen/src/SparseCore/CompressedStorage.h +274 -0
- roboticstoolbox/core/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +352 -0
- roboticstoolbox/core/Eigen/src/SparseCore/MappedSparseMatrix.h +67 -0
- roboticstoolbox/core/Eigen/src/SparseCore/SparseAssign.h +270 -0
- roboticstoolbox/core/Eigen/src/SparseCore/SparseBlock.h +571 -0
- roboticstoolbox/core/Eigen/src/SparseCore/SparseColEtree.h +206 -0
- roboticstoolbox/core/Eigen/src/SparseCore/SparseCompressedBase.h +370 -0
- roboticstoolbox/core/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +722 -0
- roboticstoolbox/core/Eigen/src/SparseCore/SparseCwiseUnaryOp.h +150 -0
- roboticstoolbox/core/Eigen/src/SparseCore/SparseDenseProduct.h +342 -0
- roboticstoolbox/core/Eigen/src/SparseCore/SparseDiagonalProduct.h +138 -0
- roboticstoolbox/core/Eigen/src/SparseCore/SparseDot.h +98 -0
- roboticstoolbox/core/Eigen/src/SparseCore/SparseFuzzy.h +29 -0
- roboticstoolbox/core/Eigen/src/SparseCore/SparseMap.h +305 -0
- roboticstoolbox/core/Eigen/src/SparseCore/SparseMatrix.h +1518 -0
- roboticstoolbox/core/Eigen/src/SparseCore/SparseMatrixBase.h +398 -0
- roboticstoolbox/core/Eigen/src/SparseCore/SparsePermutation.h +178 -0
- roboticstoolbox/core/Eigen/src/SparseCore/SparseProduct.h +181 -0
- roboticstoolbox/core/Eigen/src/SparseCore/SparseRedux.h +49 -0
- roboticstoolbox/core/Eigen/src/SparseCore/SparseRef.h +397 -0
- roboticstoolbox/core/Eigen/src/SparseCore/SparseSelfAdjointView.h +659 -0
- roboticstoolbox/core/Eigen/src/SparseCore/SparseSolverBase.h +124 -0
- roboticstoolbox/core/Eigen/src/SparseCore/SparseSparseProductWithPruning.h +198 -0
- roboticstoolbox/core/Eigen/src/SparseCore/SparseTranspose.h +92 -0
- roboticstoolbox/core/Eigen/src/SparseCore/SparseTriangularView.h +189 -0
- roboticstoolbox/core/Eigen/src/SparseCore/SparseUtil.h +186 -0
- roboticstoolbox/core/Eigen/src/SparseCore/SparseVector.h +478 -0
- roboticstoolbox/core/Eigen/src/SparseCore/SparseView.h +254 -0
- roboticstoolbox/core/Eigen/src/SparseCore/TriangularSolver.h +315 -0
- roboticstoolbox/core/Eigen/src/SparseLU/SparseLU.h +923 -0
- roboticstoolbox/core/Eigen/src/SparseLU/SparseLUImpl.h +66 -0
- roboticstoolbox/core/Eigen/src/SparseLU/SparseLU_Memory.h +226 -0
- roboticstoolbox/core/Eigen/src/SparseLU/SparseLU_Structs.h +110 -0
- roboticstoolbox/core/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h +375 -0
- roboticstoolbox/core/Eigen/src/SparseLU/SparseLU_Utils.h +80 -0
- roboticstoolbox/core/Eigen/src/SparseLU/SparseLU_column_bmod.h +181 -0
- roboticstoolbox/core/Eigen/src/SparseLU/SparseLU_column_dfs.h +179 -0
- roboticstoolbox/core/Eigen/src/SparseLU/SparseLU_copy_to_ucol.h +107 -0
- roboticstoolbox/core/Eigen/src/SparseLU/SparseLU_gemm_kernel.h +280 -0
- roboticstoolbox/core/Eigen/src/SparseLU/SparseLU_heap_relax_snode.h +126 -0
- roboticstoolbox/core/Eigen/src/SparseLU/SparseLU_kernel_bmod.h +130 -0
- roboticstoolbox/core/Eigen/src/SparseLU/SparseLU_panel_bmod.h +223 -0
- roboticstoolbox/core/Eigen/src/SparseLU/SparseLU_panel_dfs.h +258 -0
- roboticstoolbox/core/Eigen/src/SparseLU/SparseLU_pivotL.h +137 -0
- roboticstoolbox/core/Eigen/src/SparseLU/SparseLU_pruneL.h +136 -0
- roboticstoolbox/core/Eigen/src/SparseLU/SparseLU_relax_snode.h +83 -0
- roboticstoolbox/core/Eigen/src/SparseQR/SparseQR.h +758 -0
- roboticstoolbox/core/Eigen/src/StlSupport/StdDeque.h +116 -0
- roboticstoolbox/core/Eigen/src/StlSupport/StdList.h +106 -0
- roboticstoolbox/core/Eigen/src/StlSupport/StdVector.h +131 -0
- roboticstoolbox/core/Eigen/src/StlSupport/details.h +84 -0
- roboticstoolbox/core/Eigen/src/SuperLUSupport/SuperLUSupport.h +1025 -0
- roboticstoolbox/core/Eigen/src/UmfPackSupport/UmfPackSupport.h +642 -0
- roboticstoolbox/core/Eigen/src/misc/Image.h +82 -0
- roboticstoolbox/core/Eigen/src/misc/Kernel.h +79 -0
- roboticstoolbox/core/Eigen/src/misc/RealSvd2x2.h +55 -0
- roboticstoolbox/core/Eigen/src/misc/blas.h +440 -0
- roboticstoolbox/core/Eigen/src/misc/lapack.h +152 -0
- roboticstoolbox/core/Eigen/src/misc/lapacke.h +16292 -0
- roboticstoolbox/core/Eigen/src/misc/lapacke_mangling.h +17 -0
- roboticstoolbox/core/Eigen/src/plugins/ArrayCwiseBinaryOps.h +358 -0
- roboticstoolbox/core/Eigen/src/plugins/ArrayCwiseUnaryOps.h +696 -0
- roboticstoolbox/core/Eigen/src/plugins/BlockMethods.h +1442 -0
- roboticstoolbox/core/Eigen/src/plugins/CommonCwiseBinaryOps.h +115 -0
- roboticstoolbox/core/Eigen/src/plugins/CommonCwiseUnaryOps.h +177 -0
- roboticstoolbox/core/Eigen/src/plugins/IndexedViewMethods.h +262 -0
- roboticstoolbox/core/Eigen/src/plugins/MatrixCwiseBinaryOps.h +152 -0
- roboticstoolbox/core/Eigen/src/plugins/MatrixCwiseUnaryOps.h +95 -0
- roboticstoolbox/core/Eigen/src/plugins/ReshapedMethods.h +149 -0
- roboticstoolbox/core/fknm.cpp +1557 -0
- roboticstoolbox/core/fknm.h +55 -0
- roboticstoolbox/core/frne.c +351 -0
- roboticstoolbox/core/frne.h +96 -0
- roboticstoolbox/core/ik.cpp +301 -0
- roboticstoolbox/core/ik.h +59 -0
- roboticstoolbox/core/linalg.cpp +316 -0
- roboticstoolbox/core/linalg.h +64 -0
- roboticstoolbox/core/methods.cpp +372 -0
- roboticstoolbox/core/methods.h +32 -0
- roboticstoolbox/core/ne.c +493 -0
- roboticstoolbox/core/structs.cpp +24 -0
- roboticstoolbox/core/structs.h +62 -0
- roboticstoolbox/core/vmath.c +163 -0
- roboticstoolbox/core/vmath.h +32 -0
- roboticstoolbox/fknm.cp312-win_amd64.pyd +0 -0
- roboticstoolbox/frne.cp312-win_amd64.pyd +0 -0
- roboticstoolbox/mobile/Animations.py +485 -0
- roboticstoolbox/mobile/Bug2.py +455 -0
- roboticstoolbox/mobile/CurvaturePolyPlanner.py +179 -0
- roboticstoolbox/mobile/DistanceTransformPlanner.py +395 -0
- roboticstoolbox/mobile/DstarPlanner.py +591 -0
- roboticstoolbox/mobile/DubinsPlanner.py +474 -0
- roboticstoolbox/mobile/EKF.py +1617 -0
- roboticstoolbox/mobile/LatticePlanner.py +419 -0
- roboticstoolbox/mobile/OccGrid.py +613 -0
- roboticstoolbox/mobile/PRMPlanner.py +348 -0
- roboticstoolbox/mobile/ParticleFilter.py +706 -0
- roboticstoolbox/mobile/PlannerBase.py +1009 -0
- roboticstoolbox/mobile/PoseGraph.py +544 -0
- roboticstoolbox/mobile/QuinticPolyPlanner.py +349 -0
- roboticstoolbox/mobile/RRTPlanner.py +359 -0
- roboticstoolbox/mobile/ReedsSheppPlanner.py +545 -0
- roboticstoolbox/mobile/Vehicle.py +1909 -0
- roboticstoolbox/mobile/__init__.py +193 -0
- roboticstoolbox/mobile/drivers.py +390 -0
- roboticstoolbox/mobile/landmarkmap.py +181 -0
- roboticstoolbox/mobile/sensors.py +771 -0
- roboticstoolbox/models/DH/AL5D.py +121 -0
- roboticstoolbox/models/DH/Ball.py +87 -0
- roboticstoolbox/models/DH/Baxter.py +91 -0
- roboticstoolbox/models/DH/Cobra600.py +63 -0
- roboticstoolbox/models/DH/Coil.py +80 -0
- roboticstoolbox/models/DH/Hyper.py +83 -0
- roboticstoolbox/models/DH/Hyper3d.py +85 -0
- roboticstoolbox/models/DH/IRB140.py +159 -0
- roboticstoolbox/models/DH/Jaco.py +102 -0
- roboticstoolbox/models/DH/KR5.py +112 -0
- roboticstoolbox/models/DH/LWR4.py +85 -0
- roboticstoolbox/models/DH/Mico.py +102 -0
- roboticstoolbox/models/DH/Orion5.py +91 -0
- roboticstoolbox/models/DH/P8.py +80 -0
- roboticstoolbox/models/DH/Panda.py +178 -0
- roboticstoolbox/models/DH/Planar2.py +69 -0
- roboticstoolbox/models/DH/Planar3.py +51 -0
- roboticstoolbox/models/DH/Puma560.py +326 -0
- roboticstoolbox/models/DH/README.md +216 -0
- roboticstoolbox/models/DH/Sawyer.py +85 -0
- roboticstoolbox/models/DH/Stanford.py +147 -0
- roboticstoolbox/models/DH/TwoLink.py +109 -0
- roboticstoolbox/models/DH/UR10.py +124 -0
- roboticstoolbox/models/DH/UR3.py +98 -0
- roboticstoolbox/models/DH/UR5.py +98 -0
- roboticstoolbox/models/DH/Uprighttl.py +24 -0
- roboticstoolbox/models/DH/__init__.py +52 -0
- roboticstoolbox/models/ETS/Frankie.py +90 -0
- roboticstoolbox/models/ETS/GenericSeven.py +54 -0
- roboticstoolbox/models/ETS/Omni.py +74 -0
- roboticstoolbox/models/ETS/Panda.py +69 -0
- roboticstoolbox/models/ETS/Planar2.py +49 -0
- roboticstoolbox/models/ETS/Planar_Y.py +65 -0
- roboticstoolbox/models/ETS/Puma560.py +69 -0
- roboticstoolbox/models/ETS/XYPanda.py +84 -0
- roboticstoolbox/models/ETS/__init__.py +20 -0
- roboticstoolbox/models/README.md +9 -0
- roboticstoolbox/models/URDF/AL5D.py +54 -0
- roboticstoolbox/models/URDF/Fetch.py +70 -0
- roboticstoolbox/models/URDF/FetchCamera.py +71 -0
- roboticstoolbox/models/URDF/Frankie.py +75 -0
- roboticstoolbox/models/URDF/FrankieOmni.py +94 -0
- roboticstoolbox/models/URDF/KinovaGen3.py +71 -0
- roboticstoolbox/models/URDF/LBR.py +59 -0
- roboticstoolbox/models/URDF/Mico.py +68 -0
- roboticstoolbox/models/URDF/PR2.py +64 -0
- roboticstoolbox/models/URDF/Panda.py +67 -0
- roboticstoolbox/models/URDF/Puma560.py +97 -0
- roboticstoolbox/models/URDF/UR10.py +53 -0
- roboticstoolbox/models/URDF/UR3.py +53 -0
- roboticstoolbox/models/URDF/UR5.py +74 -0
- roboticstoolbox/models/URDF/Valkyrie.py +84 -0
- roboticstoolbox/models/URDF/YuMi.py +109 -0
- roboticstoolbox/models/URDF/__init__.py +53 -0
- roboticstoolbox/models/URDF/px100.py +56 -0
- roboticstoolbox/models/URDF/px150.py +56 -0
- roboticstoolbox/models/URDF/rx150.py +56 -0
- roboticstoolbox/models/URDF/rx200.py +56 -0
- roboticstoolbox/models/URDF/vx300.py +56 -0
- roboticstoolbox/models/URDF/vx300s.py +56 -0
- roboticstoolbox/models/URDF/wx200.py +56 -0
- roboticstoolbox/models/URDF/wx250.py +56 -0
- roboticstoolbox/models/URDF/wx250s.py +56 -0
- roboticstoolbox/models/__init__.py +7 -0
- roboticstoolbox/models/list.py +119 -0
- roboticstoolbox/robot/BaseRobot.py +3133 -0
- roboticstoolbox/robot/DHFactor.py +522 -0
- roboticstoolbox/robot/DHLink.py +981 -0
- roboticstoolbox/robot/DHRobot.py +2520 -0
- roboticstoolbox/robot/Dynamics.py +1620 -0
- roboticstoolbox/robot/ELink.py +23 -0
- roboticstoolbox/robot/ERobot.py +25 -0
- roboticstoolbox/robot/ET.py +1097 -0
- roboticstoolbox/robot/ETS.py +3542 -0
- roboticstoolbox/robot/Gripper.py +282 -0
- roboticstoolbox/robot/IK.py +1522 -0
- roboticstoolbox/robot/Link.py +1698 -0
- roboticstoolbox/robot/PoERobot.py +348 -0
- roboticstoolbox/robot/Robot.py +2100 -0
- roboticstoolbox/robot/RobotKinematics.py +1725 -0
- roboticstoolbox/robot/RobotProto.py +92 -0
- roboticstoolbox/robot/__init__.py +54 -0
- roboticstoolbox/tools/DHFactor.py +375 -0
- roboticstoolbox/tools/Ticker.py +53 -0
- roboticstoolbox/tools/__init__.py +54 -0
- roboticstoolbox/tools/data.py +187 -0
- roboticstoolbox/tools/jsingu.py +51 -0
- roboticstoolbox/tools/null.py +48 -0
- roboticstoolbox/tools/numerical.py +96 -0
- roboticstoolbox/tools/p_servo.py +106 -0
- roboticstoolbox/tools/params.py +11 -0
- roboticstoolbox/tools/plot.py +109 -0
- roboticstoolbox/tools/trajectory.py +1152 -0
- roboticstoolbox/tools/types.py +13 -0
- roboticstoolbox/tools/urdf/__init__.py +45 -0
- roboticstoolbox/tools/urdf/tests/data/ur5.urdf +341 -0
- roboticstoolbox/tools/urdf/tests/test_urdf.py +116 -0
- roboticstoolbox/tools/urdf/urdf.py +1976 -0
- roboticstoolbox/tools/urdf/utils.py +50 -0
- roboticstoolbox/tools/xacro/__init__.py +1148 -0
- roboticstoolbox/tools/xacro/cli.py +128 -0
- roboticstoolbox/tools/xacro/color.py +66 -0
- roboticstoolbox/tools/xacro/tests/CMakeLists.txt +4 -0
- roboticstoolbox/tools/xacro/tests/broken.xacro +1 -0
- roboticstoolbox/tools/xacro/tests/emoji.xacro +5 -0
- roboticstoolbox/tools/xacro/tests/include1.xacro +4 -0
- roboticstoolbox/tools/xacro/tests/include1.xml +1 -0
- roboticstoolbox/tools/xacro/tests/include2.xacro +4 -0
- roboticstoolbox/tools/xacro/tests/include2.xml +1 -0
- roboticstoolbox/tools/xacro/tests/robots/README +4 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/base_v0/base.gazebo.xacro +59 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/base_v0/base.transmission.xacro +24 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/base_v0/base.urdf.xacro +264 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/common.xacro +71 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/forearm_v0/forearm.gazebo.xacro +36 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/forearm_v0/forearm.transmission.xacro +20 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/forearm_v0/forearm.urdf.xacro +130 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/gazebo/gazebo.urdf.xacro +24 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/gripper_v0/gripper.gazebo.xacro +288 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/gripper_v0/gripper.transmission.xacro +50 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/gripper_v0/gripper.urdf.xacro +374 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/head_v0/head.gazebo.xacro +16 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/head_v0/head.transmission.xacro +34 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/head_v0/head.urdf.xacro +147 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/materials.urdf.xacro +52 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/pr2.urdf.xacro +157 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/pr2_1.11.4.xml +3781 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/double_stereo_camera.gazebo.xacro +16 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/double_stereo_camera.urdf.xacro +61 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/head_sensor_package.gazebo.xacro +20 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/head_sensor_package.urdf.xacro +63 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/hokuyo_lx30_laser.gazebo.xacro +39 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/hokuyo_lx30_laser.urdf.xacro +27 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/kinect_camera.gazebo.xacro +87 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/kinect_camera.urdf.xacro +55 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/kinect_prosilica_camera.gazebo.xacro +193 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/kinect_prosilica_camera.urdf.xacro +181 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/microstrain_3dmgx2_imu.gazebo.xacro +20 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/microstrain_3dmgx2_imu.urdf.xacro +25 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/projector_wg6802418.gazebo.xacro +31 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/projector_wg6802418.urdf.xacro +42 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/prosilica_gc2450_camera.gazebo.xacro +43 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/prosilica_gc2450_camera.urdf.xacro +49 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/stereo_camera.gazebo.xacro +23 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/stereo_camera.urdf.xacro +71 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/wge100_camera.gazebo.xacro +46 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/sensors/wge100_camera.urdf.xacro +47 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/shoulder_v0/shoulder.gazebo.xacro +40 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/shoulder_v0/shoulder.transmission.xacro +35 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/shoulder_v0/shoulder.urdf.xacro +167 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/tilting_laser_v0/tilting_laser.gazebo.xacro +11 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/tilting_laser_v0/tilting_laser.transmission.xacro +14 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/tilting_laser_v0/tilting_laser.urdf.xacro +60 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/torso_v0/torso.gazebo.xacro +37 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/torso_v0/torso.transmission.xacro +22 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/torso_v0/torso.urdf.xacro +122 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/upper_arm_v0/upper_arm.gazebo.xacro +39 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/upper_arm_v0/upper_arm.transmission.xacro +28 -0
- roboticstoolbox/tools/xacro/tests/robots/pr2/upper_arm_v0/upper_arm.urdf.xacro +173 -0
- roboticstoolbox/tools/xacro/tests/settings.yaml +9 -0
- roboticstoolbox/tools/xacro/tests/subdir/foo.xacro +3 -0
- roboticstoolbox/tools/xacro/tests/subdir/include-recursive.xacro +5 -0
- roboticstoolbox/tools/xacro/tests/subdir/include1.xml +1 -0
- roboticstoolbox/tools/xacro/tests/test_xacro.py +1418 -0
- roboticstoolbox/tools/xacro/xmlutils.py +152 -0
- roboticstoolbox_python-1.3.0.dist-info/METADATA +552 -0
- roboticstoolbox_python-1.3.0.dist-info/RECORD +673 -0
- roboticstoolbox_python-1.3.0.dist-info/WHEEL +5 -0
- roboticstoolbox_python-1.3.0.dist-info/entry_points.txt +6 -0
- roboticstoolbox_python-1.3.0.dist-info/licenses/LICENSE +21 -0
- spatialgeometry/__init__.py +32 -0
- spatialgeometry/geom/CollisionShape.py +419 -0
- spatialgeometry/geom/SceneGroup.py +26 -0
- spatialgeometry/geom/SceneNode.py +315 -0
- spatialgeometry/geom/Shape.py +420 -0
- spatialgeometry/geom/__init__.py +26 -0
- spatialgeometry/scene.py +107 -0
- spatialgeometry/tools/__init__.py +0 -0
- spatialgeometry/tools/stdout_supress.py +302 -0
|
@@ -0,0 +1,1620 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Rigid-body dynamics functionality of the Toolbox.
|
|
3
|
+
|
|
4
|
+
Requires access to:
|
|
5
|
+
|
|
6
|
+
* ``links`` list of ``Link`` objects, atttribute
|
|
7
|
+
* ``rne()`` the inverse dynamics method
|
|
8
|
+
|
|
9
|
+
so must be subclassed by ``DHRobot`` class.
|
|
10
|
+
|
|
11
|
+
:todo: perhaps these should be abstract properties, methods of this calss
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
from collections import namedtuple
|
|
15
|
+
from typing import Any, Callable, Dict, Union
|
|
16
|
+
import numpy as np
|
|
17
|
+
from spatialmath.base import getvector, verifymatrix, isscalar, getmatrix, t2r, rot2jac
|
|
18
|
+
from scipy import integrate, interpolate
|
|
19
|
+
from spatialmath.base import symbolic as sym
|
|
20
|
+
from roboticstoolbox import rtb_get_param
|
|
21
|
+
from roboticstoolbox.robot.RobotProto import RobotProto
|
|
22
|
+
|
|
23
|
+
from roboticstoolbox.tools.types import ArrayLike, NDArray
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
import roboticstoolbox as rtb
|
|
26
|
+
|
|
27
|
+
from ansitable import ANSITable, Column
|
|
28
|
+
import warnings
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class DynamicsMixin:
|
|
32
|
+
# --------------------------------------------------------------------- #
|
|
33
|
+
def dynamics(self: RobotProto):
|
|
34
|
+
"""
|
|
35
|
+
Pretty print the dynamic parameters (Robot superclass)
|
|
36
|
+
|
|
37
|
+
The dynamic parameters (inertial and friction) are printed in a table,
|
|
38
|
+
with one row per link.
|
|
39
|
+
|
|
40
|
+
Examples
|
|
41
|
+
--------
|
|
42
|
+
.. runblock:: pycon
|
|
43
|
+
>>> import roboticstoolbox as rtb
|
|
44
|
+
>>> robot = rtb.models.DH.Puma560()
|
|
45
|
+
>>> robot.dynamics()
|
|
46
|
+
|
|
47
|
+
"""
|
|
48
|
+
unicode = rtb_get_param("unicode")
|
|
49
|
+
table = ANSITable(
|
|
50
|
+
Column("j", colalign=">", headalign="^"),
|
|
51
|
+
Column("m", colalign="<", headalign="^"),
|
|
52
|
+
Column("r", colalign="<", headalign="^"),
|
|
53
|
+
Column("I", colalign="<", headalign="^"),
|
|
54
|
+
Column("Jm", colalign="<", headalign="^"),
|
|
55
|
+
Column("B", colalign="<", headalign="^"),
|
|
56
|
+
Column("Tc", colalign="<", headalign="^"),
|
|
57
|
+
Column("G", colalign="<", headalign="^"),
|
|
58
|
+
border="thin" if unicode else "ascii",
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
for j, link in enumerate(self.links):
|
|
62
|
+
table.row(link.name, *link._dyn2list())
|
|
63
|
+
table.print()
|
|
64
|
+
|
|
65
|
+
def dynamics_list(self: RobotProto):
|
|
66
|
+
"""
|
|
67
|
+
Print dynamic parameters (Robot superclass)
|
|
68
|
+
|
|
69
|
+
Display the kinematic and dynamic parameters to the console in
|
|
70
|
+
reable format
|
|
71
|
+
|
|
72
|
+
"""
|
|
73
|
+
for j, link in enumerate(self.links):
|
|
74
|
+
print("\nLink {:d}::".format(j), link)
|
|
75
|
+
print(link.dyn(indent=2))
|
|
76
|
+
|
|
77
|
+
# --------------------------------------------------------------------- #
|
|
78
|
+
|
|
79
|
+
def friction(self: RobotProto, qd: NDArray) -> NDArray:
|
|
80
|
+
r"""
|
|
81
|
+
Manipulator joint friction (Robot superclass)
|
|
82
|
+
|
|
83
|
+
``robot.friction(qd)`` is a vector of joint friction
|
|
84
|
+
forces/torques for the robot moving with joint velocities ``qd``.
|
|
85
|
+
|
|
86
|
+
The friction model includes:
|
|
87
|
+
|
|
88
|
+
- Viscous friction which is a linear function of velocity.
|
|
89
|
+
- Coulomb friction which is proportional to sign(qd).
|
|
90
|
+
|
|
91
|
+
.. math::
|
|
92
|
+
|
|
93
|
+
\tau_j = G^2 B \dot{q}_j + |G_j| \left\{ \begin{array}{ll}
|
|
94
|
+
\tau_{C,j}^+ & \mbox{if $\dot{q}_j > 0$} \\
|
|
95
|
+
\tau_{C,j}^- & \mbox{if $\dot{q}_j < 0$} \end{array} \right.
|
|
96
|
+
|
|
97
|
+
Parameters
|
|
98
|
+
----------
|
|
99
|
+
qd
|
|
100
|
+
The joint velocities of the robot
|
|
101
|
+
|
|
102
|
+
Returns
|
|
103
|
+
-------
|
|
104
|
+
friction
|
|
105
|
+
The joint friction forces/torques for the robot
|
|
106
|
+
|
|
107
|
+
Notes
|
|
108
|
+
-----
|
|
109
|
+
- The friction value should be added to the motor output torque to
|
|
110
|
+
determine the nett torque. It has a negative value when qd > 0.
|
|
111
|
+
- The returned friction value is referred to the output of the
|
|
112
|
+
gearbox.
|
|
113
|
+
- The friction parameters in the Link object are referred to the
|
|
114
|
+
motor.
|
|
115
|
+
- Motor viscous friction is scaled up by :math:`G^2`.
|
|
116
|
+
- Motor Coulomb friction is scaled up by math:`G`.
|
|
117
|
+
- The appropriate Coulomb friction value to use in the
|
|
118
|
+
non-symmetric case depends on the sign of the joint velocity,
|
|
119
|
+
not the motor velocity.
|
|
120
|
+
- Coulomb friction is zero for zero joint velocity, stiction is
|
|
121
|
+
not modeled.
|
|
122
|
+
- The absolute value of the gear ratio is used. Negative gear
|
|
123
|
+
ratios are tricky: the Puma560 robot has negative gear ratio for
|
|
124
|
+
joints 1 and 3.
|
|
125
|
+
- The absolute value of the gear ratio is used. Negative gear
|
|
126
|
+
ratios are tricky: the Puma560 has negative gear ratio for
|
|
127
|
+
joints 1 and 3.
|
|
128
|
+
|
|
129
|
+
See Also
|
|
130
|
+
--------
|
|
131
|
+
:func:`Robot.nofriction`
|
|
132
|
+
:func:`Link.friction`
|
|
133
|
+
|
|
134
|
+
"""
|
|
135
|
+
|
|
136
|
+
qd = np.array(getvector(qd, self.n))
|
|
137
|
+
tau = np.zeros(self.n)
|
|
138
|
+
|
|
139
|
+
for i in range(self.n):
|
|
140
|
+
tau[i] = self.links[i].friction(qd[i])
|
|
141
|
+
|
|
142
|
+
return tau
|
|
143
|
+
|
|
144
|
+
# --------------------------------------------------------------------- #
|
|
145
|
+
|
|
146
|
+
def nofriction(self: RobotProto, coulomb: bool = True, viscous: bool = False):
|
|
147
|
+
"""
|
|
148
|
+
Remove manipulator joint friction
|
|
149
|
+
|
|
150
|
+
``nofriction()`` copies the robot and returns
|
|
151
|
+
a robot with the same link parameters except the Coulomb and/or viscous
|
|
152
|
+
friction parameter are set to zero.
|
|
153
|
+
|
|
154
|
+
Parameters
|
|
155
|
+
----------
|
|
156
|
+
coulomb
|
|
157
|
+
set the Coulomb friction to 0
|
|
158
|
+
viscous
|
|
159
|
+
set the viscous friction to 0
|
|
160
|
+
|
|
161
|
+
Returns
|
|
162
|
+
-------
|
|
163
|
+
robot
|
|
164
|
+
A copy of the robot with dynamic parameters perturbed
|
|
165
|
+
|
|
166
|
+
See Also
|
|
167
|
+
--------
|
|
168
|
+
:func:`Robot.friction`
|
|
169
|
+
:func:`Link.nofriction`
|
|
170
|
+
|
|
171
|
+
"""
|
|
172
|
+
|
|
173
|
+
# shallow copy the robot object
|
|
174
|
+
if isinstance(self, rtb.DHRobot):
|
|
175
|
+
self.delete_rne() # remove the inherited C pointers
|
|
176
|
+
|
|
177
|
+
nf = self.copy()
|
|
178
|
+
nf.name = "NF/" + self.name
|
|
179
|
+
|
|
180
|
+
# add the modified links (copies)
|
|
181
|
+
nf._links = [link.nofriction(coulomb, viscous) for link in self.links]
|
|
182
|
+
|
|
183
|
+
return nf
|
|
184
|
+
|
|
185
|
+
def fdyn(
|
|
186
|
+
self: RobotProto,
|
|
187
|
+
T: float,
|
|
188
|
+
q0: ArrayLike,
|
|
189
|
+
Q: Union[Callable[[Any, float, NDArray, NDArray], NDArray], None] = None,
|
|
190
|
+
Q_args: Dict = {},
|
|
191
|
+
qd0: Union[ArrayLike, None] = None,
|
|
192
|
+
solver: str = "RK45",
|
|
193
|
+
solver_args: Dict = {},
|
|
194
|
+
dt: Union[float, None] = None,
|
|
195
|
+
progress: bool = False,
|
|
196
|
+
):
|
|
197
|
+
"""
|
|
198
|
+
Integrate forward dynamics
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
``tg = R.fdyn(T, q)`` integrates the dynamics of the robot with zero
|
|
202
|
+
input torques over the time interval 0 to ``T`` and returns the
|
|
203
|
+
trajectory as a namedtuple with elements:
|
|
204
|
+
|
|
205
|
+
- ``t`` the time vector (M,)
|
|
206
|
+
- ``q`` the joint coordinates (M,n)
|
|
207
|
+
- ``qd`` the joint velocities (M,n)
|
|
208
|
+
|
|
209
|
+
``tg = R.fdyn(T, q, torqfun)`` as above but the torque applied to the
|
|
210
|
+
joints is given by the provided function::
|
|
211
|
+
|
|
212
|
+
tau = function(robot, t, q, qd, **args)
|
|
213
|
+
|
|
214
|
+
where the inputs are:
|
|
215
|
+
|
|
216
|
+
- the robot object
|
|
217
|
+
- current time
|
|
218
|
+
- current joint coordinates (n,)
|
|
219
|
+
- current joint velocity (n,)
|
|
220
|
+
- args, optional keyword arguments can be specified, these are
|
|
221
|
+
passed in from the ``targs`` keyword argument.
|
|
222
|
+
|
|
223
|
+
The function must return a Numpy array (n,) of joint forces/torques.
|
|
224
|
+
|
|
225
|
+
Parameters
|
|
226
|
+
----------
|
|
227
|
+
T
|
|
228
|
+
integration time
|
|
229
|
+
q0
|
|
230
|
+
initial joint coordinates
|
|
231
|
+
qd0
|
|
232
|
+
initial joint velocities, assumed zero if not given
|
|
233
|
+
Q
|
|
234
|
+
a function that computes generalized joint force as a function of
|
|
235
|
+
time and/or state
|
|
236
|
+
Q_args
|
|
237
|
+
positional arguments passed to ``torque``
|
|
238
|
+
solver
|
|
239
|
+
str
|
|
240
|
+
solver_args
|
|
241
|
+
dict
|
|
242
|
+
dt
|
|
243
|
+
float
|
|
244
|
+
progress
|
|
245
|
+
show progress bar, default False
|
|
246
|
+
|
|
247
|
+
Returns
|
|
248
|
+
-------
|
|
249
|
+
trajectory
|
|
250
|
+
robot trajectory
|
|
251
|
+
|
|
252
|
+
Examples
|
|
253
|
+
--------
|
|
254
|
+
|
|
255
|
+
To apply zero joint torque to the robot without Coulomb
|
|
256
|
+
friction:
|
|
257
|
+
|
|
258
|
+
>>> def myfunc(robot, t, q, qd):
|
|
259
|
+
>>> return np.zeros((robot.n,))
|
|
260
|
+
|
|
261
|
+
>>> tg = robot.nofriction().fdyn(5, q0, myfunc)
|
|
262
|
+
|
|
263
|
+
>>> plt.figure()
|
|
264
|
+
>>> plt.plot(tg.t, tg.q)
|
|
265
|
+
>>> plt.show()
|
|
266
|
+
|
|
267
|
+
We could also use a lambda function::
|
|
268
|
+
|
|
269
|
+
>>> tg = robot.nofriction().fdyn(
|
|
270
|
+
>>> 5, q0, lambda r, t, q, qd: np.zeros((r.n,)))
|
|
271
|
+
|
|
272
|
+
The robot is controlled by a PD controller. We first define a
|
|
273
|
+
function to compute the control which has additional parameters for
|
|
274
|
+
the setpoint and control gains (qstar, P, D)::
|
|
275
|
+
|
|
276
|
+
>>> def myfunc(robot, t, q, qd, qstar, P, D):
|
|
277
|
+
>>> return (qstar - q) * P + qd * D # P, D are (6,)
|
|
278
|
+
|
|
279
|
+
>>> tg = robot.fdyn(10, q0, myfunc, torque_args=(qstar, P, D)) )
|
|
280
|
+
|
|
281
|
+
Many integrators have variable step length which is problematic if we
|
|
282
|
+
want to animate the result. If ``dt`` is specified then the solver
|
|
283
|
+
results are interpolated in time steps of ``dt``.
|
|
284
|
+
|
|
285
|
+
Notes
|
|
286
|
+
-----
|
|
287
|
+
- This function performs poorly with non-linear joint friction,
|
|
288
|
+
such as Coulomb friction. The R.nofriction() method can be used
|
|
289
|
+
to set this friction to zero.
|
|
290
|
+
- If the function is not specified then zero force/torque is
|
|
291
|
+
applied to the manipulator joints.
|
|
292
|
+
- Interpolation is performed using
|
|
293
|
+
`SciPy integrate.ode <https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.ode.html>`_
|
|
294
|
+
- The SciPy RK45 integrator is used by default
|
|
295
|
+
- Interpolation is performed using
|
|
296
|
+
`SciPy interp1d <https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.interp1d.html>`_
|
|
297
|
+
|
|
298
|
+
See Also
|
|
299
|
+
--------
|
|
300
|
+
:func:`DHRobot.accel`
|
|
301
|
+
:func:`DHRobot.nofriction`,
|
|
302
|
+
:func:`DHRobot.rne`.
|
|
303
|
+
|
|
304
|
+
"""
|
|
305
|
+
|
|
306
|
+
n = self.n
|
|
307
|
+
|
|
308
|
+
if not isscalar(T):
|
|
309
|
+
raise ValueError("T must be a scalar")
|
|
310
|
+
q0 = getvector(q0, n)
|
|
311
|
+
if qd0 is None:
|
|
312
|
+
qd0 = np.zeros((n,))
|
|
313
|
+
else:
|
|
314
|
+
qd0 = getvector(qd0, n)
|
|
315
|
+
if Q is not None:
|
|
316
|
+
if not callable(Q):
|
|
317
|
+
raise ValueError("generalized joint torque function must be callable")
|
|
318
|
+
|
|
319
|
+
# concatenate q and qd into the initial state vector
|
|
320
|
+
x0 = np.r_[q0, qd0]
|
|
321
|
+
|
|
322
|
+
# get user specified integrator
|
|
323
|
+
scipy_integrator = integrate.__dict__[solver]
|
|
324
|
+
|
|
325
|
+
integrator = scipy_integrator(
|
|
326
|
+
lambda t, y: self._fdyn(t, y, Q, Q_args),
|
|
327
|
+
t0=0.0,
|
|
328
|
+
y0=x0,
|
|
329
|
+
t_bound=T,
|
|
330
|
+
**solver_args,
|
|
331
|
+
)
|
|
332
|
+
|
|
333
|
+
# initialize list of time and states
|
|
334
|
+
tlist = [0]
|
|
335
|
+
xlist = [np.r_[q0, qd0]]
|
|
336
|
+
|
|
337
|
+
if progress:
|
|
338
|
+
_printProgressBar(0, prefix="Progress:", suffix="complete", length=60)
|
|
339
|
+
|
|
340
|
+
while integrator.status == "running":
|
|
341
|
+
# step the integrator, calls _fdyn multiple times
|
|
342
|
+
integrator.step()
|
|
343
|
+
|
|
344
|
+
if integrator.status == "failed":
|
|
345
|
+
raise RuntimeError("integration completed with failed status ")
|
|
346
|
+
|
|
347
|
+
# stash the results
|
|
348
|
+
tlist.append(integrator.t)
|
|
349
|
+
xlist.append(integrator.y)
|
|
350
|
+
|
|
351
|
+
# update the progress bar
|
|
352
|
+
if progress:
|
|
353
|
+
_printProgressBar(
|
|
354
|
+
integrator.t / T, prefix="Progress:", suffix="complete", length=60
|
|
355
|
+
)
|
|
356
|
+
|
|
357
|
+
# cleanup the progress bar
|
|
358
|
+
if progress:
|
|
359
|
+
print("\r" + " " * 90 + "\r")
|
|
360
|
+
|
|
361
|
+
tarray = np.array(tlist)
|
|
362
|
+
xarray = np.array(xlist)
|
|
363
|
+
|
|
364
|
+
if dt is not None:
|
|
365
|
+
# interpolate data to equal time steps of dt
|
|
366
|
+
interp = interpolate.interp1d(tarray, xarray, axis=0)
|
|
367
|
+
|
|
368
|
+
tnew = np.arange(0, T, dt)
|
|
369
|
+
xnew = interp(tnew)
|
|
370
|
+
return namedtuple("fdyn", "t q qd")(tnew, xnew[:, :n], xnew[:, n:])
|
|
371
|
+
else:
|
|
372
|
+
return namedtuple("fdyn", "t q qd")(tarray, xarray[:, :n], xarray[:, n:])
|
|
373
|
+
|
|
374
|
+
def _fdyn(
|
|
375
|
+
self: RobotProto,
|
|
376
|
+
t: float,
|
|
377
|
+
x: NDArray,
|
|
378
|
+
Qfunc: Callable[[Any, float, NDArray, NDArray], NDArray],
|
|
379
|
+
Qargs: Dict,
|
|
380
|
+
):
|
|
381
|
+
"""
|
|
382
|
+
Private function called by fdyn
|
|
383
|
+
|
|
384
|
+
Called by ``fdyn`` to evaluate the robot velocity and acceleration for
|
|
385
|
+
forward dynamics.
|
|
386
|
+
|
|
387
|
+
Parameters
|
|
388
|
+
----------
|
|
389
|
+
t
|
|
390
|
+
current time
|
|
391
|
+
x
|
|
392
|
+
current state [q, qd]
|
|
393
|
+
Qfunc
|
|
394
|
+
a function that computes torque as a function of time
|
|
395
|
+
and/or state
|
|
396
|
+
Qargs : dict
|
|
397
|
+
argumments passed to ``Qfunc``
|
|
398
|
+
|
|
399
|
+
Returns
|
|
400
|
+
-------
|
|
401
|
+
fdyn
|
|
402
|
+
derivative of current state [qd, qdd]
|
|
403
|
+
|
|
404
|
+
"""
|
|
405
|
+
n = self.n
|
|
406
|
+
|
|
407
|
+
q = x[0:n]
|
|
408
|
+
qd = x[n:]
|
|
409
|
+
|
|
410
|
+
# evaluate the torque function if one is given
|
|
411
|
+
if Qfunc is None:
|
|
412
|
+
tau = np.zeros((n,))
|
|
413
|
+
else:
|
|
414
|
+
tau = Qfunc(self, t, q, qd, **Qargs)
|
|
415
|
+
if len(tau) != n or not all(np.isreal(tau)):
|
|
416
|
+
raise RuntimeError(
|
|
417
|
+
"torque function must return vector with N real elements"
|
|
418
|
+
)
|
|
419
|
+
|
|
420
|
+
qdd = self.accel(q, qd, tau)
|
|
421
|
+
|
|
422
|
+
return np.r_[qd, qdd]
|
|
423
|
+
|
|
424
|
+
def accel(self: RobotProto, q, qd, torque, gravity=None):
|
|
425
|
+
r"""
|
|
426
|
+
Compute acceleration due to applied torque
|
|
427
|
+
|
|
428
|
+
``qdd = accel(q, qd, torque)`` calculates a vector (n) of joint
|
|
429
|
+
accelerations that result from applying the actuator force/torque (n)
|
|
430
|
+
to the manipulator in state `q` (n) and `qd` (n), and ``n`` is
|
|
431
|
+
the number of robot joints.
|
|
432
|
+
|
|
433
|
+
.. math::
|
|
434
|
+
|
|
435
|
+
\ddot{q} = \mathbf{M}^{-1} \left(\tau - \mathbf{C}(q)\dot{q} - \mathbf{g}(q)\right)
|
|
436
|
+
|
|
437
|
+
**Trajectory operation**
|
|
438
|
+
|
|
439
|
+
If `q`, `qd`, torque are matrices (m,n) then ``qdd`` is a matrix (m,n)
|
|
440
|
+
where each row is the acceleration corresponding to the equivalent rows
|
|
441
|
+
of q, qd, torque.
|
|
442
|
+
|
|
443
|
+
Parameters
|
|
444
|
+
----------
|
|
445
|
+
q
|
|
446
|
+
Joint coordinates
|
|
447
|
+
qd
|
|
448
|
+
Joint velocity
|
|
449
|
+
torque
|
|
450
|
+
Joint torques of the robot
|
|
451
|
+
gravity
|
|
452
|
+
Gravitational acceleration (Optional, if not supplied will
|
|
453
|
+
use the ``gravity`` attribute of self).
|
|
454
|
+
|
|
455
|
+
Returns
|
|
456
|
+
-------
|
|
457
|
+
ndarray(n)
|
|
458
|
+
|
|
459
|
+
Examples
|
|
460
|
+
--------
|
|
461
|
+
.. runblock:: pycon
|
|
462
|
+
>>> import roboticstoolbox as rtb
|
|
463
|
+
>>> puma = rtb.models.DH.Puma560()
|
|
464
|
+
>>> puma.accel(puma.qz, 0.5 * np.ones(6), np.zeros(6))
|
|
465
|
+
|
|
466
|
+
Notes
|
|
467
|
+
-----
|
|
468
|
+
- Useful for simulation of manipulator dynamics, in
|
|
469
|
+
conjunction with a numerical integration function.
|
|
470
|
+
- Uses the method 1 of Walker and Orin to compute the forward
|
|
471
|
+
dynamics.
|
|
472
|
+
- Featherstone's method is more efficient for robots with large
|
|
473
|
+
numbers of joints.
|
|
474
|
+
- Joint friction is considered.
|
|
475
|
+
|
|
476
|
+
References
|
|
477
|
+
----------
|
|
478
|
+
- Efficient dynamic computer simulation of robotic mechanisms,
|
|
479
|
+
M. W. Walker and D. E. Orin,
|
|
480
|
+
ASME Journa of Dynamic Systems, Measurement and Control, vol.
|
|
481
|
+
104, no. 3, pp. 205-211, 1982.
|
|
482
|
+
|
|
483
|
+
""" # noqa
|
|
484
|
+
|
|
485
|
+
q = getmatrix(q, (None, self.n))
|
|
486
|
+
qd = getmatrix(qd, (None, self.n))
|
|
487
|
+
torque = getmatrix(torque, (None, self.n))
|
|
488
|
+
|
|
489
|
+
qdd = np.zeros((q.shape[0], self.n))
|
|
490
|
+
|
|
491
|
+
for k, (qk, qdk, tauk) in enumerate(zip(q, qd, torque)):
|
|
492
|
+
# Compute current manipulator inertia torques resulting from unit
|
|
493
|
+
# acceleration of each joint with no gravity.
|
|
494
|
+
qI = (np.c_[qk] @ np.ones((1, self.n))).T
|
|
495
|
+
qdI = np.zeros((self.n, self.n))
|
|
496
|
+
qddI = np.eye(self.n)
|
|
497
|
+
|
|
498
|
+
M = self.rne(qI, qdI, qddI, gravity=[0, 0, 0])
|
|
499
|
+
|
|
500
|
+
# Compute gravity and coriolis torque torques resulting from zero
|
|
501
|
+
# acceleration at given velocity & with gravity acting.
|
|
502
|
+
tau = self.rne(qk, qdk, np.zeros((1, self.n)), gravity=gravity)
|
|
503
|
+
|
|
504
|
+
# solve is faster than inv() which is faster than pinv()
|
|
505
|
+
qdd[k, :] = np.linalg.solve(M, tauk - tau)
|
|
506
|
+
|
|
507
|
+
if q.shape[0] == 1:
|
|
508
|
+
return qdd[0, :]
|
|
509
|
+
else:
|
|
510
|
+
return qdd
|
|
511
|
+
|
|
512
|
+
def pay(
|
|
513
|
+
self: RobotProto,
|
|
514
|
+
W: ArrayLike,
|
|
515
|
+
q: Union[NDArray, None] = None,
|
|
516
|
+
J: Union[NDArray, None] = None,
|
|
517
|
+
frame: int = 1,
|
|
518
|
+
):
|
|
519
|
+
"""
|
|
520
|
+
Generalised joint force/torque due to a payload wrench
|
|
521
|
+
|
|
522
|
+
tau = pay(W, J) Returns the generalised joint force/torques due to a
|
|
523
|
+
payload wrench W applied to the end-effector. Where the manipulator
|
|
524
|
+
Jacobian is J (6xn), and n is the number of robot joints.
|
|
525
|
+
|
|
526
|
+
tau = pay(W, q, frame) as above but the Jacobian is calculated at pose
|
|
527
|
+
q in the frame given by frame which is 0 for base frame, 1 for
|
|
528
|
+
end-effector frame.
|
|
529
|
+
|
|
530
|
+
Uses the formula tau = J'W, where W is a wrench vector applied at the
|
|
531
|
+
end effector, W = [Fx Fy Fz Mx My Mz]'.
|
|
532
|
+
|
|
533
|
+
Trajectory operation:
|
|
534
|
+
In the case q is nxm or J is 6xnxm then tau is nxm where each row
|
|
535
|
+
is the generalised force/torque at the pose given by corresponding
|
|
536
|
+
row of q.
|
|
537
|
+
|
|
538
|
+
Parameters
|
|
539
|
+
----------
|
|
540
|
+
W
|
|
541
|
+
A wrench vector applied at the end effector,
|
|
542
|
+
W = [Fx Fy Fz Mx My Mz]
|
|
543
|
+
q
|
|
544
|
+
Joint coordinates
|
|
545
|
+
J
|
|
546
|
+
The manipulator Jacobian (Optional, if not supplied will
|
|
547
|
+
use the q value).
|
|
548
|
+
frame
|
|
549
|
+
The frame in which to torques are expressed in when J
|
|
550
|
+
is not supplied. 0 means base frame of the robot, 1 means end-
|
|
551
|
+
effector frame
|
|
552
|
+
|
|
553
|
+
Returns
|
|
554
|
+
-------
|
|
555
|
+
t
|
|
556
|
+
Joint forces/torques due to w
|
|
557
|
+
|
|
558
|
+
Notes
|
|
559
|
+
-----
|
|
560
|
+
- Wrench vector and Jacobian must be from the same reference
|
|
561
|
+
frame.
|
|
562
|
+
- Tool transforms are taken into consideration when frame=1.
|
|
563
|
+
- Must have a constant wrench - no trajectory support for this
|
|
564
|
+
yet.
|
|
565
|
+
|
|
566
|
+
"""
|
|
567
|
+
|
|
568
|
+
try:
|
|
569
|
+
W = np.array(getvector(W, 6))
|
|
570
|
+
trajn = 0
|
|
571
|
+
except ValueError:
|
|
572
|
+
if isinstance(W, NDArray):
|
|
573
|
+
trajn = W.shape[0]
|
|
574
|
+
verifymatrix(W, (trajn, 6))
|
|
575
|
+
else:
|
|
576
|
+
raise ValueError("W is invalid")
|
|
577
|
+
|
|
578
|
+
if trajn:
|
|
579
|
+
# A trajectory
|
|
580
|
+
if J is not None:
|
|
581
|
+
# Jacobian supplied
|
|
582
|
+
verifymatrix(J, (trajn, 6, self.n))
|
|
583
|
+
elif q is not None:
|
|
584
|
+
# Use q instead
|
|
585
|
+
verifymatrix(q, (trajn, self.n))
|
|
586
|
+
J = np.zeros((trajn, 6, self.n))
|
|
587
|
+
for i in range(trajn):
|
|
588
|
+
if frame:
|
|
589
|
+
J[i, :, :] = self.jacobe(q[i, :])
|
|
590
|
+
else:
|
|
591
|
+
J[i, :, :] = self.jacob0(q[i, :])
|
|
592
|
+
else:
|
|
593
|
+
raise ValueError("q of J is needed for trajectory")
|
|
594
|
+
else:
|
|
595
|
+
# Single configuration
|
|
596
|
+
if J is not None:
|
|
597
|
+
# Jacobian supplied
|
|
598
|
+
verifymatrix(J, (6, self.n))
|
|
599
|
+
else:
|
|
600
|
+
# Use q instead
|
|
601
|
+
if q is None:
|
|
602
|
+
q = np.copy(self.q)
|
|
603
|
+
else:
|
|
604
|
+
q = getvector(q, self.n)
|
|
605
|
+
|
|
606
|
+
if frame:
|
|
607
|
+
J = self.jacobe(q)
|
|
608
|
+
else:
|
|
609
|
+
J = self.jacob0(q)
|
|
610
|
+
|
|
611
|
+
if trajn == 0:
|
|
612
|
+
tau = -J.T @ W
|
|
613
|
+
else:
|
|
614
|
+
tau = np.zeros((trajn, self.n))
|
|
615
|
+
|
|
616
|
+
for i in range(trajn):
|
|
617
|
+
tau[i, :] = -J[i, :, :].T @ W[i, :]
|
|
618
|
+
|
|
619
|
+
return tau
|
|
620
|
+
|
|
621
|
+
def payload(self: RobotProto, m: float, p=np.zeros(3)):
|
|
622
|
+
"""
|
|
623
|
+
Add a payload to the end-effector
|
|
624
|
+
|
|
625
|
+
payload(m, p) adds payload mass adds a payload with point mass m at
|
|
626
|
+
position p in the end-effector coordinate frame.
|
|
627
|
+
|
|
628
|
+
payload(m) adds payload mass adds a payload with point mass m at
|
|
629
|
+
in the end-effector coordinate frame.
|
|
630
|
+
|
|
631
|
+
payload(0) removes added payload.
|
|
632
|
+
|
|
633
|
+
Parameters
|
|
634
|
+
----------
|
|
635
|
+
m
|
|
636
|
+
mass (kg)
|
|
637
|
+
p
|
|
638
|
+
position in end-effector frame
|
|
639
|
+
|
|
640
|
+
"""
|
|
641
|
+
|
|
642
|
+
p = getvector(p, 3, out="col")
|
|
643
|
+
lastlink = self.links[self.n - 1]
|
|
644
|
+
|
|
645
|
+
lastlink.m = m
|
|
646
|
+
lastlink.r = p
|
|
647
|
+
|
|
648
|
+
def jointdynamics(self: RobotProto, q, qd=None):
|
|
649
|
+
"""
|
|
650
|
+
Transfer function of joint actuator
|
|
651
|
+
|
|
652
|
+
``tf = jointdynamics(qd, q)`` calculates a vector of n
|
|
653
|
+
continuous-time transfer functions that represent the transfer
|
|
654
|
+
function 1/(Js+B) for each joint based on the dynamic parameters
|
|
655
|
+
of the robot and the configuration q (n). n is the number of robot
|
|
656
|
+
joints. The result is a list of tuples (J, B) for each joint.
|
|
657
|
+
|
|
658
|
+
``tf = jointdynamics(q, qd)`` as above but include the linearized
|
|
659
|
+
effects of Coulomb friction when operating at joint velocity QD
|
|
660
|
+
(1xN).
|
|
661
|
+
|
|
662
|
+
Parameters
|
|
663
|
+
----------
|
|
664
|
+
q
|
|
665
|
+
Joint coordinates
|
|
666
|
+
qd
|
|
667
|
+
Joint velocity
|
|
668
|
+
|
|
669
|
+
Returns
|
|
670
|
+
-------
|
|
671
|
+
list of 2-tuples
|
|
672
|
+
transfer function denominators
|
|
673
|
+
|
|
674
|
+
"""
|
|
675
|
+
|
|
676
|
+
tf = []
|
|
677
|
+
for j, link in enumerate(self.links):
|
|
678
|
+
# compute inertia for this joint
|
|
679
|
+
zero = np.zeros((self.n))
|
|
680
|
+
qdd = np.zeros((self.n))
|
|
681
|
+
qdd[j] = 1
|
|
682
|
+
M = self.rne(q, zero, qdd, gravity=[0, 0, 0])
|
|
683
|
+
J = link.Jm + M[j] / abs(link.G) ** 2
|
|
684
|
+
|
|
685
|
+
# compute friction
|
|
686
|
+
B = link.B
|
|
687
|
+
if qd is not None:
|
|
688
|
+
# add linearized Coulomb friction at the operating point
|
|
689
|
+
if qd > 0:
|
|
690
|
+
B += link.Tc[0] / qd[j]
|
|
691
|
+
elif qd < 0:
|
|
692
|
+
B += link.Tc[1] / qd[j]
|
|
693
|
+
tf.append(((1,), (J, B)))
|
|
694
|
+
|
|
695
|
+
return tf
|
|
696
|
+
|
|
697
|
+
def cinertia(self: RobotProto, q):
|
|
698
|
+
"""
|
|
699
|
+
Deprecated, use ``inertia_x``
|
|
700
|
+
|
|
701
|
+
"""
|
|
702
|
+
warnings.warn("cinertia is deprecated, use inertia_x", DeprecationWarning)
|
|
703
|
+
|
|
704
|
+
def inertia(self: RobotProto, q: NDArray) -> NDArray:
|
|
705
|
+
"""Manipulator inertia matrix
|
|
706
|
+
``inertia(q)`` is the symmetric joint inertia matrix (n,n) which
|
|
707
|
+
relates joint torque to joint acceleration for the robot at joint
|
|
708
|
+
configuration q.
|
|
709
|
+
|
|
710
|
+
**Trajectory operation**
|
|
711
|
+
|
|
712
|
+
If ``q`` is a matrix (m,n), each row is interpretted as a joint state
|
|
713
|
+
vector, and the result is a 3d-matrix (nxnxk) where each plane
|
|
714
|
+
corresponds to the inertia for the corresponding row of q.
|
|
715
|
+
|
|
716
|
+
Parameters
|
|
717
|
+
----------
|
|
718
|
+
q
|
|
719
|
+
Joint coordinates
|
|
720
|
+
|
|
721
|
+
Returns
|
|
722
|
+
-------
|
|
723
|
+
inertia
|
|
724
|
+
The inertia matrix
|
|
725
|
+
|
|
726
|
+
Examples
|
|
727
|
+
--------
|
|
728
|
+
.. runblock:: pycon
|
|
729
|
+
>>> import roboticstoolbox as rtb
|
|
730
|
+
>>> puma = rtb.models.DH.Puma560()
|
|
731
|
+
>>> puma.inertia(puma.qz)
|
|
732
|
+
|
|
733
|
+
Notes
|
|
734
|
+
-----
|
|
735
|
+
- The diagonal elements ``M[j,j]`` are the inertia seen by joint
|
|
736
|
+
actuator ``j``.
|
|
737
|
+
- The off-diagonal elements ``M[j,k]`` are coupling inertias that
|
|
738
|
+
relate acceleration on joint ``j`` to force/torque on
|
|
739
|
+
joint ``k``.
|
|
740
|
+
- The diagonal terms include the motor inertia reflected through
|
|
741
|
+
the gear ratio.
|
|
742
|
+
|
|
743
|
+
See Also
|
|
744
|
+
--------
|
|
745
|
+
:func:`cinertia`
|
|
746
|
+
|
|
747
|
+
"""
|
|
748
|
+
q = getmatrix(q, (None, self.n))
|
|
749
|
+
|
|
750
|
+
In = np.zeros((q.shape[0], self.n, self.n))
|
|
751
|
+
|
|
752
|
+
for k, qk in enumerate(q):
|
|
753
|
+
In[k, :, :] = self.rne(
|
|
754
|
+
(np.c_[qk] @ np.ones((1, self.n))).T,
|
|
755
|
+
np.zeros((self.n, self.n)),
|
|
756
|
+
np.eye(self.n),
|
|
757
|
+
gravity=[0, 0, 0],
|
|
758
|
+
)
|
|
759
|
+
|
|
760
|
+
if q.shape[0] == 1:
|
|
761
|
+
return In[0, :, :]
|
|
762
|
+
else:
|
|
763
|
+
return In
|
|
764
|
+
|
|
765
|
+
def coriolis(self: RobotProto, q, qd):
|
|
766
|
+
r"""
|
|
767
|
+
Coriolis and centripetal term
|
|
768
|
+
|
|
769
|
+
``coriolis(q, qd)`` calculates the Coriolis/centripetal matrix (n,n)
|
|
770
|
+
for the robot in configuration ``q`` and velocity ``qd``, where ``n``
|
|
771
|
+
is the number of joints.
|
|
772
|
+
|
|
773
|
+
The product :math:`\mathbf{C} \dot{q}` is the vector of joint
|
|
774
|
+
force/torque due to velocity coupling. The diagonal elements are due to
|
|
775
|
+
centripetal effects and the off-diagonal elements are due to Coriolis
|
|
776
|
+
effects. This matrix is also known as the velocity coupling matrix,
|
|
777
|
+
since it describes the disturbance forces on any joint due to
|
|
778
|
+
velocity of all other joints.
|
|
779
|
+
|
|
780
|
+
**Trajectory operation**
|
|
781
|
+
|
|
782
|
+
If ``q`` and `qd` are matrices (m,n), each row is interpretted as a
|
|
783
|
+
joint configuration, and the result (n,n,m) is a 3d-matrix where
|
|
784
|
+
each plane corresponds to a row of ``q`` and ``qd``.
|
|
785
|
+
|
|
786
|
+
Parameters
|
|
787
|
+
----------
|
|
788
|
+
q
|
|
789
|
+
Joint coordinates
|
|
790
|
+
qd
|
|
791
|
+
Joint velocity
|
|
792
|
+
|
|
793
|
+
Returns
|
|
794
|
+
-------
|
|
795
|
+
coriolis
|
|
796
|
+
Velocity matrix
|
|
797
|
+
|
|
798
|
+
Examples
|
|
799
|
+
--------
|
|
800
|
+
.. runblock:: pycon
|
|
801
|
+
>>> import roboticstoolbox as rtb
|
|
802
|
+
>>> puma = rtb.models.DH.Puma560()
|
|
803
|
+
>>> puma.coriolis(puma.qz, 0.5 * np.ones((6,)))
|
|
804
|
+
|
|
805
|
+
Notes
|
|
806
|
+
-----
|
|
807
|
+
- Joint viscous friction is also a joint force proportional to
|
|
808
|
+
velocity but it is eliminated in the computation of this value.
|
|
809
|
+
- Computationally slow, involves :math:`n^2/2` invocations of RNE.
|
|
810
|
+
|
|
811
|
+
"""
|
|
812
|
+
|
|
813
|
+
q = getmatrix(q, (None, self.n))
|
|
814
|
+
qd = getmatrix(qd, (None, self.n))
|
|
815
|
+
if q.shape[0] != qd.shape[0]:
|
|
816
|
+
raise ValueError("q and qd must have the same number of rows")
|
|
817
|
+
|
|
818
|
+
# ensure that friction doesn't enter the mix, it's also a velocity
|
|
819
|
+
# dependent force/torque
|
|
820
|
+
r1 = self.nofriction(True, True)
|
|
821
|
+
|
|
822
|
+
C = np.zeros((q.shape[0], self.n, self.n))
|
|
823
|
+
Csq = np.zeros((q.shape[0], self.n, self.n))
|
|
824
|
+
|
|
825
|
+
# Find the torques that depend on a single finite joint speed,
|
|
826
|
+
# these are due to the squared (centripetal) terms
|
|
827
|
+
# set QD = [1 0 0 ...] then resulting torque is due to qd_1^2
|
|
828
|
+
for k, qk in enumerate(q):
|
|
829
|
+
for i in range(self.n):
|
|
830
|
+
QD = np.zeros(self.n)
|
|
831
|
+
QD[i] = 1
|
|
832
|
+
tau = r1.rne(qk, QD, np.zeros(self.n), gravity=[0, 0, 0])
|
|
833
|
+
Csq[k, :, i] = Csq[k, :, i] + tau
|
|
834
|
+
|
|
835
|
+
# Find the torques that depend on a pair of finite joint speeds,
|
|
836
|
+
# these are due to the product (Coriolis) terms
|
|
837
|
+
# set QD = [1 1 0 ...] then resulting torque is due to
|
|
838
|
+
# qd_1 qd_2 + qd_1^2 + qd_2^2
|
|
839
|
+
for k, (qk, qdk) in enumerate(zip(q, qd)):
|
|
840
|
+
for i in range(self.n):
|
|
841
|
+
for j in range(i + 1, self.n):
|
|
842
|
+
# Find a product term qd_i * qd_j
|
|
843
|
+
QD = np.zeros(self.n)
|
|
844
|
+
QD[i] = 1
|
|
845
|
+
QD[j] = 1
|
|
846
|
+
tau = r1.rne(qk, QD, np.zeros(self.n), gravity=[0, 0, 0])
|
|
847
|
+
|
|
848
|
+
C[k, :, j] = (
|
|
849
|
+
C[k, :, j] + (tau - Csq[k, :, j] - Csq[k, :, i]) * qdk[i] / 2
|
|
850
|
+
)
|
|
851
|
+
|
|
852
|
+
C[k, :, i] = (
|
|
853
|
+
C[k, :, i] + (tau - Csq[k, :, j] - Csq[k, :, i]) * qdk[j] / 2
|
|
854
|
+
)
|
|
855
|
+
|
|
856
|
+
C[k, :, :] = C[k, :, :] + Csq[k, :, :] @ np.diag(qdk)
|
|
857
|
+
|
|
858
|
+
if q.shape[0] == 1:
|
|
859
|
+
return C[0, :, :]
|
|
860
|
+
else:
|
|
861
|
+
return C
|
|
862
|
+
|
|
863
|
+
def gravload(
|
|
864
|
+
self: RobotProto,
|
|
865
|
+
q: Union[ArrayLike, None] = None,
|
|
866
|
+
gravity: Union[ArrayLike, None] = None,
|
|
867
|
+
):
|
|
868
|
+
"""
|
|
869
|
+
Compute gravity load
|
|
870
|
+
|
|
871
|
+
``robot.gravload(q)`` calculates the joint gravity loading (n) for
|
|
872
|
+
the robot in the joint configuration ``q`` and using the default
|
|
873
|
+
gravitational acceleration specified in the DHRobot object.
|
|
874
|
+
|
|
875
|
+
``robot.gravload(q, gravity=g)`` as above except the gravitational
|
|
876
|
+
acceleration is explicitly specified as ``g``.
|
|
877
|
+
|
|
878
|
+
**Trajectory operation**
|
|
879
|
+
|
|
880
|
+
If q is a matrix (nxm) each column is interpreted as a joint
|
|
881
|
+
configuration vector, and the result is a matrix (nxm) each column
|
|
882
|
+
being the corresponding joint torques.
|
|
883
|
+
|
|
884
|
+
Parameters
|
|
885
|
+
----------
|
|
886
|
+
q
|
|
887
|
+
Joint coordinates
|
|
888
|
+
gravity : ndarray(3)
|
|
889
|
+
Gravitational acceleration (Optional, if not supplied will
|
|
890
|
+
use the stored gravity values).
|
|
891
|
+
|
|
892
|
+
Returns
|
|
893
|
+
-------
|
|
894
|
+
gravload
|
|
895
|
+
The generalised joint force/torques due to gravity
|
|
896
|
+
|
|
897
|
+
Examples
|
|
898
|
+
--------
|
|
899
|
+
.. runblock:: pycon
|
|
900
|
+
>>> import roboticstoolbox as rtb
|
|
901
|
+
>>> puma = rtb.models.DH.Puma560()
|
|
902
|
+
>>> puma.gravload(puma.qz)
|
|
903
|
+
|
|
904
|
+
"""
|
|
905
|
+
|
|
906
|
+
q = getmatrix(q, (None, self.n))
|
|
907
|
+
|
|
908
|
+
if gravity is None:
|
|
909
|
+
gravity = self.gravity
|
|
910
|
+
else:
|
|
911
|
+
gravity = getvector(gravity, 3)
|
|
912
|
+
|
|
913
|
+
taug = np.zeros((q.shape[0], self.n))
|
|
914
|
+
z = np.zeros(self.n)
|
|
915
|
+
|
|
916
|
+
for k, qk in enumerate(q):
|
|
917
|
+
taug[k, :] = self.rne(qk, z, z, gravity=gravity)
|
|
918
|
+
|
|
919
|
+
if q.shape[0] == 1:
|
|
920
|
+
return taug[0, :]
|
|
921
|
+
else:
|
|
922
|
+
return taug
|
|
923
|
+
|
|
924
|
+
def inertia_x(
|
|
925
|
+
self: RobotProto, q=None, pinv=False, representation="rpy/xyz", Ji=None
|
|
926
|
+
):
|
|
927
|
+
r"""
|
|
928
|
+
Operational space inertia matrix
|
|
929
|
+
|
|
930
|
+
``robot.inertia_x(q)`` is the operational space (Cartesian) inertia
|
|
931
|
+
matrix which relates Cartesian force/torque to Cartesian
|
|
932
|
+
acceleration at the joint configuration q.
|
|
933
|
+
|
|
934
|
+
.. math::
|
|
935
|
+
|
|
936
|
+
\mathbf{M}_x = \mathbf{J}(q)^{-T} \mathbf{M}(q) \mathbf{J}(q)^{-1}
|
|
937
|
+
|
|
938
|
+
The transformation to operational space requires an analytical, rather
|
|
939
|
+
than geometric, Jacobian. ``analytical`` can be one of:
|
|
940
|
+
|
|
941
|
+
============= ========================================
|
|
942
|
+
Value Rotational representation
|
|
943
|
+
============= ========================================
|
|
944
|
+
``'rpy/xyz'`` RPY angular rates in XYZ order (default)
|
|
945
|
+
``'rpy/zyx'`` RPY angular rates in XYZ order
|
|
946
|
+
``'eul'`` Euler angular rates in ZYZ order
|
|
947
|
+
``'exp'`` exponential coordinate rates
|
|
948
|
+
============= ========================================
|
|
949
|
+
|
|
950
|
+
**Trajectory operation**
|
|
951
|
+
|
|
952
|
+
If ``q`` is a matrix (m,n), each row is interpretted as a joint state
|
|
953
|
+
vector, and the result is a 3d-matrix (m,n,n) where each plane
|
|
954
|
+
corresponds to the Cartesian inertia for the corresponding
|
|
955
|
+
row of ``q``.
|
|
956
|
+
|
|
957
|
+
Parameters
|
|
958
|
+
----------
|
|
959
|
+
q
|
|
960
|
+
Joint coordinates
|
|
961
|
+
pinv
|
|
962
|
+
use pseudo inverse rather than inverse (Default value = False)
|
|
963
|
+
analytical
|
|
964
|
+
the type of analytical Jacobian to use, default is
|
|
965
|
+
'rpy/xyz'
|
|
966
|
+
representation
|
|
967
|
+
(Default value = "rpy/xyz")
|
|
968
|
+
Ji
|
|
969
|
+
The inverse analytical Jacobian (base-frame)
|
|
970
|
+
|
|
971
|
+
Returns
|
|
972
|
+
-------
|
|
973
|
+
inertia_x
|
|
974
|
+
The operational space inertia matrix
|
|
975
|
+
|
|
976
|
+
Examples
|
|
977
|
+
--------
|
|
978
|
+
.. runblock:: pycon
|
|
979
|
+
>>> import roboticstoolbox as rtb
|
|
980
|
+
>>> puma = rtb.models.DH.Puma560()
|
|
981
|
+
>>> puma.inertia_x(puma.qn)
|
|
982
|
+
|
|
983
|
+
Notes
|
|
984
|
+
-----
|
|
985
|
+
- If the robot is not 6 DOF the ``pinv`` option is set True.
|
|
986
|
+
- ``pinv()`` is around 5x slower than ``inv()``
|
|
987
|
+
|
|
988
|
+
.. warning:: Assumes that the operational space has 6 DOF.
|
|
989
|
+
|
|
990
|
+
See Also
|
|
991
|
+
--------
|
|
992
|
+
:func:`inertia`
|
|
993
|
+
|
|
994
|
+
"""
|
|
995
|
+
|
|
996
|
+
q = getmatrix(q, (None, self.n))
|
|
997
|
+
if q.shape[1] != 6:
|
|
998
|
+
pinv = True
|
|
999
|
+
|
|
1000
|
+
if q.shape[0] == 1:
|
|
1001
|
+
# single q case
|
|
1002
|
+
if Ji is None:
|
|
1003
|
+
Ja = self.jacob0_analytical(q[0, :], representation)
|
|
1004
|
+
if pinv:
|
|
1005
|
+
Ji = np.linalg.pinv(Ja)
|
|
1006
|
+
else:
|
|
1007
|
+
Ji = np.linalg.inv(Ja)
|
|
1008
|
+
M = self.inertia(q[0, :])
|
|
1009
|
+
return Ji.T @ M @ Ji
|
|
1010
|
+
|
|
1011
|
+
else:
|
|
1012
|
+
# trajectory case
|
|
1013
|
+
Mt = np.zeros((q.shape[0], 6, 6))
|
|
1014
|
+
|
|
1015
|
+
for k, qk in enumerate(q):
|
|
1016
|
+
Ja = self.jacob0_analytical(qk, representation)
|
|
1017
|
+
if pinv:
|
|
1018
|
+
Ji = np.linalg.pinv(Ja)
|
|
1019
|
+
else:
|
|
1020
|
+
Ji = np.linalg.inv(Ja)
|
|
1021
|
+
M = self.inertia(qk)
|
|
1022
|
+
Mt[k, :, :] = Ji.T @ M @ Ji
|
|
1023
|
+
|
|
1024
|
+
return Mt
|
|
1025
|
+
|
|
1026
|
+
def coriolis_x(
|
|
1027
|
+
self: RobotProto,
|
|
1028
|
+
q,
|
|
1029
|
+
qd,
|
|
1030
|
+
pinv=False,
|
|
1031
|
+
representation="rpy/xyz",
|
|
1032
|
+
J=None,
|
|
1033
|
+
Ji=None,
|
|
1034
|
+
Jd=None,
|
|
1035
|
+
C=None,
|
|
1036
|
+
Mx=None,
|
|
1037
|
+
):
|
|
1038
|
+
r"""
|
|
1039
|
+
Operational space Coriolis and centripetal term
|
|
1040
|
+
|
|
1041
|
+
``coriolis_x(q, qd)`` is the Coriolis/centripetal matrix (m,m)
|
|
1042
|
+
in operational space for the robot in configuration ``q`` and velocity
|
|
1043
|
+
``qd``, where ``n`` is the number of joints.
|
|
1044
|
+
|
|
1045
|
+
.. math::
|
|
1046
|
+
|
|
1047
|
+
\mathbf{C}_x = \mathbf{J}(q)^{-T} \left(
|
|
1048
|
+
\mathbf{C}(q) - \mathbf{M}_x(q) \mathbf{J})(q)
|
|
1049
|
+
\right) \mathbf{J}(q)^{-1}
|
|
1050
|
+
|
|
1051
|
+
The product :math:`\mathbf{C} \dot{x}` is the operational space wrench
|
|
1052
|
+
due to joint velocity coupling. This matrix is also known as the
|
|
1053
|
+
velocity coupling matrix, since it describes the disturbance forces on
|
|
1054
|
+
any joint due to velocity of all other joints.
|
|
1055
|
+
|
|
1056
|
+
The transformation to operational space requires an analytical, rather
|
|
1057
|
+
than geometric, Jacobian. ``analytical`` can be one of:
|
|
1058
|
+
|
|
1059
|
+
============= ========================================
|
|
1060
|
+
Value Rotational representation
|
|
1061
|
+
============= ========================================
|
|
1062
|
+
``'rpy/xyz'`` RPY angular rates in XYZ order (default)
|
|
1063
|
+
``'rpy/zyx'`` RPY angular rates in XYZ order
|
|
1064
|
+
``'eul'`` Euler angular rates in ZYZ order
|
|
1065
|
+
``'exp'`` exponential coordinate rates
|
|
1066
|
+
============= ========================================
|
|
1067
|
+
|
|
1068
|
+
**Trajectory operation**
|
|
1069
|
+
|
|
1070
|
+
If ``q`` and `qd` are matrices (m,n), each row is interpretted as a
|
|
1071
|
+
joint configuration, and the result (n,n,m) is a 3d-matrix where
|
|
1072
|
+
each plane corresponds to a row of ``q`` and ``qd``.
|
|
1073
|
+
|
|
1074
|
+
Parameters
|
|
1075
|
+
----------
|
|
1076
|
+
q
|
|
1077
|
+
Joint coordinates
|
|
1078
|
+
qd
|
|
1079
|
+
Joint velocity
|
|
1080
|
+
pinv
|
|
1081
|
+
use pseudo inverse rather than inverse (Default value = False)
|
|
1082
|
+
analytical
|
|
1083
|
+
the type of analytical Jacobian to use, default is
|
|
1084
|
+
'rpy/xyz'
|
|
1085
|
+
representation
|
|
1086
|
+
(Default value = "rpy/xyz")
|
|
1087
|
+
J
|
|
1088
|
+
|
|
1089
|
+
Ji
|
|
1090
|
+
|
|
1091
|
+
Jd
|
|
1092
|
+
|
|
1093
|
+
C
|
|
1094
|
+
|
|
1095
|
+
Mx
|
|
1096
|
+
|
|
1097
|
+
|
|
1098
|
+
Returns
|
|
1099
|
+
-------
|
|
1100
|
+
ndarray(6,6) or ndarray(m,6,6)
|
|
1101
|
+
Operational space velocity matrix
|
|
1102
|
+
|
|
1103
|
+
Examples
|
|
1104
|
+
--------
|
|
1105
|
+
.. runblock:: pycon
|
|
1106
|
+
>>> import roboticstoolbox as rtb
|
|
1107
|
+
>>> puma = rtb.models.DH.Puma560()
|
|
1108
|
+
>>> puma.coriolis_x(puma.qn, 0.5 * np.ones((6,)))
|
|
1109
|
+
|
|
1110
|
+
Notes
|
|
1111
|
+
-----
|
|
1112
|
+
- Joint viscous friction is also a joint force proportional to
|
|
1113
|
+
velocity but it is eliminated in the computation of this value.
|
|
1114
|
+
- Computationally slow, involves :math:`n^2/2` invocations of RNE.
|
|
1115
|
+
- If the robot is not 6 DOF the ``pinv`` option is set True.
|
|
1116
|
+
- ``pinv()`` is around 5x slower than ``inv()``
|
|
1117
|
+
|
|
1118
|
+
.. warning:: Assumes that the operational space has 6 DOF.
|
|
1119
|
+
|
|
1120
|
+
See Also
|
|
1121
|
+
--------
|
|
1122
|
+
:func:`coriolis`
|
|
1123
|
+
:func:`inertia_x`
|
|
1124
|
+
:func:`hessian0`
|
|
1125
|
+
|
|
1126
|
+
"""
|
|
1127
|
+
|
|
1128
|
+
q = getmatrix(q, (None, self.n))
|
|
1129
|
+
qd = getmatrix(qd, (None, self.n))
|
|
1130
|
+
n = q.shape[1]
|
|
1131
|
+
if n != 6:
|
|
1132
|
+
pinv = True
|
|
1133
|
+
|
|
1134
|
+
if q.shape[0] == 1:
|
|
1135
|
+
# single q case
|
|
1136
|
+
if Ji is None:
|
|
1137
|
+
Ja = self.jacob0_analytical(q[0, :], representation)
|
|
1138
|
+
if pinv:
|
|
1139
|
+
Ji = np.linalg.pinv(Ja)
|
|
1140
|
+
else:
|
|
1141
|
+
Ji = np.linalg.inv(Ja)
|
|
1142
|
+
if C is None:
|
|
1143
|
+
C = self.coriolis(q[0, :], qd[0, :])
|
|
1144
|
+
if Mx is None:
|
|
1145
|
+
Mx = self.inertia_x(q[0, :], Ji=Ji)
|
|
1146
|
+
if Jd is None:
|
|
1147
|
+
Jd = self.jacob0_dot(q[0, :], qd[0, :], J0=Ja)
|
|
1148
|
+
return Ji.T @ (C - Mx @ Jd) @ Ji
|
|
1149
|
+
else:
|
|
1150
|
+
# trajectory case
|
|
1151
|
+
Ct = np.zeros((q.shape[0], 6, 6))
|
|
1152
|
+
|
|
1153
|
+
for k, (qk, qdk) in enumerate(zip(q, qd)):
|
|
1154
|
+
if Ji is None:
|
|
1155
|
+
Ja = self.jacob0_analytical(q[0, :], representation)
|
|
1156
|
+
if pinv:
|
|
1157
|
+
Ji = np.linalg.pinv(Ja)
|
|
1158
|
+
else:
|
|
1159
|
+
Ji = np.linalg.inv(Ja)
|
|
1160
|
+
|
|
1161
|
+
C = self.coriolis(qk, qdk)
|
|
1162
|
+
Mx = self.inertia_x(qk, Ji=Ji)
|
|
1163
|
+
Jd = self.jacob0_dot(qk, qdk, J0=J)
|
|
1164
|
+
|
|
1165
|
+
Ct[k, :, :] = Ji.T @ (C - Mx @ Jd) @ Ji
|
|
1166
|
+
|
|
1167
|
+
return Ct
|
|
1168
|
+
|
|
1169
|
+
def gravload_x(
|
|
1170
|
+
self: RobotProto,
|
|
1171
|
+
q=None,
|
|
1172
|
+
gravity=None,
|
|
1173
|
+
pinv=False,
|
|
1174
|
+
representation="rpy/xyz",
|
|
1175
|
+
Ji=None,
|
|
1176
|
+
):
|
|
1177
|
+
r"""
|
|
1178
|
+
Operational space gravity load
|
|
1179
|
+
|
|
1180
|
+
``robot.gravload_x(q)`` calculates the gravity wrench for
|
|
1181
|
+
the robot in the joint configuration ``q`` and using the default
|
|
1182
|
+
gravitational acceleration specified in the robot object.
|
|
1183
|
+
|
|
1184
|
+
``robot.gravload_x(q, gravity=g)`` as above except the gravitational
|
|
1185
|
+
acceleration is explicitly specified as ``g``.
|
|
1186
|
+
|
|
1187
|
+
.. math::
|
|
1188
|
+
|
|
1189
|
+
\mathbf{G}_x = \mathbf{J}(q)^{-T} \mathbf{G}(q)
|
|
1190
|
+
|
|
1191
|
+
The transformation to operational space requires an analytical, rather
|
|
1192
|
+
than geometric, Jacobian. ``analytical`` can be one of:
|
|
1193
|
+
|
|
1194
|
+
============= ========================================
|
|
1195
|
+
Value Rotational representation
|
|
1196
|
+
============= ========================================
|
|
1197
|
+
``'rpy/xyz'`` RPY angular rates in XYZ order (default)
|
|
1198
|
+
``'rpy/zyx'`` RPY angular rates in XYZ order
|
|
1199
|
+
``'eul'`` Euler angular rates in ZYZ order
|
|
1200
|
+
``'exp'`` exponential coordinate rates
|
|
1201
|
+
============= ========================================
|
|
1202
|
+
|
|
1203
|
+
**Trajectory operation**
|
|
1204
|
+
|
|
1205
|
+
If q is a matrix (nxm) each column is interpreted as a joint
|
|
1206
|
+
configuration vector, and the result is a matrix (nxm) each column
|
|
1207
|
+
being the corresponding joint torques.
|
|
1208
|
+
|
|
1209
|
+
Parameters
|
|
1210
|
+
----------
|
|
1211
|
+
q
|
|
1212
|
+
Joint coordinates
|
|
1213
|
+
gravity
|
|
1214
|
+
Gravitational acceleration (Optional, if not supplied will
|
|
1215
|
+
use the ``gravity`` attribute of self).
|
|
1216
|
+
pinv
|
|
1217
|
+
use pseudo inverse rather than inverse (Default value = False)
|
|
1218
|
+
analytical
|
|
1219
|
+
the type of analytical Jacobian to use, default is
|
|
1220
|
+
'rpy/xyz'
|
|
1221
|
+
representation :
|
|
1222
|
+
(Default value = "rpy/xyz")
|
|
1223
|
+
Ji :
|
|
1224
|
+
|
|
1225
|
+
|
|
1226
|
+
Returns
|
|
1227
|
+
-------
|
|
1228
|
+
gravload
|
|
1229
|
+
The operational space gravity wrench
|
|
1230
|
+
|
|
1231
|
+
Examples
|
|
1232
|
+
--------
|
|
1233
|
+
.. runblock:: pycon
|
|
1234
|
+
>>> import roboticstoolbox as rtb
|
|
1235
|
+
>>> puma = rtb.models.DH.Puma560()
|
|
1236
|
+
>>> puma.gravload_x(puma.qn)
|
|
1237
|
+
|
|
1238
|
+
Notes
|
|
1239
|
+
-----
|
|
1240
|
+
- If the robot is not 6 DOF the ``pinv`` option is set True.
|
|
1241
|
+
- ``pinv()`` is around 5x slower than ``inv()``
|
|
1242
|
+
|
|
1243
|
+
.. warning:: Assumes that the operational space has 6 DOF.
|
|
1244
|
+
|
|
1245
|
+
See Also
|
|
1246
|
+
--------
|
|
1247
|
+
:func:`gravload`
|
|
1248
|
+
|
|
1249
|
+
"""
|
|
1250
|
+
|
|
1251
|
+
q = getmatrix(q, (None, self.n))
|
|
1252
|
+
if q.shape[1] != 6:
|
|
1253
|
+
pinv = True
|
|
1254
|
+
|
|
1255
|
+
# if gravity is None:
|
|
1256
|
+
# gravity = self.gravity
|
|
1257
|
+
# else:
|
|
1258
|
+
# gravity = getvector(gravity, 3)
|
|
1259
|
+
|
|
1260
|
+
if q.shape[0] == 1:
|
|
1261
|
+
# single q case
|
|
1262
|
+
if Ji is None:
|
|
1263
|
+
Ja = self.jacob0_analytical(q[0, :], representation=representation)
|
|
1264
|
+
if pinv:
|
|
1265
|
+
Ji = np.linalg.pinv(Ja)
|
|
1266
|
+
else:
|
|
1267
|
+
Ji = np.linalg.inv(Ja)
|
|
1268
|
+
G = self.gravload(q[0, :])
|
|
1269
|
+
return Ji.T @ G
|
|
1270
|
+
|
|
1271
|
+
else:
|
|
1272
|
+
# trajectory case
|
|
1273
|
+
taug = np.zeros((q.shape[0], self.n))
|
|
1274
|
+
# z = np.zeros(self.n)
|
|
1275
|
+
|
|
1276
|
+
for k, qk in enumerate(q):
|
|
1277
|
+
Ja = self.jacob0_analytical(qk, representation=representation)
|
|
1278
|
+
G = self.gravload(qk)
|
|
1279
|
+
if pinv:
|
|
1280
|
+
Ji = np.linalg.pinv(Ja)
|
|
1281
|
+
else:
|
|
1282
|
+
Ji = np.linalg.inv(Ja)
|
|
1283
|
+
|
|
1284
|
+
taug[k, :] = Ji.T @ G
|
|
1285
|
+
|
|
1286
|
+
return taug
|
|
1287
|
+
|
|
1288
|
+
def accel_x(
|
|
1289
|
+
self: RobotProto,
|
|
1290
|
+
q,
|
|
1291
|
+
xd,
|
|
1292
|
+
wrench,
|
|
1293
|
+
gravity=None,
|
|
1294
|
+
pinv=False,
|
|
1295
|
+
representation="rpy/xyz",
|
|
1296
|
+
):
|
|
1297
|
+
r"""
|
|
1298
|
+
Operational space acceleration due to applied wrench
|
|
1299
|
+
|
|
1300
|
+
``xdd = accel_x(q, qd, wrench)`` is the operational space acceleration
|
|
1301
|
+
due to ``wrench`` applied to the end-effector of a robot in joint
|
|
1302
|
+
configuration ``q`` and joint velocity ``qd``.
|
|
1303
|
+
|
|
1304
|
+
.. math::
|
|
1305
|
+
|
|
1306
|
+
\ddot{x} = \mathbf{J}(q) \mathbf{M}(q)^{-1} \left(
|
|
1307
|
+
\mathbf{J}(q)^T w - \mathbf{C}(q)\dot{q} - \mathbf{g}(q)
|
|
1308
|
+
\right)
|
|
1309
|
+
|
|
1310
|
+
**Trajectory operation**
|
|
1311
|
+
|
|
1312
|
+
If `q`, `qd`, torque are matrices (m,n) then ``qdd`` is a matrix (m,n)
|
|
1313
|
+
where each row is the acceleration corresponding to the equivalent rows
|
|
1314
|
+
of q, qd, wrench.
|
|
1315
|
+
|
|
1316
|
+
Parameters
|
|
1317
|
+
----------
|
|
1318
|
+
q
|
|
1319
|
+
Joint coordinates
|
|
1320
|
+
qd
|
|
1321
|
+
Joint velocity
|
|
1322
|
+
wrench
|
|
1323
|
+
Wrench applied to the end-effector
|
|
1324
|
+
gravity
|
|
1325
|
+
Gravitational acceleration (Optional, if not supplied will
|
|
1326
|
+
use the ``gravity`` attribute of self).
|
|
1327
|
+
pinv
|
|
1328
|
+
use pseudo inverse rather than inverse
|
|
1329
|
+
analytical
|
|
1330
|
+
the type of analytical Jacobian to use, default is
|
|
1331
|
+
'rpy/xyz'
|
|
1332
|
+
xd :
|
|
1333
|
+
representation :
|
|
1334
|
+
(Default value = "rpy/xyz")
|
|
1335
|
+
|
|
1336
|
+
Returns
|
|
1337
|
+
-------
|
|
1338
|
+
accel
|
|
1339
|
+
Operational space accelerations of the end-effector
|
|
1340
|
+
|
|
1341
|
+
Notes
|
|
1342
|
+
-----
|
|
1343
|
+
- Useful for simulation of manipulator dynamics, in
|
|
1344
|
+
conjunction with a numerical integration function.
|
|
1345
|
+
- Uses the method 1 of Walker and Orin to compute the forward
|
|
1346
|
+
dynamics.
|
|
1347
|
+
- Featherstone's method is more efficient for robots with large
|
|
1348
|
+
numbers of joints.
|
|
1349
|
+
- Joint friction is considered.
|
|
1350
|
+
|
|
1351
|
+
See Also
|
|
1352
|
+
--------
|
|
1353
|
+
:func:`accel`
|
|
1354
|
+
|
|
1355
|
+
""" # noqa
|
|
1356
|
+
|
|
1357
|
+
q = getmatrix(q, (None, self.n))
|
|
1358
|
+
xd = getmatrix(xd, (None, 6))
|
|
1359
|
+
w = getmatrix(wrench, (None, 6))
|
|
1360
|
+
if q.shape[1] != 6:
|
|
1361
|
+
pinv = True
|
|
1362
|
+
|
|
1363
|
+
xdd = np.zeros((q.shape[0], self.n))
|
|
1364
|
+
|
|
1365
|
+
for k, (qk, xdk, wk) in enumerate(zip(q, xd, w)):
|
|
1366
|
+
Ja = self.jacob0_analytical(qk, representation=representation)
|
|
1367
|
+
if pinv:
|
|
1368
|
+
Ji = np.linalg.pinv(Ja)
|
|
1369
|
+
else:
|
|
1370
|
+
Ji = np.linalg.inv(Ja)
|
|
1371
|
+
|
|
1372
|
+
# Compute current manipulator inertia tensor
|
|
1373
|
+
# shortcut from torques resulting from unit
|
|
1374
|
+
# acceleration of each joint with zero gravity and zero velocity
|
|
1375
|
+
qI = (np.c_[qk] @ np.ones((1, self.n))).T
|
|
1376
|
+
qdI = np.zeros((self.n, self.n))
|
|
1377
|
+
qddI = np.eye(self.n)
|
|
1378
|
+
M = self.rne(qI, qdI, qddI, gravity=[0, 0, 0])
|
|
1379
|
+
|
|
1380
|
+
# Compute gravity and coriolis torque torques resulting from zero
|
|
1381
|
+
# acceleration at given velocity & with gravity acting.
|
|
1382
|
+
tau_rne = self.rne(qk, Ji @ xdk, np.zeros((1, self.n)), gravity=gravity)
|
|
1383
|
+
|
|
1384
|
+
# solve is faster than inv() which is faster than pinv()
|
|
1385
|
+
# tau_rne = C(q,qd) + G(q)
|
|
1386
|
+
# qdd = M^-1 (tau - C(q,qd) - G(q))
|
|
1387
|
+
qdd = np.linalg.solve(M, Ja.T @ wk - tau_rne)
|
|
1388
|
+
|
|
1389
|
+
# xd = Ja qd
|
|
1390
|
+
# xdd = Jad qd + Ja qdd
|
|
1391
|
+
#
|
|
1392
|
+
# Ja = T J
|
|
1393
|
+
# Jad = Td J + T Jd
|
|
1394
|
+
# assume Td = 0, not sure how valid that is
|
|
1395
|
+
|
|
1396
|
+
# need Jacobian dot
|
|
1397
|
+
qdk = Ji @ xdk
|
|
1398
|
+
Jd = self.jacob0_dot(qk, qdk, J0=Ja)
|
|
1399
|
+
|
|
1400
|
+
xdd[k, :] = T @ (Jd @ qdk + J @ qdd)
|
|
1401
|
+
|
|
1402
|
+
if q.shape[0] == 1:
|
|
1403
|
+
return xdd[0, :]
|
|
1404
|
+
else:
|
|
1405
|
+
return xdd
|
|
1406
|
+
|
|
1407
|
+
def itorque(self: RobotProto, q, qdd):
|
|
1408
|
+
r"""
|
|
1409
|
+
Inertia torque
|
|
1410
|
+
|
|
1411
|
+
``itorque(q, qdd)`` is the inertia force/torque vector (n) at
|
|
1412
|
+
the specified joint configuration q (n) and acceleration qdd (n), and
|
|
1413
|
+
``n`` is the number of robot joints.
|
|
1414
|
+
It is :math:`\mathbf{I}(q) \ddot{q}`.
|
|
1415
|
+
|
|
1416
|
+
**Trajectory operation**
|
|
1417
|
+
|
|
1418
|
+
If ``q`` and ``qdd`` are matrices (m,n), each row is interpretted as a
|
|
1419
|
+
joint configuration, and the result is a matrix (m,n) where each row is
|
|
1420
|
+
the corresponding joint torques.
|
|
1421
|
+
|
|
1422
|
+
Parameters
|
|
1423
|
+
----------
|
|
1424
|
+
q
|
|
1425
|
+
Joint coordinates
|
|
1426
|
+
qdd
|
|
1427
|
+
Joint acceleration
|
|
1428
|
+
|
|
1429
|
+
Returns
|
|
1430
|
+
-------
|
|
1431
|
+
itorque
|
|
1432
|
+
The inertia torque vector
|
|
1433
|
+
|
|
1434
|
+
Examples
|
|
1435
|
+
--------
|
|
1436
|
+
.. runblock:: pycon
|
|
1437
|
+
>>> import roboticstoolbox as rtb
|
|
1438
|
+
>>> puma = rtb.models.DH.Puma560()
|
|
1439
|
+
>>> puma.itorque(puma.qz, 0.5 * np.ones((6,)))
|
|
1440
|
+
|
|
1441
|
+
Notes
|
|
1442
|
+
-----
|
|
1443
|
+
- If the robot model contains non-zero motor inertia then this
|
|
1444
|
+
will be included in the result.
|
|
1445
|
+
|
|
1446
|
+
See Also
|
|
1447
|
+
--------
|
|
1448
|
+
:func:`inertia`
|
|
1449
|
+
|
|
1450
|
+
"""
|
|
1451
|
+
|
|
1452
|
+
q = getmatrix(q, (None, self.n))
|
|
1453
|
+
qdd = getmatrix(qdd, (None, self.n))
|
|
1454
|
+
if q.shape[0] != qdd.shape[0]:
|
|
1455
|
+
raise ValueError("q and qdd must have the same number of rows")
|
|
1456
|
+
|
|
1457
|
+
taui = np.zeros((q.shape[0], self.n))
|
|
1458
|
+
|
|
1459
|
+
for k, (qk, qddk) in enumerate(zip(q, qdd)):
|
|
1460
|
+
taui[k, :] = self.rne(qk, np.zeros(self.n), qddk, gravity=[0, 0, 0])
|
|
1461
|
+
|
|
1462
|
+
if q.shape[0] == 1:
|
|
1463
|
+
return taui[0, :]
|
|
1464
|
+
else:
|
|
1465
|
+
return taui
|
|
1466
|
+
|
|
1467
|
+
def paycap(
|
|
1468
|
+
self: RobotProto,
|
|
1469
|
+
w: NDArray,
|
|
1470
|
+
tauR: NDArray,
|
|
1471
|
+
frame: int = 1,
|
|
1472
|
+
q: Union[ArrayLike, None] = None,
|
|
1473
|
+
):
|
|
1474
|
+
"""
|
|
1475
|
+
Static payload capacity of a robot
|
|
1476
|
+
|
|
1477
|
+
``wmax, joint = paycap(q, w, f, tauR)`` returns the maximum permissible
|
|
1478
|
+
payload wrench ``wmax`` (6) applied at the end-effector, and the index
|
|
1479
|
+
of the joint (zero indexed) which hits its force/torque limit at that
|
|
1480
|
+
wrench. ``q`` (n) is the manipulator pose, ``w`` the payload wrench
|
|
1481
|
+
(6), ``f`` the wrench reference frame and tauR (nx2) is a matrix of
|
|
1482
|
+
joint forces/torques (first col is maximum, second col minimum).
|
|
1483
|
+
|
|
1484
|
+
**Trajectory operation:**
|
|
1485
|
+
|
|
1486
|
+
In the case q is nxm then wmax is Mx6 and J is Mx1 where the rows are
|
|
1487
|
+
the results at the pose given by corresponding row of q.
|
|
1488
|
+
|
|
1489
|
+
Parameters
|
|
1490
|
+
----------
|
|
1491
|
+
w
|
|
1492
|
+
The payload wrench
|
|
1493
|
+
tauR
|
|
1494
|
+
Joint torque matrix minimum and maximums
|
|
1495
|
+
frame
|
|
1496
|
+
The frame in which to torques are expressed in when J
|
|
1497
|
+
is not supplied. 'base' means base frame of the robot, 'ee' means
|
|
1498
|
+
end-effector frame
|
|
1499
|
+
q
|
|
1500
|
+
Joint coordinates
|
|
1501
|
+
|
|
1502
|
+
Returns
|
|
1503
|
+
-------
|
|
1504
|
+
ndarray(6)
|
|
1505
|
+
The maximum permissible payload wrench
|
|
1506
|
+
|
|
1507
|
+
Notes
|
|
1508
|
+
-----
|
|
1509
|
+
- Wrench vector and Jacobian must be from the same reference frame
|
|
1510
|
+
- Tool transforms are taken into consideration for frame=1.
|
|
1511
|
+
|
|
1512
|
+
"""
|
|
1513
|
+
|
|
1514
|
+
# TODO rewrite
|
|
1515
|
+
trajn = 1
|
|
1516
|
+
|
|
1517
|
+
if q is None:
|
|
1518
|
+
q = self.q
|
|
1519
|
+
else:
|
|
1520
|
+
q = np.array(q)
|
|
1521
|
+
|
|
1522
|
+
try:
|
|
1523
|
+
q = np.array(getvector(q, self.n, "row"))
|
|
1524
|
+
w = np.array(getvector(w, 6, "row"))
|
|
1525
|
+
except ValueError:
|
|
1526
|
+
trajn = q.shape[1]
|
|
1527
|
+
verifymatrix(q, (trajn, self.n))
|
|
1528
|
+
verifymatrix(w, (trajn, 6))
|
|
1529
|
+
|
|
1530
|
+
verifymatrix(tauR, (self.n, 2))
|
|
1531
|
+
|
|
1532
|
+
wmax = np.zeros((trajn, 6))
|
|
1533
|
+
joint = np.zeros(trajn, dtype=np.int)
|
|
1534
|
+
|
|
1535
|
+
for i in range(trajn):
|
|
1536
|
+
tauB = self.gravload(q[i, :])
|
|
1537
|
+
|
|
1538
|
+
# tauP = self.rne(
|
|
1539
|
+
# np.zeros(self.n), np.zeros(self.n),
|
|
1540
|
+
# q, grav=[0, 0, 0], fext=w/np.linalg.norm(w))
|
|
1541
|
+
|
|
1542
|
+
tauP = self.pay(w[i, :] / np.linalg.norm(w[i, :]), q=q[i, :], frame=frame)
|
|
1543
|
+
|
|
1544
|
+
M = tauP > 0
|
|
1545
|
+
m = tauP <= 0
|
|
1546
|
+
|
|
1547
|
+
TAUm = np.ones(self.n)
|
|
1548
|
+
TAUM = np.ones(self.n)
|
|
1549
|
+
|
|
1550
|
+
for c in range(self.n):
|
|
1551
|
+
TAUM[c] = tauR[c, 0]
|
|
1552
|
+
TAUm[c] = tauR[c, 1]
|
|
1553
|
+
|
|
1554
|
+
WM = np.zeros(self.n)
|
|
1555
|
+
WM[M] = (TAUM[M] - tauB[M]) / tauP[M]
|
|
1556
|
+
WM[m] = (TAUm[m] - tauB[m]) / tauP[m]
|
|
1557
|
+
|
|
1558
|
+
WM[WM == np.NINF] = np.Inf
|
|
1559
|
+
|
|
1560
|
+
wmax[i, :] = WM
|
|
1561
|
+
joint[i] = np.argmin(WM)
|
|
1562
|
+
|
|
1563
|
+
if trajn == 1:
|
|
1564
|
+
return wmax[0, :], joint[0]
|
|
1565
|
+
else:
|
|
1566
|
+
return wmax, joint
|
|
1567
|
+
|
|
1568
|
+
def perturb(self: RobotProto, p=0.1):
|
|
1569
|
+
"""
|
|
1570
|
+
Perturb robot parameters
|
|
1571
|
+
|
|
1572
|
+
rp = perturb(p) is a new robot object in which the dynamic parameters
|
|
1573
|
+
(link mass and inertia) have been perturbed. The perturbation is
|
|
1574
|
+
multiplicative so that values are multiplied by random numbers in the
|
|
1575
|
+
interval (1-p) to (1+p). The name string of the perturbed robot is
|
|
1576
|
+
prefixed by 'P/'.
|
|
1577
|
+
|
|
1578
|
+
Useful for investigating the robustness of various model-based control
|
|
1579
|
+
schemes. For example to vary parameters in the range +/- 10 percent
|
|
1580
|
+
is: r2 = puma.perturb(0.1)
|
|
1581
|
+
|
|
1582
|
+
Parameters
|
|
1583
|
+
----------
|
|
1584
|
+
p
|
|
1585
|
+
The percent (+/-) to be perturbed. Default 10%
|
|
1586
|
+
|
|
1587
|
+
Returns
|
|
1588
|
+
-------
|
|
1589
|
+
DHRobot
|
|
1590
|
+
A copy of the robot with dynamic parameters perturbed
|
|
1591
|
+
|
|
1592
|
+
"""
|
|
1593
|
+
|
|
1594
|
+
r2 = self.copy()
|
|
1595
|
+
r2.name = "P/" + self.name
|
|
1596
|
+
|
|
1597
|
+
for i in range(self.n):
|
|
1598
|
+
s = (2 * np.random.random() - 1) * p + 1
|
|
1599
|
+
r2.links[i].m = r2.links[i].m * s
|
|
1600
|
+
|
|
1601
|
+
s = (2 * np.random.random() - 1) * p + 1
|
|
1602
|
+
r2.links[i].I = r2.links[i].I * s # noqa
|
|
1603
|
+
|
|
1604
|
+
return r2
|
|
1605
|
+
|
|
1606
|
+
|
|
1607
|
+
def _printProgressBar(
|
|
1608
|
+
fraction, prefix="", suffix="", decimals=1, length=50, fill="█", printEnd="\r"
|
|
1609
|
+
):
|
|
1610
|
+
|
|
1611
|
+
percent = ("{0:." + str(decimals) + "f}").format(fraction * 100)
|
|
1612
|
+
filledLength = int(length * fraction)
|
|
1613
|
+
bar = fill * filledLength + "-" * (length - filledLength)
|
|
1614
|
+
print(f"\r{prefix} |{bar}| {percent}% {suffix}", end=printEnd)
|
|
1615
|
+
|
|
1616
|
+
|
|
1617
|
+
if __name__ == "__main__": # pragma nocover
|
|
1618
|
+
import roboticstoolbox as rtb
|
|
1619
|
+
|
|
1620
|
+
puma = rtb.models.DH.Puma560()
|