Commit af3c1712 authored by Olivier Stasse's avatar Olivier Stasse
Browse files

[format] Makes yapf happy.

parent 7e140b40
Pipeline #10913 passed with stage
in 36 minutes and 30 seconds
......@@ -7,7 +7,8 @@ from functools import reduce
from dynamic_graph import plug
from dynamic_graph.entity import Entity
from dynamic_graph.signal_base import SignalBase
from dynamic_graph.sot.core.feature_point6d_relative import FeaturePoint6dRelative
from dynamic_graph.sot.core.feature_point6d_relative \
import FeaturePoint6dRelative
# Identity matrix of order 4
I4 = reduce(lambda m, i: m + (i * (0., ) + (1., ) + (3 - i) * (0., ), ),
......
......@@ -10,10 +10,11 @@ from .operator import (
Compose_R_and_T, ConvolutionTemporal, HomoToMatrix, HomoToRotation,
HomoToTwist, Inverse_of_matrix, Inverse_of_matrixHomo,
Inverse_of_matrixrotation, Inverse_of_matrixtwist, Inverse_of_unitquat,
MatrixDiagonal, MatrixHomoToPose, MatrixHomoToPoseQuaternion, PoseQuatToMatrixHomo,
MatrixHomoToPoseRollPitchYaw, MatrixHomoToPoseUTheta, MatrixToHomo,
MatrixToQuaternion, MatrixToRPY, MatrixToUTheta, MatrixHomoToSE3Vector, SE3VectorToMatrixHomo,
MatrixTranspose, Multiply_double_vector, Multiply_matrix_vector,
MatrixDiagonal, MatrixHomoToPose, MatrixHomoToPoseQuaternion,
PoseQuatToMatrixHomo, MatrixHomoToPoseRollPitchYaw, MatrixHomoToPoseUTheta,
MatrixToHomo, MatrixToQuaternion, MatrixToRPY, MatrixToUTheta,
MatrixHomoToSE3Vector, SE3VectorToMatrixHomo, MatrixTranspose,
Multiply_double_vector, Multiply_matrix_vector,
Multiply_matrixTwist_vector, Multiply_matrixHomo_vector,
Multiply_of_double, Multiply_of_matrix, Multiply_of_matrixHomo,
Multiply_of_matrixrotation, Multiply_of_matrixtwist,
......
......@@ -7,7 +7,8 @@ from dynamic_graph.sot.core.task import Task
def toFlags(arr):
"""
Convert an array of boolean to a /flag/ format, type 001010110, in little indian
Convert an array of boolean to a /flag/ format, type 001010110,
in little indian
(reverse order, first bool of the list will be the [01] of extrem right).
"""
lres = [0] * (max(arr) + 1)
......
......@@ -34,7 +34,7 @@ class MetaTaskCom(object):
self.featureDes.errorIN.value = v
# --- HELPER FUNCTIONS ---------------------------------------------------------
# --- HELPER FUNCTIONS --------------------------------------------------------
def setGain(gain, val):
if val is not None:
if isinstance(val, int) or isinstance(val, float):
......
from dynamic_graph import plug
from dynamic_graph.sot.core.gain_adaptive import GainAdaptive
from dynamic_graph.sot.core.meta_task_6d import MetaTask6d
# TODO: this function is imported from meta_tasks_kine in several places, whereas it is defined in meta_tasks
# TODO: this function is imported from meta_tasks_kine in several places,
# whereas it is defined in meta_tasks
from dynamic_graph.sot.core.meta_tasks import gotoNd # noqa
from dynamic_graph.sot.core.meta_tasks import MetaTaskCom
from dynamic_graph.sot.core.task import Task
......
......@@ -99,7 +99,7 @@ class MetaTaskKine6dRel(MetaTask6d):
self.opPointModifBase.activ = True
# --- HELPER FUNCTIONS ---------------------------------------------------------
# --- HELPER FUNCTIONS --------------------------------------------------------
def goto6dRel(task, position, positionRef, gain=None, resetJacobian=True):
......@@ -141,20 +141,27 @@ Documentation
Inherited from MetaTask6d.
The aim of this MetaTask is to give a simple and immediate interface to implement a relative task between two
operational points of the robot. The new variable "opPointBase" represents in fact the second operational point (the
The aim of this MetaTask is to give a simple and immediate interface to
implement a relative task between two
operational points of the robot. The new variable "opPointBase" represents
in fact the second operational point (the
first is inherited from the father class).
It's been decided to reuse (so not to redefine) all methodes from MetaTask6d related to the opPoint to implement the
behaviour of one of the two points (called "Other" from now on) and to reimplement in a intuitive way the same
It's been decided to reuse (so not to redefine) all methodes from MetaTask6d
related to the opPoint to implement the
behaviour of one of the two points (called "Other" from now on) and to
reimplement in a intuitive way the same
functions for the second point ("Ref").
Utilization
It should be noticed that both feature and reference are defined as a couple of signals, while normally it would be
enough define the reference as one signal that represents the diplacement between the two positions. Nevertheless this
redundant approach allows to a very intuitive and safe usage of the class because the references can be set just using
It should be noticed that both feature and reference are defined as a
couple of signals, while normally it would be
enough define the reference as one signal that represents the diplacement
between the two positions. Nevertheless this
redundant approach allows to a very intuitive and safe usage of the class
because the references can be set just using
the current position of the two operational points.
For this reason all the goTo functions have been redefined.
......
# This class embeds a given loop function (generally by using a decorator) into a
# dedicated thread, whose execution can be stoped or run on demand from the
# This class embeds a given loop function (generally by using a decorator) into
# a dedicated thread, whose execution can be stoped or run on demand from the
# script thread.
#
# To use the previous class, a 'loop' function has to be defined.
......
......@@ -55,7 +55,8 @@ def addRobotViewer(robot, **args):
if small:
if verbose:
print('using a small robot')
RobotClass.stateFullSize = lambda x: stateFullSize(x, small_extra * (0.0, ))
RobotClass.stateFullSize = lambda x: \
stateFullSize(x, small_extra * (0.0, ))
else:
RobotClass.stateFullSize = stateFullSize
......
......@@ -12,8 +12,7 @@ class OpPointModifierTest(unittest.TestCase):
with self.assertRaises(dgpy.dgpyError) as cm:
ent.initialize()
self.assertEqual(
str(cm.exception),
'In SignalPtr: SIN ptr not set. (in signal '
str(cm.exception), 'In SignalPtr: SIN ptr not set. (in signal '
'<sotIntegratorAbstract(ie)::input(vector)::sin>)'
)
......
......@@ -31,9 +31,6 @@ class MatrixUtilTest(unittest.TestCase):
(0, 0, 0, 1))),
]:
np.testing.assert_allclose(tr, mod.rpy2tr(*rpy), atol=1e-15)
# np.testing.assert_allclose(rpy, mod.tr2rpy(tr), atol=1e-15)
# np.testing.assert_allclose(tr, mod.rpy2tr(*mod.tr2rpy(tr)), atol=1e-15)
# np.testing.assert_allclose(rpy, mod.tr2rpy(mod.rpy2tr(*rpy)), atol=1e-15)
def test_matrix_rpy(self):
for mat, rpy in [
......@@ -44,7 +41,6 @@ class MatrixUtilTest(unittest.TestCase):
# np.testing.assert_allclose(mat, mod.RPYToMatrix(rpy))
np.testing.assert_allclose(rpy,
mod.matrixToRPY(mod.RPYToMatrix(rpy)))
# np.testing.assert_allclose(mat, mod.RPYToMatrix(mod.matrixToRPY(mat)))
def test_rotate(self):
for axis, angle, mat in [
......
......@@ -8,7 +8,6 @@ from os.path import dirname, join, abspath
# Switch pinocchio to numpy matrix
pin.switchToNumpyMatrix()
param_server = ParameterServer("param_server")
param_server.init(0.001, "talos.urdf", "talos")
......@@ -21,7 +20,6 @@ urdfDir = param_server_conf.model_path
class TestParameterServer(unittest.TestCase):
def test_set_parameter(self):
# Read talos model
path = join(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment