Spatial vector
- class SpatialVector(value)[source]
Bases:
spatialmath.baseposelist.BasePoseList
Spatial 6-vector abstract superclass
This class has two abstract subclasses, which each have concrete subclasses. Key characteristics:
6D vectors that represent velocity, acceleration, momentum and force of bodies in 3D.
inherit list-like properties from
SMUserList
classsupport operators:
Operator
Operation
+
addition of spatial vectors of the same subclass
-
subtraction of spatial vectors of the same subclass
-
unary minus
*
see table below
^
cross product x or x*
Certain subtypes can be multiplied
Multiplicands
Product
left
right
type
operation
SE3, Twist3
SpatialVelocity
SpatialVelocity
adjoint product
SE3, Twist3
SpatialAcceleration
SpatialAcceleration
adjoint product
SE3, Twist3
SpatialMomentum
SpatialMomentum
adjoint transpose product
SE3, Twist3
SpatialForce
SpatialForce
adjoint transpose product
SpatialAcceleration
SpatialInertia
SpatialForce
matrix-vector product**
SpatialVelocity
SpatialInertia
SpatialMomentum
matrix-vector product**
** indicates commutative operator.
References:
“Robot Dynamics Algorithms”, R. Featherstone, volume 22, Springer International Series in Engineering and Computer Science, Springer, 1987.
“A beginner’s guide to 6-d vectors (part 1)”, R. Featherstone, IEEE Robotics Automation Magazine, 17(3):83-94, Sep. 2010.
Online notes Methods:
- Seealso
SpatialM6()
,SpatialF6()
,SpatialVelocity()
,SpatialAcceleration()
,SpatialForce()
,SpatialMomentum()
.
- __add__(right)[source]
Overloaded
*
operator (superclass method)- Returns
sum of spatial vectors
- Return type
SpatialVector subclass instance
- Raises
TypeError – attempting to add SpatialVectors of different subclass
ValueErrror – attempting to add SpatialVectors with different numbers of values
v1 + v2
is a spatial vector of the same type asv1
andv2
whose value is the element-wise sum ofv1
andv2
. If both are arrays of spatial vectors V1 (1xN) and V2 (1xN) the result is an array (1xN).- Seealso
- __init__(value)[source]
Create a new spatial vector (abstract superclass)
- Parameters
value – Value of the
SpatialVector(vec)
is a spatial vector constructed from the 6-element array-likevec
SpatialVector([V1, V2, ... VN])
is a spatial vector array with N elements, constructed from the 6-element array-like valuesVi
SpatialVector(A)
is a spatial vector array with N elements, constructed from the columns of the 6xN arrayA
.
- __neg__()[source]
Overloaded unary
-
operator (superclass method)- Returns
negative of spatial vector
- Return type
SpatialVector subclass instance
-v
is a spatial vector of the same type asv
whose value is the element-wise negative ofv
.- Seealso
- __sub__(right)[source]
Overloaded
-
operator (superclass method)- Returns
difference of spatial vectors
- Return type
SpatialVector subclass instance
- Raises
TypeError – attempting to subtract SpatialVectors of different subclass
ValueErrror – attempting to subtract SpatialVectors with different numbers of values
v1 - v2
is a spatial vector of the same type asv1
andv2
whose value is the element-wise difference ofv1
andv2
. If both are arrays of spatial vectors V1 (1xN) and V2 (1xN) the result is an array (1xN).
- isvalid(x, check)[source]
Test if vector is valid spatial vector
- Parameters
x (numpy.ndarray) – vector to test
check (bool) – ignored
- Returns
True if the matrix has shape (6,).
- Return type
bool
- property shape
Shape of the object’s interal matrix representation
- Returns
(6,)
- Return type
tuple