Skip to content

Commit d424170

Browse files
committed
Added constrained uniform sampling of angles
1 parent 0a97e6e commit d424170

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

spatialmath/base/quaternions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -891,8 +891,8 @@ def qrand(theta_range:Optional[ArrayLike2] = None, unit: str = "rad") -> UnitQua
891891
ValueError('Invalid angular range. Must be within the range[0, pi].'
892892
+ f' Recieved {theta_range}.')
893893

894-
# Sample axis and angle indepently, respecing the CDF of the
895-
# angular magnitued under uniform sampling.
894+
# Sample axis and angle independently, respecting the CDF of the
895+
# angular magnitude under uniform sampling.
896896

897897
# Sample angle using inverse transform sampling based on CDF
898898
# of the anular distribution (2/pi * sin^2(theta/2))

tests/test_pose3d.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def test_constructor(self):
7878
nt.assert_equal(len(R), 1)
7979
self.assertIsInstance(R, SO3)
8080

81-
# random constained
81+
# random constrained
8282
R = SO3.Rand(theta_range=(0.1, 0.7))
8383
self.assertIsInstance(R, SO3)
8484
self.assertEqual(R.A.shape, (3, 3))
@@ -856,7 +856,7 @@ def test_constructor(self):
856856
nt.assert_equal(TT.y, ones * t[1])
857857
nt.assert_equal(TT.z, ones * t[2])
858858

859-
# random constained
859+
# random constrained
860860
T = SE3.Rand(theta_range=(0.1, 0.7))
861861
self.assertIsInstance(T, SE3)
862862
self.assertEqual(T.A.shape, (4, 4))

0 commit comments

Comments
 (0)