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,1522 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
@author Jesse Haviland
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import numpy as np
|
|
8
|
+
from abc import ABC, abstractmethod
|
|
9
|
+
from typing import Tuple, Union
|
|
10
|
+
import roboticstoolbox as rtb
|
|
11
|
+
from dataclasses import dataclass
|
|
12
|
+
from spatialmath import SE3
|
|
13
|
+
from roboticstoolbox.tools.types import ArrayLike, NDArray
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
try:
|
|
17
|
+
import qpsolvers as qp
|
|
18
|
+
|
|
19
|
+
_qp = True
|
|
20
|
+
except ImportError: # pragma nocover
|
|
21
|
+
_qp = False
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@dataclass
|
|
25
|
+
class IKSolution:
|
|
26
|
+
"""
|
|
27
|
+
A dataclass for representing an IK solution
|
|
28
|
+
|
|
29
|
+
Attributes
|
|
30
|
+
----------
|
|
31
|
+
q
|
|
32
|
+
The joint coordinates of the solution (ndarray). Note that these
|
|
33
|
+
will not be valid if failed to find a solution
|
|
34
|
+
success
|
|
35
|
+
True if a valid solution was found
|
|
36
|
+
iterations
|
|
37
|
+
How many iterations were performed
|
|
38
|
+
searches
|
|
39
|
+
How many searches were performed
|
|
40
|
+
residual
|
|
41
|
+
The final error value from the cost function
|
|
42
|
+
reason
|
|
43
|
+
The reason the IK problem failed if applicable
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
.. versionchanged:: 1.0.3
|
|
47
|
+
Added IKSolution dataclass to replace the IKsolution named tuple
|
|
48
|
+
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
q: np.ndarray
|
|
52
|
+
success: bool
|
|
53
|
+
iterations: int = 0
|
|
54
|
+
searches: int = 0
|
|
55
|
+
residual: float = 0.0
|
|
56
|
+
reason: str = ""
|
|
57
|
+
|
|
58
|
+
def __iter__(self):
|
|
59
|
+
return iter(
|
|
60
|
+
(
|
|
61
|
+
self.q,
|
|
62
|
+
self.success,
|
|
63
|
+
self.iterations,
|
|
64
|
+
self.searches,
|
|
65
|
+
self.residual,
|
|
66
|
+
self.reason,
|
|
67
|
+
)
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
def __str__(self):
|
|
71
|
+
if self.q is not None:
|
|
72
|
+
q_str = np.array2string(
|
|
73
|
+
self.q,
|
|
74
|
+
separator=", ",
|
|
75
|
+
formatter={
|
|
76
|
+
"float": lambda x: "{:.4g}".format(0 if abs(x) < 1e-6 else x)
|
|
77
|
+
},
|
|
78
|
+
) # np.round(self.q, 4)
|
|
79
|
+
else:
|
|
80
|
+
q_str = None
|
|
81
|
+
|
|
82
|
+
if self.iterations == 0 and self.searches == 0:
|
|
83
|
+
# Check for analytic
|
|
84
|
+
if self.success:
|
|
85
|
+
return f"IKSolution: q={q_str}, success=True"
|
|
86
|
+
else:
|
|
87
|
+
return f"IKSolution: q={q_str}, success=False, reason={self.reason}"
|
|
88
|
+
else:
|
|
89
|
+
# Otherwise it is a numeric solution
|
|
90
|
+
if self.success:
|
|
91
|
+
return (
|
|
92
|
+
f"IKSolution: q={q_str}, success=True,"
|
|
93
|
+
f" iterations={self.iterations}, searches={self.searches},"
|
|
94
|
+
f" residual={self.residual:.3g}"
|
|
95
|
+
)
|
|
96
|
+
else:
|
|
97
|
+
return (
|
|
98
|
+
f"IKSolution: q={q_str}, success=False, reason={self.reason},"
|
|
99
|
+
f" iterations={self.iterations}, searches={self.searches},"
|
|
100
|
+
f" residual={np.round(self.residual, 4):.3g}"
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
class IKSolver(ABC):
|
|
105
|
+
"""
|
|
106
|
+
An abstract super class for numerical inverse kinematics (IK)
|
|
107
|
+
|
|
108
|
+
This class provides basic functionality to perform numerical IK. Superclasses
|
|
109
|
+
can inherit this class and implement the `solve` method and redefine any other
|
|
110
|
+
methods necessary.
|
|
111
|
+
|
|
112
|
+
Parameters
|
|
113
|
+
----------
|
|
114
|
+
name
|
|
115
|
+
The name of the IK algorithm
|
|
116
|
+
ilimit
|
|
117
|
+
How many iterations are allowed within a search before a new search
|
|
118
|
+
is started
|
|
119
|
+
slimit
|
|
120
|
+
How many searches are allowed before being deemed unsuccessful
|
|
121
|
+
tol
|
|
122
|
+
Maximum allowed residual error E
|
|
123
|
+
mask
|
|
124
|
+
A 6 vector which assigns weights to Cartesian degrees-of-freedom
|
|
125
|
+
error priority
|
|
126
|
+
joint_limits
|
|
127
|
+
Reject solutions with joint limit violations
|
|
128
|
+
seed
|
|
129
|
+
A seed for the private RNG used to generate random joint coordinate
|
|
130
|
+
vectors
|
|
131
|
+
|
|
132
|
+
See Also
|
|
133
|
+
--------
|
|
134
|
+
IK_NR
|
|
135
|
+
Implements this class using the Newton-Raphson method
|
|
136
|
+
IK_GN
|
|
137
|
+
Implements this class using the Gauss-Newton method
|
|
138
|
+
IK_LM
|
|
139
|
+
Implements this class using the Levemberg-Marquadt method
|
|
140
|
+
IK_QP
|
|
141
|
+
Implements this class using a quadratic programming approach
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
.. versionchanged:: 1.0.3
|
|
145
|
+
Added the abstract super class IKSolver
|
|
146
|
+
|
|
147
|
+
"""
|
|
148
|
+
|
|
149
|
+
def __init__(
|
|
150
|
+
self,
|
|
151
|
+
name: str = "IK Solver",
|
|
152
|
+
ilimit: int = 30,
|
|
153
|
+
slimit: int = 100,
|
|
154
|
+
tol: float = 1e-6,
|
|
155
|
+
mask: Union[ArrayLike, None] = None,
|
|
156
|
+
joint_limits: bool = True,
|
|
157
|
+
seed: Union[int, None] = None,
|
|
158
|
+
):
|
|
159
|
+
# Solver parameters
|
|
160
|
+
self.name = name
|
|
161
|
+
self.slimit = slimit
|
|
162
|
+
self.ilimit = ilimit
|
|
163
|
+
self.tol = tol
|
|
164
|
+
|
|
165
|
+
# Random number generator
|
|
166
|
+
self._private_random = np.random.default_rng(seed=seed)
|
|
167
|
+
|
|
168
|
+
if mask is None:
|
|
169
|
+
mask = np.ones(6)
|
|
170
|
+
|
|
171
|
+
self.We = np.diag(mask) # type: ignore
|
|
172
|
+
self.joint_limits = joint_limits
|
|
173
|
+
|
|
174
|
+
def solve(
|
|
175
|
+
self,
|
|
176
|
+
ets: "rtb.ETS",
|
|
177
|
+
Tep: Union[SE3, np.ndarray],
|
|
178
|
+
q0: Union[ArrayLike, None] = None,
|
|
179
|
+
) -> IKSolution:
|
|
180
|
+
"""
|
|
181
|
+
Solves the IK problem
|
|
182
|
+
|
|
183
|
+
This method will attempt to solve the IK problem and obtain joint coordinates
|
|
184
|
+
which result the the end-effector pose `Tep`.
|
|
185
|
+
|
|
186
|
+
Parameters
|
|
187
|
+
----------
|
|
188
|
+
ets
|
|
189
|
+
The ETS representing the manipulators kinematics
|
|
190
|
+
Tep
|
|
191
|
+
The desired end-effector pose
|
|
192
|
+
q0
|
|
193
|
+
The initial joint coordinate vector
|
|
194
|
+
|
|
195
|
+
Returns
|
|
196
|
+
-------
|
|
197
|
+
q
|
|
198
|
+
The joint coordinates of the solution (ndarray). Note that these
|
|
199
|
+
will not be valid if failed to find a solution
|
|
200
|
+
success
|
|
201
|
+
True if a valid solution was found
|
|
202
|
+
iterations
|
|
203
|
+
How many iterations were performed
|
|
204
|
+
searches
|
|
205
|
+
How many searches were performed
|
|
206
|
+
residual
|
|
207
|
+
The final error value from the cost function
|
|
208
|
+
jl_valid
|
|
209
|
+
True if q is inbounds of the robots joint limits
|
|
210
|
+
reason
|
|
211
|
+
The reason the IK problem failed if applicable
|
|
212
|
+
|
|
213
|
+
"""
|
|
214
|
+
# Get the largest jindex in the ETS. If this is greater than ETS.n
|
|
215
|
+
# then we need to pad the q vector with zeros
|
|
216
|
+
max_jindex: int = 0
|
|
217
|
+
|
|
218
|
+
for j in ets.joints():
|
|
219
|
+
if j.jindex > max_jindex: # type: ignore
|
|
220
|
+
max_jindex = j.jindex # type: ignore
|
|
221
|
+
|
|
222
|
+
q0_method = np.zeros((self.slimit, max_jindex + 1))
|
|
223
|
+
|
|
224
|
+
if q0 is None:
|
|
225
|
+
q0_method[:, ets.jindices] = self._random_q(ets, self.slimit)
|
|
226
|
+
|
|
227
|
+
elif not isinstance(q0, np.ndarray):
|
|
228
|
+
q0 = np.array(q0)
|
|
229
|
+
|
|
230
|
+
if q0 is not None and q0.ndim == 1:
|
|
231
|
+
q0_method[:, ets.jindices] = self._random_q(ets, self.slimit)
|
|
232
|
+
|
|
233
|
+
q0_method[0, ets.jindices] = q0
|
|
234
|
+
|
|
235
|
+
if q0 is not None and q0.ndim == 2:
|
|
236
|
+
q0_method[:, ets.jindices] = self._random_q(ets, self.slimit)
|
|
237
|
+
|
|
238
|
+
q0_method[: q0.shape[0], ets.jindices] = q0
|
|
239
|
+
|
|
240
|
+
q0 = q0_method
|
|
241
|
+
|
|
242
|
+
traj = False
|
|
243
|
+
|
|
244
|
+
methTep: np.ndarray
|
|
245
|
+
|
|
246
|
+
if isinstance(Tep, SE3):
|
|
247
|
+
if len(Tep) > 1:
|
|
248
|
+
traj = True
|
|
249
|
+
methTep = np.empty((len(Tep), 4, 4))
|
|
250
|
+
|
|
251
|
+
for i, T in enumerate(Tep):
|
|
252
|
+
methTep[i] = T.A
|
|
253
|
+
else:
|
|
254
|
+
methTep = Tep.A
|
|
255
|
+
elif Tep.ndim == 3:
|
|
256
|
+
traj = True
|
|
257
|
+
methTep = Tep
|
|
258
|
+
elif Tep.shape != (4, 4):
|
|
259
|
+
raise ValueError("Tep must be a 4x4 SE3 matrix")
|
|
260
|
+
else:
|
|
261
|
+
methTep = Tep
|
|
262
|
+
|
|
263
|
+
if traj:
|
|
264
|
+
q = np.empty((methTep.shape[0], ets.n))
|
|
265
|
+
success = True
|
|
266
|
+
interations = 0
|
|
267
|
+
searches = 0
|
|
268
|
+
residual = np.inf
|
|
269
|
+
reason = ""
|
|
270
|
+
|
|
271
|
+
for i, T in enumerate(methTep):
|
|
272
|
+
sol = self._solve(ets, T, q0)
|
|
273
|
+
q[i] = sol.q
|
|
274
|
+
if not sol.success:
|
|
275
|
+
success = False
|
|
276
|
+
reason = sol.reason
|
|
277
|
+
interations += sol.iterations
|
|
278
|
+
searches += sol.searches
|
|
279
|
+
|
|
280
|
+
if sol.residual < residual:
|
|
281
|
+
residual = sol.residual
|
|
282
|
+
|
|
283
|
+
return IKSolution(
|
|
284
|
+
q=q,
|
|
285
|
+
success=success,
|
|
286
|
+
iterations=interations,
|
|
287
|
+
searches=searches,
|
|
288
|
+
residual=residual,
|
|
289
|
+
reason=reason,
|
|
290
|
+
)
|
|
291
|
+
|
|
292
|
+
else:
|
|
293
|
+
sol = self._solve(ets, methTep, q0)
|
|
294
|
+
|
|
295
|
+
return sol
|
|
296
|
+
|
|
297
|
+
def _solve(self, ets: "rtb.ETS", Tep: np.ndarray, q0: np.ndarray) -> IKSolution:
|
|
298
|
+
# Iteration count
|
|
299
|
+
i = 0
|
|
300
|
+
total_i = 0
|
|
301
|
+
|
|
302
|
+
# Error flags
|
|
303
|
+
found_with_limits = False
|
|
304
|
+
linalg_error = 0
|
|
305
|
+
|
|
306
|
+
# Initialise variables
|
|
307
|
+
E = 0.0
|
|
308
|
+
q = q0[0]
|
|
309
|
+
|
|
310
|
+
for search in range(self.slimit):
|
|
311
|
+
q = q0[search].copy()
|
|
312
|
+
i = 0
|
|
313
|
+
|
|
314
|
+
while i < self.ilimit:
|
|
315
|
+
i += 1
|
|
316
|
+
|
|
317
|
+
# Attempt a step
|
|
318
|
+
try:
|
|
319
|
+
E, q[ets.jindices] = self.step(ets, Tep, q)
|
|
320
|
+
|
|
321
|
+
except np.linalg.LinAlgError:
|
|
322
|
+
# Abandon search and try again
|
|
323
|
+
linalg_error += 1
|
|
324
|
+
break
|
|
325
|
+
|
|
326
|
+
# Check if we have arrived
|
|
327
|
+
if E < self.tol:
|
|
328
|
+
# Wrap q to be within +- 180 deg
|
|
329
|
+
# If your robot has larger than 180 deg range on a joint
|
|
330
|
+
# this line should be modified in incorporate the extra range
|
|
331
|
+
q = (q + np.pi) % (2 * np.pi) - np.pi
|
|
332
|
+
|
|
333
|
+
# Check if we have violated joint limits
|
|
334
|
+
jl_valid = self._check_jl(ets, q)
|
|
335
|
+
|
|
336
|
+
if not jl_valid and self.joint_limits:
|
|
337
|
+
# Abandon search and try again
|
|
338
|
+
found_with_limits = True
|
|
339
|
+
break
|
|
340
|
+
else:
|
|
341
|
+
return IKSolution(
|
|
342
|
+
q=q[ets.jindices],
|
|
343
|
+
success=True,
|
|
344
|
+
iterations=total_i + i,
|
|
345
|
+
searches=search + 1,
|
|
346
|
+
residual=E,
|
|
347
|
+
reason="Success",
|
|
348
|
+
)
|
|
349
|
+
total_i += i
|
|
350
|
+
|
|
351
|
+
# If we make it here, then we have failed
|
|
352
|
+
reason = "iteration and search limit reached"
|
|
353
|
+
|
|
354
|
+
if linalg_error:
|
|
355
|
+
reason += f", {linalg_error} numpy.LinAlgError encountered"
|
|
356
|
+
|
|
357
|
+
if found_with_limits:
|
|
358
|
+
reason += ", solution found but violates joint limits"
|
|
359
|
+
|
|
360
|
+
return IKSolution(
|
|
361
|
+
q=q,
|
|
362
|
+
success=False,
|
|
363
|
+
iterations=total_i,
|
|
364
|
+
searches=self.slimit,
|
|
365
|
+
residual=E,
|
|
366
|
+
reason=reason,
|
|
367
|
+
)
|
|
368
|
+
|
|
369
|
+
def error(self, Te: np.ndarray, Tep: np.ndarray) -> Tuple[np.ndarray, float]:
|
|
370
|
+
r"""
|
|
371
|
+
Calculates the error between Te and Tep
|
|
372
|
+
|
|
373
|
+
Calculates the engle axis error between current end-effector pose Te and
|
|
374
|
+
the desired end-effector pose Tep. Also calulates the quadratic error E
|
|
375
|
+
which is weighted by the diagonal matrix We.
|
|
376
|
+
|
|
377
|
+
.. math::
|
|
378
|
+
|
|
379
|
+
E = \frac{1}{2} \vec{e}^{\top} \mat{W}_e \vec{e}
|
|
380
|
+
|
|
381
|
+
where :math:`\vec{e} \in \mathbb{R}^6` is the angle-axis error.
|
|
382
|
+
|
|
383
|
+
Parameters
|
|
384
|
+
----------
|
|
385
|
+
Te
|
|
386
|
+
The current end-effector pose
|
|
387
|
+
Tep
|
|
388
|
+
The desired end-effector pose
|
|
389
|
+
|
|
390
|
+
Returns
|
|
391
|
+
-------
|
|
392
|
+
e
|
|
393
|
+
angle-axis error (6 vector)
|
|
394
|
+
E
|
|
395
|
+
The quadratic error weighted by We
|
|
396
|
+
|
|
397
|
+
"""
|
|
398
|
+
e = rtb.angle_axis(Te, Tep)
|
|
399
|
+
E = float(0.5 * e @ self.We @ e)
|
|
400
|
+
|
|
401
|
+
return e, E
|
|
402
|
+
|
|
403
|
+
@abstractmethod
|
|
404
|
+
def step(
|
|
405
|
+
self, ets: "rtb.ETS", Tep: np.ndarray, q: np.ndarray
|
|
406
|
+
) -> Tuple[float, np.ndarray]:
|
|
407
|
+
"""
|
|
408
|
+
Abstract step method
|
|
409
|
+
|
|
410
|
+
Superclasses will implement this method to perform a step of the
|
|
411
|
+
implemented IK algorithm
|
|
412
|
+
|
|
413
|
+
Parameters
|
|
414
|
+
----------
|
|
415
|
+
ets
|
|
416
|
+
The ETS representing the manipulators kinematics
|
|
417
|
+
Tep
|
|
418
|
+
The desired end-effector pose
|
|
419
|
+
q
|
|
420
|
+
The current joint coordinate vector
|
|
421
|
+
|
|
422
|
+
Raises
|
|
423
|
+
------
|
|
424
|
+
numpy.LinAlgError
|
|
425
|
+
If a step is impossible due to a linear algebra error
|
|
426
|
+
|
|
427
|
+
Returns
|
|
428
|
+
-------
|
|
429
|
+
E
|
|
430
|
+
The new error value
|
|
431
|
+
q
|
|
432
|
+
The new joint coordinate vector
|
|
433
|
+
|
|
434
|
+
"""
|
|
435
|
+
pass # pragma: nocover
|
|
436
|
+
|
|
437
|
+
def _random_q(self, ets: "rtb.ETS", i: int = 1) -> np.ndarray:
|
|
438
|
+
"""
|
|
439
|
+
Generate a random valid joint configuration using a private RNG
|
|
440
|
+
|
|
441
|
+
Generates a random q vector within the joint limits defined by
|
|
442
|
+
`ets.qlim`.
|
|
443
|
+
|
|
444
|
+
Parameters
|
|
445
|
+
----------
|
|
446
|
+
ets
|
|
447
|
+
The ETS representing the manipulators kinematics
|
|
448
|
+
i
|
|
449
|
+
number of configurations to generate
|
|
450
|
+
|
|
451
|
+
Returns
|
|
452
|
+
-------
|
|
453
|
+
q
|
|
454
|
+
An `i x n` ndarray of random valid joint configurations, where n
|
|
455
|
+
is the number of joints in the `ets`
|
|
456
|
+
|
|
457
|
+
"""
|
|
458
|
+
|
|
459
|
+
if i == 1:
|
|
460
|
+
q = np.zeros((1, ets.n))
|
|
461
|
+
|
|
462
|
+
for i in range(ets.n):
|
|
463
|
+
q[0, i] = self._private_random.uniform(ets.qlim[0, i], ets.qlim[1, i])
|
|
464
|
+
|
|
465
|
+
else:
|
|
466
|
+
q = np.zeros((i, ets.n))
|
|
467
|
+
|
|
468
|
+
for j in range(i):
|
|
469
|
+
for i in range(ets.n):
|
|
470
|
+
q[j, i] = self._private_random.uniform(
|
|
471
|
+
ets.qlim[0, i], ets.qlim[1, i]
|
|
472
|
+
)
|
|
473
|
+
|
|
474
|
+
return q
|
|
475
|
+
|
|
476
|
+
def _check_jl(self, ets: "rtb.ETS", q: np.ndarray) -> bool:
|
|
477
|
+
"""
|
|
478
|
+
Checks if the joints are within their respective limits
|
|
479
|
+
|
|
480
|
+
Parameters
|
|
481
|
+
----------
|
|
482
|
+
ets
|
|
483
|
+
the ETS
|
|
484
|
+
q
|
|
485
|
+
the current joint coordinate vector
|
|
486
|
+
|
|
487
|
+
Returns
|
|
488
|
+
-------
|
|
489
|
+
True if joints within feasible limits otherwise False
|
|
490
|
+
|
|
491
|
+
"""
|
|
492
|
+
|
|
493
|
+
# Loop through the joints in the ETS
|
|
494
|
+
for i in range(ets.n):
|
|
495
|
+
# Get the corresponding joint limits
|
|
496
|
+
ql0 = ets.qlim[0, i]
|
|
497
|
+
ql1 = ets.qlim[1, i]
|
|
498
|
+
|
|
499
|
+
# Check if q exceeds the limits
|
|
500
|
+
if q[i] < ql0 or q[i] > ql1:
|
|
501
|
+
return False
|
|
502
|
+
|
|
503
|
+
# If we make it here, all the joints are fine
|
|
504
|
+
return True
|
|
505
|
+
|
|
506
|
+
|
|
507
|
+
def _null_Σ(ets: "rtb.ETS", q: NDArray, ps: float, pi: Union[NDArray, float]):
|
|
508
|
+
"""
|
|
509
|
+
Formulates a relationship between joint limits and the joint velocity.
|
|
510
|
+
When this is projected into the null-space of the differential kinematics
|
|
511
|
+
to attempt to avoid exceeding joint limits
|
|
512
|
+
|
|
513
|
+
:param q: The joint coordinates of the robot
|
|
514
|
+
:param ps: The minimum angle/distance (in radians or metres) in which the joint is
|
|
515
|
+
allowed to approach to its limit
|
|
516
|
+
:param pi: The influence angle/distance (in radians or metres) in which the velocity
|
|
517
|
+
damper becomes active
|
|
518
|
+
|
|
519
|
+
:return: Σ
|
|
520
|
+
"""
|
|
521
|
+
|
|
522
|
+
if isinstance(pi, float) or isinstance(pi, int):
|
|
523
|
+
pi = pi * np.ones(ets.n)
|
|
524
|
+
|
|
525
|
+
# Add cost to going in the direction of joint limits, if they are within
|
|
526
|
+
# the influence distance
|
|
527
|
+
Σ = np.zeros((ets.n, 1))
|
|
528
|
+
|
|
529
|
+
for i in range(ets.n):
|
|
530
|
+
qi = q[i]
|
|
531
|
+
ql0 = ets.qlim[0, i]
|
|
532
|
+
ql1 = ets.qlim[1, i]
|
|
533
|
+
|
|
534
|
+
if qi - ql0 <= pi[i]:
|
|
535
|
+
Σ[i, 0] = -np.power(((qi - ql0) - pi[i]), 2) / np.power((ps - pi[i]), 2)
|
|
536
|
+
if ql1 - qi <= pi[i]:
|
|
537
|
+
Σ[i, 0] = np.power(((ql1 - qi) - pi[i]), 2) / np.power((ps - pi[i]), 2)
|
|
538
|
+
|
|
539
|
+
return -Σ
|
|
540
|
+
|
|
541
|
+
|
|
542
|
+
def _calc_qnull(
|
|
543
|
+
ets: "rtb.ETS",
|
|
544
|
+
q: np.ndarray,
|
|
545
|
+
J: np.ndarray,
|
|
546
|
+
λΣ: float,
|
|
547
|
+
λm: float,
|
|
548
|
+
ps: float,
|
|
549
|
+
pi: Union[np.ndarray, float],
|
|
550
|
+
):
|
|
551
|
+
"""
|
|
552
|
+
Calculates the desired null-space motion according to the gains λΣ and λm.
|
|
553
|
+
This is a helper method that is used within the `step` method of an IK solver
|
|
554
|
+
|
|
555
|
+
:return: qnull - the desired null-space motion
|
|
556
|
+
"""
|
|
557
|
+
|
|
558
|
+
qnull_grad = np.zeros(ets.n)
|
|
559
|
+
qnull = np.zeros(ets.n)
|
|
560
|
+
|
|
561
|
+
# Add the joint limit avoidance if the gain is above 0
|
|
562
|
+
if λΣ > 0:
|
|
563
|
+
Σ = _null_Σ(ets, q, ps, pi)
|
|
564
|
+
qnull_grad += (1.0 / λΣ * Σ).flatten()
|
|
565
|
+
|
|
566
|
+
# Add the manipulability maximisation if the gain is above 0
|
|
567
|
+
if λm > 0:
|
|
568
|
+
Jm = ets.jacobm(q)
|
|
569
|
+
qnull_grad += (1.0 / λm * Jm).flatten()
|
|
570
|
+
|
|
571
|
+
# Calculate the null-space motion
|
|
572
|
+
if λΣ > 0 or λΣ > 0:
|
|
573
|
+
null_space = np.eye(ets.n) - np.linalg.pinv(J) @ J
|
|
574
|
+
qnull = null_space @ qnull_grad
|
|
575
|
+
|
|
576
|
+
return qnull.flatten()
|
|
577
|
+
|
|
578
|
+
|
|
579
|
+
class IK_NR(IKSolver):
|
|
580
|
+
"""
|
|
581
|
+
Newton-Raphson Numerical Inverse Kinematics Solver
|
|
582
|
+
|
|
583
|
+
A class which provides functionality to perform numerical inverse kinematics (IK)
|
|
584
|
+
using the Newton-Raphson method. See `step` method for mathematical description.
|
|
585
|
+
|
|
586
|
+
Note
|
|
587
|
+
----
|
|
588
|
+
When using this class with redundant robots (>6 DoF), `pinv` must be set to `True`
|
|
589
|
+
|
|
590
|
+
Parameters
|
|
591
|
+
----------
|
|
592
|
+
name
|
|
593
|
+
The name of the IK algorithm
|
|
594
|
+
ilimit
|
|
595
|
+
How many iterations are allowed within a search before a new search
|
|
596
|
+
is started
|
|
597
|
+
slimit
|
|
598
|
+
How many searches are allowed before being deemed unsuccessful
|
|
599
|
+
tol
|
|
600
|
+
Maximum allowed residual error E
|
|
601
|
+
mask
|
|
602
|
+
A 6 vector which assigns weights to Cartesian degrees-of-freedom
|
|
603
|
+
error priority
|
|
604
|
+
joint_limits
|
|
605
|
+
Reject solutions with joint limit violations
|
|
606
|
+
seed
|
|
607
|
+
A seed for the private RNG used to generate random joint coordinate
|
|
608
|
+
vectors
|
|
609
|
+
pinv
|
|
610
|
+
If True, will use the psuedoinverse in the `step` method instead of
|
|
611
|
+
the normal inverse
|
|
612
|
+
kq
|
|
613
|
+
The gain for joint limit avoidance. Setting to 0.0 will remove this
|
|
614
|
+
completely from the solution
|
|
615
|
+
km
|
|
616
|
+
The gain for maximisation. Setting to 0.0 will remove this completely
|
|
617
|
+
from the solution
|
|
618
|
+
ps
|
|
619
|
+
The minimum angle/distance (in radians or metres) in which the joint is
|
|
620
|
+
allowed to approach to its limit
|
|
621
|
+
pi
|
|
622
|
+
The influence angle/distance (in radians or metres) in null space motion
|
|
623
|
+
becomes active
|
|
624
|
+
|
|
625
|
+
Examples
|
|
626
|
+
--------
|
|
627
|
+
The following example gets the ``ets`` of a ``panda`` robot object, instantiates
|
|
628
|
+
the IK_NR solver class using default parameters, makes a goal pose ``Tep``,
|
|
629
|
+
and then solves for the joint coordinates which result in the pose ``Tep``
|
|
630
|
+
using the ``solve`` method.
|
|
631
|
+
|
|
632
|
+
.. runblock:: pycon
|
|
633
|
+
>>> import roboticstoolbox as rtb
|
|
634
|
+
>>> panda = rtb.models.Panda().ets()
|
|
635
|
+
>>> solver = rtb.IK_NR(pinv=True)
|
|
636
|
+
>>> Tep = panda.fkine([0, -0.3, 0, -2.2, 0, 2, 0.7854])
|
|
637
|
+
>>> solver.solve(panda, Tep)
|
|
638
|
+
|
|
639
|
+
Notes
|
|
640
|
+
-----
|
|
641
|
+
When using the NR method, the initial joint coordinates :math:`q_0`, should correspond
|
|
642
|
+
to a non-singular manipulator pose, since it uses the manipulator Jacobian. When the
|
|
643
|
+
the problem is solvable, it converges very quickly. However, this method frequently
|
|
644
|
+
fails to converge on the goal.
|
|
645
|
+
|
|
646
|
+
This class supports null-space motion to assist with maximising manipulability and
|
|
647
|
+
avoiding joint limits. These are enabled by setting kq and km to non-zero values.
|
|
648
|
+
|
|
649
|
+
References
|
|
650
|
+
----------
|
|
651
|
+
- J. Haviland, and P. Corke. "Manipulator Differential Kinematics Part I:
|
|
652
|
+
Kinematics, Velocity, and Applications." arXiv preprint arXiv:2207.01796 (2022).
|
|
653
|
+
- J. Haviland, and P. Corke. "Manipulator Differential Kinematics Part II:
|
|
654
|
+
Acceleration and Advanced Applications." arXiv preprint arXiv:2207.01794 (2022).
|
|
655
|
+
|
|
656
|
+
See Also
|
|
657
|
+
--------
|
|
658
|
+
IKSolver
|
|
659
|
+
An abstract super class for numerical IK solvers
|
|
660
|
+
IK_GN
|
|
661
|
+
Implements the IKSolver class using the Gauss-Newton method
|
|
662
|
+
IK_LM
|
|
663
|
+
Implements the IKSolver class using the Levemberg-Marquadt method
|
|
664
|
+
IK_QP
|
|
665
|
+
Implements the IKSolver class using a quadratic programming approach
|
|
666
|
+
|
|
667
|
+
|
|
668
|
+
.. versionchanged:: 1.0.3
|
|
669
|
+
Added the Newton-Raphson IK solver class
|
|
670
|
+
|
|
671
|
+
""" # noqa
|
|
672
|
+
|
|
673
|
+
def __init__(
|
|
674
|
+
self,
|
|
675
|
+
name: str = "IK Solver",
|
|
676
|
+
ilimit: int = 30,
|
|
677
|
+
slimit: int = 100,
|
|
678
|
+
tol: float = 1e-6,
|
|
679
|
+
mask: Union[ArrayLike, None] = None,
|
|
680
|
+
joint_limits: bool = True,
|
|
681
|
+
seed: Union[int, None] = None,
|
|
682
|
+
pinv: bool = False,
|
|
683
|
+
kq: float = 0.0,
|
|
684
|
+
km: float = 0.0,
|
|
685
|
+
ps: float = 0.0,
|
|
686
|
+
pi: Union[np.ndarray, float] = 0.3,
|
|
687
|
+
**kwargs,
|
|
688
|
+
):
|
|
689
|
+
super().__init__(
|
|
690
|
+
name=name,
|
|
691
|
+
ilimit=ilimit,
|
|
692
|
+
slimit=slimit,
|
|
693
|
+
tol=tol,
|
|
694
|
+
mask=mask,
|
|
695
|
+
joint_limits=joint_limits,
|
|
696
|
+
seed=seed,
|
|
697
|
+
**kwargs,
|
|
698
|
+
)
|
|
699
|
+
|
|
700
|
+
self.pinv = pinv
|
|
701
|
+
self.kq = kq
|
|
702
|
+
self.km = km
|
|
703
|
+
self.ps = ps
|
|
704
|
+
self.pi = pi
|
|
705
|
+
|
|
706
|
+
self.name = f"NR (pinv={pinv})"
|
|
707
|
+
|
|
708
|
+
if self.kq > 0.0:
|
|
709
|
+
self.name += " Σ"
|
|
710
|
+
|
|
711
|
+
if self.km > 0.0:
|
|
712
|
+
self.name += " Jm"
|
|
713
|
+
|
|
714
|
+
def step(
|
|
715
|
+
self, ets: "rtb.ETS", Tep: np.ndarray, q: np.ndarray
|
|
716
|
+
) -> Tuple[float, np.ndarray]:
|
|
717
|
+
r"""
|
|
718
|
+
Performs a single iteration of the Newton-Raphson optimisation method
|
|
719
|
+
|
|
720
|
+
.. math::
|
|
721
|
+
|
|
722
|
+
\vec{q}_{k+1} = \vec{q}_k + {^0\mat{J}(\vec{q}_k)}^{-1} \vec{e}_k
|
|
723
|
+
|
|
724
|
+
Parameters
|
|
725
|
+
----------
|
|
726
|
+
ets
|
|
727
|
+
The ETS representing the manipulators kinematics
|
|
728
|
+
Tep
|
|
729
|
+
The desired end-effector pose
|
|
730
|
+
q
|
|
731
|
+
The current joint coordinate vector
|
|
732
|
+
|
|
733
|
+
Raises
|
|
734
|
+
------
|
|
735
|
+
numpy.LinAlgError
|
|
736
|
+
If a step is impossible due to a linear algebra error
|
|
737
|
+
|
|
738
|
+
Returns
|
|
739
|
+
-------
|
|
740
|
+
E
|
|
741
|
+
The new error value
|
|
742
|
+
q
|
|
743
|
+
The new joint coordinate vector
|
|
744
|
+
|
|
745
|
+
"""
|
|
746
|
+
|
|
747
|
+
Te = ets.eval(q)
|
|
748
|
+
e, E = self.error(Te, Tep)
|
|
749
|
+
|
|
750
|
+
J = ets.jacob0(q)
|
|
751
|
+
|
|
752
|
+
# Null-space motion
|
|
753
|
+
qnull = _calc_qnull(
|
|
754
|
+
ets=ets, q=q, J=J, λΣ=self.kq, λm=self.km, ps=self.ps, pi=self.pi
|
|
755
|
+
)
|
|
756
|
+
|
|
757
|
+
if self.pinv:
|
|
758
|
+
q[ets.jindices] += np.linalg.pinv(J) @ e + qnull
|
|
759
|
+
else:
|
|
760
|
+
q[ets.jindices] += np.linalg.inv(J) @ e + qnull
|
|
761
|
+
|
|
762
|
+
return E, q[ets.jindices]
|
|
763
|
+
|
|
764
|
+
|
|
765
|
+
class IK_LM(IKSolver):
|
|
766
|
+
"""
|
|
767
|
+
Levemberg-Marquadt Numerical Inverse Kinematics Solver
|
|
768
|
+
|
|
769
|
+
A class which provides functionality to perform numerical inverse kinematics (IK)
|
|
770
|
+
using the Levemberg-Marquadt method. See ``step`` method for mathematical description.
|
|
771
|
+
|
|
772
|
+
Parameters
|
|
773
|
+
----------
|
|
774
|
+
name
|
|
775
|
+
The name of the IK algorithm
|
|
776
|
+
ilimit
|
|
777
|
+
How many iterations are allowed within a search before a new search
|
|
778
|
+
is started
|
|
779
|
+
slimit
|
|
780
|
+
How many searches are allowed before being deemed unsuccessful
|
|
781
|
+
tol
|
|
782
|
+
Maximum allowed residual error E
|
|
783
|
+
mask
|
|
784
|
+
A 6 vector which assigns weights to Cartesian degrees-of-freedom
|
|
785
|
+
error priority
|
|
786
|
+
joint_limits
|
|
787
|
+
Reject solutions with joint limit violations
|
|
788
|
+
seed
|
|
789
|
+
A seed for the private RNG used to generate random joint coordinate
|
|
790
|
+
vectors
|
|
791
|
+
k
|
|
792
|
+
Sets the gain value for the damping matrix Wn in the ``step`` method. See
|
|
793
|
+
notes
|
|
794
|
+
method
|
|
795
|
+
One of "chan", "sugihara" or "wampler". Defines which method is used
|
|
796
|
+
to calculate the damping matrix Wn in the ``step`` method
|
|
797
|
+
kq
|
|
798
|
+
The gain for joint limit avoidance. Setting to 0.0 will remove this
|
|
799
|
+
completely from the solution
|
|
800
|
+
km
|
|
801
|
+
The gain for maximisation. Setting to 0.0 will remove this completely
|
|
802
|
+
from the solution
|
|
803
|
+
ps
|
|
804
|
+
The minimum angle/distance (in radians or metres) in which the joint is
|
|
805
|
+
allowed to approach to its limit
|
|
806
|
+
pi
|
|
807
|
+
The influence angle/distance (in radians or metres) in null space motion
|
|
808
|
+
becomes active
|
|
809
|
+
|
|
810
|
+
Examples
|
|
811
|
+
--------
|
|
812
|
+
The following example gets the ``ets`` of a ``panda`` robot object, instantiates
|
|
813
|
+
the IK_LM solver class using default parameters, makes a goal pose ``Tep``,
|
|
814
|
+
and then solves for the joint coordinates which result in the pose ``Tep``
|
|
815
|
+
using the `solve` method.
|
|
816
|
+
|
|
817
|
+
.. runblock:: pycon
|
|
818
|
+
>>> import roboticstoolbox as rtb
|
|
819
|
+
>>> panda = rtb.models.Panda().ets()
|
|
820
|
+
>>> solver = rtb.IK_LM()
|
|
821
|
+
>>> Tep = panda.fkine([0, -0.3, 0, -2.2, 0, 2, 0.7854])
|
|
822
|
+
>>> solver.solve(panda, Tep)
|
|
823
|
+
|
|
824
|
+
Notes
|
|
825
|
+
-----
|
|
826
|
+
The value for the ``k`` kwarg will depend on the ``method`` chosen and the arm you are
|
|
827
|
+
using. Use the following as a rough guide ``chan, k = 1.0 - 0.01``,
|
|
828
|
+
``wampler, k = 0.01 - 0.0001``, and ``sugihara, k = 0.1 - 0.0001``
|
|
829
|
+
|
|
830
|
+
When using the this method, the initial joint coordinates :math:`q_0`, should correspond
|
|
831
|
+
to a non-singular manipulator pose, since it uses the manipulator Jacobian.
|
|
832
|
+
|
|
833
|
+
This class supports null-space motion to assist with maximising manipulability and
|
|
834
|
+
avoiding joint limits. These are enabled by setting kq and km to non-zero values.
|
|
835
|
+
|
|
836
|
+
References
|
|
837
|
+
----------
|
|
838
|
+
- J. Haviland, and P. Corke. "Manipulator Differential Kinematics Part I:
|
|
839
|
+
Kinematics, Velocity, and Applications." arXiv preprint arXiv:2207.01796 (2022).
|
|
840
|
+
- J. Haviland, and P. Corke. "Manipulator Differential Kinematics Part II:
|
|
841
|
+
Acceleration and Advanced Applications." arXiv preprint arXiv:2207.01794 (2022).
|
|
842
|
+
|
|
843
|
+
See Also
|
|
844
|
+
--------
|
|
845
|
+
IKSolver
|
|
846
|
+
An abstract super class for numerical IK solvers
|
|
847
|
+
IK_NR
|
|
848
|
+
Implements the IKSolver class using the Newton-Raphson method
|
|
849
|
+
IK_GN
|
|
850
|
+
Implements the IKSolver class using the Gauss-Newton method
|
|
851
|
+
IK_QP
|
|
852
|
+
Implements the IKSolver class using a quadratic programming approach
|
|
853
|
+
|
|
854
|
+
|
|
855
|
+
.. versionchanged:: 1.0.3
|
|
856
|
+
Added the Levemberg-Marquadt IK solver class
|
|
857
|
+
|
|
858
|
+
""" # noqa
|
|
859
|
+
|
|
860
|
+
def __init__(
|
|
861
|
+
self,
|
|
862
|
+
name: str = "IK Solver",
|
|
863
|
+
ilimit: int = 30,
|
|
864
|
+
slimit: int = 100,
|
|
865
|
+
tol: float = 1e-6,
|
|
866
|
+
mask: Union[ArrayLike, None] = None,
|
|
867
|
+
joint_limits: bool = True,
|
|
868
|
+
seed: Union[int, None] = None,
|
|
869
|
+
k: float = 1.0,
|
|
870
|
+
method="chan",
|
|
871
|
+
kq: float = 0.0,
|
|
872
|
+
km: float = 0.0,
|
|
873
|
+
ps: float = 0.0,
|
|
874
|
+
pi: Union[np.ndarray, float] = 0.3,
|
|
875
|
+
**kwargs,
|
|
876
|
+
):
|
|
877
|
+
super().__init__(
|
|
878
|
+
name=name,
|
|
879
|
+
ilimit=ilimit,
|
|
880
|
+
slimit=slimit,
|
|
881
|
+
tol=tol,
|
|
882
|
+
mask=mask,
|
|
883
|
+
joint_limits=joint_limits,
|
|
884
|
+
seed=seed,
|
|
885
|
+
**kwargs,
|
|
886
|
+
)
|
|
887
|
+
|
|
888
|
+
if method.lower().startswith("sugi"):
|
|
889
|
+
self.method = 1
|
|
890
|
+
method_name = "Sugihara"
|
|
891
|
+
elif method.lower().startswith("wamp"):
|
|
892
|
+
self.method = 2
|
|
893
|
+
method_name = "Wampler"
|
|
894
|
+
else:
|
|
895
|
+
self.method = 0
|
|
896
|
+
method_name = "Chan"
|
|
897
|
+
|
|
898
|
+
self.k = k
|
|
899
|
+
self.kq = kq
|
|
900
|
+
self.km = km
|
|
901
|
+
self.ps = ps
|
|
902
|
+
self.pi = pi
|
|
903
|
+
|
|
904
|
+
self.name = f"LM ({method_name} λ={k})"
|
|
905
|
+
|
|
906
|
+
if self.kq > 0.0:
|
|
907
|
+
self.name += " Σ"
|
|
908
|
+
|
|
909
|
+
if self.km > 0.0:
|
|
910
|
+
self.name += " Jm"
|
|
911
|
+
|
|
912
|
+
def step(self, ets: "rtb.ETS", Tep: np.ndarray, q: np.ndarray):
|
|
913
|
+
r"""
|
|
914
|
+
Performs a single iteration of the Levenberg-Marquadt optimisation
|
|
915
|
+
|
|
916
|
+
The operation is defined by the choice of `method` when instantiating the class.
|
|
917
|
+
|
|
918
|
+
The next step is deined as
|
|
919
|
+
|
|
920
|
+
.. math::
|
|
921
|
+
\vec{q}_{k+1}
|
|
922
|
+
&=
|
|
923
|
+
\vec{q}_k +
|
|
924
|
+
\left(
|
|
925
|
+
\mat{A}_k
|
|
926
|
+
\right)^{-1}
|
|
927
|
+
\bf{g}_k \\
|
|
928
|
+
%
|
|
929
|
+
\mat{A}_k
|
|
930
|
+
&=
|
|
931
|
+
{\mat{J}(\vec{q}_k)}^\top
|
|
932
|
+
\mat{W}_e \
|
|
933
|
+
{\mat{J}(\vec{q}_k)}
|
|
934
|
+
+
|
|
935
|
+
\mat{W}_n
|
|
936
|
+
|
|
937
|
+
where :math:`\mat{W}_n = \text{diag}(\vec{w_n})(\vec{w_n} \in \mathbb{R}^n_{>0})` is a
|
|
938
|
+
diagonal damping matrix. The damping matrix ensures that :math:`\mat{A}_k` is
|
|
939
|
+
non-singular and positive definite. The performance of the LM method largely depends
|
|
940
|
+
on the choice of :math:`\mat{W}_n`.
|
|
941
|
+
|
|
942
|
+
**Chan's Method**
|
|
943
|
+
|
|
944
|
+
Chan proposed
|
|
945
|
+
|
|
946
|
+
.. math::
|
|
947
|
+
\mat{W}_n
|
|
948
|
+
=
|
|
949
|
+
λ E_k \mat{1}_n
|
|
950
|
+
|
|
951
|
+
where λ is a constant which reportedly does not have much influence on performance.
|
|
952
|
+
Use the kwarg `k` to adjust the weighting term λ.
|
|
953
|
+
|
|
954
|
+
**Sugihara's Method**
|
|
955
|
+
|
|
956
|
+
Sugihara proposed
|
|
957
|
+
|
|
958
|
+
.. math::
|
|
959
|
+
\mat{W}_n
|
|
960
|
+
=
|
|
961
|
+
E_k \mat{1}_n + \text{diag}(\hat{\vec{w}}_n)
|
|
962
|
+
|
|
963
|
+
where :math:`\hat{\vec{w}}_n \in \mathbb{R}^n`, :math:`\hat{w}_{n_i} = l^2 \sim 0.01 l^2`,
|
|
964
|
+
and :math:`l` is the length of a typical link within the manipulator. We provide the
|
|
965
|
+
variable `k` as a kwarg to adjust the value of :math:`w_n`.
|
|
966
|
+
|
|
967
|
+
**Wampler's Method**
|
|
968
|
+
|
|
969
|
+
Wampler proposed :math:`\vec{w_n}` to be a constant. This is set through the `k` kwarg.
|
|
970
|
+
|
|
971
|
+
Parameters
|
|
972
|
+
----------
|
|
973
|
+
ets
|
|
974
|
+
The ETS representing the manipulators kinematics
|
|
975
|
+
Tep
|
|
976
|
+
The desired end-effector pose
|
|
977
|
+
q
|
|
978
|
+
The current joint coordinate vector
|
|
979
|
+
|
|
980
|
+
Raises
|
|
981
|
+
------
|
|
982
|
+
numpy.LinAlgError
|
|
983
|
+
If a step is impossible due to a linear algebra error
|
|
984
|
+
|
|
985
|
+
Returns
|
|
986
|
+
-------
|
|
987
|
+
E
|
|
988
|
+
The new error value
|
|
989
|
+
q
|
|
990
|
+
The new joint coordinate vector
|
|
991
|
+
|
|
992
|
+
""" # noqa
|
|
993
|
+
|
|
994
|
+
Te = ets.eval(q)
|
|
995
|
+
e, E = self.error(Te, Tep)
|
|
996
|
+
|
|
997
|
+
if self.method == 1:
|
|
998
|
+
# Sugihara's method
|
|
999
|
+
Wn = E * np.eye(ets.n) + self.k * np.eye(ets.n)
|
|
1000
|
+
elif self.method == 2:
|
|
1001
|
+
# Wampler's method
|
|
1002
|
+
Wn = self.k * np.eye(ets.n)
|
|
1003
|
+
else:
|
|
1004
|
+
# Chan's method
|
|
1005
|
+
Wn = self.k * E * np.eye(ets.n)
|
|
1006
|
+
|
|
1007
|
+
J = ets.jacob0(q)
|
|
1008
|
+
g = J.T @ self.We @ e
|
|
1009
|
+
|
|
1010
|
+
# Null-space motion
|
|
1011
|
+
qnull = _calc_qnull(
|
|
1012
|
+
ets=ets, q=q, J=J, λΣ=self.kq, λm=self.km, ps=self.ps, pi=self.pi
|
|
1013
|
+
)
|
|
1014
|
+
|
|
1015
|
+
q[ets.jindices] += np.linalg.inv(J.T @ self.We @ J + Wn) @ g + qnull
|
|
1016
|
+
|
|
1017
|
+
return E, q[ets.jindices]
|
|
1018
|
+
|
|
1019
|
+
|
|
1020
|
+
class IK_GN(IKSolver):
|
|
1021
|
+
"""
|
|
1022
|
+
Gauss-Newton Numerical Inverse Kinematics Solver
|
|
1023
|
+
|
|
1024
|
+
A class which provides functionality to perform numerical inverse kinematics (IK)
|
|
1025
|
+
using the Gauss-Newton method. See `step` method for mathematical description.
|
|
1026
|
+
|
|
1027
|
+
Note
|
|
1028
|
+
----
|
|
1029
|
+
When using this class with redundant robots (>6 DoF), ``pinv`` must be set to ``True``
|
|
1030
|
+
|
|
1031
|
+
Parameters
|
|
1032
|
+
----------
|
|
1033
|
+
name
|
|
1034
|
+
The name of the IK algorithm
|
|
1035
|
+
ilimit
|
|
1036
|
+
How many iterations are allowed within a search before a new search
|
|
1037
|
+
is started
|
|
1038
|
+
slimit
|
|
1039
|
+
How many searches are allowed before being deemed unsuccessful
|
|
1040
|
+
tol
|
|
1041
|
+
Maximum allowed residual error E
|
|
1042
|
+
mask
|
|
1043
|
+
A 6 vector which assigns weights to Cartesian degrees-of-freedom
|
|
1044
|
+
error priority
|
|
1045
|
+
joint_limits
|
|
1046
|
+
Reject solutions with joint limit violations
|
|
1047
|
+
seed
|
|
1048
|
+
A seed for the private RNG used to generate random joint coordinate
|
|
1049
|
+
vectors
|
|
1050
|
+
pinv
|
|
1051
|
+
If True, will use the psuedoinverse in the `step` method instead of
|
|
1052
|
+
the normal inverse
|
|
1053
|
+
kq
|
|
1054
|
+
The gain for joint limit avoidance. Setting to 0.0 will remove this
|
|
1055
|
+
completely from the solution
|
|
1056
|
+
km
|
|
1057
|
+
The gain for maximisation. Setting to 0.0 will remove this completely
|
|
1058
|
+
from the solution
|
|
1059
|
+
ps
|
|
1060
|
+
The minimum angle/distance (in radians or metres) in which the joint is
|
|
1061
|
+
allowed to approach to its limit
|
|
1062
|
+
pi
|
|
1063
|
+
The influence angle/distance (in radians or metres) in null space motion
|
|
1064
|
+
becomes active
|
|
1065
|
+
|
|
1066
|
+
Examples
|
|
1067
|
+
--------
|
|
1068
|
+
The following example gets the ``ets`` of a ``panda`` robot object, instantiates
|
|
1069
|
+
the `IK_GN` solver class using default parameters, makes a goal pose ``Tep``,
|
|
1070
|
+
and then solves for the joint coordinates which result in the pose ``Tep``
|
|
1071
|
+
using the `solve` method.
|
|
1072
|
+
|
|
1073
|
+
.. runblock:: pycon
|
|
1074
|
+
>>> import roboticstoolbox as rtb
|
|
1075
|
+
>>> panda = rtb.models.Panda().ets()
|
|
1076
|
+
>>> solver = rtb.IK_GN(pinv=True)
|
|
1077
|
+
>>> Tep = panda.fkine([0, -0.3, 0, -2.2, 0, 2, 0.7854])
|
|
1078
|
+
>>> solver.solve(panda, Tep)
|
|
1079
|
+
|
|
1080
|
+
Notes
|
|
1081
|
+
-----
|
|
1082
|
+
When using the this method, the initial joint coordinates :math:`q_0`, should correspond
|
|
1083
|
+
to a non-singular manipulator pose, since it uses the manipulator Jacobian. When the
|
|
1084
|
+
the problem is solvable, it converges very quickly.
|
|
1085
|
+
|
|
1086
|
+
This class supports null-space motion to assist with maximising manipulability and
|
|
1087
|
+
avoiding joint limits. These are enabled by setting kq and km to non-zero values.
|
|
1088
|
+
|
|
1089
|
+
References
|
|
1090
|
+
----------
|
|
1091
|
+
- J. Haviland, and P. Corke. "Manipulator Differential Kinematics Part I:
|
|
1092
|
+
Kinematics, Velocity, and Applications." arXiv preprint arXiv:2207.01796 (2022).
|
|
1093
|
+
- J. Haviland, and P. Corke. "Manipulator Differential Kinematics Part II:
|
|
1094
|
+
Acceleration and Advanced Applications." arXiv preprint arXiv:2207.01794 (2022).
|
|
1095
|
+
|
|
1096
|
+
See Also
|
|
1097
|
+
--------
|
|
1098
|
+
IKSolver
|
|
1099
|
+
An abstract super class for numerical IK solvers
|
|
1100
|
+
IK_NR
|
|
1101
|
+
Implements IKSolver using the Newton-Raphson method
|
|
1102
|
+
IK_LM
|
|
1103
|
+
Implements IKSolver using the Levemberg-Marquadt method
|
|
1104
|
+
IK_QP
|
|
1105
|
+
Implements IKSolver using a quadratic programming approach
|
|
1106
|
+
|
|
1107
|
+
|
|
1108
|
+
.. versionchanged:: 1.0.3
|
|
1109
|
+
Added the Gauss-Newton IK solver class
|
|
1110
|
+
|
|
1111
|
+
""" # noqa
|
|
1112
|
+
|
|
1113
|
+
def __init__(
|
|
1114
|
+
self,
|
|
1115
|
+
name: str = "IK Solver",
|
|
1116
|
+
ilimit: int = 30,
|
|
1117
|
+
slimit: int = 100,
|
|
1118
|
+
tol: float = 1e-6,
|
|
1119
|
+
mask: Union[ArrayLike, None] = None,
|
|
1120
|
+
joint_limits: bool = True,
|
|
1121
|
+
seed: Union[int, None] = None,
|
|
1122
|
+
pinv: bool = False,
|
|
1123
|
+
kq: float = 0.0,
|
|
1124
|
+
km: float = 0.0,
|
|
1125
|
+
ps: float = 0.0,
|
|
1126
|
+
pi: Union[np.ndarray, float] = 0.3,
|
|
1127
|
+
**kwargs,
|
|
1128
|
+
):
|
|
1129
|
+
super().__init__(
|
|
1130
|
+
name=name,
|
|
1131
|
+
ilimit=ilimit,
|
|
1132
|
+
slimit=slimit,
|
|
1133
|
+
tol=tol,
|
|
1134
|
+
mask=mask,
|
|
1135
|
+
joint_limits=joint_limits,
|
|
1136
|
+
seed=seed,
|
|
1137
|
+
**kwargs,
|
|
1138
|
+
)
|
|
1139
|
+
|
|
1140
|
+
self.pinv = pinv
|
|
1141
|
+
self.kq = kq
|
|
1142
|
+
self.km = km
|
|
1143
|
+
self.ps = ps
|
|
1144
|
+
self.pi = pi
|
|
1145
|
+
|
|
1146
|
+
self.name = f"GN (pinv={pinv})"
|
|
1147
|
+
|
|
1148
|
+
if self.kq > 0.0:
|
|
1149
|
+
self.name += " Σ"
|
|
1150
|
+
|
|
1151
|
+
if self.km > 0.0:
|
|
1152
|
+
self.name += " Jm"
|
|
1153
|
+
|
|
1154
|
+
def step(
|
|
1155
|
+
self, ets: "rtb.ETS", Tep: np.ndarray, q: np.ndarray
|
|
1156
|
+
) -> Tuple[float, np.ndarray]:
|
|
1157
|
+
r"""
|
|
1158
|
+
Performs a single iteration of the Gauss-Newton optimisation method
|
|
1159
|
+
|
|
1160
|
+
The next step is defined as
|
|
1161
|
+
|
|
1162
|
+
.. math::
|
|
1163
|
+
|
|
1164
|
+
\vec{q}_{k+1} &= \vec{q}_k +
|
|
1165
|
+
\left(
|
|
1166
|
+
{\mat{J}(\vec{q}_k)}^\top
|
|
1167
|
+
\mat{W}_e \
|
|
1168
|
+
{\mat{J}(\vec{q}_k)}
|
|
1169
|
+
\right)^{-1}
|
|
1170
|
+
\bf{g}_k \\
|
|
1171
|
+
\bf{g}_k &=
|
|
1172
|
+
{\mat{J}(\vec{q}_k)}^\top
|
|
1173
|
+
\mat{W}_e
|
|
1174
|
+
\vec{e}_k
|
|
1175
|
+
|
|
1176
|
+
where :math:`\mat{J} = {^0\mat{J}}` is the base-frame manipulator Jacobian. If
|
|
1177
|
+
:math:`\mat{J}(\vec{q}_k)` is non-singular, and :math:`\mat{W}_e = \mat{1}_n`, then
|
|
1178
|
+
the above provides the pseudoinverse solution. However, if :math:`\mat{J}(\vec{q}_k)`
|
|
1179
|
+
is singular, the above can not be computed and the GN solution is infeasible.
|
|
1180
|
+
|
|
1181
|
+
Parameters
|
|
1182
|
+
----------
|
|
1183
|
+
ets
|
|
1184
|
+
The ETS representing the manipulators kinematics
|
|
1185
|
+
Tep
|
|
1186
|
+
The desired end-effector pose
|
|
1187
|
+
q
|
|
1188
|
+
The current joint coordinate vector
|
|
1189
|
+
|
|
1190
|
+
Raises
|
|
1191
|
+
------
|
|
1192
|
+
numpy.LinAlgError
|
|
1193
|
+
If a step is impossible due to a linear algebra error
|
|
1194
|
+
|
|
1195
|
+
Returns
|
|
1196
|
+
-------
|
|
1197
|
+
E
|
|
1198
|
+
The new error value
|
|
1199
|
+
q
|
|
1200
|
+
The new joint coordinate vector
|
|
1201
|
+
|
|
1202
|
+
""" # noqa
|
|
1203
|
+
|
|
1204
|
+
Te = ets.eval(q)
|
|
1205
|
+
e, E = self.error(Te, Tep)
|
|
1206
|
+
|
|
1207
|
+
J = ets.jacob0(q)
|
|
1208
|
+
|
|
1209
|
+
# Null-space motion
|
|
1210
|
+
qnull = _calc_qnull(
|
|
1211
|
+
ets=ets, q=q, J=J, λΣ=self.kq, λm=self.km, ps=self.ps, pi=self.pi
|
|
1212
|
+
)
|
|
1213
|
+
|
|
1214
|
+
if self.pinv:
|
|
1215
|
+
q[ets.jindices] += np.linalg.pinv(J) @ e + qnull
|
|
1216
|
+
else:
|
|
1217
|
+
q[ets.jindices] += np.linalg.inv(J) @ e + qnull
|
|
1218
|
+
|
|
1219
|
+
return E, q[ets.jindices]
|
|
1220
|
+
|
|
1221
|
+
|
|
1222
|
+
class IK_QP(IKSolver):
|
|
1223
|
+
"""
|
|
1224
|
+
Quadratic Progamming Numerical Inverse Kinematics Solver
|
|
1225
|
+
|
|
1226
|
+
A class which provides functionality to perform numerical inverse kinematics (IK)
|
|
1227
|
+
using a quadratic progamming approach. See `step` method for mathematical
|
|
1228
|
+
description.
|
|
1229
|
+
|
|
1230
|
+
Parameters
|
|
1231
|
+
----------
|
|
1232
|
+
name
|
|
1233
|
+
The name of the IK algorithm
|
|
1234
|
+
ilimit
|
|
1235
|
+
How many iterations are allowed within a search before a new search
|
|
1236
|
+
is started
|
|
1237
|
+
slimit
|
|
1238
|
+
How many searches are allowed before being deemed unsuccessful
|
|
1239
|
+
tol
|
|
1240
|
+
Maximum allowed residual error E
|
|
1241
|
+
mask
|
|
1242
|
+
A 6 vector which assigns weights to Cartesian degrees-of-freedom
|
|
1243
|
+
error priority
|
|
1244
|
+
joint_limits
|
|
1245
|
+
Reject solutions with joint limit violations
|
|
1246
|
+
seed
|
|
1247
|
+
A seed for the private RNG used to generate random joint coordinate
|
|
1248
|
+
vectors
|
|
1249
|
+
kj
|
|
1250
|
+
A gain for joint velocity norm minimisation
|
|
1251
|
+
ks
|
|
1252
|
+
A gain which adjusts the cost of slack (intentional error)
|
|
1253
|
+
kq
|
|
1254
|
+
The gain for joint limit avoidance. Setting to 0.0 will remove this
|
|
1255
|
+
completely from the solution
|
|
1256
|
+
km
|
|
1257
|
+
The gain for maximisation. Setting to 0.0 will remove this completely
|
|
1258
|
+
from the solution
|
|
1259
|
+
ps
|
|
1260
|
+
The minimum angle/distance (in radians or metres) in which the joint is
|
|
1261
|
+
allowed to approach to its limit
|
|
1262
|
+
pi
|
|
1263
|
+
The influence angle/distance (in radians or metres) in null space motion
|
|
1264
|
+
becomes active
|
|
1265
|
+
|
|
1266
|
+
Raises
|
|
1267
|
+
------
|
|
1268
|
+
ImportError
|
|
1269
|
+
If the package ``qpsolvers`` is not installed
|
|
1270
|
+
|
|
1271
|
+
Examples
|
|
1272
|
+
--------
|
|
1273
|
+
The following example gets the ``ets`` of a ``panda`` robot object, instantiates
|
|
1274
|
+
the `IK_QP` solver class using default parameters, makes a goal pose ``Tep``,
|
|
1275
|
+
and then solves for the joint coordinates which result in the pose ``Tep``
|
|
1276
|
+
using the `solve` method.
|
|
1277
|
+
|
|
1278
|
+
.. runblock:: pycon
|
|
1279
|
+
>>> import roboticstoolbox as rtb
|
|
1280
|
+
>>> panda = rtb.models.Panda().ets()
|
|
1281
|
+
>>> solver = rtb.IK_QP()
|
|
1282
|
+
>>> Tep = panda.fkine([0, -0.3, 0, -2.2, 0, 2, 0.7854])
|
|
1283
|
+
>>> solver.solve(panda, Tep)
|
|
1284
|
+
|
|
1285
|
+
Notes
|
|
1286
|
+
-----
|
|
1287
|
+
When using the this method, the initial joint coordinates :math:`q_0`, should correspond
|
|
1288
|
+
to a non-singular manipulator pose, since it uses the manipulator Jacobian. When the
|
|
1289
|
+
the problem is solvable, it converges very quickly.
|
|
1290
|
+
|
|
1291
|
+
References
|
|
1292
|
+
----------
|
|
1293
|
+
- J. Haviland, and P. Corke. "Manipulator Differential Kinematics Part II:
|
|
1294
|
+
Acceleration and Advanced Applications." arXiv preprint arXiv:2207.01794 (2022).
|
|
1295
|
+
|
|
1296
|
+
See Also
|
|
1297
|
+
--------
|
|
1298
|
+
IKSolver
|
|
1299
|
+
An abstract super class for numerical IK solvers
|
|
1300
|
+
IK_NR
|
|
1301
|
+
Implements IKSolver class using the Newton-Raphson method
|
|
1302
|
+
IK_GN
|
|
1303
|
+
Implements IKSolver class using the Gauss-Newton method
|
|
1304
|
+
IK_LM
|
|
1305
|
+
Implements IKSolver class using the Levemberg-Marquadt method
|
|
1306
|
+
|
|
1307
|
+
|
|
1308
|
+
.. versionchanged:: 1.0.3
|
|
1309
|
+
Added the Quadratic Programming IK solver class
|
|
1310
|
+
|
|
1311
|
+
""" # noqa
|
|
1312
|
+
|
|
1313
|
+
def __init__(
|
|
1314
|
+
self,
|
|
1315
|
+
name: str = "IK Solver",
|
|
1316
|
+
ilimit: int = 30,
|
|
1317
|
+
slimit: int = 100,
|
|
1318
|
+
tol: float = 1e-6,
|
|
1319
|
+
mask: Union[ArrayLike, None] = None,
|
|
1320
|
+
joint_limits: bool = True,
|
|
1321
|
+
seed: Union[int, None] = None,
|
|
1322
|
+
kj=0.01,
|
|
1323
|
+
ks=1.0,
|
|
1324
|
+
kq: float = 0.0,
|
|
1325
|
+
km: float = 0.0,
|
|
1326
|
+
ps: float = 0.0,
|
|
1327
|
+
pi: Union[np.ndarray, float] = 0.3,
|
|
1328
|
+
**kwargs,
|
|
1329
|
+
):
|
|
1330
|
+
if not _qp: # pragma: nocover
|
|
1331
|
+
raise ImportError(
|
|
1332
|
+
"the package qpsolvers is required for this class. \nInstall using 'pip"
|
|
1333
|
+
" install qpsolvers'"
|
|
1334
|
+
)
|
|
1335
|
+
|
|
1336
|
+
super().__init__(
|
|
1337
|
+
name=name,
|
|
1338
|
+
ilimit=ilimit,
|
|
1339
|
+
slimit=slimit,
|
|
1340
|
+
tol=tol,
|
|
1341
|
+
mask=mask,
|
|
1342
|
+
joint_limits=joint_limits,
|
|
1343
|
+
seed=seed,
|
|
1344
|
+
**kwargs,
|
|
1345
|
+
)
|
|
1346
|
+
|
|
1347
|
+
self.kj = kj
|
|
1348
|
+
self.ks = ks
|
|
1349
|
+
self.kq = kq
|
|
1350
|
+
self.km = km
|
|
1351
|
+
self.ps = ps
|
|
1352
|
+
self.pi = pi
|
|
1353
|
+
|
|
1354
|
+
self.name = "QP)"
|
|
1355
|
+
|
|
1356
|
+
if self.kq > 0.0:
|
|
1357
|
+
self.name += " Σ"
|
|
1358
|
+
|
|
1359
|
+
if self.km > 0.0:
|
|
1360
|
+
self.name += " Jm"
|
|
1361
|
+
|
|
1362
|
+
def step(
|
|
1363
|
+
self, ets: "rtb.ETS", Tep: np.ndarray, q: np.ndarray
|
|
1364
|
+
) -> Tuple[float, np.ndarray]:
|
|
1365
|
+
r"""
|
|
1366
|
+
Performs a single iteration of the Gauss-Newton optimisation method
|
|
1367
|
+
|
|
1368
|
+
The next step is defined as
|
|
1369
|
+
|
|
1370
|
+
.. math::
|
|
1371
|
+
|
|
1372
|
+
\vec{q}_{k+1} = \vec{q}_{k} + \dot{\vec{q}}.
|
|
1373
|
+
|
|
1374
|
+
where the QP is defined as
|
|
1375
|
+
|
|
1376
|
+
.. math::
|
|
1377
|
+
|
|
1378
|
+
\min_x \quad f_o(\vec{x}) &= \frac{1}{2} \vec{x}^\top \mathcal{Q} \vec{x}+ \mathcal{C}^\top \vec{x}, \\
|
|
1379
|
+
\text{subject to} \quad \mathcal{J} \vec{x} &= \vec{\nu}, \\
|
|
1380
|
+
\mathcal{A} \vec{x} &\leq \mathcal{B}, \\
|
|
1381
|
+
\vec{x}^- &\leq \vec{x} \leq \vec{x}^+
|
|
1382
|
+
|
|
1383
|
+
with
|
|
1384
|
+
|
|
1385
|
+
.. math::
|
|
1386
|
+
|
|
1387
|
+
\vec{x} &=
|
|
1388
|
+
\begin{pmatrix}
|
|
1389
|
+
\dvec{q} \\ \vec{\delta}
|
|
1390
|
+
\end{pmatrix} \in \mathbb{R}^{(n+6)} \\
|
|
1391
|
+
\mathcal{Q} &=
|
|
1392
|
+
\begin{pmatrix}
|
|
1393
|
+
\lambda_q \mat{1}_{n} & \mathbf{0}_{6 \times 6} \\ \mathbf{0}_{n \times n} & \lambda_\delta \mat{1}_{6}
|
|
1394
|
+
\end{pmatrix} \in \mathbb{R}^{(n+6) \times (n+6)} \\
|
|
1395
|
+
\mathcal{J} &=
|
|
1396
|
+
\begin{pmatrix}
|
|
1397
|
+
\mat{J}(\vec{q}) & \mat{1}_{6}
|
|
1398
|
+
\end{pmatrix} \in \mathbb{R}^{6 \times (n+6)} \\
|
|
1399
|
+
\mathcal{C} &=
|
|
1400
|
+
\begin{pmatrix}
|
|
1401
|
+
\mat{J}_m \\ \bf{0}_{6 \times 1}
|
|
1402
|
+
\end{pmatrix} \in \mathbb{R}^{(n + 6)} \\
|
|
1403
|
+
\mathcal{A} &=
|
|
1404
|
+
\begin{pmatrix}
|
|
1405
|
+
\mat{1}_{n \times n + 6} \\
|
|
1406
|
+
\end{pmatrix} \in \mathbb{R}^{(l + n) \times (n + 6)} \\
|
|
1407
|
+
\mathcal{B} &=
|
|
1408
|
+
\eta
|
|
1409
|
+
\begin{pmatrix}
|
|
1410
|
+
\frac{\rho_0 - \rho_s}
|
|
1411
|
+
{\rho_i - \rho_s} \\
|
|
1412
|
+
\vdots \\
|
|
1413
|
+
\frac{\rho_n - \rho_s}
|
|
1414
|
+
{\rho_i - \rho_s}
|
|
1415
|
+
\end{pmatrix} \in \mathbb{R}^{n} \\
|
|
1416
|
+
\vec{x}^{-, +} &=
|
|
1417
|
+
\begin{pmatrix}
|
|
1418
|
+
\dvec{q}^{-, +} \\
|
|
1419
|
+
\vec{\delta}^{-, +}
|
|
1420
|
+
\end{pmatrix} \in \mathbb{R}^{(n+6)},
|
|
1421
|
+
|
|
1422
|
+
where :math:`\vec{\delta} \in \mathbb{R}^6` is the slack vector,
|
|
1423
|
+
:math:`\lambda_\delta \in \mathbb{R}^+` is a gain term which adjusts the
|
|
1424
|
+
cost of the norm of the slack vector in the optimiser,
|
|
1425
|
+
:math:`\dvec{q}^{-,+}` are the minimum and maximum joint velocities, and
|
|
1426
|
+
:math:`\dvec{\delta}^{-,+}` are the minimum and maximum slack velocities.
|
|
1427
|
+
|
|
1428
|
+
Parameters
|
|
1429
|
+
----------
|
|
1430
|
+
ets
|
|
1431
|
+
The ETS representing the manipulators kinematics
|
|
1432
|
+
Tep
|
|
1433
|
+
The desired end-effector pose
|
|
1434
|
+
q
|
|
1435
|
+
The current joint coordinate vector
|
|
1436
|
+
|
|
1437
|
+
Raises
|
|
1438
|
+
------
|
|
1439
|
+
numpy.LinAlgError
|
|
1440
|
+
If a step is impossible due to a linear algebra error
|
|
1441
|
+
|
|
1442
|
+
Returns
|
|
1443
|
+
-------
|
|
1444
|
+
E
|
|
1445
|
+
The new error value
|
|
1446
|
+
q
|
|
1447
|
+
The new joint coordinate vector
|
|
1448
|
+
|
|
1449
|
+
""" # noqa
|
|
1450
|
+
|
|
1451
|
+
Te = ets.eval(q)
|
|
1452
|
+
e, E = self.error(Te, Tep)
|
|
1453
|
+
J = ets.jacob0(q)
|
|
1454
|
+
|
|
1455
|
+
if isinstance(self.pi, float) or isinstance(self.pi, int):
|
|
1456
|
+
self.pi = self.pi * np.ones(ets.n)
|
|
1457
|
+
|
|
1458
|
+
# Quadratic component of objective function
|
|
1459
|
+
Q = np.eye(ets.n + 6)
|
|
1460
|
+
|
|
1461
|
+
# Joint velocity component of Q
|
|
1462
|
+
Q[: ets.n, : ets.n] *= self.kj
|
|
1463
|
+
|
|
1464
|
+
# Slack component of Q
|
|
1465
|
+
Q[ets.n :, ets.n :] = self.ks * (1 / np.sum(np.abs(e))) * np.eye(6)
|
|
1466
|
+
|
|
1467
|
+
# The equality contraints
|
|
1468
|
+
Aeq = np.concatenate((J, np.eye(6)), axis=1)
|
|
1469
|
+
beq = e.reshape((6,))
|
|
1470
|
+
|
|
1471
|
+
# The inequality constraints for joint limit avoidance
|
|
1472
|
+
if self.kq > 0.0:
|
|
1473
|
+
Ain = np.zeros((ets.n + 6, ets.n + 6))
|
|
1474
|
+
bin = np.zeros(ets.n + 6)
|
|
1475
|
+
|
|
1476
|
+
# Form the joint limit velocity damper
|
|
1477
|
+
Ain_l = np.zeros((ets.n, ets.n))
|
|
1478
|
+
Bin_l = np.zeros(ets.n)
|
|
1479
|
+
|
|
1480
|
+
for i in range(ets.n):
|
|
1481
|
+
ql0 = ets.qlim[0, i]
|
|
1482
|
+
ql1 = ets.qlim[1, i]
|
|
1483
|
+
|
|
1484
|
+
if ql1 - q[i] <= self.pi[i]:
|
|
1485
|
+
Bin_l[i] = ((ql1 - q[i]) - self.ps) / (self.pi[i] - self.ps)
|
|
1486
|
+
Ain_l[i, i] = 1
|
|
1487
|
+
|
|
1488
|
+
if q[i] - ql0 <= self.pi[i]:
|
|
1489
|
+
Bin_l[i] = -(((ql0 - q[i]) + self.ps) / (self.pi[i] - self.ps))
|
|
1490
|
+
Ain_l[i, i] = -1
|
|
1491
|
+
|
|
1492
|
+
Ain[: ets.n, : ets.n] = Ain_l
|
|
1493
|
+
bin[: ets.n] = (1.0 / self.kq) * Bin_l
|
|
1494
|
+
else:
|
|
1495
|
+
Ain = None
|
|
1496
|
+
bin = None
|
|
1497
|
+
|
|
1498
|
+
# Manipulability maximisation
|
|
1499
|
+
if self.km > 0.0:
|
|
1500
|
+
Jm = ets.jacobm(q).reshape((ets.n,))
|
|
1501
|
+
c = np.concatenate(((1.0 / self.km) * -Jm, np.zeros(6)))
|
|
1502
|
+
else:
|
|
1503
|
+
c = np.zeros(ets.n + 6)
|
|
1504
|
+
|
|
1505
|
+
xd = qp.solve_qp(Q, c, Ain, bin, Aeq, beq, lb=None, ub=None, solver="quadprog")
|
|
1506
|
+
|
|
1507
|
+
if xd is None: # pragma: nocover
|
|
1508
|
+
raise np.linalg.LinAlgError("QP Unsolvable")
|
|
1509
|
+
|
|
1510
|
+
q += xd[: ets.n]
|
|
1511
|
+
|
|
1512
|
+
return E, q
|
|
1513
|
+
|
|
1514
|
+
|
|
1515
|
+
if __name__ == "__main__": # pragma nocover
|
|
1516
|
+
sol = IKSolution(
|
|
1517
|
+
np.array([1, 2, 3]), success=True, iterations=10, searches=100, residual=0.1
|
|
1518
|
+
)
|
|
1519
|
+
|
|
1520
|
+
a, b, c, d, e = sol
|
|
1521
|
+
|
|
1522
|
+
print(a, b, c, d, e)
|