Skip to content

Commit af3c171

Browse files
[format] Makes yapf happy.
1 parent 7e140b4 commit af3c171

11 files changed

+32
-27
lines changed

src/dynamic_graph/sot/core/feature_position_relative.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
from dynamic_graph import plug
88
from dynamic_graph.entity import Entity
99
from dynamic_graph.signal_base import SignalBase
10-
from dynamic_graph.sot.core.feature_point6d_relative import FeaturePoint6dRelative
10+
from dynamic_graph.sot.core.feature_point6d_relative \
11+
import FeaturePoint6dRelative
1112

1213
# Identity matrix of order 4
1314
I4 = reduce(lambda m, i: m + (i * (0., ) + (1., ) + (3 - i) * (0., ), ),

src/dynamic_graph/sot/core/math_small_entities.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010
Compose_R_and_T, ConvolutionTemporal, HomoToMatrix, HomoToRotation,
1111
HomoToTwist, Inverse_of_matrix, Inverse_of_matrixHomo,
1212
Inverse_of_matrixrotation, Inverse_of_matrixtwist, Inverse_of_unitquat,
13-
MatrixDiagonal, MatrixHomoToPose, MatrixHomoToPoseQuaternion, PoseQuatToMatrixHomo,
14-
MatrixHomoToPoseRollPitchYaw, MatrixHomoToPoseUTheta, MatrixToHomo,
15-
MatrixToQuaternion, MatrixToRPY, MatrixToUTheta, MatrixHomoToSE3Vector, SE3VectorToMatrixHomo,
16-
MatrixTranspose, Multiply_double_vector, Multiply_matrix_vector,
13+
MatrixDiagonal, MatrixHomoToPose, MatrixHomoToPoseQuaternion,
14+
PoseQuatToMatrixHomo, MatrixHomoToPoseRollPitchYaw, MatrixHomoToPoseUTheta,
15+
MatrixToHomo, MatrixToQuaternion, MatrixToRPY, MatrixToUTheta,
16+
MatrixHomoToSE3Vector, SE3VectorToMatrixHomo, MatrixTranspose,
17+
Multiply_double_vector, Multiply_matrix_vector,
1718
Multiply_matrixTwist_vector, Multiply_matrixHomo_vector,
1819
Multiply_of_double, Multiply_of_matrix, Multiply_of_matrixHomo,
1920
Multiply_of_matrixrotation, Multiply_of_matrixtwist,

src/dynamic_graph/sot/core/meta_task_6d.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77

88
def toFlags(arr):
99
"""
10-
Convert an array of boolean to a /flag/ format, type 001010110, in little indian
10+
Convert an array of boolean to a /flag/ format, type 001010110,
11+
in little indian
1112
(reverse order, first bool of the list will be the [01] of extrem right).
1213
"""
1314
lres = [0] * (max(arr) + 1)

src/dynamic_graph/sot/core/meta_tasks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def ref(self, v):
3434
self.featureDes.errorIN.value = v
3535

3636

37-
# --- HELPER FUNCTIONS ---------------------------------------------------------
37+
# --- HELPER FUNCTIONS --------------------------------------------------------
3838
def setGain(gain, val):
3939
if val is not None:
4040
if isinstance(val, int) or isinstance(val, float):

src/dynamic_graph/sot/core/meta_tasks_kine.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
from dynamic_graph import plug
22
from dynamic_graph.sot.core.gain_adaptive import GainAdaptive
33
from dynamic_graph.sot.core.meta_task_6d import MetaTask6d
4-
# TODO: this function is imported from meta_tasks_kine in several places, whereas it is defined in meta_tasks
4+
# TODO: this function is imported from meta_tasks_kine in several places,
5+
# whereas it is defined in meta_tasks
56
from dynamic_graph.sot.core.meta_tasks import gotoNd # noqa
67
from dynamic_graph.sot.core.meta_tasks import MetaTaskCom
78
from dynamic_graph.sot.core.task import Task

src/dynamic_graph/sot/core/meta_tasks_kine_relative.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def opmodifBase(self, m):
9999
self.opPointModifBase.activ = True
100100

101101

102-
# --- HELPER FUNCTIONS ---------------------------------------------------------
102+
# --- HELPER FUNCTIONS --------------------------------------------------------
103103

104104

105105
def goto6dRel(task, position, positionRef, gain=None, resetJacobian=True):
@@ -141,20 +141,27 @@ def gotoNdRel(task,
141141
142142
Inherited from MetaTask6d.
143143
144-
The aim of this MetaTask is to give a simple and immediate interface to implement a relative task between two
145-
operational points of the robot. The new variable "opPointBase" represents in fact the second operational point (the
144+
The aim of this MetaTask is to give a simple and immediate interface to
145+
implement a relative task between two
146+
operational points of the robot. The new variable "opPointBase" represents
147+
in fact the second operational point (the
146148
first is inherited from the father class).
147149
148-
It's been decided to reuse (so not to redefine) all methodes from MetaTask6d related to the opPoint to implement the
149-
behaviour of one of the two points (called "Other" from now on) and to reimplement in a intuitive way the same
150+
It's been decided to reuse (so not to redefine) all methodes from MetaTask6d
151+
related to the opPoint to implement the
152+
behaviour of one of the two points (called "Other" from now on) and to
153+
reimplement in a intuitive way the same
150154
functions for the second point ("Ref").
151155
152156
153157
Utilization
154158
155-
It should be noticed that both feature and reference are defined as a couple of signals, while normally it would be
156-
enough define the reference as one signal that represents the diplacement between the two positions. Nevertheless this
157-
redundant approach allows to a very intuitive and safe usage of the class because the references can be set just using
159+
It should be noticed that both feature and reference are defined as a
160+
couple of signals, while normally it would be
161+
enough define the reference as one signal that represents the diplacement
162+
between the two positions. Nevertheless this
163+
redundant approach allows to a very intuitive and safe usage of the class
164+
because the references can be set just using
158165
the current position of the two operational points.
159166
For this reason all the goTo functions have been redefined.
160167

src/dynamic_graph/sot/core/utils/thread_interruptible_loop.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# This class embeds a given loop function (generally by using a decorator) into a
2-
# dedicated thread, whose execution can be stoped or run on demand from the
1+
# This class embeds a given loop function (generally by using a decorator) into
2+
# a dedicated thread, whose execution can be stoped or run on demand from the
33
# script thread.
44
#
55
# To use the previous class, a 'loop' function has to be defined.

src/dynamic_graph/sot/core/utils/viewer_helper.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ def addRobotViewer(robot, **args):
5555
if small:
5656
if verbose:
5757
print('using a small robot')
58-
RobotClass.stateFullSize = lambda x: stateFullSize(x, small_extra * (0.0, ))
58+
RobotClass.stateFullSize = lambda x: \
59+
stateFullSize(x, small_extra * (0.0, ))
5960
else:
6061
RobotClass.stateFullSize = stateFullSize
6162

tests/python/initialize-euler.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ def test_initialize_ie(self):
1212
with self.assertRaises(dgpy.dgpyError) as cm:
1313
ent.initialize()
1414
self.assertEqual(
15-
str(cm.exception),
16-
'In SignalPtr: SIN ptr not set. (in signal '
15+
str(cm.exception), 'In SignalPtr: SIN ptr not set. (in signal '
1716
'<sotIntegratorAbstract(ie)::input(vector)::sin>)'
1817
)
1918

tests/python/matrix-util.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ def test_rpy_tr(self):
3131
(0, 0, 0, 1))),
3232
]:
3333
np.testing.assert_allclose(tr, mod.rpy2tr(*rpy), atol=1e-15)
34-
# np.testing.assert_allclose(rpy, mod.tr2rpy(tr), atol=1e-15)
35-
# np.testing.assert_allclose(tr, mod.rpy2tr(*mod.tr2rpy(tr)), atol=1e-15)
36-
# np.testing.assert_allclose(rpy, mod.tr2rpy(mod.rpy2tr(*rpy)), atol=1e-15)
3734

3835
def test_matrix_rpy(self):
3936
for mat, rpy in [
@@ -44,7 +41,6 @@ def test_matrix_rpy(self):
4441
# np.testing.assert_allclose(mat, mod.RPYToMatrix(rpy))
4542
np.testing.assert_allclose(rpy,
4643
mod.matrixToRPY(mod.RPYToMatrix(rpy)))
47-
# np.testing.assert_allclose(mat, mod.RPYToMatrix(mod.matrixToRPY(mat)))
4844

4945
def test_rotate(self):
5046
for axis, angle, mat in [

0 commit comments

Comments
 (0)