roboglia.base.PVL¶
-
class
PVL(p=nan, v=nan, ld=nan)[source]¶ Bases:
objectA representation of a (position, value, load) command that supports
nanvalue components and implements a number of help functions like addition, substraction, negation, equality (with error margin) and representation.- Parameters
p (float or
nan) – The position value of the PVLv (float or
nan) – The velocity value of the PVLld (float or
nan) – The load value of the PVL
-
__init__(p=nan, v=nan, ld=nan)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
property
p¶ The position value in PVL.
-
property
v¶ The velocity value in PVL.
-
property
ld¶ The load value in PVL.
-
__eq__(other)[source]¶ Comparison of two PVLs with margin of error.
Compare components of PVL one to one.
nanare the same if both arenan. Numbers are the same if the relative difference between them is less than 0.1% (to account for small rounding errors that might result from conversion of values from external to internal format).- Parameters
other (PVL) – The PVL to compare to
- Returns
True – if all components match (are
nanin the same place) or the differences are bellow the thresholdFalse – if there are differences on any component of the PVLs.
-
__sub__(other)[source]¶ Substracts
otherfrom a PVL (self-other).- Parameters
other (PVL or float or int or list of float or int with size 3) –
You can substract from a PVL:
another PVL
a number (float or int)
a list of 3 numbers (float or int)
Substracting
nanwith anything results innan. Numbers are substracted normally.- Returns
The result as a PVL.
- Return type