diff --git a/2d_ellipse-1.pdf b/2d_ellipse-1.pdf index af63e334..5b2bad79 100644 Binary files a/2d_ellipse-1.pdf and b/2d_ellipse-1.pdf differ diff --git a/2d_ellipse-2.pdf b/2d_ellipse-2.pdf index 4129eb5d..b008ecc5 100644 Binary files a/2d_ellipse-2.pdf and b/2d_ellipse-2.pdf differ diff --git a/2d_ellipse.html b/2d_ellipse.html index 0677191d..6bee76a7 100644 --- a/2d_ellipse.html +++ b/2d_ellipse.html @@ -555,7 +555,7 @@
© Copyright 2020-, Peter Corke.. - Last updated on 26-Jun-2024. + Last updated on 23-Jul-2024.
diff --git a/2d_line.html b/2d_line.html index 291ac2ca..2837775d 100644 --- a/2d_line.html +++ b/2d_line.html @@ -302,7 +302,7 @@© Copyright 2020-, Peter Corke.. - Last updated on 26-Jun-2024. + Last updated on 23-Jul-2024.
diff --git a/2d_linesegment.html b/2d_linesegment.html index 051c8c00..b7539ee4 100644 --- a/2d_linesegment.html +++ b/2d_linesegment.html @@ -122,7 +122,7 @@© Copyright 2020-, Peter Corke.. - Last updated on 26-Jun-2024. + Last updated on 23-Jul-2024.
diff --git a/2d_orient_SO2-1.pdf b/2d_orient_SO2-1.pdf index 98a07d72..bd6e8cb1 100644 Binary files a/2d_orient_SO2-1.pdf and b/2d_orient_SO2-1.pdf differ diff --git a/2d_orient_SO2.html b/2d_orient_SO2.html index 9d1d419e..9ddb9e79 100644 --- a/2d_orient_SO2.html +++ b/2d_orient_SO2.html @@ -121,7 +121,7 @@n (int, optional) – Number of values, defaults to 1
Self
+Self
pose instance with n
default values
arg (Any) – initial value
convertfrom (Tuple) – list of classes to accept and convert from
arg (Any
) – initial value
convertfrom (Tuple
) – list of classes to accept and convert from
check (bool) – check value is valid, defaults to True
bool
+bool
None
+None
Array value of an instance (BasePoseList superclass method)
© Copyright 2020-, Peter Corke.. - Last updated on 26-Jun-2024. + Last updated on 23-Jul-2024.
diff --git a/2d_polygon-1.pdf b/2d_polygon-1.pdf index 7db4adb1..bf931a39 100644 Binary files a/2d_polygon-1.pdf and b/2d_polygon-1.pdf differ diff --git a/2d_polygon-2.pdf b/2d_polygon-2.pdf index 7bcec263..fa17e7a4 100644 Binary files a/2d_polygon-2.pdf and b/2d_polygon-2.pdf differ diff --git a/2d_polygon.html b/2d_polygon.html index a10e2629..79c8da5d 100644 --- a/2d_polygon.html +++ b/2d_polygon.html @@ -537,7 +537,7 @@© Copyright 2020-, Peter Corke.. - Last updated on 26-Jun-2024. + Last updated on 23-Jul-2024.
diff --git a/2d_pose_SE2-1.pdf b/2d_pose_SE2-1.pdf index 93afc610..ace00e27 100644 Binary files a/2d_pose_SE2-1.pdf and b/2d_pose_SE2-1.pdf differ diff --git a/2d_pose_SE2.html b/2d_pose_SE2.html index 05692369..5d523558 100644 --- a/2d_pose_SE2.html +++ b/2d_pose_SE2.html @@ -125,7 +125,7 @@n (int, optional) – Number of values, defaults to 1
Self
+Self
pose instance with n
default values
arg (Any) – initial value
convertfrom (Tuple) – list of classes to accept and convert from
arg (Any
) – initial value
convertfrom (Tuple
) – list of classes to accept and convert from
check (bool) – check value is valid, defaults to True
bool
+bool
None
+None
Array value of an instance (BasePoseList superclass method)
© Copyright 2020-, Peter Corke.. - Last updated on 26-Jun-2024. + Last updated on 23-Jul-2024.
diff --git a/2d_pose_twist.html b/2d_pose_twist.html index e17f715c..2dd933a8 100644 --- a/2d_pose_twist.html +++ b/2d_pose_twist.html @@ -116,7 +116,7 @@n (int, optional) – Number of values, defaults to 1
Self
+Self
pose instance with n
default values
>>> from spatialmath import Twist3
>>> S = Twist3(SE3.Rand())
>>> S
-Twist3([-0.085167, 0.084531, -0.18368, 0.007879, 2.716, -0.97149])
+Twist3([0.53291, -0.8185, -0.32723, -2.2705, 0.2433, -0.10986])
>>> S.inv()
-Twist3([0.085167, -0.084531, 0.18368, -0.007879, -2.716, 0.97149])
+Twist3([-0.53291, 0.8185, 0.32723, 2.2705, -0.2433, 0.10986])
>>> S * S.inv()
-Twist3([0, -2.7756e-17, -3.9899e-17, 0, 0, 0])
+Twist3([1.1102e-16, -2.2204e-16, 0, 0, 0, 0])
Array value of an instance (BasePoseList superclass method)
© Copyright 2020-, Peter Corke.. - Last updated on 26-Jun-2024. + Last updated on 23-Jul-2024.
diff --git a/3d_dualquaternion.html b/3d_dualquaternion.html index 4a7d4398..9f73e778 100644 --- a/3d_dualquaternion.html +++ b/3d_dualquaternion.html @@ -140,7 +140,7 @@Self
+Self
Self
+Self
© Copyright 2020-, Peter Corke.. - Last updated on 26-Jun-2024. + Last updated on 23-Jul-2024.
diff --git a/3d_line.html b/3d_line.html index 6a8fcffc..4b9af3a0 100644 --- a/3d_line.html +++ b/3d_line.html @@ -108,9 +108,7 @@Bases: spatialmath.baseposelist.BasePoseList
n (int, optional) – Number of values, defaults to 1
Self
+Self
pose instance with n
default values
Create a Line3 object
arg (Any) – initial value
convertfrom (Tuple) – list of classes to accept and convert from
arg (Any
) – initial value
convertfrom (Tuple
) – list of classes to accept and convert from
check (bool) – check value is valid, defaults to True
bool
+bool
© Copyright 2020-, Peter Corke.. - Last updated on 26-Jun-2024. + Last updated on 23-Jul-2024.
diff --git a/3d_orient_SO3-1.pdf b/3d_orient_SO3-1.pdf index aeabc732..1a1b774f 100644 Binary files a/3d_orient_SO3-1.pdf and b/3d_orient_SO3-1.pdf differ diff --git a/3d_orient_SO3.html b/3d_orient_SO3.html index f4ae4462..21198034 100644 --- a/3d_orient_SO3.html +++ b/3d_orient_SO3.html @@ -126,7 +126,7 @@n (int, optional) – Number of values, defaults to 1
Self
+Self
pose instance with n
default values
Construct a new SO(3) from Euler angles
Construct a new SO(3) from roll-pitch-yaw angles
>>> from spatialmath import SO3
>>> x = SO3.Rand()
>>> x
-SO3(array([[ 0.9424, -0.3344, -0.0026],
- [ 0.1644, 0.4564, 0.8745],
- [-0.2912, -0.8246, 0.4851]]))
+SO3(array([[-0.9534, 0.1331, 0.2706],
+ [-0.1306, -0.9911, 0.027 ],
+ [ 0.2718, -0.0096, 0.9623]]))
Construct new SO(3) object
arg (Any) – initial value
convertfrom (Tuple) – list of classes to accept and convert from
arg (Any
) – initial value
convertfrom (Tuple
) – list of classes to accept and convert from
check (bool) – check value is valid, defaults to True
bool
+bool
None
+None
Array value of an instance (BasePoseList superclass method)
© Copyright 2020-, Peter Corke.. - Last updated on 26-Jun-2024. + Last updated on 23-Jul-2024.
diff --git a/3d_orient_unitquaternion.html b/3d_orient_unitquaternion.html index ab40c116..f0e75ddb 100644 --- a/3d_orient_unitquaternion.html +++ b/3d_orient_unitquaternion.html @@ -137,7 +137,7 @@n (int, optional) – Number of values, defaults to 1
Self
+Self
pose instance with n
default values
>>> from spatialmath import UnitQuaternion as UQ
>>> print(UQ.Rand())
- 0.4136 << -0.0236, 0.7383, 0.5322 >>
+ 0.1611 << -0.3811, 0.2960, 0.8610 >>
>>> print(UQ.Rand(3))
- 0.3477 << -0.9081, 0.2034, 0.1147 >>
- 0.1876 << -0.7945, 0.5712, -0.0855 >>
- 0.2736 << -0.8952, -0.0688, -0.3451 >>
+ 0.1372 << 0.4102, 0.9013, 0.0250 >>
+ 0.7938 << -0.4059, -0.3980, -0.2163 >>
+ 0.2434 << 0.3112, -0.1144, 0.9115 >>
None
+None
end (UnitQuaternion) – final unit quaternion
shortest (Optional[bool]) – Take the shortest path along the great circle
shortest (Optional
[bool
]) – Take the shortest path along the great circle
s (array_like or int) – interpolation coefficient, range 0 to 1, or number of steps
shortest (Optional[bool]) – Take the shortest path along the great circle
shortest (Optional
[bool
]) – Take the shortest path along the great circle
s (array_like or int) – interpolation coefficient, range 0 to 1, or number of steps
Array value of an instance (BasePoseList superclass method)
© Copyright 2020-, Peter Corke.. - Last updated on 26-Jun-2024. + Last updated on 23-Jul-2024.
diff --git a/3d_plane.html b/3d_plane.html index 579ec5ea..14fb70d7 100644 --- a/3d_plane.html +++ b/3d_plane.html @@ -361,7 +361,7 @@© Copyright 2020-, Peter Corke.. - Last updated on 26-Jun-2024. + Last updated on 23-Jul-2024.
n (int, optional) – Number of values, defaults to 1
Self
+Self
pose instance with n
default values
Create an SE(3) pure rotation from Euler angles
Create an SE(3) pure rotation from roll-pitch-yaw angles
>>> from spatialmath import SE3
>>> SE3.Rand(2)
SE3([
-array([[ 0.3642, 0.9207, -0.14 , 0.4218],
- [ 0.5679, -0.3388, -0.7502, 0.3033],
- [-0.7381, 0.1937, -0.6463, 0.7354],
+array([[-0.5737, -0.5994, 0.5583, 0.0125],
+ [-0.7935, 0.5757, -0.1973, 0.2054],
+ [-0.2032, -0.5561, -0.8059, -0.3645],
[ 0. , 0. , 0. , 1. ]]),
-array([[-0.706 , -0.1586, -0.6903, 0.4993],
- [ 0.6593, 0.2087, -0.7223, -0.3281],
- [ 0.2586, -0.965 , -0.0428, -0.2934],
+array([[ 0.8297, -0.4327, 0.3526, -0.3633],
+ [-0.1064, 0.4975, 0.8609, 0.4885],
+ [-0.548 , -0.7518, 0.3667, -0.2392],
[ 0. , 0. , 0. , 1. ]]) ])
Create SE(3) from translation vector
Construct new SE(3) object
None
+None
Array value of an instance (BasePoseList superclass method)
© Copyright 2020-, Peter Corke.. - Last updated on 26-Jun-2024. + Last updated on 23-Jul-2024.
diff --git a/3d_pose_dualquaternion.html b/3d_pose_dualquaternion.html index 0021edf1..d94b1344 100644 --- a/3d_pose_dualquaternion.html +++ b/3d_pose_dualquaternion.html @@ -108,7 +108,7 @@Bases: spatialmath.DualQuaternion.DualQuaternion
[summary]
Self
+Self
Create new unit dual quaternion
>>> from spatialmath import UnitDualQuaternion, SE3
>>> T = SE3.Rand()
>>> print(T)
- 0.7367 0.1074 -0.6676 -0.4989
- 0.6681 -0.2683 0.694 0.3831
- -0.1046 -0.9573 -0.2694 0.5062
+ 0.007573 -0.65 0.7599 0.1257
+ 0.3056 0.7251 0.6172 -0.03884
+ -0.9521 0.2275 0.2041 0.9315
0 0 0 1
>>> d = UnitDualQuaternion(T)
>>> print(d)
--0.5475 << 0.7541, 0.2571, -0.2560 >> + ε 0.2037 < 0.0225, 0.0221, -0.3471 >
+ 0.6958 << -0.1400, 0.6151, 0.3433 >> + ε -0.1392 < -0.2494, -0.1003, 0.3600 >
>>> type(d)
<class 'spatialmath.DualQuaternion.UnitDualQuaternion'>
Self
+Self
© Copyright 2020-, Peter Corke.. - Last updated on 26-Jun-2024. + Last updated on 23-Jul-2024.
diff --git a/3d_pose_twist.html b/3d_pose_twist.html index 881df7c0..5cc4de01 100644 --- a/3d_pose_twist.html +++ b/3d_pose_twist.html @@ -177,7 +177,7 @@n (int, optional) – Number of values, defaults to 1
Self
+Self
pose instance with n
default values
>>> from spatialmath import Twist3
>>> Twist3.Rand(N=2)
Twist3([
- [-0.30051, -1.1276, 0.38612, 2.4369, 0.022505, 1.849],
- [0.38281, 0.35688, -0.43225, -2.0304, 0.5188, -0.24966]
+ [-0.3593, -0.5476, 1.3714, 0.33385, -0.99977, 0.88985],
+ [0.18471, 0.33358, 1.0167, 2.5831, 0.72188, 0.64953]
])
>>> from spatialmath import Twist3
>>> S = Twist3(SE3.Rand())
>>> S
-Twist3([0.50234, -0.19903, 0.067103, -0.61177, -1.6873, 0.17415])
+Twist3([0.91701, -0.51477, 0.19019, -0.43025, -0.52311, 0.82259])
>>> S.inv()
-Twist3([-0.50234, 0.19903, -0.067103, 0.61177, 1.6873, -0.17415])
+Twist3([-0.91701, 0.51477, -0.19019, 0.43025, 0.52311, -0.82259])
>>> S * S.inv()
-Twist3([2.7756e-17, 1.3878e-17, 0, 0, 0, 0])
+Twist3([1.1102e-16, 8.3267e-17, 1.1102e-16, 4.5679e-17, 2.7756e-17, 8.1938e-18])
File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/spatialmath/twist.py", line 968, in <listcomp>
return Line3([Line3(-tw.v + tw.pitch * tw.w, tw.w) for tw in self])
- File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/spatialmath/geom3d.py", line 326, in __init__
+ File "/opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/site-packages/spatialmath/geom3d.py", line 314, in __init__
raise ValueError("invalid Plucker coordinates")
ValueError: invalid Plucker coordinates
Array value of an instance (BasePoseList superclass method)
© Copyright 2020-, Peter Corke.. - Last updated on 26-Jun-2024. + Last updated on 23-Jul-2024.
diff --git a/3d_quaternion.html b/3d_quaternion.html index 117c8285..ba0159d2 100644 --- a/3d_quaternion.html +++ b/3d_quaternion.html @@ -127,7 +127,7 @@n (int, optional) – Number of values, defaults to 1
Self
+Self
pose instance with n
default values
arg (Any) – initial value
convertfrom (Tuple) – list of classes to accept and convert from
arg (Any
) – initial value
convertfrom (Tuple
) – list of classes to accept and convert from
check (bool) – check value is valid, defaults to True
bool
+bool
Array value of an instance (BasePoseList superclass method)
© Copyright 2020-, Peter Corke.. - Last updated on 26-Jun-2024. + Last updated on 23-Jul-2024.
diff --git a/6d_acceleration.html b/6d_acceleration.html index 4397d188..072d8704 100644 --- a/6d_acceleration.html +++ b/6d_acceleration.html @@ -137,7 +137,7 @@n (int, optional) – Number of values, defaults to 1
Self
+Self
pose instance with n
default values
Array value of an instance (BasePoseList superclass method)
© Copyright 2020-, Peter Corke.. - Last updated on 26-Jun-2024. + Last updated on 23-Jul-2024.
diff --git a/6d_f6.html b/6d_f6.html index a6fd181c..ea60fc01 100644 --- a/6d_f6.html +++ b/6d_f6.html @@ -144,7 +144,7 @@© Copyright 2020-, Peter Corke.. - Last updated on 26-Jun-2024. + Last updated on 23-Jul-2024.
diff --git a/6d_force.html b/6d_force.html index ee611d4e..a28030dc 100644 --- a/6d_force.html +++ b/6d_force.html @@ -135,7 +135,7 @@n (int, optional) – Number of values, defaults to 1
Self
+Self
pose instance with n
default values
Array value of an instance (BasePoseList superclass method)
© Copyright 2020-, Peter Corke.. - Last updated on 26-Jun-2024. + Last updated on 23-Jul-2024.
diff --git a/6d_inertia.html b/6d_inertia.html index cd5c2ab0..86856a20 100644 --- a/6d_inertia.html +++ b/6d_inertia.html @@ -148,7 +148,7 @@n (int, optional) – Number of values, defaults to 1
Self
+Self
pose instance with n
default values
Array value of an instance (BasePoseList superclass method)
© Copyright 2020-, Peter Corke.. - Last updated on 26-Jun-2024. + Last updated on 23-Jul-2024.
diff --git a/6d_m6.html b/6d_m6.html index b22cda7a..b0c14133 100644 --- a/6d_m6.html +++ b/6d_m6.html @@ -168,7 +168,7 @@© Copyright 2020-, Peter Corke.. - Last updated on 26-Jun-2024. + Last updated on 23-Jul-2024.
diff --git a/6d_momentum.html b/6d_momentum.html index a83fb0c1..17a498c6 100644 --- a/6d_momentum.html +++ b/6d_momentum.html @@ -135,7 +135,7 @@n (int, optional) – Number of values, defaults to 1
Self
+Self
pose instance with n
default values
Array value of an instance (BasePoseList superclass method)
© Copyright 2020-, Peter Corke.. - Last updated on 26-Jun-2024. + Last updated on 23-Jul-2024.
diff --git a/6d_spatial.html b/6d_spatial.html index 2feccefc..9f8fd30c 100644 --- a/6d_spatial.html +++ b/6d_spatial.html @@ -372,7 +372,7 @@© Copyright 2020-, Peter Corke.. - Last updated on 26-Jun-2024. + Last updated on 23-Jul-2024.
diff --git a/6d_velocity.html b/6d_velocity.html index 5ed43dab..8db22e45 100644 --- a/6d_velocity.html +++ b/6d_velocity.html @@ -137,7 +137,7 @@n (int, optional) – Number of values, defaults to 1
Self
+Self
pose instance with n
default values
Array value of an instance (BasePoseList superclass method)
© Copyright 2020-, Peter Corke.. - Last updated on 26-Jun-2024. + Last updated on 23-Jul-2024.
diff --git a/_images/func_2d_graphics-8.png b/_images/func_2d_graphics-8.png index b21640af..be292ec8 100644 Binary files a/_images/func_2d_graphics-8.png and b/_images/func_2d_graphics-8.png differ diff --git a/_images/func_2d_graphics-9.png b/_images/func_2d_graphics-9.png index 846f0d69..f2b24dde 100644 Binary files a/_images/func_2d_graphics-9.png and b/_images/func_2d_graphics-9.png differ diff --git a/_images/func_3d_graphics-2.png b/_images/func_3d_graphics-2.png index 6b156418..a4c4d8e4 100644 Binary files a/_images/func_3d_graphics-2.png and b/_images/func_3d_graphics-2.png differ diff --git a/_modules/index.html b/_modules/index.html index 734ef573..3d3c9907 100644 --- a/_modules/index.html +++ b/_modules/index.html @@ -103,7 +103,7 @@© Copyright 2020-, Peter Corke.. - Last updated on 26-Jun-2024. + Last updated on 23-Jul-2024.
import numpy as np
from spatialmath import Quaternion, UnitQuaternion, SE3
from spatialmath import base
-from spatialmath.base.types import (
- ArrayLike3,
- R8,
- R8x8,
-)
-from typing import Tuple, overload
+from spatialmath.base.types import *
# TODO scalar multiplication
@@ -354,9 +349,11 @@ Source code for spatialmath.DualQuaternion
"""
@overload
- def __init__(self, T: SE3): ...
+ def __init__(self, T: SE3):
+ ...
- def __init__(self, real: Quaternion, dual: Quaternion): ...
+ def __init__(self, real: Quaternion, dual: Quaternion):
+ ...
[docs] def __init__(self, real=None, dual=None):
r"""
@@ -455,7 +452,7 @@ Source code for spatialmath.DualQuaternion
© Copyright 2020-, Peter Corke..
- Last updated on 26-Jun-2024.
+ Last updated on 23-Jul-2024.
diff --git a/_modules/spatialmath/base/animate.html b/_modules/spatialmath/base/animate.html
index baf99bfd..423f1d24 100644
--- a/_modules/spatialmath/base/animate.html
+++ b/_modules/spatialmath/base/animate.html
@@ -290,6 +290,7 @@ Source code for spatialmath.base.animate
# assume it is an SO(3) or SE(3)
T = frame
# ensure result is SE(3)
+
if T.shape == (3, 3):
T = smb.r2t(T)
@@ -386,7 +387,7 @@ Source code for spatialmath.base.animate
self.anim = anim
def draw(self, T):
- p = T @ self.p
+ p = T.A @ self.p
self.h.set_data(p[0, :], p[1, :])
self.h.set_3d_properties(p[2, :])
@@ -443,7 +444,8 @@ Source code for spatialmath.base.animate
self.anim = anim
def draw(self, T):
- p = T @ self.p
+ # import ipdb; ipdb.set_trace()
+ p = T.A @ self.p
# reshape it
p = p[0:3, :].T.reshape(3, 2, 3)
@@ -497,7 +499,7 @@ Source code for spatialmath.base.animate
self.anim = anim
def draw(self, T):
- p = T @ self.p
+ p = T.A @ self.p
# x2, y2, _ = proj3d.proj_transform(
# p[0], p[1], p[2], self.anim.ax.get_proj())
# self.h.set_position((x2, y2))
@@ -992,7 +994,7 @@ Source code for spatialmath.base.animate
© Copyright 2020-, Peter Corke..
- Last updated on 26-Jun-2024.
+ Last updated on 23-Jul-2024.
diff --git a/_modules/spatialmath/base/argcheck.html b/_modules/spatialmath/base/argcheck.html
index c9473207..5e669535 100644
--- a/_modules/spatialmath/base/argcheck.html
+++ b/_modules/spatialmath/base/argcheck.html
@@ -83,25 +83,29 @@ Source code for spatialmath.base.argcheck
"""
Utility functions for testing and converting passed arguments. Used in all
-spatialmath functions and classes to provides for flexibility in argument types
+spatialmath functions and classes to provides for flexibility in argument types
that can be passed.
"""
# pylint: disable=invalid-name
+import math
import numpy as np
from collections.abc import Iterable
-from typing import Union, List, Tuple, Any, Optional, Type, Callable, cast, overload
-from numpy.typing import DTypeLike, NDArray
# from spatialmath.base import symbolic as sym # HACK
from spatialmath.base.symbolic import issymbol, symtype
-from spatialmath.base.types import ArrayLike
-
# valid scalar types
_scalartypes = (int, np.integer, float, np.floating) + symtype
+# from typing import Union, List, Tuple, Any, Optional, Type, Callable
+# from numpy.typing import DTypeLike
+# Array = np.ndarray[Any, np.dtype[np.floating]]
+# ArrayLike = Union[float,List[float],Tuple,Array] # various ways to represent R^3 for input
+
+from spatialmath.base.types import *
+
[docs]def isscalar(x: Any) -> bool:
"""
@@ -348,8 +352,7 @@ Source code for spatialmath.base.argcheck
raise ValueError("incorrect matrix dimensions, expecting {0}".format(shape))
-# and not np.iscomplex(m) checks every element, would need to be not
-# np.any(np.iscomplex(m)) which seems expensive
+# and not np.iscomplex(m) checks every element, would need to be not np.any(np.iscomplex(m)) which seems expensive
@overload
@@ -358,7 +361,8 @@ Source code for spatialmath.base.argcheck
dim: Optional[Union[int, None]] = None,
out: str = "array",
dtype: DTypeLike = np.float64,
-) -> NDArray: ...
+) -> NDArray:
+ ...
@overload
@@ -367,7 +371,8 @@ Source code for spatialmath.base.argcheck
dim: Optional[Union[int, None]] = None,
out: str = "list",
dtype: DTypeLike = np.float64,
-) -> List[float]: ...
+) -> List[float]:
+ ...
@overload
@@ -376,7 +381,8 @@ Source code for spatialmath.base.argcheck
dim: Optional[Union[int, None]] = None,
out: str = "sequence",
dtype: DTypeLike = np.float64,
-) -> Tuple[float, ...]: ...
+) -> Tuple[float, ...]:
+ ...
@overload
@@ -385,7 +391,8 @@ Source code for spatialmath.base.argcheck
dim: Optional[Union[int, None]] = None,
out: str = "sequence",
dtype: DTypeLike = np.float64,
-) -> List[float]: ...
+) -> List[float]:
+ ...
[docs]def getvector(
@@ -581,8 +588,8 @@ Source code for spatialmath.base.argcheck
if dim is None:
return (
(len(s) == 1 and s[0] > 0)
- or (len(s) > 1 and s[0] == 1 and s[1] > 0)
- or (len(s) > 1 and s[0] > 0 and s[1] == 1)
+ or (s[0] == 1 and s[1] > 0)
+ or (s[0] > 0 and s[1] == 1)
)
else:
return s == (dim,) or s == (1, dim) or s == (dim, 1)
@@ -773,7 +780,7 @@ Source code for spatialmath.base.argcheck
© Copyright 2020-, Peter Corke..
- Last updated on 26-Jun-2024.
+ Last updated on 23-Jul-2024.
diff --git a/_modules/spatialmath/base/graphics.html b/_modules/spatialmath/base/graphics.html
index 4cfca900..c975d8f2 100644
--- a/_modules/spatialmath/base/graphics.html
+++ b/_modules/spatialmath/base/graphics.html
@@ -83,19 +83,7 @@ Source code for spatialmath.base.graphics
from matplotlib import colors
from spatialmath import base as smb
-from spatialmath.base.types import (
- ArrayLike,
- ArrayLike2,
- ArrayLike3,
- ArrayLike4,
- R2x2,
- R3x3,
- Points2,
- SE3Array,
- Color,
-)
-from typing import List, Optional, Union, Tuple, Callable, overload
-from numpy.typing import NDArray
+from spatialmath.base.types import *
# To assist code portability to headless platforms, these graphics primitives
# are defined as null functions.
@@ -1299,7 +1287,9 @@ Source code for spatialmath.base.graphics
z = height
X, Z = np.meshgrid(x, z)
- Y = np.sqrt(radius**2 - (X - centre[0]) ** 2) + centre[1] # Pythagorean theorem
+ Y = (
+ np.sqrt(radius**2 - (X - centre[0]) ** 2) + centre[1]
+ ) # Pythagorean theorem
handles = []
handles.append(_render3D(ax, X, Y, Z, filled=filled, **kwargs))
@@ -1482,9 +1472,9 @@ Source code for spatialmath.base.graphics
edges = [[0, 1, 3, 2, 0], [4, 5, 7, 6, 4], [0, 4], [1, 5], [3, 7], [2, 6]]
lines = []
for edge in edges:
- E = vertices[:, edge]
- # ax.plot(E[0], E[1], E[2], **kwargs)
- lines.append(E.T)
+ for line in zip(edge[:-1], edge[1:]):
+ E = vertices[:, line]
+ lines.append(E.T)
if "color" in kwargs:
if "alpha" in kwargs:
alpha = kwargs["alpha"]
@@ -1570,7 +1560,8 @@ Source code for spatialmath.base.graphics
dimensions: int = 2,
autoscale: Optional[bool] = True,
new: Optional[bool] = False,
- ) -> plt.Axes: ...
+ ) -> plt.Axes:
+ ...
@overload
def axes_logic(
@@ -1579,7 +1570,8 @@ Source code for spatialmath.base.graphics
projection: Optional[str] = "ortho",
autoscale: Optional[bool] = True,
new: Optional[bool] = False,
- ) -> Axes3D: ...
+ ) -> Axes3D:
+ ...
def axes_logic(
ax: Union[plt.Axes, Axes3D, None],
@@ -1894,7 +1886,7 @@ Source code for spatialmath.base.graphics
© Copyright 2020-, Peter Corke..
- Last updated on 26-Jun-2024.
+ Last updated on 23-Jul-2024.
diff --git a/_modules/spatialmath/base/numeric.html b/_modules/spatialmath/base/numeric.html
index 32abc4b4..ec017367 100644
--- a/_modules/spatialmath/base/numeric.html
+++ b/_modules/spatialmath/base/numeric.html
@@ -79,13 +79,7 @@ Source code for spatialmath.base.numeric
import re
import numpy as np
from spatialmath import base
-from spatialmath.base.types import (
- ArrayLike,
- ArrayLike2,
- Points2,
-)
-from numpy.typing import NDArray
-from typing import Callable, Tuple
+from spatialmath.base.types import *
# this is a collection of useful algorithms, not otherwise categorized
@@ -457,7 +451,11 @@ Source code for spatialmath.base.numeric
sigma = np.sqrt(var)
x = base.getvector(x)
- return 1.0 / np.sqrt(sigma**2 * 2 * np.pi) * np.exp(-((x - mu) ** 2) / 2 / sigma**2)
+ return (
+ 1.0
+ / np.sqrt(sigma**2 * 2 * np.pi)
+ * np.exp(-((x - mu) ** 2) / 2 / sigma**2)
+ )
[docs]def gauss2d(mu: ArrayLike2, P: NDArray, X: NDArray, Y: NDArray) -> NDArray:
@@ -534,7 +532,7 @@ Source code for spatialmath.base.numeric
© Copyright 2020-, Peter Corke..
- Last updated on 26-Jun-2024.
+ Last updated on 23-Jul-2024.
diff --git a/_modules/spatialmath/base/quaternions.html b/_modules/spatialmath/base/quaternions.html
index a857ba7c..d735c4ff 100644
--- a/_modules/spatialmath/base/quaternions.html
+++ b/_modules/spatialmath/base/quaternions.html
@@ -92,17 +92,7 @@ Source code for spatialmath.base.quaternions
import math
import numpy as np
import spatialmath.base as smb
-from spatialmath.base.types import (
- ArrayLike3,
- ArrayLike4,
- R3,
- R4x4,
- SO3Array,
- QuaternionArray,
- UnitQuaternionArray,
-)
-
-from typing import Union, Optional, Tuple, overload, TextIO
+from spatialmath.base.types import *
_eps = np.finfo(np.float64).eps
@@ -264,7 +254,8 @@ Source code for spatialmath.base.quaternions
q2: ArrayLike4,
tol: float = 20,
unitq: Optional[bool] = False,
-) -> bool: ...
+) -> bool:
+ ...
@overload
@@ -273,7 +264,8 @@ Source code for spatialmath.base.quaternions
q2: ArrayLike4,
tol: float = 20,
unitq: Optional[bool] = True,
-) -> bool: ...
+) -> bool:
+ ...
[docs]def qisequal(q1, q2, tol: float = 20, unitq: Optional[bool] = False):
@@ -1157,7 +1149,7 @@ Source code for spatialmath.base.quaternions
© Copyright 2020-, Peter Corke..
- Last updated on 26-Jun-2024.
+ Last updated on 23-Jul-2024.
diff --git a/_modules/spatialmath/base/symbolic.html b/_modules/spatialmath/base/symbolic.html
index 04baf7dc..f73cc952 100644
--- a/_modules/spatialmath/base/symbolic.html
+++ b/_modules/spatialmath/base/symbolic.html
@@ -86,13 +86,11 @@ Source code for spatialmath.base.symbolic
Symbolic arguments.
If SymPy is not installed then only the standard numeric operations are
-supported.
+supported.
"""
import math
-
-from typing import Any, Optional, Tuple, Union, overload
-
+from spatialmath.base.types import *
try: # pragma: no cover
# print('Using SymPy')
@@ -174,11 +172,13 @@ Source code for spatialmath.base.symbolic
@overload
-def sin(theta: float) -> float: ...
+def sin(theta: float) -> float:
+ ...
@overload
-def sin(theta: Symbol) -> Symbol: ...
+def sin(theta: Symbol) -> Symbol:
+ ...
[docs]def sin(theta):
@@ -206,11 +206,13 @@ Source code for spatialmath.base.symbolic
@overload
-def cos(theta: float) -> float: ...
+def cos(theta: float) -> float:
+ ...
@overload
-def cos(theta: Symbol) -> Symbol: ...
+def cos(theta: Symbol) -> Symbol:
+ ...
[docs]def cos(theta):
@@ -238,11 +240,13 @@ Source code for spatialmath.base.symbolic
@overload
-def tan(theta: float) -> float: ...
+def tan(theta: float) -> float:
+ ...
@overload
-def tan(theta: Symbol) -> Symbol: ...
+def tan(theta: Symbol) -> Symbol:
+ ...
[docs]def tan(theta):
@@ -270,11 +274,13 @@ Source code for spatialmath.base.symbolic
@overload
-def sqrt(theta: float) -> float: ...
+def sqrt(theta: float) -> float:
+ ...
@overload
-def sqrt(theta: Symbol) -> Symbol: ...
+def sqrt(theta: Symbol) -> Symbol:
+ ...
[docs]def sqrt(v):
@@ -435,7 +441,7 @@ Source code for spatialmath.base.symbolic
© Copyright 2020-, Peter Corke..
- Last updated on 26-Jun-2024.
+ Last updated on 23-Jul-2024.
diff --git a/_modules/spatialmath/base/transforms2d.html b/_modules/spatialmath/base/transforms2d.html
index 5e28e91c..877ab089 100644
--- a/_modules/spatialmath/base/transforms2d.html
+++ b/_modules/spatialmath/base/transforms2d.html
@@ -104,26 +104,7 @@ Source code for spatialmath.base.transforms2d
_matplotlib_exists = False
import spatialmath.base as smb
-
-# from spatialmath.base.types import *
-from typing import Any, Optional, Union, overload, cast, TextIO, Tuple
-from numpy.typing import ArrayLike, NDArray
-from spatialmath.base.types import (
- SO2Array,
- SE2Array,
- SE3Array,
- so2Array,
- se2Array,
- R2,
- R3,
- ArrayLike2,
- ArrayLike3,
- R1x1,
- R3x3,
- ArrayLikePure,
- Points2,
- Color,
-)
+from spatialmath.base.types import *
from spatialmath.base.transformsNd import rt2tr
from spatialmath.base.vectors import unitvec
@@ -269,15 +250,18 @@ Source code for spatialmath.base.transforms2d
# ---------------------------------------------------------------------------------------#
@overload # pragma: no cover
-def transl2(x: float, y: float) -> SE2Array: ...
+def transl2(x: float, y: float) -> SE2Array:
+ ...
@overload # pragma: no cover
-def transl2(x: ArrayLike2) -> SE2Array: ...
+def transl2(x: ArrayLike2) -> SE2Array:
+ ...
@overload # pragma: no cover
-def transl2(x: SE2Array) -> R2: ...
+def transl2(x: SE2Array) -> R2:
+ ...
[docs]def transl2(x, y=None):
@@ -540,7 +524,8 @@ Source code for spatialmath.base.transforms2d
twist: bool = False,
check: bool = True,
tol: float = 20,
-) -> so2Array: ...
+) -> so2Array:
+ ...
@overload # pragma: no cover
@@ -549,7 +534,8 @@ Source code for spatialmath.base.transforms2d
twist: bool = False,
check: bool = True,
tol: float = 20,
-) -> se2Array: ...
+) -> se2Array:
+ ...
@overload # pragma: no cover
@@ -558,7 +544,8 @@ Source code for spatialmath.base.transforms2d
twist: bool = True,
check: bool = True,
tol: float = 20,
-) -> float: ...
+) -> float:
+ ...
@overload # pragma: no cover
@@ -567,7 +554,8 @@ Source code for spatialmath.base.transforms2d
twist: bool = True,
check: bool = True,
tol: float = 20,
-) -> R3: ...
+) -> R3:
+ ...
[docs]def trlog2(
@@ -653,15 +641,13 @@ Source code for spatialmath.base.transforms2d
# ---------------------------------------------------------------------------------------#
@overload # pragma: no cover
-def trexp2(
- S: so2Array, theta: Optional[float] = None, check: bool = True
-) -> SO2Array: ...
+def trexp2(S: so2Array, theta: Optional[float] = None, check: bool = True) -> SO2Array:
+ ...
@overload # pragma: no cover
-def trexp2(
- S: se2Array, theta: Optional[float] = None, check: bool = True
-) -> SE2Array: ...
+def trexp2(S: se2Array, theta: Optional[float] = None, check: bool = True) -> SE2Array:
+ ...
[docs]def trexp2(
@@ -784,7 +770,8 @@ Source code for spatialmath.base.transforms2d
@overload # pragma: no cover
-def trnorm2(R: SO2Array) -> SO2Array: ...
+def trnorm2(R: SO2Array) -> SO2Array:
+ ...
[docs]def trnorm2(T: SE2Array) -> SE2Array:
@@ -849,11 +836,13 @@ Source code for spatialmath.base.transforms2d
@overload # pragma: no cover
-def tradjoint2(T: SO2Array) -> R1x1: ...
+def tradjoint2(T: SO2Array) -> R1x1:
+ ...
@overload # pragma: no cover
-def tradjoint2(T: SE2Array) -> R3x3: ...
+def tradjoint2(T: SE2Array) -> R3x3:
+ ...
[docs]def tradjoint2(T):
@@ -942,15 +931,13 @@ Source code for spatialmath.base.transforms2d
@overload
-def trinterp2(
- start: Optional[SO2Array], end: SO2Array, s: float, shortest: bool = True
-) -> SO2Array: ...
+def trinterp2(start: Optional[SO2Array], end: SO2Array, s: float, shortest: bool = True) -> SO2Array:
+ ...
@overload
-def trinterp2(
- start: Optional[SE2Array], end: SE2Array, s: float, shortest: bool = True
-) -> SE2Array: ...
+def trinterp2(start: Optional[SE2Array], end: SE2Array, s: float, shortest: bool = True) -> SE2Array:
+ ...
[docs]def trinterp2(start, end, s, shortest: bool = True):
@@ -1674,7 +1661,7 @@ Source code for spatialmath.base.transforms2d
© Copyright 2020-, Peter Corke..
- Last updated on 26-Jun-2024.
+ Last updated on 23-Jul-2024.
diff --git a/_modules/spatialmath/base/transforms3d.html b/_modules/spatialmath/base/transforms3d.html
index c23100af..19b8dcad 100644
--- a/_modules/spatialmath/base/transforms3d.html
+++ b/_modules/spatialmath/base/transforms3d.html
@@ -96,7 +96,7 @@ Source code for spatialmath.base.transforms3d
from collections.abc import Iterable
import math
import numpy as np
-from typing import Any, Optional, Union, overload, cast, Tuple, TextIO, List
+
from spatialmath.base.argcheck import getunit, getvector, isvector, isscalar, ismatrix
from spatialmath.base.vectors import (
unitvec,
@@ -118,6 +118,7 @@ Source code for spatialmath.base.transforms3d
isskew,
isskewa,
isR,
+ iseye,
tr2rt,
Ab2M,
)
@@ -125,19 +126,8 @@ Source code for spatialmath.base.transforms3d
from spatialmath.base.graphics import plotvol3, axes_logic
from spatialmath.base.animate import Animate
import spatialmath.base.symbolic as sym
-from spatialmath.base.types import (
- ArrayLikePure,
- ArrayLike3,
- ArrayLike6,
- R3,
- R6,
- R3x3,
- R6x6,
- SO3Array,
- SE3Array,
- so3Array,
- se3Array,
-)
+
+from spatialmath.base.types import *
_eps = np.finfo(np.float64).eps
@@ -351,15 +341,18 @@ Source code for spatialmath.base.transforms3d
@overload # pragma: no cover
-def transl(x: float, y: float, z: float) -> SE3Array: ...
+def transl(x: float, y: float, z: float) -> SE3Array:
+ ...
@overload # pragma: no cover
-def transl(x: ArrayLike3) -> SE3Array: ...
+def transl(x: ArrayLike3) -> SE3Array:
+ ...
@overload # pragma: no cover
-def transl(x: SE3Array) -> R3: ...
+def transl(x: SE3Array) -> R3:
+ ...
[docs]def transl(x, y=None, z=None):
@@ -511,7 +504,8 @@ Source code for spatialmath.base.transforms3d
@overload # pragma: no cover
def rpy2r(
roll: float, pitch: float, yaw: float, *, unit: str = "rad", order: str = "zyx"
-) -> SO3Array: ...
+) -> SO3Array:
+ ...
@overload # pragma: no cover
@@ -522,7 +516,8 @@ Source code for spatialmath.base.transforms3d
*,
unit: str = "rad",
order: str = "zyx",
-) -> SO3Array: ...
+) -> SO3Array:
+ ...
[docs]def rpy2r(
@@ -600,7 +595,8 @@ Source code for spatialmath.base.transforms3d
@overload # pragma: no cover
def rpy2tr(
roll: float, pitch: float, yaw: float, unit: str = "rad", order: str = "zyx"
-) -> SE3Array: ...
+) -> SE3Array:
+ ...
@overload # pragma: no cover
@@ -610,7 +606,8 @@ Source code for spatialmath.base.transforms3d
yaw: None = None,
unit: str = "rad",
order: str = "zyx",
-) -> SE3Array: ...
+) -> SE3Array:
+ ...
[docs]def rpy2tr(
@@ -674,13 +671,15 @@ Source code for spatialmath.base.transforms3d
@overload # pragma: no cover
-def eul2r(phi: float, theta: float, psi: float, unit: str = "rad") -> SO3Array: ...
+def eul2r(phi: float, theta: float, psi: float, unit: str = "rad") -> SO3Array:
+ ...
@overload # pragma: no cover
def eul2r(
phi: ArrayLike3, theta: None = None, psi: None = None, unit: str = "rad"
-) -> SO3Array: ...
+) -> SO3Array:
+ ...
[docs]def eul2r(
@@ -733,11 +732,13 @@ Source code for spatialmath.base.transforms3d
# ---------------------------------------------------------------------------------------#
@overload # pragma: no cover
-def eul2tr(phi: float, theta: float, psi: float, unit: str = "rad") -> SE3Array: ...
+def eul2tr(phi: float, theta: float, psi: float, unit: str = "rad") -> SE3Array:
+ ...
@overload # pragma: no cover
-def eul2tr(phi: ArrayLike3, theta=None, psi=None, unit: str = "rad") -> SE3Array: ...
+def eul2tr(phi: ArrayLike3, theta=None, psi=None, unit: str = "rad") -> SE3Array:
+ ...
[docs]def eul2tr(
@@ -1349,25 +1350,25 @@ Source code for spatialmath.base.transforms3d
@overload # pragma: no cover
def trlog(
T: SO3Array, check: bool = True, twist: bool = False, tol: float = 20
-) -> so3Array: ...
+) -> so3Array:
+ ...
@overload # pragma: no cover
def trlog(
T: SE3Array, check: bool = True, twist: bool = False, tol: float = 20
-) -> se3Array: ...
+) -> se3Array:
+ ...
@overload # pragma: no cover
-def trlog(
- T: SO3Array, check: bool = True, twist: bool = True, tol: float = 20
-) -> R3: ...
+def trlog(T: SO3Array, check: bool = True, twist: bool = True, tol: float = 20) -> R3:
+ ...
@overload # pragma: no cover
-def trlog(
- T: SE3Array, check: bool = True, twist: bool = True, tol: float = 20
-) -> R6: ...
+def trlog(T: SE3Array, check: bool = True, twist: bool = True, tol: float = 20) -> R6:
+ ...
[docs]def trlog(
@@ -1482,23 +1483,23 @@ Source code for spatialmath.base.transforms3d
# ---------------------------------------------------------------------------------------#
@overload # pragma: no cover
-def trexp(
- S: so3Array, theta: Optional[float] = None, check: bool = True
-) -> SO3Array: ...
+def trexp(S: so3Array, theta: Optional[float] = None, check: bool = True) -> SO3Array:
+ ...
@overload # pragma: no cover
-def trexp(
- S: se3Array, theta: Optional[float] = None, check: bool = True
-) -> SE3Array: ...
+def trexp(S: se3Array, theta: Optional[float] = None, check: bool = True) -> SE3Array:
+ ...
@overload # pragma: no cover
-def trexp(S: ArrayLike3, theta: Optional[float] = None, check=True) -> SO3Array: ...
+def trexp(S: ArrayLike3, theta: Optional[float] = None, check=True) -> SO3Array:
+ ...
@overload # pragma: no cover
-def trexp(S: ArrayLike6, theta: Optional[float] = None, check=True) -> SE3Array: ...
+def trexp(S: ArrayLike6, theta: Optional[float] = None, check=True) -> SE3Array:
+ ...
[docs]def trexp(S, theta=None, check=True):
@@ -1619,7 +1620,8 @@ Source code for spatialmath.base.transforms3d
@overload # pragma: no cover
-def trnorm(R: SO3Array) -> SO3Array: ...
+def trnorm(R: SO3Array) -> SO3Array:
+ ...
[docs]def trnorm(T: SE3Array) -> SE3Array:
@@ -1681,15 +1683,13 @@ Source code for spatialmath.base.transforms3d
@overload
-def trinterp(
- start: Optional[SO3Array], end: SO3Array, s: float, shortest: bool = True
-) -> SO3Array: ...
+def trinterp(start: Optional[SO3Array], end: SO3Array, s: float, shortest: bool = True) -> SO3Array:
+ ...
@overload
-def trinterp(
- start: Optional[SE3Array], end: SE3Array, s: float, shortest: bool = True
-) -> SE3Array: ...
+def trinterp(start: Optional[SE3Array], end: SE3Array, s: float, shortest: bool = True) -> SE3Array:
+ ...
[docs]def trinterp(start, end, s, shortest=True):
@@ -2302,7 +2302,8 @@ Source code for spatialmath.base.transforms3d
inverse: bool = False,
full: bool = False,
representation="rpy/xyz",
-) -> R3x3: ...
+) -> R3x3:
+ ...
@overload # pragma: no cover
@@ -2310,7 +2311,8 @@ Source code for spatialmath.base.transforms3d
𝚪: SO3Array,
inverse: bool = False,
full: bool = False,
-) -> R3x3: ...
+) -> R3x3:
+ ...
@overload # pragma: no cover
@@ -2319,7 +2321,8 @@ Source code for spatialmath.base.transforms3d
inverse: bool = False,
full: bool = True,
representation="rpy/xyz",
-) -> R6x6: ...
+) -> R6x6:
+ ...
@overload # pragma: no cover
@@ -2327,7 +2330,8 @@ Source code for spatialmath.base.transforms3d
𝚪: SO3Array,
inverse: bool = False,
full: bool = True,
-) -> R6x6: ...
+) -> R6x6:
+ ...
[docs]def rotvelxform(
@@ -2539,13 +2543,15 @@ Source code for spatialmath.base.transforms3d
@overload # pragma: no cover
def rotvelxform_inv_dot(
𝚪: ArrayLike3, 𝚪d: ArrayLike3, full: bool = False, representation: str = "rpy/xyz"
-) -> R3x3: ...
+) -> R3x3:
+ ...
@overload # pragma: no cover
def rotvelxform_inv_dot(
𝚪: ArrayLike3, 𝚪d: ArrayLike3, full: bool = True, representation: str = "rpy/xyz"
-) -> R6x6: ...
+) -> R6x6:
+ ...
[docs]def rotvelxform_inv_dot(
@@ -2742,11 +2748,13 @@ Source code for spatialmath.base.transforms3d
@overload # pragma: no cover
-def tr2adjoint(T: SO3Array) -> R3x3: ...
+def tr2adjoint(T: SO3Array) -> R3x3:
+ ...
@overload # pragma: no cover
-def tr2adjoint(T: SE3Array) -> R6x6: ...
+def tr2adjoint(T: SE3Array) -> R6x6:
+ ...
[docs]def tr2adjoint(T):
@@ -3544,7 +3552,7 @@ Source code for spatialmath.base.transforms3d
© Copyright 2020-, Peter Corke..
- Last updated on 26-Jun-2024.
+ Last updated on 23-Jul-2024.
diff --git a/_modules/spatialmath/base/transformsNd.html b/_modules/spatialmath/base/transformsNd.html
index 2d975b14..5f508b8f 100644
--- a/_modules/spatialmath/base/transformsNd.html
+++ b/_modules/spatialmath/base/transformsNd.html
@@ -89,31 +89,11 @@ Source code for spatialmath.base.transformsNd
"""
# pylint: disable=invalid-name
+import math
import numpy as np
-from spatialmath.base.types import (
- ArrayLike2,
- ArrayLike3,
- ArrayLike6,
- R1,
- R2,
- R3,
- R6,
- SO2Array,
- SE2Array,
- SO3Array,
- SE3Array,
- so2Array,
- se2Array,
- so3Array,
- se3Array,
- Rn,
- SOnArray,
- SEnArray,
- senArray,
-)
+from spatialmath.base.types import *
from spatialmath.base.argcheck import getvector, isvector
-from typing import Tuple, Union, overload
-from numpy.typing import NDArray
+from spatialmath.base.vectors import iszerovec, unitvec_norm
# from spatialmath.base.symbolic import issymbol
# from spatialmath.base.transforms3d import transl
@@ -134,11 +114,13 @@ Source code for spatialmath.base.transformsNd
# ---------------------------------------------------------------------------------------#
@overload
-def r2t(R: SO2Array, check: bool = False) -> SE2Array: ...
+def r2t(R: SO2Array, check: bool = False) -> SE2Array:
+ ...
@overload
-def r2t(R: SO3Array, check: bool = False) -> SE3Array: ...
+def r2t(R: SO3Array, check: bool = False) -> SE3Array:
+ ...
[docs]def r2t(R, check=False):
@@ -198,11 +180,13 @@ Source code for spatialmath.base.transformsNd
# ---------------------------------------------------------------------------------------#
@overload
-def t2r(T: SE2Array, check: bool = False) -> SO2Array: ...
+def t2r(T: SE2Array, check: bool = False) -> SO2Array:
+ ...
@overload
-def t2r(T: SE3Array, check: bool = False) -> SO3Array: ...
+def t2r(T: SE3Array, check: bool = False) -> SO3Array:
+ ...
[docs]def t2r(T: SEnArray, check: bool = False) -> SOnArray:
@@ -261,11 +245,13 @@ Source code for spatialmath.base.transformsNd
@overload
-def tr2rt(T: SE2Array, check=False) -> Tuple[SO2Array, R2]: ...
+def tr2rt(T: SE2Array, check=False) -> Tuple[SO2Array, R2]:
+ ...
@overload
-def tr2rt(T: SE3Array, check=False) -> Tuple[SO3Array, R3]: ...
+def tr2rt(T: SE3Array, check=False) -> Tuple[SO3Array, R3]:
+ ...
[docs]def tr2rt(T: SEnArray, check=False) -> Tuple[SOnArray, Rn]:
@@ -319,11 +305,13 @@ Source code for spatialmath.base.transformsNd
@overload
-def rt2tr(R: SO2Array, t: ArrayLike2, check=False) -> SE2Array: ...
+def rt2tr(R: SO2Array, t: ArrayLike2, check=False) -> SE2Array:
+ ...
@overload
-def rt2tr(R: SO3Array, t: ArrayLike3, check=False) -> SE3Array: ...
+def rt2tr(R: SO3Array, t: ArrayLike3, check=False) -> SE3Array:
+ ...
[docs]def rt2tr(R, t, check=False):
@@ -562,11 +550,13 @@ Source code for spatialmath.base.transformsNd
# ---------------------------------------------------------------------------------------#
@overload
-def skew(v: float) -> se2Array: ...
+def skew(v: float) -> se2Array:
+ ...
@overload
-def skew(v: ArrayLike3) -> se3Array: ...
+def skew(v: ArrayLike3) -> se3Array:
+ ...
[docs]def skew(v):
@@ -620,11 +610,13 @@ Source code for spatialmath.base.transformsNd
# ---------------------------------------------------------------------------------------#
@overload
-def vex(s: so2Array, check: bool = False) -> R1: ...
+def vex(s: so2Array, check: bool = False) -> R1:
+ ...
@overload
-def vex(s: so3Array, check: bool = False) -> R3: ...
+def vex(s: so3Array, check: bool = False) -> R3:
+ ...
[docs]def vex(s, check=False):
@@ -677,11 +669,13 @@ Source code for spatialmath.base.transformsNd
# ---------------------------------------------------------------------------------------#
@overload
-def skewa(v: ArrayLike3) -> se2Array: ...
+def skewa(v: ArrayLike3) -> se2Array:
+ ...
@overload
-def skewa(v: ArrayLike6) -> se3Array: ...
+def skewa(v: ArrayLike6) -> se3Array:
+ ...
[docs]def skewa(v: Union[ArrayLike3, ArrayLike6]) -> Union[se2Array, se3Array]:
@@ -731,11 +725,13 @@ Source code for spatialmath.base.transformsNd
@overload
-def vexa(Omega: se2Array, check: bool = False) -> R3: ...
+def vexa(Omega: se2Array, check: bool = False) -> R3:
+ ...
@overload
-def vexa(Omega: se3Array, check: bool = False) -> R6: ...
+def vexa(Omega: se3Array, check: bool = False) -> R6:
+ ...
[docs]def vexa(Omega: senArray, check: bool = False) -> Union[R3, R6]:
@@ -952,7 +948,7 @@ Source code for spatialmath.base.transformsNd
© Copyright 2020-, Peter Corke..
- Last updated on 26-Jun-2024.
+ Last updated on 23-Jul-2024.
diff --git a/_modules/spatialmath/base/vectors.html b/_modules/spatialmath/base/vectors.html
index eba2e08c..1dd8e15f 100644
--- a/_modules/spatialmath/base/vectors.html
+++ b/_modules/spatialmath/base/vectors.html
@@ -92,16 +92,7 @@ Source code for spatialmath.base.vectors
import math
import numpy as np
from spatialmath.base.argcheck import getvector
-from spatialmath.base.types import (
- ArrayLike,
- ArrayLikePure,
- R3,
- R6,
- ArrayLike6,
- ArrayLike3,
-)
-from typing import Tuple, Union, overload
-from numpy.typing import NDArray
+from spatialmath.base.types import *
try: # pragma: no cover
# print('Using SymPy')
@@ -707,11 +698,13 @@ Source code for spatialmath.base.vectors
@overload
-def angdiff(a: ArrayLike, b: ArrayLike) -> NDArray: ...
+def angdiff(a: ArrayLike, b: ArrayLike) -> NDArray:
+ ...
@overload
-def angdiff(a: ArrayLike) -> NDArray: ...
+def angdiff(a: ArrayLike) -> NDArray:
+ ...
[docs]def angdiff(a, b=None):
@@ -955,7 +948,7 @@ Source code for spatialmath.base.vectors
© Copyright 2020-, Peter Corke..
- Last updated on 26-Jun-2024.
+ Last updated on 23-Jul-2024.
diff --git a/_modules/spatialmath/geom2d.html b/_modules/spatialmath/geom2d.html
index eca4329b..5efc0033 100644
--- a/_modules/spatialmath/geom2d.html
+++ b/_modules/spatialmath/geom2d.html
@@ -85,7 +85,6 @@ Source code for spatialmath.geom2d
"""
from __future__ import annotations
-from typing_extensions import Self
from functools import reduce
import warnings
import matplotlib.pyplot as plt
@@ -99,15 +98,22 @@ Source code for spatialmath.geom2d
from spatialmath.base import plot_ellipse
from spatialmath.base.types import (
Points2,
+ Optional,
ArrayLike,
ArrayLike2,
ArrayLike3,
+ NDArray,
+ Union,
+ List,
+ Tuple,
R2,
R3,
R4,
+ Iterator,
+ Tuple,
+ Self,
+ cast,
)
-from typing import Optional, Tuple, Union, List, Iterator, cast
-from numpy.typing import NDArray
_eps = np.finfo(np.float64).eps
@@ -1268,7 +1274,7 @@ Source code for spatialmath.geom2d
© Copyright 2020-, Peter Corke..
- Last updated on 26-Jun-2024.
+ Last updated on 23-Jul-2024.
diff --git a/_modules/spatialmath/geom3d.html b/_modules/spatialmath/geom3d.html
index 4f26601e..66315da5 100644
--- a/_modules/spatialmath/geom3d.html
+++ b/_modules/spatialmath/geom3d.html
@@ -86,23 +86,9 @@ Source code for spatialmath.geom3d
from collections import namedtuple
import matplotlib.pyplot as plt
import spatialmath.base as base
-from spatialmath.base.types import (
- ArrayLike,
- ArrayLike3,
- ArrayLike4,
- ArrayLike6,
- R3,
- R6,
- R3x3,
- R4x4,
- Points3,
- Rn,
-)
+from spatialmath.base.types import *
from spatialmath.baseposelist import BasePoseList
import warnings
-from typing import Union, Tuple, Optional, List, cast, overload
-from typing_extensions import Self
-from numpy.typing import NDArray
_eps = np.finfo(np.float64).eps
@@ -345,10 +331,12 @@ Source code for spatialmath.geom3d
__array_ufunc__ = None # allow pose matrices operators with NumPy values
@overload
- def __init__(self, v: ArrayLike3, w: ArrayLike3): ...
+ def __init__(self, v: ArrayLike3, w: ArrayLike3):
+ ...
@overload
- def __init__(self, v: ArrayLike6): ...
+ def __init__(self, v: ArrayLike6):
+ ...
[docs] def __init__(self, v=None, w=None, check=True):
"""
@@ -1525,7 +1513,7 @@ Source code for spatialmath.geom3d
© Copyright 2020-, Peter Corke..
- Last updated on 26-Jun-2024.
+ Last updated on 23-Jul-2024.
diff --git a/_modules/spatialmath/pose2d.html b/_modules/spatialmath/pose2d.html
index 98e459c1..2f1bc80e 100644
--- a/_modules/spatialmath/pose2d.html
+++ b/_modules/spatialmath/pose2d.html
@@ -732,7 +732,7 @@ Source code for spatialmath.pose2d
© Copyright 2020-, Peter Corke..
- Last updated on 26-Jun-2024.
+ Last updated on 23-Jul-2024.
diff --git a/_modules/spatialmath/pose3d.html b/_modules/spatialmath/pose3d.html
index 442c7ef0..223f08c7 100644
--- a/_modules/spatialmath/pose3d.html
+++ b/_modules/spatialmath/pose3d.html
@@ -105,28 +105,14 @@ Source code for spatialmath.pose3d
import numpy as np
import spatialmath.base as smb
-from spatialmath.base.types import (
- ArrayLike,
- ArrayLike2,
- ArrayLike3,
- ArrayLike6,
- R3,
- R6,
- R3x3,
- R4x4,
- R6x6,
- RNx3,
- SO3Array,
- SE3Array,
-)
+from spatialmath.base.types import *
from spatialmath.base.vectors import orthogonalize
from spatialmath.baseposematrix import BasePoseMatrix
from spatialmath.pose2d import SE2
+
from spatialmath.twist import Twist3
-from typing import TYPE_CHECKING, List, Tuple, Union, overload, Optional, cast
-from typing_extensions import Self
-from numpy.typing import NDArray
+from typing import TYPE_CHECKING
if TYPE_CHECKING:
from spatialmath.quaternion import UnitQuaternion
@@ -146,22 +132,28 @@ Source code for spatialmath.pose3d
"""
@overload
- def __init__(self): ...
+ def __init__(self):
+ ...
@overload
- def __init__(self, arg: SO3, *, check=True): ...
+ def __init__(self, arg: SO3, *, check=True):
+ ...
@overload
- def __init__(self, arg: SE3, *, check=True): ...
+ def __init__(self, arg: SE3, *, check=True):
+ ...
@overload
- def __init__(self, arg: SO3Array, *, check=True): ...
+ def __init__(self, arg: SO3Array, *, check=True):
+ ...
@overload
- def __init__(self, arg: List[SO3Array], *, check=True): ...
+ def __init__(self, arg: List[SO3Array], *, check=True):
+ ...
@overload
- def __init__(self, arg: List[Union[SO3, SO3Array]], *, check=True): ...
+ def __init__(self, arg: List[Union[SO3, SO3Array]], *, check=True):
+ ...
[docs] def __init__(self, arg=None, *, check=True):
"""
@@ -427,7 +419,7 @@ Source code for spatialmath.pose3d