Skip to content

Commit 9c4a77b

Browse files
Fix trailing whitespace and end of file lines. (#164)
1 parent c04abc7 commit 9c4a77b

10 files changed

+49
-58
lines changed

.github/CONTRIBUTORS.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ A number of people have contributed to this, and earlier, versions of this Toolb
33
* Jesse Haviland, 2020 (part of the ropy project)
44
* Luis Fernando Lara Tobar, 2008
55
* Josh Carrigg Hodson, Aditya Dua, Chee Ho Chan, 2017 (part of the robopy project)
6-
* Peter Corke
6+
* Peter Corke

.pre-commit-config.yaml

+7-8
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,16 @@ repos:
1818
rev: v4.5.0
1919
hooks:
2020
- id: end-of-file-fixer
21-
- id: debug-statements # Ensure we don't commit `import pdb; pdb.set_trace()`
2221
exclude: |
23-
(?x)^(
24-
docker/ros/web/static/.*|
25-
)$
22+
(?x)(
23+
^docs/
24+
)
25+
- id: debug-statements # Ensure we don't commit `import pdb; pdb.set_trace()`
2626
- id: trailing-whitespace
2727
exclude: |
28-
(?x)^(
29-
docker/ros/web/static/.*|
30-
(.*/).*\.patch|
31-
)$
28+
(?x)(
29+
^docs/
30+
)
3231
# - repo: https://github.com/pre-commit/mirrors-mypy
3332
# rev: v1.6.1
3433
# hooks:

Makefile

-1
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,3 @@ clean: .FORCE
3939
(cd docs; make clean)
4040
-rm -r *.egg-info
4141
-rm -r dist build
42-

README.md

+25-25
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ space:
4545
| ------------ | ---------------- | -------- |
4646
| pose | ``SE3`` ``Twist3`` ``UnitDualQuaternion`` | ``SE2`` ``Twist2`` |
4747
| orientation | ``SO3`` ``UnitQuaternion`` | ``SO2`` |
48-
49-
48+
49+
5050
More specifically:
5151

5252
* `SE3` matrices belonging to the group $\mathbf{SE}(3)$ for position and orientation (pose) in 3-dimensions
@@ -160,26 +160,26 @@ For example, to create an object representing a rotation of 0.3 radians about th
160160
>>> from spatialmath import SO3, SE3
161161
>>> R1 = SO3.Rx(0.3)
162162
>>> R1
163-
1 0 0
164-
0 0.955336 -0.29552
165-
0 0.29552 0.955336
163+
1 0 0
164+
0 0.955336 -0.29552
165+
0 0.29552 0.955336
166166
```
167167
while a rotation of 30 deg about the z-axis is
168168

169169
```python
170170
>>> R2 = SO3.Rz(30, 'deg')
171171
>>> R2
172-
0.866025 -0.5 0
173-
0.5 0.866025 0
174-
0 0 1
172+
0.866025 -0.5 0
173+
0.5 0.866025 0
174+
0 0 1
175175
```
176-
and the composition of these two rotations is
176+
and the composition of these two rotations is
177177

178178
```python
179179
>>> R = R1 * R2
180-
0.866025 -0.5 0
181-
0.433013 0.75 -0.5
182-
0.25 0.433013 0.866025
180+
0.866025 -0.5 0
181+
0.433013 0.75 -0.5
182+
0.25 0.433013 0.866025
183183
```
184184

185185
We can find the corresponding Euler angles (in radians)
@@ -198,16 +198,16 @@ Frequently in robotics we want a sequence, a trajectory, of rotation matrices or
198198
>>> len(R)
199199
3
200200
>>> R[1]
201-
1 0 0
202-
0 0.955336 -0.29552
203-
0 0.29552 0.955336
201+
1 0 0
202+
0 0.955336 -0.29552
203+
0 0.29552 0.955336
204204
```
205205
and this can be used in `for` loops and list comprehensions.
206206

207207
An alternative way of constructing this would be (`R1`, `R2` defined above)
208208

209209
```python
210-
>>> R = SO3( [ SO3(), R1, R2 ] )
210+
>>> R = SO3( [ SO3(), R1, R2 ] )
211211
>>> len(R)
212212
3
213213
```
@@ -233,7 +233,7 @@ will produce a result where each element is the product of each element of the l
233233
Similarly
234234

235235
```python
236-
>>> A = SO3.Ry(0.5) * R
236+
>>> A = SO3.Ry(0.5) * R
237237
>>> len(R)
238238
32
239239
```
@@ -242,7 +242,7 @@ will produce a result where each element is the product of the left-hand side wi
242242
Finally
243243

244244
```python
245-
>>> A = R * R
245+
>>> A = R * R
246246
>>> len(R)
247247
32
248248
```
@@ -267,10 +267,10 @@ We can print and plot these objects as well
267267
```
268268
>>> T = SE3(1,2,3) * SE3.Rx(30, 'deg')
269269
>>> T.print()
270-
1 0 0 1
271-
0 0.866025 -0.5 2
272-
0 0.5 0.866025 3
273-
0 0 0 1
270+
1 0 0 1
271+
0 0.866025 -0.5 2
272+
0 0.5 0.866025 3
273+
0 0 0 1
274274
275275
>>> T.printline()
276276
t = 1, 2, 3; rpy/zyx = 30, 0, 0 deg
@@ -339,7 +339,7 @@ array([[1., 0., 1.],
339339
[0., 0., 1.]])
340340
341341
transl2( (1,2) )
342-
Out[444]:
342+
Out[444]:
343343
array([[1., 0., 1.],
344344
[0., 1., 2.],
345345
[0., 0., 1.]])
@@ -349,7 +349,7 @@ array([[1., 0., 1.],
349349

350350
```
351351
transl2( np.array([1,2]) )
352-
Out[445]:
352+
Out[445]:
353353
array([[1., 0., 1.],
354354
[0., 1., 2.],
355355
[0., 0., 1.]])
@@ -436,7 +436,7 @@ Out[259]: int
436436
437437
a = T[1,1]
438438
a
439-
Out[256]:
439+
Out[256]:
440440
cos(theta)
441441
type(a)
442442
Out[255]: cos

spatialmath/base/README.md

+10-17
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ import spatialmath as sm
2121
2222
R = sm.SO3.Rx(30, 'deg')
2323
print(R)
24-
1 0 0
25-
0 0.866025 -0.5
26-
0 0.5 0.866025
24+
1 0 0
25+
0 0.866025 -0.5
26+
0 0.5 0.866025
2727
```
2828
which constructs a rotation about the x-axis by 30 degrees.
2929

@@ -45,7 +45,7 @@ array([[ 1. , 0. , 0. ],
4545
[ 0. , 0.29552021, 0.95533649]])
4646
4747
>>> rotx(30, unit='deg')
48-
Out[438]:
48+
Out[438]:
4949
array([[ 1. , 0. , 0. ],
5050
[ 0. , 0.8660254, -0.5 ],
5151
[ 0. , 0.5 , 0.8660254]])
@@ -64,7 +64,7 @@ We also support multiple ways of passing vector information to functions that re
6464

6565
```
6666
transl2(1, 2)
67-
Out[442]:
67+
Out[442]:
6868
array([[1., 0., 1.],
6969
[0., 1., 2.],
7070
[0., 0., 1.]])
@@ -74,13 +74,13 @@ array([[1., 0., 1.],
7474

7575
```
7676
transl2( [1,2] )
77-
Out[443]:
77+
Out[443]:
7878
array([[1., 0., 1.],
7979
[0., 1., 2.],
8080
[0., 0., 1.]])
8181
8282
transl2( (1,2) )
83-
Out[444]:
83+
Out[444]:
8484
array([[1., 0., 1.],
8585
[0., 1., 2.],
8686
[0., 0., 1.]])
@@ -90,7 +90,7 @@ array([[1., 0., 1.],
9090

9191
```
9292
transl2( np.array([1,2]) )
93-
Out[445]:
93+
Out[445]:
9494
array([[1., 0., 1.],
9595
[0., 1., 2.],
9696
[0., 0., 1.]])
@@ -129,7 +129,7 @@ Using classes ensures type safety, for example it stops us mixing a 2D homogeneo
129129
These classes are all derived from two parent classes:
130130

131131
* `RTBPose` which provides common functionality for all
132-
* `UserList` which provdides the ability to act like a list
132+
* `UserList` which provdides the ability to act like a list
133133

134134
The latter is important because frequnetly in robotics we want a sequence, a trajectory, of rotation matrices or poses. However a list of these items has the type `list` and the elements are not enforced to be homogeneous, ie. a list could contain a mixture of classes.
135135

@@ -178,7 +178,7 @@ Out[259]: int
178178
179179
a = T[1,1]
180180
a
181-
Out[256]:
181+
Out[256]:
182182
cos(theta)
183183
type(a)
184184
Out[255]: cos
@@ -226,10 +226,3 @@ TypeError: can't convert expression to float
226226
| t2r | yes |
227227
| rotx | yes |
228228
| rotx | yes |
229-
230-
231-
232-
233-
234-
235-

spatialmath/base/argcheck.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
"""
77
Utility functions for testing and converting passed arguments. Used in all
8-
spatialmath functions and classes to provides for flexibility in argument types
8+
spatialmath functions and classes to provides for flexibility in argument types
99
that can be passed.
1010
"""
1111

spatialmath/base/symbolic.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
Symbolic arguments.
99
1010
If SymPy is not installed then only the standard numeric operations are
11-
supported.
11+
supported.
1212
"""
1313

1414
import math

spatialmath/base/transformsNd.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ def skew(v):
514514
if len(v) == 1:
515515
# fmt: off
516516
return np.array([
517-
[0.0, -v[0]],
517+
[0.0, -v[0]],
518518
[v[0], 0.0]
519519
]) # type: ignore
520520
# fmt: on

spatialmath/geom3d.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ def vec(self) -> R6:
507507
def skew(self) -> R4x4:
508508
r"""
509509
Line as a Plucker skew-symmetric matrix
510-
510+
511511
:return: Skew-symmetric matrix form of Plucker coordinates
512512
:rtype: ndarray(4,4)
513513
@@ -523,7 +523,7 @@ def skew(self) -> R4x4:
523523
-\omega_x & -\omega_y & -\omega_z & 0 \end{bmatrix}
524524
525525
.. note::
526-
526+
527527
- For two homogeneous points P and Q on the line, :math:`PQ^T-QP^T` is
528528
also skew symmetric.
529529
- The projection of Plucker line by a perspective camera is a

spatialmath/spatialvector.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
:top-classes: collections.UserList
1111
:parts: 1
1212
13-
.. note:: Compared to Featherstone's papers these spatial vectors have the
13+
.. note:: Compared to Featherstone's papers these spatial vectors have the
1414
translational components first, followed by rotational components.
1515
"""
1616

0 commit comments

Comments
 (0)