sdurw_math module

class sdurw_math.EAAd(*args)

Bases: sdurw_math.Rotation3DVectord

A class for representing an equivalent angle-axis rotation

This class defines an equivalent-axis-angle orientation vector also known as an \(\thetak\) vector or “axis+angle” vector

The equivalent-axis-angle vector is the product of a unit vector \(\hat{\mathbf{k}}\) and an angle of rotation around that axis \(\theta\)

Notes: given two EAA vectors \(\theta_1\mathbf{\hat{k}}_1\) and \(\theta_2\mathbf{\hat{k}}_2\) it is generally not possible to subtract or add these vectors, except for the special case when \(\mathbf{\hat{k}}_1 == \mathbf{\hat{k}}_2\) this is why this class does not have any subtraction or addition operators

__init__(*args)

Overload 1:

Extracts Equivalent axis-angle vector from Rotation matrix

Parameters

R (rw::math::Rotation3D< double >) – [in] A 3x3 rotation matrix \(\mathbf{R}\)

\(\theta = arccos(\frac{1}{2}(Trace(\mathbf{R})-1)=arccos(\frac{r_{11}+r_{22}+r_{33}-1}{2})\)

\(\thetak=log(\mathbf{R})=\frac{\theta}{2 sin \theta}(\mathbf{R}-\mathbf{R}^T) =\frac{\theta}{2 sin \theta}\left[\begin{array}{c}r_{32}-r_{23}\\r_{13}-r_{31}\\r_{21}-r_{12}\end{array}\right]\)

\(\thetak=\left[\begin{array}{c}0\\0\\0\end{array}\right]\) if \(\theta = 0\)

\(\thetak=\pi\left[\begin{array}{c}\sqrt{(R(0,0)+1.0)/2.0}\\\sqrt{(R(1,1)+1.0)/2.0}\\\sqrt{(R(2,2)+1.0)/2.0}\end{array}\right]\) if \(\theta = \pi\)


Overload 2:

Constructs an EAA vector initialized to \(\{0,0,0\}\)


Overload 3:

Constructs an initialized EAA vector :type axis: rw::math::Vector3D< double > :param axis: [in] \(\mathbf{\hat{k}}\) :type angle: float :param angle: [in] \(\theta\)


Overload 4:

Constructs an initialized EAA vector \(\thetak =\left[\begin{array}{c} \theta k_x\\ \theta k_y\\ \theta k_z\end{array}\right]\) :type thetakx: float :param thetakx: [in] \(\theta k_x\) :type thetaky: float :param thetaky: [in] \(\theta k_y\) :type thetakz: float :param thetakz: [in] \(\theta k_z\)


Overload 5:

Constructs an EAA vector that will rotate v1 into v2. Where v1 and v2 are normalized and described in the same reference frame. :type v1: rw::math::Vector3D< double > :param v1: [in] normalized vector :type v2: rw::math::Vector3D< double > :param v2: [in] normalized vector


Overload 6:

Constructs an initialized EAA vector

The angle of the EAA are \(\|eaa\|\) and the axis is \(\frac{eaa}{\|eaa\|}\) :type eaa: rw::math::Vector3D< double > :param eaa: [in] Values to initialize the EAA

angle()

Extracts the angle of rotation \(\theta\) :rtype: float :return: \(\theta\)

axis()

Extracts the axis of rotation vector \(\mathbf{\hat{\mathbf{k}}}\) :rtype: rw::math::Vector3D< double > :return: \(\mathbf{\hat{\mathbf{k}}}\)

copy(*args)

Overload 1:

copy operator :type rhs: rw::math::EAA< double > :param rhs: [in] the EAA to be copied :rtype: rw::math::EAA< double > :return: reference to this EAA


Overload 2:

assign vector to EAA :type rhs: rw::math::Vector3D< double > :param rhs: [in] the vector to asign :rtype: rw::math::EAA< double > :return: reference to this EAA


Overload 3:

copy operator :type rhs: rw::math::Rotation3D< double > :param rhs: [in] the Rotation3D to be copied :rtype: rw::math::EAA< double > :return: reference to this EAA

cross(*args)

Overload 1:

Calculates the cross product and returns the result :type v: rw::math::Vector3D< double > :param v: [in] a Vector3D :rtype: rw::math::Vector3D< double > :return: the resulting 3D vector


Overload 2:

Calculates the cross product and returns the result :type eaa: rw::math::EAA< double > :param eaa: [in] a EAA :rtype: rw::math::EAA< double > :return: the resulting 3D vector

dot(*args)

Overload 1:

Calculates the dot product and returns the result :type v: rw::math::Vector3D< double > :param v: [in] a Vector3D :rtype: float :return: the resulting scalar


Overload 2:

Calculates the cross product and returns the result :type eaa: rw::math::EAA< double > :param eaa: [in] a EAA :rtype: float :return: the resulting 3D vector

e()

get as eigen vector :rtype: Eigen::Matrix< double,3,1 > :return: Eigenvector

elemAdd(*args)

Overload 1:

element wise addition :type rhs: rw::math::EAA< double > :param rhs: [in] the EAA to be added :rtype: rw::math::EAA< double > :return: the sum of the two EAA’s


Overload 2:

Scalar addition.

elemDivide(*args)

Overload 1:

element wise devision ( this / rhs ) :type rhs: rw::math::EAA< double > :param rhs: [in] the EAA to be devided with :rtype: rw::math::EAA< double > :return: the result of division


Overload 2:

scalar devision :type rhs: float :param rhs: [in] the scalar to devide with :rtype: rw::math::EAA< double > :return: the resulting EAA


Overload 3:

element wise devision ( this / rhs ) :type rhs: rw::math::Vector3D< double > :param rhs: [in] the Vector to be devided with :rtype: rw::math::EAA< double > :return: the result of division

elemMultiply(*args)

Overload 1:

element wise multiplication :type rhs: rw::math::EAA< double > :param rhs: [in] the EAA to be multiplyed with :rtype: rw::math::EAA< double > :return: the result of division


Overload 2:

scalar multiplication :type rhs: float :param rhs: [in] the scalar to multiply with :rtype: rw::math::EAA< double > :return: the product


Overload 3:

element wise multiplication :type rhs: rw::math::Vector3D< double > :param rhs: [in] the Vector to be multiplyed with :rtype: rw::math::EAA< double > :return: the result of division

elemSubtract(*args)

Overload 1:

element wise subtraction :type rhs: rw::math::EAA< double > :param rhs: [in] the EAA to be subtracted :rtype: rw::math::EAA< double > :return: the difference between the two EAA’s


Overload 2:

Scalar subtraction.

norm1()

Returns the Manhatten norm (1-norm) of the vector :rtype: float :return: the norm

norm2()

Returns the Euclidean norm (2-norm) of the vector :rtype: float :return: the norm

normInf()

Returns the infinte norm (\(\inf\)-norm) of the vector :rtype: float :return: the norm

scaleAngle(scale)

scale the angle, keeping the axis the same :type scale: float :param scale: [in] how much the angle should change :rtype: rw::math::EAA< double > :return: a new EAA with the scaled angle

setAngle(angle)

change the angle of the EAA :type angle: float :param angle: [in] the new angle :rtype: rw::math::EAA< double > :return: this object

size()

Get the size of the EAA. :rtype: int :return: the size (always 3).

property thisown

The membership flag

toRotation3D()

\(\mathbf{R} = e^{[\mathbf{\hat{k}}],\theta}=\mathbf{I}^{3x3}+[\mathbf{\hat{k}}]sin\theta+[{\mathbf{\hat{k}}}]^2(1-cos\theta) = \left[ \begin{array}{ccc} k_xk_xv\theta + c\theta & k_xk_yv\theta - k_zs\theta & k_xk_zv\theta + k_ys\theta \\ k_xk_yv\theta + k_zs\theta & k_yk_yv\theta + c\theta & k_yk_zv\theta - k_xs\theta\\ k_xk_zv\theta - k_ys\theta & k_yk_zv\theta + k_xs\theta & k_zk_zv\theta + c\theta \end{array} \right]\)

where: - \(c\theta = cos \theta\) - \(s\theta = sin \theta\) - \(v\theta = 1-cos \theta\)

toVector3D()

get the underling Vector :rtype: rw::math::Vector3D< double > :return: the vector

class sdurw_math.EAAf(*args)

Bases: sdurw_math.Rotation3DVectorf

A class for representing an equivalent angle-axis rotation

This class defines an equivalent-axis-angle orientation vector also known as an \(\thetak\) vector or “axis+angle” vector

The equivalent-axis-angle vector is the product of a unit vector \(\hat{\mathbf{k}}\) and an angle of rotation around that axis \(\theta\)

Notes: given two EAA vectors \(\theta_1\mathbf{\hat{k}}_1\) and \(\theta_2\mathbf{\hat{k}}_2\) it is generally not possible to subtract or add these vectors, except for the special case when \(\mathbf{\hat{k}}_1 == \mathbf{\hat{k}}_2\) this is why this class does not have any subtraction or addition operators

__init__(*args)

Overload 1:

Extracts Equivalent axis-angle vector from Rotation matrix

Parameters

R (rw::math::Rotation3D< float >) – [in] A 3x3 rotation matrix \(\mathbf{R}\)

\(\theta = arccos(\frac{1}{2}(Trace(\mathbf{R})-1)=arccos(\frac{r_{11}+r_{22}+r_{33}-1}{2})\)

\(\thetak=log(\mathbf{R})=\frac{\theta}{2 sin \theta}(\mathbf{R}-\mathbf{R}^T) =\frac{\theta}{2 sin \theta}\left[\begin{array}{c}r_{32}-r_{23}\\r_{13}-r_{31}\\r_{21}-r_{12}\end{array}\right]\)

\(\thetak=\left[\begin{array}{c}0\\0\\0\end{array}\right]\) if \(\theta = 0\)

\(\thetak=\pi\left[\begin{array}{c}\sqrt{(R(0,0)+1.0)/2.0}\\\sqrt{(R(1,1)+1.0)/2.0}\\\sqrt{(R(2,2)+1.0)/2.0}\end{array}\right]\) if \(\theta = \pi\)


Overload 2:

Constructs an EAA vector initialized to \(\{0,0,0\}\)


Overload 3:

Constructs an initialized EAA vector :type axis: rw::math::Vector3D< float > :param axis: [in] \(\mathbf{\hat{k}}\) :type angle: float :param angle: [in] \(\theta\)


Overload 4:

Constructs an initialized EAA vector \(\thetak =\left[\begin{array}{c} \theta k_x\\ \theta k_y\\ \theta k_z\end{array}\right]\) :type thetakx: float :param thetakx: [in] \(\theta k_x\) :type thetaky: float :param thetaky: [in] \(\theta k_y\) :type thetakz: float :param thetakz: [in] \(\theta k_z\)


Overload 5:

Constructs an EAA vector that will rotate v1 into v2. Where v1 and v2 are normalized and described in the same reference frame. :type v1: rw::math::Vector3D< float > :param v1: [in] normalized vector :type v2: rw::math::Vector3D< float > :param v2: [in] normalized vector


Overload 6:

Constructs an initialized EAA vector

The angle of the EAA are \(\|eaa\|\) and the axis is \(\frac{eaa}{\|eaa\|}\) :type eaa: rw::math::Vector3D< float > :param eaa: [in] Values to initialize the EAA

angle()

Extracts the angle of rotation \(\theta\) :rtype: float :return: \(\theta\)

axis()

Extracts the axis of rotation vector \(\mathbf{\hat{\mathbf{k}}}\) :rtype: rw::math::Vector3D< float > :return: \(\mathbf{\hat{\mathbf{k}}}\)

copy(*args)

Overload 1:

copy operator :type rhs: rw::math::EAA< float > :param rhs: [in] the EAA to be copied :rtype: rw::math::EAA< float > :return: reference to this EAA


Overload 2:

assign vector to EAA :type rhs: rw::math::Vector3D< float > :param rhs: [in] the vector to asign :rtype: rw::math::EAA< float > :return: reference to this EAA


Overload 3:

copy operator :type rhs: rw::math::Rotation3D< float > :param rhs: [in] the Rotation3D to be copied :rtype: rw::math::EAA< float > :return: reference to this EAA

cross(*args)

Overload 1:

Calculates the cross product and returns the result :type v: rw::math::Vector3D< float > :param v: [in] a Vector3D :rtype: rw::math::Vector3D< float > :return: the resulting 3D vector


Overload 2:

Calculates the cross product and returns the result :type eaa: rw::math::EAA< float > :param eaa: [in] a EAA :rtype: rw::math::EAA< float > :return: the resulting 3D vector

dot(*args)

Overload 1:

Calculates the dot product and returns the result :type v: rw::math::Vector3D< float > :param v: [in] a Vector3D :rtype: float :return: the resulting scalar


Overload 2:

Calculates the cross product and returns the result :type eaa: rw::math::EAA< float > :param eaa: [in] a EAA :rtype: float :return: the resulting 3D vector

e()

get as eigen vector :rtype: Eigen::Matrix< float,3,1 > :return: Eigenvector

elemAdd(*args)

Overload 1:

element wise addition :type rhs: rw::math::EAA< float > :param rhs: [in] the EAA to be added :rtype: rw::math::EAA< float > :return: the sum of the two EAA’s


Overload 2:

Scalar addition.

elemDivide(*args)

Overload 1:

element wise devision ( this / rhs ) :type rhs: rw::math::EAA< float > :param rhs: [in] the EAA to be devided with :rtype: rw::math::EAA< float > :return: the result of division


Overload 2:

scalar devision :type rhs: float :param rhs: [in] the scalar to devide with :rtype: rw::math::EAA< float > :return: the resulting EAA


Overload 3:

element wise devision ( this / rhs ) :type rhs: rw::math::Vector3D< float > :param rhs: [in] the Vector to be devided with :rtype: rw::math::EAA< float > :return: the result of division

elemMultiply(*args)

Overload 1:

element wise multiplication :type rhs: rw::math::EAA< float > :param rhs: [in] the EAA to be multiplyed with :rtype: rw::math::EAA< float > :return: the result of division


Overload 2:

scalar multiplication :type rhs: float :param rhs: [in] the scalar to multiply with :rtype: rw::math::EAA< float > :return: the product


Overload 3:

element wise multiplication :type rhs: rw::math::Vector3D< float > :param rhs: [in] the Vector to be multiplyed with :rtype: rw::math::EAA< float > :return: the result of division

elemSubtract(*args)

Overload 1:

element wise subtraction :type rhs: rw::math::EAA< float > :param rhs: [in] the EAA to be subtracted :rtype: rw::math::EAA< float > :return: the difference between the two EAA’s


Overload 2:

Scalar subtraction.

norm1()

Returns the Manhatten norm (1-norm) of the vector :rtype: float :return: the norm

norm2()

Returns the Euclidean norm (2-norm) of the vector :rtype: float :return: the norm

normInf()

Returns the infinte norm (\(\inf\)-norm) of the vector :rtype: float :return: the norm

scaleAngle(scale)

scale the angle, keeping the axis the same :type scale: float :param scale: [in] how much the angle should change :rtype: rw::math::EAA< float > :return: a new EAA with the scaled angle

setAngle(angle)

change the angle of the EAA :type angle: float :param angle: [in] the new angle :rtype: rw::math::EAA< float > :return: this object

size()

Get the size of the EAA. :rtype: int :return: the size (always 3).

property thisown

The membership flag

toRotation3D()

\(\mathbf{R} = e^{[\mathbf{\hat{k}}],\theta}=\mathbf{I}^{3x3}+[\mathbf{\hat{k}}]sin\theta+[{\mathbf{\hat{k}}}]^2(1-cos\theta) = \left[ \begin{array}{ccc} k_xk_xv\theta + c\theta & k_xk_yv\theta - k_zs\theta & k_xk_zv\theta + k_ys\theta \\ k_xk_yv\theta + k_zs\theta & k_yk_yv\theta + c\theta & k_yk_zv\theta - k_xs\theta\\ k_xk_zv\theta - k_ys\theta & k_yk_zv\theta + k_xs\theta & k_zk_zv\theta + c\theta \end{array} \right]\)

where: - \(c\theta = cos \theta\) - \(s\theta = sin \theta\) - \(v\theta = 1-cos \theta\)

toVector3D()

get the underling Vector :rtype: rw::math::Vector3D< float > :return: the vector

class sdurw_math.EigenDecomposition(vectors, values)

Bases: object

Type representing a set of eigen values and eigen vectors.

__init__(vectors, values)

Construct new decomposition. :type vectors: Eigen::Matrix< double,Eigen::Dynamic,Eigen::Dynamic > :param vectors: [in] the eigen vectors as columns in a matrix. :type values: Eigen::Matrix< double,Eigen::Dynamic,1 > :param values: [in] the corresponding eigen values.

getEigenValue(i)

returns the i’th eigenvalue :rtype: float :return: the eigenvalue.

getEigenValues()

return all eigenvalues :rtype: Eigen::Matrix< double,Eigen::Dynamic,1 > :return: the eigen values.

getEigenVector(i)

returns the i’th eigenvector :rtype: Eigen::Matrix< double,Eigen::Dynamic,1 > :return: the eigen vector.

getEigenVectors()

returns all eigenvectors as columns in a matrix :rtype: Eigen::Matrix< double,Eigen::Dynamic,Eigen::Dynamic > :return: reference to the matrix.

sort()

sorts the eigen vectors according to their eigen value. The vector with smallest eigen value has index 0

property thisown

The membership flag

class sdurw_math.EigenDecomposition_f(vectors, values)

Bases: object

Type representing a set of eigen values and eigen vectors.

__init__(vectors, values)

Construct new decomposition. :type vectors: Eigen::Matrix< float,Eigen::Dynamic,Eigen::Dynamic > :param vectors: [in] the eigen vectors as columns in a matrix. :type values: Eigen::Matrix< float,Eigen::Dynamic,1 > :param values: [in] the corresponding eigen values.

getEigenValue(i)

returns the i’th eigenvalue :rtype: float :return: the eigenvalue.

getEigenValues()

return all eigenvalues :rtype: Eigen::Matrix< float,Eigen::Dynamic,1 > :return: the eigen values.

getEigenVector(i)

returns the i’th eigenvector :rtype: Eigen::Matrix< float,Eigen::Dynamic,1 > :return: the eigen vector.

getEigenVectors()

returns all eigenvectors as columns in a matrix :rtype: Eigen::Matrix< float,Eigen::Dynamic,Eigen::Dynamic > :return: reference to the matrix.

sort()

sorts the eigen vectors according to their eigen value. The vector with smallest eigen value has index 0

property thisown

The membership flag

class sdurw_math.EigenMatrix2d(dimx, dimy)

Bases: object

__init__(dimx, dimy)

Initialize self. See help(type(self)) for accurate signature.

elem(x, y)
get(x, y)
set(x, y, value)
property thisown

The membership flag

class sdurw_math.EigenMatrix2f(dimx, dimy)

Bases: object

__init__(dimx, dimy)

Initialize self. See help(type(self)) for accurate signature.

elem(x, y)
get(x, y)
set(x, y, value)
property thisown

The membership flag

class sdurw_math.EigenMatrix3d(dimx, dimy)

Bases: object

__init__(dimx, dimy)

Initialize self. See help(type(self)) for accurate signature.

elem(x, y)
get(x, y)
set(x, y, value)
property thisown

The membership flag

class sdurw_math.EigenMatrix3f(dimx, dimy)

Bases: object

__init__(dimx, dimy)

Initialize self. See help(type(self)) for accurate signature.

elem(x, y)
get(x, y)
set(x, y, value)
property thisown

The membership flag

class sdurw_math.EigenMatrix3id(dimx, dimy)

Bases: object

__init__(dimx, dimy)

Initialize self. See help(type(self)) for accurate signature.

elem(x, y)
get(x, y)
set(x, y, value)
property thisown

The membership flag

class sdurw_math.EigenMatrix4d(dimx, dimy)

Bases: object

__init__(dimx, dimy)

Initialize self. See help(type(self)) for accurate signature.

elem(x, y)
get(x, y)
set(x, y, value)
property thisown

The membership flag

class sdurw_math.EigenMatrix4f(dimx, dimy)

Bases: object

__init__(dimx, dimy)

Initialize self. See help(type(self)) for accurate signature.

elem(x, y)
get(x, y)
set(x, y, value)
property thisown

The membership flag

class sdurw_math.EigenMatrixXd(dimx, dimy)

Bases: object

__init__(dimx, dimy)

Initialize self. See help(type(self)) for accurate signature.

elem(x, y)
get(x, y)
set(x, y, value)
property thisown

The membership flag

class sdurw_math.EigenMatrixXf(dimx, dimy)

Bases: object

__init__(dimx, dimy)

Initialize self. See help(type(self)) for accurate signature.

elem(x, y)
get(x, y)
set(x, y, value)
property thisown

The membership flag

class sdurw_math.EigenQuaterniond

Bases: object

__init__()

Initialize self. See help(type(self)) for accurate signature.

property thisown

The membership flag

class sdurw_math.EigenQuaternionf

Bases: object

__init__()

Initialize self. See help(type(self)) for accurate signature.

property thisown

The membership flag

class sdurw_math.EigenRowVector3d(dimx, dimy)

Bases: object

__init__(dimx, dimy)

Initialize self. See help(type(self)) for accurate signature.

elem(x, y)
get(x, y)
set(x, y, value)
property thisown

The membership flag

class sdurw_math.EigenRowVector3f(dimx, dimy)

Bases: object

__init__(dimx, dimy)

Initialize self. See help(type(self)) for accurate signature.

elem(x, y)
get(x, y)
set(x, y, value)
property thisown

The membership flag

class sdurw_math.EigenRowVector3id(dimx, dimy)

Bases: object

__init__(dimx, dimy)

Initialize self. See help(type(self)) for accurate signature.

elem(x, y)
get(x, y)
set(x, y, value)
property thisown

The membership flag

class sdurw_math.EigenVector2d(dimx, dimy)

Bases: object

__init__(dimx, dimy)

Initialize self. See help(type(self)) for accurate signature.

elem(x, y)
get(x, y)
set(x, y, value)
property thisown

The membership flag

class sdurw_math.EigenVector2f(dimx, dimy)

Bases: object

__init__(dimx, dimy)

Initialize self. See help(type(self)) for accurate signature.

elem(x, y)
get(x, y)
set(x, y, value)
property thisown

The membership flag

class sdurw_math.EigenVector3d(dimx, dimy)

Bases: object

__init__(dimx, dimy)

Initialize self. See help(type(self)) for accurate signature.

elem(x, y)
get(x, y)
set(x, y, value)
property thisown

The membership flag

class sdurw_math.EigenVector3f(dimx, dimy)

Bases: object

__init__(dimx, dimy)

Initialize self. See help(type(self)) for accurate signature.

elem(x, y)
get(x, y)
set(x, y, value)
property thisown

The membership flag

class sdurw_math.EigenVector3id(dimx, dimy)

Bases: object

__init__(dimx, dimy)

Initialize self. See help(type(self)) for accurate signature.

elem(x, y)
get(x, y)
set(x, y, value)
property thisown

The membership flag

class sdurw_math.EigenVector6d(dimx, dimy)

Bases: object

__init__(dimx, dimy)

Initialize self. See help(type(self)) for accurate signature.

elem(x, y)
get(x, y)
set(x, y, value)
property thisown

The membership flag

class sdurw_math.EigenVector6f(dimx, dimy)

Bases: object

__init__(dimx, dimy)

Initialize self. See help(type(self)) for accurate signature.

elem(x, y)
get(x, y)
set(x, y, value)
property thisown

The membership flag

class sdurw_math.EigenVector7d(dimx, dimy)

Bases: object

__init__(dimx, dimy)

Initialize self. See help(type(self)) for accurate signature.

elem(x, y)
get(x, y)
set(x, y, value)
property thisown

The membership flag

class sdurw_math.EigenVector7f(dimx, dimy)

Bases: object

__init__(dimx, dimy)

Initialize self. See help(type(self)) for accurate signature.

elem(x, y)
get(x, y)
set(x, y, value)
property thisown

The membership flag

class sdurw_math.EigenVectorXd(dimx, dimy)

Bases: object

__init__(dimx, dimy)

Initialize self. See help(type(self)) for accurate signature.

elem(x, y)
get(x, y)
set(x, y, value)
property thisown

The membership flag

class sdurw_math.EigenVectorXf(dimx, dimy)

Bases: object

__init__(dimx, dimy)

Initialize self. See help(type(self)) for accurate signature.

elem(x, y)
get(x, y)
set(x, y, value)
property thisown

The membership flag

class sdurw_math.EuclideanMetricQ

Bases: sdurw_math.MetricQ

Euclidean distance metric for vector types.

The distance between two points \(P = (p_1, p_2, ..., p_n)\) and \(Q = (q_1, q_2, ..., q_n)\) is defined as \(\sqrt{\sum_{i=1}^{n}(p_i - q_i)^2}\)

__init__()

Initialize self. See help(type(self)) for accurate signature.

property thisown

The membership flag

class sdurw_math.EuclideanMetricVector2D

Bases: sdurw_math.MetricVector2D

Euclidean distance metric for vector types.

The distance between two points \(P = (p_1, p_2, ..., p_n)\) and \(Q = (q_1, q_2, ..., q_n)\) is defined as \(\sqrt{\sum_{i=1}^{n}(p_i - q_i)^2}\)

__init__()

Initialize self. See help(type(self)) for accurate signature.

property thisown

The membership flag

class sdurw_math.EuclideanMetricVector3D

Bases: sdurw_math.MetricVector3D

Euclidean distance metric for vector types.

The distance between two points \(P = (p_1, p_2, ..., p_n)\) and \(Q = (q_1, q_2, ..., q_n)\) is defined as \(\sqrt{\sum_{i=1}^{n}(p_i - q_i)^2}\)

__init__()

Initialize self. See help(type(self)) for accurate signature.

property thisown

The membership flag

class sdurw_math.InertiaMatrixd(*args)

Bases: object

A 3x3 inertia matrix

__init__(*args)

Overload 1:

Constructs an initialized 3x3 rotation matrix

Parameters
  • r11 (float) – \(r_{11}\)

  • r12 (float) – \(r_{12}\)

  • r13 (float) – \(r_{13}\)

  • r21 (float) – \(r_{21}\)

  • r22 (float) – \(r_{22}\)

  • r23 (float) – \(r_{23}\)

  • r31 (float) – \(r_{31}\)

  • r32 (float) – \(r_{32}\)

  • r33 (float) – \(r_{33}\)

\(\mathbf{R} = \left[ \begin{array}{ccc} r_{11} & r_{12} & r_{13} \\ r_{21} & r_{22} & r_{23} \\ r_{31} & r_{32} & r_{33} \end{array} \right]\)


Overload 2:

Constructs an initialized 3x3 rotation matrix \(\robabx{a}{b}{\mathbf{R}} =\left[ \begin{array}{ccc} \robabx{a}{b}{\mathbf{i}} & \robabx{a}{b}{\mathbf{j}} & \robabx{a}{b}{\mathbf{k}} \end{array}\right]\)

Parameters
  • i (rw::math::Vector3D< double >) – \(\robabx{a}{b}{\mathbf{i}}\)

  • j (rw::math::Vector3D< double >) – \(\robabx{a}{b}{\mathbf{j}}\)

  • k (rw::math::Vector3D< double >) – \(\robabx{a}{b}{\mathbf{k}}\)


Overload 3:

constructor - where only the diagonal is set :type i: float :param i: [in] m(0,0) :type j: float :param j: [in] m(1,1) :type k: float :param k: [in] m(2,2)


Overload 4:

constructor - where only the diagonal is set :type i: float :param i: [in] m(0,0) :type j: float :param j: [in] m(1,1) :param k: [in] m(2,2)


Overload 5:

constructor - where only the diagonal is set :type i: float :param i: [in] m(0,0) :param j: [in] m(1,1) :param k: [in] m(2,2)


Overload 6:

constructor - where only the diagonal is set :param i: [in] m(0,0) :param j: [in] m(1,1) :param k: [in] m(2,2)


Overload 7:

Construct an internal matrix from a Eigen::MatrixBase It is the responsibility of the user that 3x3 matrix is indeed an inertia matrix.

e()

Returns reference to the internal 3x3 matrix

static makeCuboidInertia(mass, x, y, z)

calculates the inertia of a cuboid where the reference frame is in the center of the cuboid with :type mass: float :param mass: :type x: float :param x: :type y: float :param y: :type z: float :param z: :rtype: rw::math::InertiaMatrix< double > :return:

static makeHollowSphereInertia(mass, radi)

Make inertia matrix for a hollow sphere. :type mass: float :param mass: [in] mass of hollow sphere. :type radi: float :param radi: [in] radius of sphere. :rtype: rw::math::InertiaMatrix< double > :return: the inertia matrix.

static makeSolidSphereInertia(mass, radi)

Make inertia matrix for a solid sphere. :type mass: float :param mass: [in] mass of solid sphere. :type radi: float :param radi: [in] radius of sphere. :rtype: rw::math::InertiaMatrix< double > :return: the inertia matrix.

property thisown

The membership flag

sdurw_math.InertiaMatrixd_makeCuboidInertia(mass, x, y, z)

calculates the inertia of a cuboid where the reference frame is in the center of the cuboid with :type mass: float :param mass: :type x: float :param x: :type y: float :param y: :type z: float :param z: :rtype: rw::math::InertiaMatrix< double > :return:

sdurw_math.InertiaMatrixd_makeHollowSphereInertia(mass, radi)

Make inertia matrix for a hollow sphere. :type mass: float :param mass: [in] mass of hollow sphere. :type radi: float :param radi: [in] radius of sphere. :rtype: rw::math::InertiaMatrix< double > :return: the inertia matrix.

sdurw_math.InertiaMatrixd_makeSolidSphereInertia(mass, radi)

Make inertia matrix for a solid sphere. :type mass: float :param mass: [in] mass of solid sphere. :type radi: float :param radi: [in] radius of sphere. :rtype: rw::math::InertiaMatrix< double > :return: the inertia matrix.

class sdurw_math.InertiaMatrixf(*args)

Bases: object

A 3x3 inertia matrix

__init__(*args)

Overload 1:

Constructs an initialized 3x3 rotation matrix

Parameters
  • r11 (float) – \(r_{11}\)

  • r12 (float) – \(r_{12}\)

  • r13 (float) – \(r_{13}\)

  • r21 (float) – \(r_{21}\)

  • r22 (float) – \(r_{22}\)

  • r23 (float) – \(r_{23}\)

  • r31 (float) – \(r_{31}\)

  • r32 (float) – \(r_{32}\)

  • r33 (float) – \(r_{33}\)

\(\mathbf{R} = \left[ \begin{array}{ccc} r_{11} & r_{12} & r_{13} \\ r_{21} & r_{22} & r_{23} \\ r_{31} & r_{32} & r_{33} \end{array} \right]\)


Overload 2:

Constructs an initialized 3x3 rotation matrix \(\robabx{a}{b}{\mathbf{R}} =\left[ \begin{array}{ccc} \robabx{a}{b}{\mathbf{i}} & \robabx{a}{b}{\mathbf{j}} & \robabx{a}{b}{\mathbf{k}} \end{array}\right]\)

Parameters
  • i (rw::math::Vector3D< float >) – \(\robabx{a}{b}{\mathbf{i}}\)

  • j (rw::math::Vector3D< float >) – \(\robabx{a}{b}{\mathbf{j}}\)

  • k (rw::math::Vector3D< float >) – \(\robabx{a}{b}{\mathbf{k}}\)


Overload 3:

constructor - where only the diagonal is set :type i: float :param i: [in] m(0,0) :type j: float :param j: [in] m(1,1) :type k: float :param k: [in] m(2,2)


Overload 4:

constructor - where only the diagonal is set :type i: float :param i: [in] m(0,0) :type j: float :param j: [in] m(1,1) :param k: [in] m(2,2)


Overload 5:

constructor - where only the diagonal is set :type i: float :param i: [in] m(0,0) :param j: [in] m(1,1) :param k: [in] m(2,2)


Overload 6:

constructor - where only the diagonal is set :param i: [in] m(0,0) :param j: [in] m(1,1) :param k: [in] m(2,2)


Overload 7:

Construct an internal matrix from a Eigen::MatrixBase It is the responsibility of the user that 3x3 matrix is indeed an inertia matrix.

e()

Returns reference to the internal 3x3 matrix

static makeCuboidInertia(mass, x, y, z)

calculates the inertia of a cuboid where the reference frame is in the center of the cuboid with :type mass: float :param mass: :type x: float :param x: :type y: float :param y: :type z: float :param z: :rtype: rw::math::InertiaMatrix< float > :return:

static makeHollowSphereInertia(mass, radi)

Make inertia matrix for a hollow sphere. :type mass: float :param mass: [in] mass of hollow sphere. :type radi: float :param radi: [in] radius of sphere. :rtype: rw::math::InertiaMatrix< float > :return: the inertia matrix.

static makeSolidSphereInertia(mass, radi)

Make inertia matrix for a solid sphere. :type mass: float :param mass: [in] mass of solid sphere. :type radi: float :param radi: [in] radius of sphere. :rtype: rw::math::InertiaMatrix< float > :return: the inertia matrix.

property thisown

The membership flag

sdurw_math.InertiaMatrixf_makeCuboidInertia(mass, x, y, z)

calculates the inertia of a cuboid where the reference frame is in the center of the cuboid with :type mass: float :param mass: :type x: float :param x: :type y: float :param y: :type z: float :param z: :rtype: rw::math::InertiaMatrix< float > :return:

sdurw_math.InertiaMatrixf_makeHollowSphereInertia(mass, radi)

Make inertia matrix for a hollow sphere. :type mass: float :param mass: [in] mass of hollow sphere. :type radi: float :param radi: [in] radius of sphere. :rtype: rw::math::InertiaMatrix< float > :return: the inertia matrix.

sdurw_math.InertiaMatrixf_makeSolidSphereInertia(mass, radi)

Make inertia matrix for a solid sphere. :type mass: float :param mass: [in] mass of solid sphere. :type radi: float :param radi: [in] radius of sphere. :rtype: rw::math::InertiaMatrix< float > :return: the inertia matrix.

class sdurw_math.InfinityMetricQ

Bases: sdurw_math.MetricQ

Infinity norm distance metric for vector types.

InfinityMetric is a metric of the Euclidean n-Plane. The distance between two points \(P = (p_1, p_2, ..., p_n)\) and \(Q = (q_1, q_2, ..., q_n)\) is defined as \(max_i |p_i - q_i|\)

__init__()

Initialize self. See help(type(self)) for accurate signature.

property thisown

The membership flag

class sdurw_math.InfinityMetricVector2D

Bases: sdurw_math.MetricVector2D

Infinity norm distance metric for vector types.

InfinityMetric is a metric of the Euclidean n-Plane. The distance between two points \(P = (p_1, p_2, ..., p_n)\) and \(Q = (q_1, q_2, ..., q_n)\) is defined as \(max_i |p_i - q_i|\)

__init__()

Initialize self. See help(type(self)) for accurate signature.

property thisown

The membership flag

class sdurw_math.InfinityMetricVector3D

Bases: sdurw_math.MetricVector3D

Infinity norm distance metric for vector types.

InfinityMetric is a metric of the Euclidean n-Plane. The distance between two points \(P = (p_1, p_2, ..., p_n)\) and \(Q = (q_1, q_2, ..., q_n)\) is defined as \(max_i |p_i - q_i|\)

__init__()

Initialize self. See help(type(self)) for accurate signature.

property thisown

The membership flag

class sdurw_math.Jacobian(*args)

Bases: object

A Jacobian class. A jacobian with m rows and n columns.

An ordinary robot jacobian defined over the joints 0 to n with configuration q is expressed as a \(6\times n\) matrix:

\[\robabx{0}{n}{\bf{J}}(\bf{q}) = [ \robabx{0}{1}{\bf{J}}(\bf{q}), \robabx{1}{2}{\bf{J}}(\bf{q}),..., \robabx{n-1}{n}{\bf{J}}(\bf{q}) ]\]
__init__(*args)

Overload 1:

Creates an empty \(m\times n\) (uninitialized) Jacobian matrix

Parameters
  • m (int) – [in] number of rows

  • n (int) – [in] number of columns


Overload 2:

Default constructor


Overload 3:

Creates an empty \(6\times n\) (uninitialized) Jacobian matrix

Parameters

n (int) – [in] number of columns


Overload 4:

Creates the velocity transform jacobian \(\robabcdx{a}{b}{a}{b}{\bf{J_v}}\) for transforming both the reference frame and the velocity reference point from one frame b to another frame a

Parameters

aTb (rw::math::Transform3D< double >) – [in] \(\robabx{a}{b}{\bf{T}}\)

Returns

\(\robabcdx{a}{b}{a}{b}{\bf{J_v}}\)

\[\begin{split}\robabcdx{a}{b}{a}{b}{\bf{J_v}} = \left[ \begin{array}{cc} \robabx{a}{b}{\mathbf{R}} & S(\robabx{a}{b}{\mathbf{d}})\robabx{a}{b}{\mathbf{R}} \\ \mathbf{0}^{3x3} & \robabx{a}{b}{\mathbf{R}} \end{array} \right]\end{split}\]

Change the frame of reference from b to frame a and reference point from frame a to frame b: \(\robabx{a}{b}{\bf{J}} = \robabcdx{a}{b}{a}{b}{\bf{J}_v} \cdot \robabx{b}{a}{\bf{J}}\)


Overload 5:

Creates the velocity transform jacobian \(\robabcdx{a}{b}{i}{i}{\bf{J_v}}\) for transforming a velocity screw from one frame of reference b to another frame a

Parameters

aRb (rw::math::Rotation3D< double >) – [in] \(\robabx{a}{b}{\bf{R}}\)

Returns

\(\robabcdx{a}{b}{i}{i}{\bf{J}_v}\)

\[\begin{split}\robabcdx{a}{b}{i}{i}{\bf{J_v}} = \left[ \begin{array}{cc} \robabx{a}{b}{\mathbf{R}} & \mathbf{0}^{3x3} \\ \mathbf{0}^{3x3} & \robabx{a}{b}{\mathbf{R}} \end{array} \right]\end{split}\]

Change the frame of reference from b to frame a : \(\robabx{a}{c}{\bf{J}} = \robabcdx{a}{b}{c}{c}{\bf{J}_v} \cdot \robabx{b}{c}{\bf{J}}\)


Overload 6:

Creates the velocity transform jacobian \(\robabcdx{i}{i}{b}{a}{\bf{J}_v}\) for transforming the reference point of a velocity screw from one frame b to another frame a

Parameters

aPb (rw::math::Vector3D< double >) – [in] \(\robabx{a}{b}{\bf{P}}\)

Returns

\(\robabcdx{i}{i}{b}{a}{\bf{J}_v}\)

\[ \begin{align}\begin{aligned}\begin{split} \robabcdx{i}{i}{b}{a}{\bf{J}_v} = \left[ \begin{array}{cc} \bf{I}^{3x3} & S(\robabx{a}{b}{\bf{P}}) \\ \bf{0}^{3x3} & \bf{I}^{3x3} \end{array} \right]\end{split}\\transforming the reference point of a Jacobian from\end{aligned}\end{align} \]

frame c to frame d : \(\robabx{a}{d}{\mathbf{J}} = \robabcdx{a}{a}{c}{d}{\mathbf{J_v}} \cdot\robabx{a}{c}{\mathbf{J}}\)

addPosition(part, row, col)

add position jacobian to a specific row and column in this jacobian :type part: rw::math::Vector3D< double > :param part: :type row: int :param row: :type col: int :param col:

addRotation(part, row, col)

add rotation jacobian to a specific row and column in this jacobian :type part: rw::math::Vector3D< double > :param part: :type row: int :param row: :type col: int :param col:

e()

Accessor for the internal Eigen matrix state.

elem(row, col)

Get an element of the jacobian. :type row: int :param row: [in] the row. :type col: int :param col: [in] the column. :rtype: float :return: reference to the element.

size1()

The number of rows.

size2()

The number of columns.

property thisown

The membership flag

static zero(size1, size2)

Construct zero initialized Jacobian. :type size1: int :param size1: [in] number of rows. :type size2: int :param size2: [in] number of columns. :rtype: Jacobian :return: zero-initialized jacobian.

sdurw_math.Jacobian_zero(size1, size2)

Construct zero initialized Jacobian. :type size1: int :param size1: [in] number of rows. :type size2: int :param size2: [in] number of columns. :rtype: Jacobian :return: zero-initialized jacobian.

class sdurw_math.Line2D(*args)

Bases: object

Describes a line segment in 2D.

COINCIDENT = 1

Two lines are parallel and coinciding

INTERSECTS = 2

Two lines intersects at one point

PARALLEL = 0

Two lines are parallel

__init__(*args)

Overload 1:

Constructor


Overload 2:

Creates a line between that intersect the two points p1 and p2. :type p1: rw::math::Vector2D< double > :param p1: [in] point :type p2: rw::math::Vector2D< double > :param p2: [in] point


Overload 3:

Creates a line between that intersect the two points (x1,y1) and (x2,y2). :type x1: float :param x1: [in] x coordinate of point 1 :type y1: float :param y1: [in] y coordinate of point 1 :type x2: float :param x2: [in] x coordinate of point 2 :type y2: float :param y2: [in] y coordinate of point 2

calcAngle(*args)

Overload 1:

calculates the angle between this line and line :type line: Line2D :param line: [in] a line :rtype: float :return: the angle from this line to line


Overload 2:

calculates the angle between the projection of this line onto yz-plane and the x-axis :rtype: float :return: the angle

calcDist(v)

calculates the shortest distance between point v and the infinite line. :type v: rw::math::Vector2D< double > :param v: [in] Point to which to calculate distance

calcUnitNormal()

calculates the unit normal of the line

getIntersect(line, res)

calculates the intersection between two lines. A intersection point is only saved in res if the two lines are not parallel or coincident. The intersection test does not take the segments into acount. :type line: Line2D :param line: [in] the line two test against :type res: rw::math::Vector2D< double > :param res: [out] the point of intersection :rtype: int :return: the intersection type

getLength()

gets the length of thi line segment. :rtype: float :return: line segment length

p1()

first point on the line

p2()

second point on the line

property thisown

The membership flag

class sdurw_math.Line2DPolar(*args)

Bases: object

Describes a line in 2D in polar coordinates.

__init__(*args)

Overload 1:

constructor

rho * (cos(theta), sin(theta)) is the point on the line nearest to origo.

Parameters
  • rho (float) – [in] distance to the point on line which is closest to origo

  • theta (float) – [in] angle from x-axis up to the line that connects the origo and the point on the line that is closest to origo.


Overload 2:

constructor

Parameters
  • pnt (rw::math::Vector2D< double >) – [in] is any point on the line

  • theta (float) – [in] angle in radians from x-axis up to the line that connects the origo and the point on the line that is closest to origo.


Overload 3:

constructor - The line moving through the segment from ‘start’ to ‘end’. :type start: rw::math::Vector2D< double > :param start: [in] point on line :type end: rw::math::Vector2D< double > :param end: [in] point on line


Overload 4:

constructor - The line moving through the line segment. :type line: Line2D :param line: [in] the line described as a segment

calcNormal()

get normal of line

dist2(pnt)

The L_2 distance from ‘pnt’ to the line.

getRho()

the shortest distance from origo the line :rtype: float :return:

getTheta()

angle in radians from x-axis up to the line that connects the origo and the point on the line that is closest to origo. :rtype: float :return:

static linePoint(line)

A supporting point on the line (equal to rho * normal).

static lineToLocal(pose, line)

line given relative to the coordinate frame of pose. :type pose: rw::math::Pose2D< double > :param pose: [in] the pose. :type line: Line2DPolar :param line: [in] the line. :rtype: Line2DPolar :return: a Line2DPolar.

static normalProjectionVector(line, pnt)

The vector for the projection of pnt onto the normal of line. :type line: Line2DPolar :param line: [in] a line. :type pnt: rw::math::Vector2D< double > :param pnt: [in] a point. :rtype: rw::math::Vector2D< double > :return: the projection vector.

static projectionPoint(line, pnt)

The point for the projection of ‘pnt’ onto ‘line’.

property thisown

The membership flag

sdurw_math.Line2DPolar_linePoint(line)

A supporting point on the line (equal to rho * normal).

sdurw_math.Line2DPolar_lineToLocal(pose, line)

line given relative to the coordinate frame of pose. :type pose: rw::math::Pose2D< double > :param pose: [in] the pose. :type line: Line2DPolar :param line: [in] the line. :rtype: Line2DPolar :return: a Line2DPolar.

sdurw_math.Line2DPolar_normalProjectionVector(line, pnt)

The vector for the projection of pnt onto the normal of line. :type line: Line2DPolar :param line: [in] a line. :type pnt: rw::math::Vector2D< double > :param pnt: [in] a point. :rtype: rw::math::Vector2D< double > :return: the projection vector.

sdurw_math.Line2DPolar_projectionPoint(line, pnt)

The point for the projection of ‘pnt’ onto ‘line’.

class sdurw_math.LinearAlgebra

Bases: object

Collection of Linear Algebra functions

__init__()

Initialize self. See help(type(self)) for accurate signature.

static checkPenroseConditions(A, X, prec)

Checks the penrose conditions :type A: Eigen::Matrix< double,-1,-1 > :param A: [in] a matrix :type X: Eigen::Matrix< double,-1,-1 > :param X: [in] a pseudoinverse of A :type prec: float :param prec: [in] the tolerance

Return type

boolean

Returns

true if the pseudoinverse X of A fullfills the penrose conditions, false otherwise

Checks the penrose conditions:

\(AXA = A\)

\(XAX = X\)

\((AX)^T = AX\)

\((XA)^T = XA\)

static pseudoInverse(am, precision=1e-06)

Calculates the moore-penrose (pseudo) inverse of a matrix \(\mathbf{M}^+\)

Parameters
  • am (Eigen::Matrix< double,-1,-1 >) – [in] the matrix \(\mathbf{M}\) to be inverted

  • precision (float) – [in] the precision to use, values below this treshold are considered singular

Return type

Eigen::Matrix< double,-1,-1 >

Returns

the pseudo-inverse \(\mathbf{M}^+\) of \(\mathbf{M}\)

\(\mathbf{M}^+=\mathbf{V}\mathbf{\Sigma} ^+\mathbf{U}^T\) where \(\mathbf{V}\), \(\mathbf{\Sigma}\) and \(\mathbf{U}\) are optained using Singular Value Decomposition (SVD)

static svd(M, U, sigma, V)

Performs a singular value decomposition (SVD)

The SVD computes the decomposition \(\mathbf{M}=\mathbf{U}*\mathbf{DiagonalMatrix(\sigma)}*\mathbf{V}^T\) .

Parameters
  • M (Eigen::Matrix< double,-1,-1 >) – [in] the matrix to decomposite

  • U (Eigen::Matrix< double,-1,-1 >) – [out] Result matrix \(\mathbf{U}\)

  • sigma (Eigen::Matrix< double,-1,1 >) – [out] The \(\mathbf{sigma}\) vector with diagonal elements

  • V (Eigen::Matrix< double,-1,-1 >) – [out] Result matrix \(\mathbf{V}\)

property thisown

The membership flag

sdurw_math.LinearAlgebra_checkPenroseConditions(A, X, prec)

Checks the penrose conditions :type A: Eigen::Matrix< double,-1,-1 > :param A: [in] a matrix :type X: Eigen::Matrix< double,-1,-1 > :param X: [in] a pseudoinverse of A :type prec: float :param prec: [in] the tolerance

Return type

boolean

Returns

true if the pseudoinverse X of A fullfills the penrose conditions, false otherwise

Checks the penrose conditions:

\(AXA = A\)

\(XAX = X\)

\((AX)^T = AX\)

\((XA)^T = XA\)

sdurw_math.LinearAlgebra_pseudoInverse(am, precision=1e-06)

Calculates the moore-penrose (pseudo) inverse of a matrix \(\mathbf{M}^+\)

Parameters
  • am (Eigen::Matrix< double,-1,-1 >) – [in] the matrix \(\mathbf{M}\) to be inverted

  • precision (float) – [in] the precision to use, values below this treshold are considered singular

Return type

Eigen::Matrix< double,-1,-1 >

Returns

the pseudo-inverse \(\mathbf{M}^+\) of \(\mathbf{M}\)

\(\mathbf{M}^+=\mathbf{V}\mathbf{\Sigma} ^+\mathbf{U}^T\) where \(\mathbf{V}\), \(\mathbf{\Sigma}\) and \(\mathbf{U}\) are optained using Singular Value Decomposition (SVD)

sdurw_math.LinearAlgebra_svd(M, U, sigma, V)

Performs a singular value decomposition (SVD)

The SVD computes the decomposition \(\mathbf{M}=\mathbf{U}*\mathbf{DiagonalMatrix(\sigma)}*\mathbf{V}^T\) .

Parameters
  • M (Eigen::Matrix< double,-1,-1 >) – [in] the matrix to decomposite

  • U (Eigen::Matrix< double,-1,-1 >) – [out] Result matrix \(\mathbf{U}\)

  • sigma (Eigen::Matrix< double,-1,1 >) – [out] The \(\mathbf{sigma}\) vector with diagonal elements

  • V (Eigen::Matrix< double,-1,-1 >) – [out] Result matrix \(\mathbf{V}\)

class sdurw_math.ManhattanMetricVector2D

Bases: sdurw_math.MetricVector2D

Manhattan distance metric for vector types.

The ManhattanMetric, also known as the taxicab metric or the 1-norm, is a metric on the Euclidean n-Plane. The Manhattan distance between two points

\(P = (p_1, p_2, ..., p_n)\) and \(Q = (q_1, q_2, ..., q_n)\) is defined as \(\sum_{i=1}^{n} |p_i - q_i|\)

__init__()

Initialize self. See help(type(self)) for accurate signature.

property thisown

The membership flag

class sdurw_math.ManhattanMetricVector3D

Bases: sdurw_math.MetricVector3D

Manhattan distance metric for vector types.

The ManhattanMetric, also known as the taxicab metric or the 1-norm, is a metric on the Euclidean n-Plane. The Manhattan distance between two points

\(P = (p_1, p_2, ..., p_n)\) and \(Q = (q_1, q_2, ..., q_n)\) is defined as \(\sum_{i=1}^{n} |p_i - q_i|\)

__init__()

Initialize self. See help(type(self)) for accurate signature.

property thisown

The membership flag

class sdurw_math.ManhattenMatricQ

Bases: sdurw_math.MetricQ

Manhattan distance metric for vector types.

The ManhattanMetric, also known as the taxicab metric or the 1-norm, is a metric on the Euclidean n-Plane. The Manhattan distance between two points

\(P = (p_1, p_2, ..., p_n)\) and \(Q = (q_1, q_2, ..., q_n)\) is defined as \(\sum_{i=1}^{n} |p_i - q_i|\)

__init__()

Initialize self. See help(type(self)) for accurate signature.

property thisown

The membership flag

class sdurw_math.Math(*args, **kwargs)

Bases: object

Utility functions for the rw::math module.

static NaN()

Get a value for NaN.

Use to make sure code is independent of specific compile specific implementations

Return type

float

Returns

a double representation of NaN.

__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

static abs(v)

Returns vector with the absolute values

Given a vector \(v=[v_1,v_2,\ldots,v_n]\) then Abs(v) is defined as \(Abs(v)=[abs(v_1),abs(v_i),\ldots,abs(v_n)]\)

Parameters

v (Q) – [in] the vector \(v\)

Return type

Q

Returns

the vector \(Abs(v)\)

static ceilLog2(n)

Exact implementation of ceil(log_2(n)) for n > 0.

static clamp(*args)

Overload 1:

clamp val to either min or max

Parameters
  • val (float) – [in] the value that is to be clamped

  • min (float) – [in] the minimum allowed value

  • max (float) – [in] the maximum allowed value

Return type

float

Returns

the clamped value of val


Overload 2:

Clamps values of q with min and max

Parameters
  • q (rw::math::Vector3D< double >) – [in] Values to clamp

  • min (rw::math::Vector3D< double >) – [min] The minimum value

  • max (rw::math::Vector3D< double >) – [min] The maximum value

Return type

rw::math::Vector3D< double >

Returns

The clamped values

static clampQ(*args)

Overload 1:

Clamps values of q with min and max

Parameters
  • q (Q) – [in] Values to clamp

  • min (Q) – [min] The minimum value

  • max (Q) – [min] The maximum value

Return type

Q

Returns

The clamped values


Overload 2:

Clamps values of q with bounds.first and bounds.second

Parameters
  • q (Q) – [in] Values to clamp

  • bounds (std::pair< rw::math::Q,rw::math::Q >) – [min] The pair containing minimum and maximum values as first and second element

Return type

Q

Returns

The clamped values

static factorial(n)

Factorial The method does not implement any safe guards for negative numbers of overflow of numbers.

static isNaN(d)

Implements an isNaN function

Use to make sure code is independent of specific compile specific implementations

static max(v)

Returns the largest element of v

If the vector has zero length, the method returns 0

Parameters

v (Q) – [in] the vector v

Return type

float

Returns

the largest element

static min(v)

Returns the smallest element of v

If the vector has zero length, the method returns 0

Parameters

v (Q) – [in] the vector v

Return type

float

Returns

the smallest element

static ran(*args)

Overload 1:

A random double in the range [0, 1[ using a uniform distribution.

Notes: Uses boost::random


Overload 2:

A random double in the range [from, to[ using a uniform distribution.

Notes: Uses boost::random

static ranDir(dim, length=1)

Returns a random direction in dim dimensions using the standard normal distribution.

The length of the vector is given by length;

Parameters
  • dim (int) – [in] Number of dimensions

  • length (float) – [in] Length of return vector. Default is 1;

Return type

Q

Returns

Random direction

Warning: Please see the warning for Math::ranNormalDist

static ranI(_from, to)

A random integer in the range [from, to[ using a uniform distribution.

Notes: Uses boost::random

static ranNormalDist(mean, sigma)

Returns a random sample around mean with standard deviation sigma using the normal distribution.

Notes: Uses boost::random Warning: The number sequence generated can vary in different Boost versions (there is a known change in Boost 1.56.0).

Parameters
  • mean (float) – [in] Means value

  • sigma (float) – [in] Standard deviation

Return type

float

Returns

Random sample

static ranQ(*args)

Overload 1:

Returns a random Q between with values in the range [from, to[ using a uniform distribution.

Notes: Uses boost::random

Parameters
  • from (Q) – [in] The lower bound

  • to (Q) – [in] The upper bound

Return type

Q

Returns

Random Q


Overload 2:

Returns a random Q between with values in the range [bounds.first, bounds.second[ using a uniform distribution.

Notes: Uses boost::random

Parameters

bounds (std::pair< rw::math::Q,rw::math::Q >) – [in] The lower and upper bounds

Return type

Q

Returns

Random Q

static ranWeightedDir(dim, weights, length=1)

Returns a weighted random direction in dim dimensions using the standard normal distribution.

The length of the vector is given by length;

Parameters
  • dim (int) – [in] Number of dimensions

  • weights (Q) – [in] Weights to use

  • length (float) – [in] Length of return vector when weights are applied as weighted Euclidean metric. Default is 1;

Return type

Q

Returns

Random weigthed direction

Warning: Please see the warning for Math::ranNormalDist

static round(d)

Rounds off to nearest integer

With some compilers round can be found in math.h. This however does not appear to be ansi C/C++ standard

Parameters

d (float) – [in] number to round

Return type

float

Returns

d rounded to nearest integer.

static seed(*args)

Overload 1:

Seeds the random number generator.

Notes: Uses boost::random


Overload 2:

Seeds the random number generator with current time of day

Notes: Uses boost::random

static sign(*args)

Overload 1:

Returns the sign of s

If s < 0 it return 0. If s >= 0 then 1 is returned.

Parameters

s (float) – [in] The value for which to return the sign

Return type

float

Returns

The sign


Overload 2:

Returns the sign of each element

For each element either -1 or 1 is returned depending on the sign. If q(i) equals 0 the method returns 1

Parameters

q (Q) – [in] Vector for which to get the signs

Return type

Q

Returns

Vector of sign values

static sqr(q)

The squares of the elements of q.

static sqrt(q)

The square roots of the elements of q.

property thisown

The membership flag

sdurw_math.Math_NaN()

Get a value for NaN.

Use to make sure code is independent of specific compile specific implementations

Return type

float

Returns

a double representation of NaN.

sdurw_math.Math_abs(v)

Returns vector with the absolute values

Given a vector \(v=[v_1,v_2,\ldots,v_n]\) then Abs(v) is defined as \(Abs(v)=[abs(v_1),abs(v_i),\ldots,abs(v_n)]\)

Parameters

v (Q) – [in] the vector \(v\)

Return type

Q

Returns

the vector \(Abs(v)\)

sdurw_math.Math_ceilLog2(n)

Exact implementation of ceil(log_2(n)) for n > 0.

sdurw_math.Math_clamp(*args)

Overload 1:

clamp val to either min or max

Parameters
  • val (float) – [in] the value that is to be clamped

  • min (float) – [in] the minimum allowed value

  • max (float) – [in] the maximum allowed value

Return type

float

Returns

the clamped value of val


Overload 2:

Clamps values of q with min and max

Parameters
  • q (rw::math::Vector3D< double >) – [in] Values to clamp

  • min (rw::math::Vector3D< double >) – [min] The minimum value

  • max (rw::math::Vector3D< double >) – [min] The maximum value

Return type

rw::math::Vector3D< double >

Returns

The clamped values

sdurw_math.Math_clampQ(*args)

Overload 1:

Clamps values of q with min and max

Parameters
  • q (Q) – [in] Values to clamp

  • min (Q) – [min] The minimum value

  • max (Q) – [min] The maximum value

Return type

Q

Returns

The clamped values


Overload 2:

Clamps values of q with bounds.first and bounds.second

Parameters
  • q (Q) – [in] Values to clamp

  • bounds (std::pair< rw::math::Q,rw::math::Q >) – [min] The pair containing minimum and maximum values as first and second element

Return type

Q

Returns

The clamped values

sdurw_math.Math_factorial(n)

Factorial The method does not implement any safe guards for negative numbers of overflow of numbers.

sdurw_math.Math_isNaN(d)

Implements an isNaN function

Use to make sure code is independent of specific compile specific implementations

sdurw_math.Math_max(v)

Returns the largest element of v

If the vector has zero length, the method returns 0

Parameters

v (Q) – [in] the vector v

Return type

float

Returns

the largest element

sdurw_math.Math_min(v)

Returns the smallest element of v

If the vector has zero length, the method returns 0

Parameters

v (Q) – [in] the vector v

Return type

float

Returns

the smallest element

sdurw_math.Math_ran(*args)

Overload 1:

A random double in the range [0, 1[ using a uniform distribution.

Notes: Uses boost::random


Overload 2:

A random double in the range [from, to[ using a uniform distribution.

Notes: Uses boost::random

sdurw_math.Math_ranDir(dim, length=1)

Returns a random direction in dim dimensions using the standard normal distribution.

The length of the vector is given by length;

Parameters
  • dim (int) – [in] Number of dimensions

  • length (float) – [in] Length of return vector. Default is 1;

Return type

Q

Returns

Random direction

Warning: Please see the warning for Math::ranNormalDist

sdurw_math.Math_ranI(_from, to)

A random integer in the range [from, to[ using a uniform distribution.

Notes: Uses boost::random

sdurw_math.Math_ranNormalDist(mean, sigma)

Returns a random sample around mean with standard deviation sigma using the normal distribution.

Notes: Uses boost::random Warning: The number sequence generated can vary in different Boost versions (there is a known change in Boost 1.56.0).

Parameters
  • mean (float) – [in] Means value

  • sigma (float) – [in] Standard deviation

Return type

float

Returns

Random sample

sdurw_math.Math_ranQ(*args)

Overload 1:

Returns a random Q between with values in the range [from, to[ using a uniform distribution.

Notes: Uses boost::random

Parameters
  • from (Q) – [in] The lower bound

  • to (Q) – [in] The upper bound

Return type

Q

Returns

Random Q


Overload 2:

Returns a random Q between with values in the range [bounds.first, bounds.second[ using a uniform distribution.

Notes: Uses boost::random

Parameters

bounds (std::pair< rw::math::Q,rw::math::Q >) – [in] The lower and upper bounds

Return type

Q

Returns

Random Q

sdurw_math.Math_ranWeightedDir(dim, weights, length=1)

Returns a weighted random direction in dim dimensions using the standard normal distribution.

The length of the vector is given by length;

Parameters
  • dim (int) – [in] Number of dimensions

  • weights (Q) – [in] Weights to use

  • length (float) – [in] Length of return vector when weights are applied as weighted Euclidean metric. Default is 1;

Return type

Q

Returns

Random weigthed direction

Warning: Please see the warning for Math::ranNormalDist

sdurw_math.Math_round(d)

Rounds off to nearest integer

With some compilers round can be found in math.h. This however does not appear to be ansi C/C++ standard

Parameters

d (float) – [in] number to round

Return type

float

Returns

d rounded to nearest integer.

sdurw_math.Math_seed(*args)

Overload 1:

Seeds the random number generator.

Notes: Uses boost::random


Overload 2:

Seeds the random number generator with current time of day

Notes: Uses boost::random

sdurw_math.Math_sign(*args)

Overload 1:

Returns the sign of s

If s < 0 it return 0. If s >= 0 then 1 is returned.

Parameters

s (float) – [in] The value for which to return the sign

Return type

float

Returns

The sign


Overload 2:

Returns the sign of each element

For each element either -1 or 1 is returned depending on the sign. If q(i) equals 0 the method returns 1

Parameters

q (Q) – [in] Vector for which to get the signs

Return type

Q

Returns

Vector of sign values

sdurw_math.Math_sqr(q)

The squares of the elements of q.

sdurw_math.Math_sqrt(q)

The square roots of the elements of q.

class sdurw_math.MetricFactory(*args, **kwargs)

Bases: object

Metric constructor functions.

The constructor functions are parameterized by a type of vector. Valid vector types include:

  • Q

  • Vector2D<double>

  • Vector3D<double>

  • std::vector<double>

  • Eigen::VectorXd

__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

static makeEuclideanQ()

Euclidean configuration metric.

See class EuclideanMetric for details.

static makeInfinityQ()

Infinity configuration metric.

See class InfinityMetric for details.

static makeManhattanQ()

Manhattan configuration metric.

See class ManhattanMetric for details.

static makeRotation3DMetric()

Metric computing distance between two rotations.

The metric is defined as the angle of the rw::math::EAA of the rotation.

static makeTransform3DMetric(linWeight, angWeight)

Metric computing distance between two transformations

The metric is defined as a weighted sum of the positional distance and the angle of the rw::math::EAA of the rotation.

Parameters
  • linWeight (float) – [in] Positional weight.

  • angWeight (float) – [in] Angular weight.

static makeWeightedEuclideanQ(weights)

Weighted Euclidean configuration metric.

See class WeightedEuclideanMetric for details.

Parameters

weights (Q) – [in] Weights for the metric.

Return type

rw::math::Metric< rw::math::Q >::Ptr

Returns

Weighted Euclidean metric.

static makeWeightedInfinityQ(weights)

Weighted infinity configuration metric.

See class WeightedInfinity for details.

Parameters

weights (Q) – [in] Weights for the metric.

Return type

rw::math::Metric< rw::math::Q >::Ptr

Returns

Weighted infinity metric.

static makeWeightedManhattanQ(weights)

WeightedManhattan configuration metric.

See class WeightedManhattanMetric for details.

property thisown

The membership flag

sdurw_math.MetricFactory_makeEuclideanQ()

Euclidean configuration metric.

See class EuclideanMetric for details.

sdurw_math.MetricFactory_makeInfinityQ()

Infinity configuration metric.

See class InfinityMetric for details.

sdurw_math.MetricFactory_makeManhattanQ()

Manhattan configuration metric.

See class ManhattanMetric for details.

sdurw_math.MetricFactory_makeRotation3DMetric()

Metric computing distance between two rotations.

The metric is defined as the angle of the rw::math::EAA of the rotation.

sdurw_math.MetricFactory_makeTransform3DMetric(linWeight, angWeight)

Metric computing distance between two transformations

The metric is defined as a weighted sum of the positional distance and the angle of the rw::math::EAA of the rotation.

Parameters
  • linWeight (float) – [in] Positional weight.

  • angWeight (float) – [in] Angular weight.

sdurw_math.MetricFactory_makeWeightedEuclideanQ(weights)

Weighted Euclidean configuration metric.

See class WeightedEuclideanMetric for details.

Parameters

weights (Q) – [in] Weights for the metric.

Return type

rw::math::Metric< rw::math::Q >::Ptr

Returns

Weighted Euclidean metric.

sdurw_math.MetricFactory_makeWeightedInfinityQ(weights)

Weighted infinity configuration metric.

See class WeightedInfinity for details.

Parameters

weights (Q) – [in] Weights for the metric.

Return type

rw::math::Metric< rw::math::Q >::Ptr

Returns

Weighted infinity metric.

sdurw_math.MetricFactory_makeWeightedManhattanQ(weights)

WeightedManhattan configuration metric.

See class WeightedManhattanMetric for details.

class sdurw_math.MetricQ(*args, **kwargs)

Bases: object

Template interface for metrics on type T.

A metric is a function that defines a scalar distance between elements.

__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

distance(*args)

Overload 1:

The distance from the zero element to q


Overload 2:

The distance from element a to b.

Parameters
  • a (rw::math::Metric< rw::math::Q >::value_type) – [in] first element

  • b (rw::math::Metric< rw::math::Q >::value_type) – [in] second element

Return type

float

Returns

the distance

size()

The dimension of elements on which this metric operates.

The returns -1 if the elements don’t have a measure of dimension or if the metric works for elements of all dimensions.

property thisown

The membership flag

class sdurw_math.MetricQCPtr(*args)

Bases: object

Ptr stores a pointer and optionally takes ownership of the value.

__init__(*args)

Overload 1:

Default constructor yielding a NULL-pointer.


Overload 2:

Do not take ownership of ptr.

ptr can be null.

The constructor is implicit on purpose.

deref()

The pointer stored in the object.

distance(*args)

Overload 1:

The distance from the zero element to q


Overload 2:

The distance from element a to b.

Parameters
  • a (rw::math::Metric< rw::math::Q >::value_type) – [in] first element

  • b (rw::math::Metric< rw::math::Q >::value_type) – [in] second element

Return type

float

Returns

the distance

getDeref()

Member access operator.

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.

size()

The dimension of elements on which this metric operates.

The returns -1 if the elements don’t have a measure of dimension or if the metric works for elements of all dimensions.

property thisown

The membership flag

class sdurw_math.MetricQPtr(*args)

Bases: object

Ptr stores a pointer and optionally takes ownership of the value.

__init__(*args)

Overload 1:

Default constructor yielding a NULL-pointer.


Overload 2:

Do not take ownership of ptr.

ptr can be null.

The constructor is implicit on purpose.

cptr()
deref()

The pointer stored in the object.

distance(*args)

Overload 1:

The distance from the zero element to q


Overload 2:

The distance from element a to b.

Parameters
  • a (rw::math::Metric< rw::math::Q >::value_type) – [in] first element

  • b (rw::math::Metric< rw::math::Q >::value_type) – [in] second element

Return type

float

Returns

the distance

getDeref()

Member access operator.

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.

size()

The dimension of elements on which this metric operates.

The returns -1 if the elements don’t have a measure of dimension or if the metric works for elements of all dimensions.

property thisown

The membership flag

class sdurw_math.MetricRotation3D(*args, **kwargs)

Bases: object

Template interface for metrics on type T.

A metric is a function that defines a scalar distance between elements.

__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

distance(*args)

Overload 1:

The distance from the zero element to q


Overload 2:

The distance from element a to b.

Parameters
  • a (rw::math::Metric< rw::math::Rotation3D< double > >::value_type) – [in] first element

  • b (rw::math::Metric< rw::math::Rotation3D< double > >::value_type) – [in] second element

Return type

float

Returns

the distance

size()

The dimension of elements on which this metric operates.

The returns -1 if the elements don’t have a measure of dimension or if the metric works for elements of all dimensions.

property thisown

The membership flag

class sdurw_math.MetricRotation3DCPtr(*args)

Bases: object

Ptr stores a pointer and optionally takes ownership of the value.

__init__(*args)

Overload 1:

Default constructor yielding a NULL-pointer.


Overload 2:

Do not take ownership of ptr.

ptr can be null.

The constructor is implicit on purpose.

deref()

The pointer stored in the object.

distance(*args)

Overload 1:

The distance from the zero element to q


Overload 2:

The distance from element a to b.

Parameters
  • a (rw::math::Metric< rw::math::Rotation3D< double > >::value_type) – [in] first element

  • b (rw::math::Metric< rw::math::Rotation3D< double > >::value_type) – [in] second element

Return type

float

Returns

the distance

getDeref()

Member access operator.

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.

size()

The dimension of elements on which this metric operates.

The returns -1 if the elements don’t have a measure of dimension or if the metric works for elements of all dimensions.

property thisown

The membership flag

class sdurw_math.MetricRotation3DPtr(*args)

Bases: object

Ptr stores a pointer and optionally takes ownership of the value.

__init__(*args)

Overload 1:

Default constructor yielding a NULL-pointer.


Overload 2:

Do not take ownership of ptr.

ptr can be null.

The constructor is implicit on purpose.

cptr()
deref()

The pointer stored in the object.

distance(*args)

Overload 1:

The distance from the zero element to q


Overload 2:

The distance from element a to b.

Parameters
  • a (rw::math::Metric< rw::math::Rotation3D< double > >::value_type) – [in] first element

  • b (rw::math::Metric< rw::math::Rotation3D< double > >::value_type) – [in] second element

Return type

float

Returns

the distance

getDeref()

Member access operator.

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.

size()

The dimension of elements on which this metric operates.

The returns -1 if the elements don’t have a measure of dimension or if the metric works for elements of all dimensions.

property thisown

The membership flag

class sdurw_math.MetricTransform3D(*args, **kwargs)

Bases: object

Template interface for metrics on type T.

A metric is a function that defines a scalar distance between elements.

__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

distance(*args)

Overload 1:

The distance from the zero element to q


Overload 2:

The distance from element a to b.

Parameters
  • a (rw::math::Metric< rw::math::Transform3D< double > >::value_type) – [in] first element

  • b (rw::math::Metric< rw::math::Transform3D< double > >::value_type) – [in] second element

Return type

float

Returns

the distance

size()

The dimension of elements on which this metric operates.

The returns -1 if the elements don’t have a measure of dimension or if the metric works for elements of all dimensions.

property thisown

The membership flag

class sdurw_math.MetricTransform3DCPtr(*args)

Bases: object

Ptr stores a pointer and optionally takes ownership of the value.

__init__(*args)

Overload 1:

Default constructor yielding a NULL-pointer.


Overload 2:

Do not take ownership of ptr.

ptr can be null.

The constructor is implicit on purpose.

deref()

The pointer stored in the object.

distance(*args)

Overload 1:

The distance from the zero element to q


Overload 2:

The distance from element a to b.

Parameters
  • a (rw::math::Metric< rw::math::Transform3D< double > >::value_type) – [in] first element

  • b (rw::math::Metric< rw::math::Transform3D< double > >::value_type) – [in] second element

Return type

float

Returns

the distance

getDeref()

Member access operator.

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.

size()

The dimension of elements on which this metric operates.

The returns -1 if the elements don’t have a measure of dimension or if the metric works for elements of all dimensions.

property thisown

The membership flag

class sdurw_math.MetricTransform3DPtr(*args)

Bases: object

Ptr stores a pointer and optionally takes ownership of the value.

__init__(*args)

Overload 1:

Default constructor yielding a NULL-pointer.


Overload 2:

Do not take ownership of ptr.

ptr can be null.

The constructor is implicit on purpose.

cptr()
deref()

The pointer stored in the object.

distance(*args)

Overload 1:

The distance from the zero element to q


Overload 2:

The distance from element a to b.

Parameters
  • a (rw::math::Metric< rw::math::Transform3D< double > >::value_type) – [in] first element

  • b (rw::math::Metric< rw::math::Transform3D< double > >::value_type) – [in] second element

Return type

float

Returns

the distance

getDeref()

Member access operator.

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.

size()

The dimension of elements on which this metric operates.

The returns -1 if the elements don’t have a measure of dimension or if the metric works for elements of all dimensions.

property thisown

The membership flag

class sdurw_math.MetricUtil

Bases: object

Various metrics and other distance measures.

__init__()

Initialize self. See help(type(self)) for accurate signature.

property thisown

The membership flag

class sdurw_math.MetricVector2D(*args, **kwargs)

Bases: object

Template interface for metrics on type T.

A metric is a function that defines a scalar distance between elements.

__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

distance(*args)

Overload 1:

The distance from the zero element to q


Overload 2:

The distance from element a to b.

Parameters
  • a (rw::math::Metric< rw::math::Vector2D< double > >::value_type) – [in] first element

  • b (rw::math::Metric< rw::math::Vector2D< double > >::value_type) – [in] second element

Return type

float

Returns

the distance

size()

The dimension of elements on which this metric operates.

The returns -1 if the elements don’t have a measure of dimension or if the metric works for elements of all dimensions.

property thisown

The membership flag

class sdurw_math.MetricVector2DCPtr(*args)

Bases: object

Ptr stores a pointer and optionally takes ownership of the value.

__init__(*args)

Overload 1:

Default constructor yielding a NULL-pointer.


Overload 2:

Do not take ownership of ptr.

ptr can be null.

The constructor is implicit on purpose.

deref()

The pointer stored in the object.

distance(*args)

Overload 1:

The distance from the zero element to q


Overload 2:

The distance from element a to b.

Parameters
  • a (rw::math::Metric< rw::math::Vector2D< double > >::value_type) – [in] first element

  • b (rw::math::Metric< rw::math::Vector2D< double > >::value_type) – [in] second element

Return type

float

Returns

the distance

getDeref()

Member access operator.

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.

size()

The dimension of elements on which this metric operates.

The returns -1 if the elements don’t have a measure of dimension or if the metric works for elements of all dimensions.

property thisown

The membership flag

class sdurw_math.MetricVector2DPtr(*args)

Bases: object

Ptr stores a pointer and optionally takes ownership of the value.

__init__(*args)

Overload 1:

Default constructor yielding a NULL-pointer.


Overload 2:

Do not take ownership of ptr.

ptr can be null.

The constructor is implicit on purpose.

cptr()
deref()

The pointer stored in the object.

distance(*args)

Overload 1:

The distance from the zero element to q


Overload 2:

The distance from element a to b.

Parameters
  • a (rw::math::Metric< rw::math::Vector2D< double > >::value_type) – [in] first element

  • b (rw::math::Metric< rw::math::Vector2D< double > >::value_type) – [in] second element

Return type

float

Returns

the distance

getDeref()

Member access operator.

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.

size()

The dimension of elements on which this metric operates.

The returns -1 if the elements don’t have a measure of dimension or if the metric works for elements of all dimensions.

property thisown

The membership flag

class sdurw_math.MetricVector3D(*args, **kwargs)

Bases: object

Template interface for metrics on type T.

A metric is a function that defines a scalar distance between elements.

__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

distance(*args)

Overload 1:

The distance from the zero element to q


Overload 2:

The distance from element a to b.

Parameters
  • a (rw::math::Metric< rw::math::Vector3D< double > >::value_type) – [in] first element

  • b (rw::math::Metric< rw::math::Vector3D< double > >::value_type) – [in] second element

Return type

float

Returns

the distance

size()

The dimension of elements on which this metric operates.

The returns -1 if the elements don’t have a measure of dimension or if the metric works for elements of all dimensions.

property thisown

The membership flag

class sdurw_math.MetricVector3DCPtr(*args)

Bases: object

Ptr stores a pointer and optionally takes ownership of the value.

__init__(*args)

Overload 1:

Default constructor yielding a NULL-pointer.


Overload 2:

Do not take ownership of ptr.

ptr can be null.

The constructor is implicit on purpose.

deref()

The pointer stored in the object.

distance(*args)

Overload 1:

The distance from the zero element to q


Overload 2:

The distance from element a to b.

Parameters
  • a (rw::math::Metric< rw::math::Vector3D< double > >::value_type) – [in] first element

  • b (rw::math::Metric< rw::math::Vector3D< double > >::value_type) – [in] second element

Return type

float

Returns

the distance

getDeref()

Member access operator.

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.

size()

The dimension of elements on which this metric operates.

The returns -1 if the elements don’t have a measure of dimension or if the metric works for elements of all dimensions.

property thisown

The membership flag

class sdurw_math.MetricVector3DPtr(*args)

Bases: object

Ptr stores a pointer and optionally takes ownership of the value.

__init__(*args)

Overload 1:

Default constructor yielding a NULL-pointer.


Overload 2:

Do not take ownership of ptr.

ptr can be null.

The constructor is implicit on purpose.

cptr()
deref()

The pointer stored in the object.

distance(*args)

Overload 1:

The distance from the zero element to q


Overload 2:

The distance from element a to b.

Parameters
  • a (rw::math::Metric< rw::math::Vector3D< double > >::value_type) – [in] first element

  • b (rw::math::Metric< rw::math::Vector3D< double > >::value_type) – [in] second element

Return type

float

Returns

the distance

getDeref()

Member access operator.

isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.

size()

The dimension of elements on which this metric operates.

The returns -1 if the elements don’t have a measure of dimension or if the metric works for elements of all dimensions.

property thisown

The membership flag

class sdurw_math.PairQ(*args)

Bases: object

__init__(*args)

Initialize self. See help(type(self)) for accurate signature.

property first
property second
property thisown

The membership flag

class sdurw_math.PerspectiveTransform2Dd(*args)

Bases: object

The PerspectiveTransform2D is a perspective transform in 2D.

The homographic transform can be used to map one arbitrary 2D quadrilateral into another.

__init__(*args)

Overload 1:

constructor


Overload 2:

constructor

calc3dVec(hT, v)

transform a 2d point into a 3d point with this perspective transform :type hT: rw::math::PerspectiveTransform2D< double > :param hT: :type v: rw::math::Vector2D< double > :param v: :rtype: rw::math::Vector3D< double > :return:

static calcTransform(pts1, pts2)

calculates a PerspectiveTransform2D that maps points from point set pts1 to point set pts2 :type pts1: std::vector< rw::math::Vector2D< double >,std::allocator< rw::math::Vector2D< double > > > :param pts1: [in] point set one :type pts2: std::vector< rw::math::Vector2D< double >,std::allocator< rw::math::Vector2D< double > > > :param pts2: [in] point set two

e()

Returns reference to the 3x3 matrix \(\mathbf{M}\in SO(3)\) that represents this rotation

Return type

Eigen::Matrix< double,3,3 >

Returns

\(\mathbf{M}\in SO(3)\)

inverse()

Returns the inverse of the PerspectiveTransform

property thisown

The membership flag

sdurw_math.PerspectiveTransform2Dd_calcTransform(pts1, pts2)

calculates a PerspectiveTransform2D that maps points from point set pts1 to point set pts2 :type pts1: std::vector< rw::math::Vector2D< double >,std::allocator< rw::math::Vector2D< double > > > :param pts1: [in] point set one :type pts2: std::vector< rw::math::Vector2D< double >,std::allocator< rw::math::Vector2D< double > > > :param pts2: [in] point set two

class sdurw_math.PerspectiveTransform2Df(*args)

Bases: object

The PerspectiveTransform2D is a perspective transform in 2D.

The homographic transform can be used to map one arbitrary 2D quadrilateral into another.

__init__(*args)

Overload 1:

constructor


Overload 2:

constructor

calc3dVec(hT, v)

transform a 2d point into a 3d point with this perspective transform :type hT: rw::math::PerspectiveTransform2D< float > :param hT: :type v: rw::math::Vector2D< float > :param v: :rtype: rw::math::Vector3D< float > :return:

static calcTransform(pts1, pts2)

calculates a PerspectiveTransform2D that maps points from point set pts1 to point set pts2 :type pts1: std::vector< rw::math::Vector2D< float >,std::allocator< rw::math::Vector2D< float > > > :param pts1: [in] point set one :type pts2: std::vector< rw::math::Vector2D< float >,std::allocator< rw::math::Vector2D< float > > > :param pts2: [in] point set two

e()

Returns reference to the 3x3 matrix \(\mathbf{M}\in SO(3)\) that represents this rotation

Return type

Eigen::Matrix< float,3,3 >

Returns

\(\mathbf{M}\in SO(3)\)

inverse()

Returns the inverse of the PerspectiveTransform

property thisown

The membership flag

sdurw_math.PerspectiveTransform2Df_calcTransform(pts1, pts2)

calculates a PerspectiveTransform2D that maps points from point set pts1 to point set pts2 :type pts1: std::vector< rw::math::Vector2D< float >,std::allocator< rw::math::Vector2D< float > > > :param pts1: [in] point set one :type pts2: std::vector< rw::math::Vector2D< float >,std::allocator< rw::math::Vector2D< float > > > :param pts2: [in] point set two

class sdurw_math.PolynomialNDEigenMatrix3dDouble(*args)

Bases: object

Representation of a polynomial that can have non-scalar coefficients (polynomial matrix).

Representation of a polynomial of the following form:

\(f(x) = C_n x^n + C_(n-1) x^(n-1) + C_2 x^2 + C_1 x + C_0\)

The polynomial is represented as a list of coefficients ordered from lowest-order term to highest-order term, \({c_0,c_1,...,c_n}\).

__init__(*args)

Overload 1:

Create polynomial with uninitialized coefficients. :type order: int :param order: [in] the order of the polynomial.


Overload 2:

Create polynomial from vector. :type coefficients: std::vector< Eigen::Matrix< double,3,3 >,std::allocator< Eigen::Matrix< double,3,3 > > > :param coefficients: [in] the coefficients ordered from lowest-order term to highest-order

term.


Overload 3:

Create polynomial from other polynomial. :type p: rw::math::PolynomialND< Eigen::Matrix< double,3,3 >,double > :param p: [in] the polynomial to copy.

deflate(x)

Perform deflation of polynomial. :type x: float :param x: [in] a root of the polynomial. :rtype: rw::math::PolynomialND< Eigen::Matrix< double,3,3 >,double > :return: a new polynomial of same order minus one. Notes: There is no check that the given root is in fact a root of the polynomial.

derivative(n=1)

Get the derivative polynomial. :type n: int :param n: [in] gives the n’th derivative (default is n=1). :rtype: rw::math::PolynomialND< Eigen::Matrix< double,3,3 >,double > :return: a new polynomial of same order minus one. Notes: To evaluate derivatives use the evaluate derivative method which is more precise.

evaluate(x)

Evaluate the polynomial using Horner’s Method. :type x: float :param x: [in] the input parameter. :rtype: Eigen::Matrix< double,3,3 > :return: the value \(f(x)\).

evaluateDerivatives(x, n=1)

Evaluate the first n derivatives of the polynomial using Horner’s Method. :type x: float :param x: [in] the input parameter. :type n: int :param n: [in] the number of derivatives to find (default is the first derivative only) :rtype: std::vector< Eigen::Matrix< double,3,3 >,std::allocator< Eigen::Matrix< double,3,3 > > > :return: a vector of values \({f(x),\dot{f}(x),\ddot{f}(x),\cdots}\).

increaseOrder(*args)

Overload 1:

Increase the order of this polynomial. :type increase: int :param increase: [in] how much to increase the order (default is 1). :type value: Eigen::Matrix< double,3,3 > :param value: [in] initialize new coefficients to this value.


Overload 2:

Increase the order of this polynomial. :type increase: int :param increase: [in] how much to increase the order (default is 1). See also: increaseOrder(std::size_t,const Coef&) for a version that initializes the new coefficients to a certain value.


Overload 3:

Increase the order of this polynomial. :param increase: [in] how much to increase the order (default is 1). See also: increaseOrder(std::size_t,const Coef&) for a version that initializes the new coefficients to a certain value.

order()

Get the order of the polynomial (the highest power). :rtype: int :return: the order.

property thisown

The membership flag

class sdurw_math.PolynomialNDEigenMatrix3fFloat(*args)

Bases: object

Representation of a polynomial that can have non-scalar coefficients (polynomial matrix).

Representation of a polynomial of the following form:

\(f(x) = C_n x^n + C_(n-1) x^(n-1) + C_2 x^2 + C_1 x + C_0\)

The polynomial is represented as a list of coefficients ordered from lowest-order term to highest-order term, \({c_0,c_1,...,c_n}\).

__init__(*args)

Overload 1:

Create polynomial with uninitialized coefficients. :type order: int :param order: [in] the order of the polynomial.


Overload 2:

Create polynomial from vector. :type coefficients: std::vector< Eigen::Matrix< float,3,3 >,std::allocator< Eigen::Matrix< float,3,3 > > > :param coefficients: [in] the coefficients ordered from lowest-order term to highest-order

term.


Overload 3:

Create polynomial from other polynomial. :type p: rw::math::PolynomialND< Eigen::Matrix< float,3,3 >,float > :param p: [in] the polynomial to copy.

deflate(x)

Perform deflation of polynomial. :type x: float :param x: [in] a root of the polynomial. :rtype: rw::math::PolynomialND< Eigen::Matrix< float,3,3 >,float > :return: a new polynomial of same order minus one. Notes: There is no check that the given root is in fact a root of the polynomial.

derivative(n=1)

Get the derivative polynomial. :type n: int :param n: [in] gives the n’th derivative (default is n=1). :rtype: rw::math::PolynomialND< Eigen::Matrix< float,3,3 >,float > :return: a new polynomial of same order minus one. Notes: To evaluate derivatives use the evaluate derivative method which is more precise.

evaluate(x)

Evaluate the polynomial using Horner’s Method. :type x: float :param x: [in] the input parameter. :rtype: Eigen::Matrix< float,3,3 > :return: the value \(f(x)\).

evaluateDerivatives(x, n=1)

Evaluate the first n derivatives of the polynomial using Horner’s Method. :type x: float :param x: [in] the input parameter. :type n: int :param n: [in] the number of derivatives to find (default is the first derivative only) :rtype: std::vector< Eigen::Matrix< float,3,3 >,std::allocator< Eigen::Matrix< float,3,3 > > > :return: a vector of values \({f(x),\dot{f}(x),\ddot{f}(x),\cdots}\).

increaseOrder(*args)

Overload 1:

Increase the order of this polynomial. :type increase: int :param increase: [in] how much to increase the order (default is 1). :type value: Eigen::Matrix< float,3,3 > :param value: [in] initialize new coefficients to this value.


Overload 2:

Increase the order of this polynomial. :type increase: int :param increase: [in] how much to increase the order (default is 1). See also: increaseOrder(std::size_t,const Coef&) for a version that initializes the new coefficients to a certain value.


Overload 3:

Increase the order of this polynomial. :param increase: [in] how much to increase the order (default is 1). See also: increaseOrder(std::size_t,const Coef&) for a version that initializes the new coefficients to a certain value.

order()

Get the order of the polynomial (the highest power). :rtype: int :return: the order.

property thisown

The membership flag

class sdurw_math.PolynomialNDEigenMatrix3ifComplexDouble(*args)

Bases: object

Representation of a polynomial that can have non-scalar coefficients (polynomial matrix).

Representation of a polynomial of the following form:

\(f(x) = C_n x^n + C_(n-1) x^(n-1) + C_2 x^2 + C_1 x + C_0\)

The polynomial is represented as a list of coefficients ordered from lowest-order term to highest-order term, \({c_0,c_1,...,c_n}\).

__init__(*args)

Overload 1:

Create polynomial with uninitialized coefficients. :type order: int :param order: [in] the order of the polynomial.


Overload 2:

Create polynomial from vector. :type coefficients: std::vector< Eigen::Matrix< std::complex< float >,3,3 >,std::allocator< Eigen::Matrix< std::complex< float >,3,3 > > > :param coefficients: [in] the coefficients ordered from lowest-order term to highest-order

term.


Overload 3:

Create polynomial from other polynomial. :type p: rw::math::PolynomialND< Eigen::Matrix< std::complex< float >,3,3 >,std::complex< float > > :param p: [in] the polynomial to copy.

deflate(x)

Perform deflation of polynomial. :type x: std::complex< float > :param x: [in] a root of the polynomial. :rtype: rw::math::PolynomialND< Eigen::Matrix< std::complex< float >,3,3 >,std::complex< float > > :return: a new polynomial of same order minus one. Notes: There is no check that the given root is in fact a root of the polynomial.

derivative(n=1)

Get the derivative polynomial. :type n: int :param n: [in] gives the n’th derivative (default is n=1). :rtype: rw::math::PolynomialND< Eigen::Matrix< std::complex< float >,3,3 >,std::complex< float > > :return: a new polynomial of same order minus one. Notes: To evaluate derivatives use the evaluate derivative method which is more precise.

evaluate(x)

Evaluate the polynomial using Horner’s Method. :type x: std::complex< float > :param x: [in] the input parameter. :rtype: Eigen::Matrix< std::complex< float >,3,3 > :return: the value \(f(x)\).

evaluateDerivatives(x, n=1)

Evaluate the first n derivatives of the polynomial using Horner’s Method. :type x: std::complex< float > :param x: [in] the input parameter. :type n: int :param n: [in] the number of derivatives to find (default is the first derivative only) :rtype: std::vector< Eigen::Matrix< std::complex< float >,3,3 >,std::allocator< Eigen::Matrix< std::complex< float >,3,3 > > > :return: a vector of values \({f(x),\dot{f}(x),\ddot{f}(x),\cdots}\).

increaseOrder(*args)

Overload 1:

Increase the order of this polynomial. :type increase: int :param increase: [in] how much to increase the order (default is 1). :type value: Eigen::Matrix< std::complex< float >,3,3 > :param value: [in] initialize new coefficients to this value.


Overload 2:

Increase the order of this polynomial. :type increase: int :param increase: [in] how much to increase the order (default is 1). See also: increaseOrder(std::size_t,const Coef&) for a version that initializes the new coefficients to a certain value.


Overload 3:

Increase the order of this polynomial. :param increase: [in] how much to increase the order (default is 1). See also: increaseOrder(std::size_t,const Coef&) for a version that initializes the new coefficients to a certain value.

order()

Get the order of the polynomial (the highest power). :rtype: int :return: the order.

property thisown

The membership flag

class sdurw_math.PolynomialNDEigenRowVector3dDouble(*args)

Bases: object

Representation of a polynomial that can have non-scalar coefficients (polynomial matrix).

Representation of a polynomial of the following form:

\(f(x) = C_n x^n + C_(n-1) x^(n-1) + C_2 x^2 + C_1 x + C_0\)

The polynomial is represented as a list of coefficients ordered from lowest-order term to highest-order term, \({c_0,c_1,...,c_n}\).

__init__(*args)

Overload 1:

Create polynomial with uninitialized coefficients. :type order: int :param order: [in] the order of the polynomial.


Overload 2:

Create polynomial from vector. :type coefficients: std::vector< Eigen::Matrix< double,1,3 >,std::allocator< Eigen::Matrix< double,1,3 > > > :param coefficients: [in] the coefficients ordered from lowest-order term to highest-order

term.


Overload 3:

Create polynomial from other polynomial. :type p: rw::math::PolynomialND< Eigen::Matrix< double,1,3 >,double > :param p: [in] the polynomial to copy.

deflate(x)

Perform deflation of polynomial. :type x: float :param x: [in] a root of the polynomial. :rtype: rw::math::PolynomialND< Eigen::Matrix< double,1,3 >,double > :return: a new polynomial of same order minus one. Notes: There is no check that the given root is in fact a root of the polynomial.

derivative(n=1)

Get the derivative polynomial. :type n: int :param n: [in] gives the n’th derivative (default is n=1). :rtype: rw::math::PolynomialND< Eigen::Matrix< double,1,3 >,double > :return: a new polynomial of same order minus one. Notes: To evaluate derivatives use the evaluate derivative method which is more precise.

evaluate(x)

Evaluate the polynomial using Horner’s Method. :type x: float :param x: [in] the input parameter. :rtype: Eigen::Matrix< double,1,3 > :return: the value \(f(x)\).

evaluateDerivatives(x, n=1)

Evaluate the first n derivatives of the polynomial using Horner’s Method. :type x: float :param x: [in] the input parameter. :type n: int :param n: [in] the number of derivatives to find (default is the first derivative only) :rtype: std::vector< Eigen::Matrix< double,1,3 >,std::allocator< Eigen::Matrix< double,1,3 > > > :return: a vector of values \({f(x),\dot{f}(x),\ddot{f}(x),\cdots}\).

increaseOrder(*args)

Overload 1:

Increase the order of this polynomial. :type increase: int :param increase: [in] how much to increase the order (default is 1). :type value: Eigen::Matrix< double,1,3 > :param value: [in] initialize new coefficients to this value.


Overload 2:

Increase the order of this polynomial. :type increase: int :param increase: [in] how much to increase the order (default is 1). See also: increaseOrder(std::size_t,const Coef&) for a version that initializes the new coefficients to a certain value.


Overload 3:

Increase the order of this polynomial. :param increase: [in] how much to increase the order (default is 1). See also: increaseOrder(std::size_t,const Coef&) for a version that initializes the new coefficients to a certain value.

order()

Get the order of the polynomial (the highest power). :rtype: int :return: the order.

property thisown

The membership flag

class sdurw_math.PolynomialNDEigenRowVector3fFloat(*args)

Bases: object

Representation of a polynomial that can have non-scalar coefficients (polynomial matrix).

Representation of a polynomial of the following form:

\(f(x) = C_n x^n + C_(n-1) x^(n-1) + C_2 x^2 + C_1 x + C_0\)

The polynomial is represented as a list of coefficients ordered from lowest-order term to highest-order term, \({c_0,c_1,...,c_n}\).

__init__(*args)

Overload 1:

Create polynomial with uninitialized coefficients. :type order: int :param order: [in] the order of the polynomial.


Overload 2:

Create polynomial from vector. :type coefficients: std::vector< Eigen::Matrix< float,1,3 >,std::allocator< Eigen::Matrix< float,1,3 > > > :param coefficients: [in] the coefficients ordered from lowest-order term to highest-order

term.


Overload 3:

Create polynomial from other polynomial. :type p: rw::math::PolynomialND< Eigen::Matrix< float,1,3 >,float > :param p: [in] the polynomial to copy.

deflate(x)

Perform deflation of polynomial. :type x: float :param x: [in] a root of the polynomial. :rtype: rw::math::PolynomialND< Eigen::Matrix< float,1,3 >,float > :return: a new polynomial of same order minus one. Notes: There is no check that the given root is in fact a root of the polynomial.

derivative(n=1)

Get the derivative polynomial. :type n: int :param n: [in] gives the n’th derivative (default is n=1). :rtype: rw::math::PolynomialND< Eigen::Matrix< float,1,3 >,float > :return: a new polynomial of same order minus one. Notes: To evaluate derivatives use the evaluate derivative method which is more precise.

evaluate(x)

Evaluate the polynomial using Horner’s Method. :type x: float :param x: [in] the input parameter. :rtype: Eigen::Matrix< float,1,3 > :return: the value \(f(x)\).

evaluateDerivatives(x, n=1)

Evaluate the first n derivatives of the polynomial using Horner’s Method. :type x: float :param x: [in] the input parameter. :type n: int :param n: [in] the number of derivatives to find (default is the first derivative only) :rtype: std::vector< Eigen::Matrix< float,1,3 >,std::allocator< Eigen::Matrix< float,1,3 > > > :return: a vector of values \({f(x),\dot{f}(x),\ddot{f}(x),\cdots}\).

increaseOrder(*args)

Overload 1:

Increase the order of this polynomial. :type increase: int :param increase: [in] how much to increase the order (default is 1). :type value: Eigen::Matrix< float,1,3 > :param value: [in] initialize new coefficients to this value.


Overload 2:

Increase the order of this polynomial. :type increase: int :param increase: [in] how much to increase the order (default is 1). See also: increaseOrder(std::size_t,const Coef&) for a version that initializes the new coefficients to a certain value.


Overload 3:

Increase the order of this polynomial. :param increase: [in] how much to increase the order (default is 1). See also: increaseOrder(std::size_t,const Coef&) for a version that initializes the new coefficients to a certain value.

order()

Get the order of the polynomial (the highest power). :rtype: int :return: the order.

property thisown

The membership flag

class sdurw_math.PolynomialNDEigenRowVector3idComplexDouble(*args)

Bases: object

Representation of a polynomial that can have non-scalar coefficients (polynomial matrix).

Representation of a polynomial of the following form:

\(f(x) = C_n x^n + C_(n-1) x^(n-1) + C_2 x^2 + C_1 x + C_0\)

The polynomial is represented as a list of coefficients ordered from lowest-order term to highest-order term, \({c_0,c_1,...,c_n}\).

__init__(*args)

Overload 1:

Create polynomial with uninitialized coefficients. :type order: int :param order: [in] the order of the polynomial.


Overload 2:

Create polynomial from vector. :type coefficients: std::vector< Eigen::Matrix< std::complex< double >,1,3 >,std::allocator< Eigen::Matrix< std::complex< double >,1,3 > > > :param coefficients: [in] the coefficients ordered from lowest-order term to highest-order

term.


Overload 3:

Create polynomial from other polynomial. :type p: rw::math::PolynomialND< Eigen::Matrix< std::complex< double >,1,3 >,std::complex< double > > :param p: [in] the polynomial to copy.

deflate(x)

Perform deflation of polynomial. :type x: std::complex< double > :param x: [in] a root of the polynomial. :rtype: rw::math::PolynomialND< Eigen::Matrix< std::complex< double >,1,3 >,std::complex< double > > :return: a new polynomial of same order minus one. Notes: There is no check that the given root is in fact a root of the polynomial.

derivative(n=1)

Get the derivative polynomial. :type n: int :param n: [in] gives the n’th derivative (default is n=1). :rtype: rw::math::PolynomialND< Eigen::Matrix< std::complex< double >,1,3 >,std::complex< double > > :return: a new polynomial of same order minus one. Notes: To evaluate derivatives use the evaluate derivative method which is more precise.

evaluate(x)

Evaluate the polynomial using Horner’s Method. :type x: std::complex< double > :param x: [in] the input parameter. :rtype: Eigen::Matrix< std::complex< double >,1,3 > :return: the value \(f(x)\).

evaluateDerivatives(x, n=1)

Evaluate the first n derivatives of the polynomial using Horner’s Method. :type x: std::complex< double > :param x: [in] the input parameter. :type n: int :param n: [in] the number of derivatives to find (default is the first derivative only) :rtype: std::vector< Eigen::Matrix< std::complex< double >,1,3 >,std::allocator< Eigen::Matrix< std::complex< double >,1,3 > > > :return: a vector of values \({f(x),\dot{f}(x),\ddot{f}(x),\cdots}\).

increaseOrder(*args)

Overload 1:

Increase the order of this polynomial. :type increase: int :param increase: [in] how much to increase the order (default is 1). :type value: Eigen::Matrix< std::complex< double >,1,3 > :param value: [in] initialize new coefficients to this value.


Overload 2:

Increase the order of this polynomial. :type increase: int :param increase: [in] how much to increase the order (default is 1). See also: increaseOrder(std::size_t,const Coef&) for a version that initializes the new coefficients to a certain value.


Overload 3:

Increase the order of this polynomial. :param increase: [in] how much to increase the order (default is 1). See also: increaseOrder(std::size_t,const Coef&) for a version that initializes the new coefficients to a certain value.

order()

Get the order of the polynomial (the highest power). :rtype: int :return: the order.

property thisown

The membership flag

class sdurw_math.PolynomialNDEigenVector3dDouble(*args)

Bases: object

Representation of a polynomial that can have non-scalar coefficients (polynomial matrix).

Representation of a polynomial of the following form:

\(f(x) = C_n x^n + C_(n-1) x^(n-1) + C_2 x^2 + C_1 x + C_0\)

The polynomial is represented as a list of coefficients ordered from lowest-order term to highest-order term, \({c_0,c_1,...,c_n}\).

__init__(*args)

Overload 1:

Create polynomial with uninitialized coefficients. :type order: int :param order: [in] the order of the polynomial.


Overload 2:

Create polynomial from vector. :type coefficients: std::vector< Eigen::Matrix< double,3,1 >,std::allocator< Eigen::Matrix< double,3,1 > > > :param coefficients: [in] the coefficients ordered from lowest-order term to highest-order

term.


Overload 3:

Create polynomial from other polynomial. :type p: rw::math::PolynomialND< Eigen::Matrix< double,3,1 >,double > :param p: [in] the polynomial to copy.

deflate(x)

Perform deflation of polynomial. :type x: float :param x: [in] a root of the polynomial. :rtype: rw::math::PolynomialND< Eigen::Matrix< double,3,1 >,double > :return: a new polynomial of same order minus one. Notes: There is no check that the given root is in fact a root of the polynomial.

derivative(n=1)

Get the derivative polynomial. :type n: int :param n: [in] gives the n’th derivative (default is n=1). :rtype: rw::math::PolynomialND< Eigen::Matrix< double,3,1 >,double > :return: a new polynomial of same order minus one. Notes: To evaluate derivatives use the evaluate derivative method which is more precise.

evaluate(x)

Evaluate the polynomial using Horner’s Method. :type x: float :param x: [in] the input parameter. :rtype: Eigen::Matrix< double,3,1 > :return: the value \(f(x)\).

evaluateDerivatives(x, n=1)

Evaluate the first n derivatives of the polynomial using Horner’s Method. :type x: float :param x: [in] the input parameter. :type n: int :param n: [in] the number of derivatives to find (default is the first derivative only) :rtype: std::vector< Eigen::Matrix< double,3,1 >,std::allocator< Eigen::Matrix< double,3,1 > > > :return: a vector of values \({f(x),\dot{f}(x),\ddot{f}(x),\cdots}\).

increaseOrder(*args)

Overload 1:

Increase the order of this polynomial. :type increase: int :param increase: [in] how much to increase the order (default is 1). :type value: Eigen::Matrix< double,3,1 > :param value: [in] initialize new coefficients to this value.


Overload 2:

Increase the order of this polynomial. :type increase: int :param increase: [in] how much to increase the order (default is 1). See also: increaseOrder(std::size_t,const Coef&) for a version that initializes the new coefficients to a certain value.


Overload 3:

Increase the order of this polynomial. :param increase: [in] how much to increase the order (default is 1). See also: increaseOrder(std::size_t,const Coef&) for a version that initializes the new coefficients to a certain value.

order()

Get the order of the polynomial (the highest power). :rtype: int :return: the order.

property thisown

The membership flag

class sdurw_math.PolynomialNDEigenVector3fFloat(*args)

Bases: object

Representation of a polynomial that can have non-scalar coefficients (polynomial matrix).

Representation of a polynomial of the following form:

\(f(x) = C_n x^n + C_(n-1) x^(n-1) + C_2 x^2 + C_1 x + C_0\)

The polynomial is represented as a list of coefficients ordered from lowest-order term to highest-order term, \({c_0,c_1,...,c_n}\).

__init__(*args)

Overload 1:

Create polynomial with uninitialized coefficients. :type order: int :param order: [in] the order of the polynomial.


Overload 2:

Create polynomial from vector. :type coefficients: std::vector< Eigen::Matrix< float,3,1 >,std::allocator< Eigen::Matrix< float,3,1 > > > :param coefficients: [in] the coefficients ordered from lowest-order term to highest-order

term.


Overload 3:

Create polynomial from other polynomial. :type p: rw::math::PolynomialND< Eigen::Matrix< float,3,1 >,float > :param p: [in] the polynomial to copy.

deflate(x)

Perform deflation of polynomial. :type x: float :param x: [in] a root of the polynomial. :rtype: rw::math::PolynomialND< Eigen::Matrix< float,3,1 >,float > :return: a new polynomial of same order minus one. Notes: There is no check that the given root is in fact a root of the polynomial.

derivative(n=1)

Get the derivative polynomial. :type n: int :param n: [in] gives the n’th derivative (default is n=1). :rtype: rw::math::PolynomialND< Eigen::Matrix< float,3,1 >,float > :return: a new polynomial of same order minus one. Notes: To evaluate derivatives use the evaluate derivative method which is more precise.

evaluate(x)

Evaluate the polynomial using Horner’s Method. :type x: float :param x: [in] the input parameter. :rtype: Eigen::Matrix< float,3,1 > :return: the value \(f(x)\).

evaluateDerivatives(x, n=1)

Evaluate the first n derivatives of the polynomial using Horner’s Method. :type x: float :param x: [in] the input parameter. :type n: int :param n: [in] the number of derivatives to find (default is the first derivative only) :rtype: std::vector< Eigen::Matrix< float,3,1 >,std::allocator< Eigen::Matrix< float,3,1 > > > :return: a vector of values \({f(x),\dot{f}(x),\ddot{f}(x),\cdots}\).

increaseOrder(*args)

Overload 1:

Increase the order of this polynomial. :type increase: int :param increase: [in] how much to increase the order (default is 1). :type value: Eigen::Matrix< float,3,1 > :param value: [in] initialize new coefficients to this value.


Overload 2:

Increase the order of this polynomial. :type increase: int :param increase: [in] how much to increase the order (default is 1). See also: increaseOrder(std::size_t,const Coef&) for a version that initializes the new coefficients to a certain value.


Overload 3:

Increase the order of this polynomial. :param increase: [in] how much to increase the order (default is 1). See also: increaseOrder(std::size_t,const Coef&) for a version that initializes the new coefficients to a certain value.

order()

Get the order of the polynomial (the highest power). :rtype: int :return: the order.

property thisown

The membership flag

class sdurw_math.PolynomialNDEigenVector3idComplexDouble(*args)

Bases: object

Representation of a polynomial that can have non-scalar coefficients (polynomial matrix).

Representation of a polynomial of the following form:

\(f(x) = C_n x^n + C_(n-1) x^(n-1) + C_2 x^2 + C_1 x + C_0\)

The polynomial is represented as a list of coefficients ordered from lowest-order term to highest-order term, \({c_0,c_1,...,c_n}\).

__init__(*args)

Overload 1:

Create polynomial with uninitialized coefficients. :type order: int :param order: [in] the order of the polynomial.


Overload 2:

Create polynomial from vector. :type coefficients: std::vector< Eigen::Matrix< std::complex< double >,3,1 >,std::allocator< Eigen::Matrix< std::complex< double >,3,1 > > > :param coefficients: [in] the coefficients ordered from lowest-order term to highest-order

term.


Overload 3:

Create polynomial from other polynomial. :type p: rw::math::PolynomialND< Eigen::Matrix< std::complex< double >,3,1 >,std::complex< double > > :param p: [in] the polynomial to copy.

deflate(x)

Perform deflation of polynomial. :type x: std::complex< double > :param x: [in] a root of the polynomial. :rtype: rw::math::PolynomialND< Eigen::Matrix< std::complex< double >,3,1 >,std::complex< double > > :return: a new polynomial of same order minus one. Notes: There is no check that the given root is in fact a root of the polynomial.

derivative(n=1)

Get the derivative polynomial. :type n: int :param n: [in] gives the n’th derivative (default is n=1). :rtype: rw::math::PolynomialND< Eigen::Matrix< std::complex< double >,3,1 >,std::complex< double > > :return: a new polynomial of same order minus one. Notes: To evaluate derivatives use the evaluate derivative method which is more precise.

evaluate(x)

Evaluate the polynomial using Horner’s Method. :type x: std::complex< double > :param x: [in] the input parameter. :rtype: Eigen::Matrix< std::complex< double >,3,1 > :return: the value \(f(x)\).

evaluateDerivatives(x, n=1)

Evaluate the first n derivatives of the polynomial using Horner’s Method. :type x: std::complex< double > :param x: [in] the input parameter. :type n: int :param n: [in] the number of derivatives to find (default is the first derivative only) :rtype: std::vector< Eigen::Matrix< std::complex< double >,3,1 >,std::allocator< Eigen::Matrix< std::complex< double >,3,1 > > > :return: a vector of values \({f(x),\dot{f}(x),\ddot{f}(x),\cdots}\).

increaseOrder(*args)

Overload 1:

Increase the order of this polynomial. :type increase: int :param increase: [in] how much to increase the order (default is 1). :type value: Eigen::Matrix< std::complex< double >,3,1 > :param value: [in] initialize new coefficients to this value.


Overload 2:

Increase the order of this polynomial. :type increase: int :param increase: [in] how much to increase the order (default is 1). See also: increaseOrder(std::size_t,const Coef&) for a version that initializes the new coefficients to a certain value.


Overload 3:

Increase the order of this polynomial. :param increase: [in] how much to increase the order (default is 1). See also: increaseOrder(std::size_t,const Coef&) for a version that initializes the new coefficients to a certain value.

order()

Get the order of the polynomial (the highest power). :rtype: int :return: the order.

property thisown

The membership flag

class sdurw_math.PolynomialNDdDouble(*args)

Bases: object

Representation of a polynomial that can have non-scalar coefficients (polynomial matrix).

Representation of a polynomial of the following form:

\(f(x) = C_n x^n + C_(n-1) x^(n-1) + C_2 x^2 + C_1 x + C_0\)

The polynomial is represented as a list of coefficients ordered from lowest-order term to highest-order term, \({c_0,c_1,...,c_n}\).

__init__(*args)

Overload 1:

Create polynomial with uninitialized coefficients. :type order: int :param order: [in] the order of the polynomial.


Overload 2:

Create polynomial from vector. :type coefficients: std::vector< double,std::allocator< double > > :param coefficients: [in] the coefficients ordered from lowest-order term to highest-order

term.


Overload 3:

Create polynomial from other polynomial. :type p: rw::math::PolynomialND< double,double > :param p: [in] the polynomial to copy.

deflate(x)

Perform deflation of polynomial. :type x: float :param x: [in] a root of the polynomial. :rtype: rw::math::PolynomialND< double,double > :return: a new polynomial of same order minus one. Notes: There is no check that the given root is in fact a root of the polynomial.

derivative(n=1)

Get the derivative polynomial. :type n: int :param n: [in] gives the n’th derivative (default is n=1). :rtype: rw::math::PolynomialND< double,double > :return: a new polynomial of same order minus one. Notes: To evaluate derivatives use the evaluate derivative method which is more precise.

evaluate(x)

Evaluate the polynomial using Horner’s Method. :type x: float :param x: [in] the input parameter. :rtype: float :return: the value \(f(x)\).

evaluateDerivatives(x, n=1)

Evaluate the first n derivatives of the polynomial using Horner’s Method. :type x: float :param x: [in] the input parameter. :type n: int :param n: [in] the number of derivatives to find (default is the first derivative only) :rtype: std::vector< double,std::allocator< double > > :return: a vector of values \({f(x),\dot{f}(x),\ddot{f}(x),\cdots}\).

increaseOrder(*args)

Overload 1:

Increase the order of this polynomial. :type increase: int :param increase: [in] how much to increase the order (default is 1). :type value: float :param value: [in] initialize new coefficients to this value.


Overload 2:

Increase the order of this polynomial. :type increase: int :param increase: [in] how much to increase the order (default is 1). See also: increaseOrder(std::size_t,const Coef&) for a version that initializes the new coefficients to a certain value.


Overload 3:

Increase the order of this polynomial. :param increase: [in] how much to increase the order (default is 1). See also: increaseOrder(std::size_t,const Coef&) for a version that initializes the new coefficients to a certain value.

order()

Get the order of the polynomial (the highest power). :rtype: int :return: the order.

property thisown

The membership flag

class sdurw_math.PolynomialNDfFloat(*args)

Bases: object

Representation of a polynomial that can have non-scalar coefficients (polynomial matrix).

Representation of a polynomial of the following form:

\(f(x) = C_n x^n + C_(n-1) x^(n-1) + C_2 x^2 + C_1 x + C_0\)

The polynomial is represented as a list of coefficients ordered from lowest-order term to highest-order term, \({c_0,c_1,...,c_n}\).

__init__(*args)

Overload 1:

Create polynomial with uninitialized coefficients. :type order: int :param order: [in] the order of the polynomial.


Overload 2:

Create polynomial from vector. :type coefficients: std::vector< float,std::allocator< float > > :param coefficients: [in] the coefficients ordered from lowest-order term to highest-order

term.


Overload 3:

Create polynomial from other polynomial. :type p: rw::math::PolynomialND< float,float > :param p: [in] the polynomial to copy.

deflate(x)

Perform deflation of polynomial. :type x: float :param x: [in] a root of the polynomial. :rtype: rw::math::PolynomialND< float,float > :return: a new polynomial of same order minus one. Notes: There is no check that the given root is in fact a root of the polynomial.

derivative(n=1)

Get the derivative polynomial. :type n: int :param n: [in] gives the n’th derivative (default is n=1). :rtype: rw::math::PolynomialND< float,float > :return: a new polynomial of same order minus one. Notes: To evaluate derivatives use the evaluate derivative method which is more precise.

evaluate(x)

Evaluate the polynomial using Horner’s Method. :type x: float :param x: [in] the input parameter. :rtype: float :return: the value \(f(x)\).

evaluateDerivatives(x, n=1)

Evaluate the first n derivatives of the polynomial using Horner’s Method. :type x: float :param x: [in] the input parameter. :type n: int :param n: [in] the number of derivatives to find (default is the first derivative only) :rtype: std::vector< float,std::allocator< float > > :return: a vector of values \({f(x),\dot{f}(x),\ddot{f}(x),\cdots}\).

increaseOrder(*args)

Overload 1:

Increase the order of this polynomial. :type increase: int :param increase: [in] how much to increase the order (default is 1). :type value: float :param value: [in] initialize new coefficients to this value.


Overload 2:

Increase the order of this polynomial. :type increase: int :param increase: [in] how much to increase the order (default is 1). See also: increaseOrder(std::size_t,const Coef&) for a version that initializes the new coefficients to a certain value.


Overload 3:

Increase the order of this polynomial. :param increase: [in] how much to increase the order (default is 1). See also: increaseOrder(std::size_t,const Coef&) for a version that initializes the new coefficients to a certain value.

order()

Get the order of the polynomial (the highest power). :rtype: int :return: the order.

property thisown

The membership flag

class sdurw_math.PolynomialNDidComplexDouble(*args)

Bases: object

Representation of a polynomial that can have non-scalar coefficients (polynomial matrix).

Representation of a polynomial of the following form:

\(f(x) = C_n x^n + C_(n-1) x^(n-1) + C_2 x^2 + C_1 x + C_0\)

The polynomial is represented as a list of coefficients ordered from lowest-order term to highest-order term, \({c_0,c_1,...,c_n}\).

__init__(*args)

Overload 1:

Create polynomial with uninitialized coefficients. :type order: int :param order: [in] the order of the polynomial.


Overload 2:

Create polynomial from vector. :type coefficients: std::vector< std::complex< double >,std::allocator< std::complex< double > > > :param coefficients: [in] the coefficients ordered from lowest-order term to highest-order

term.


Overload 3:

Create polynomial from other polynomial. :type p: rw::math::PolynomialND< std::complex< double >,std::complex< double > > :param p: [in] the polynomial to copy.

deflate(x)

Perform deflation of polynomial. :type x: std::complex< double > :param x: [in] a root of the polynomial. :rtype: rw::math::PolynomialND< std::complex< double >,std::complex< double > > :return: a new polynomial of same order minus one. Notes: There is no check that the given root is in fact a root of the polynomial.

derivative(n=1)

Get the derivative polynomial. :type n: int :param n: [in] gives the n’th derivative (default is n=1). :rtype: rw::math::PolynomialND< std::complex< double >,std::complex< double > > :return: a new polynomial of same order minus one. Notes: To evaluate derivatives use the evaluate derivative method which is more precise.

evaluate(x)

Evaluate the polynomial using Horner’s Method. :type x: std::complex< double > :param x: [in] the input parameter. :rtype: std::complex< double > :return: the value \(f(x)\).

evaluateDerivatives(x, n=1)

Evaluate the first n derivatives of the polynomial using Horner’s Method. :type x: std::complex< double > :param x: [in] the input parameter. :type n: int :param n: [in] the number of derivatives to find (default is the first derivative only) :rtype: std::vector< std::complex< double >,std::allocator< std::complex< double > > > :return: a vector of values \({f(x),\dot{f}(x),\ddot{f}(x),\cdots}\).

increaseOrder(*args)

Overload 1:

Increase the order of this polynomial. :type increase: int :param increase: [in] how much to increase the order (default is 1). :type value: std::complex< double > :param value: [in] initialize new coefficients to this value.


Overload 2:

Increase the order of this polynomial. :type increase: int :param increase: [in] how much to increase the order (default is 1). See also: increaseOrder(std::size_t,const Coef&) for a version that initializes the new coefficients to a certain value.


Overload 3:

Increase the order of this polynomial. :param increase: [in] how much to increase the order (default is 1). See also: increaseOrder(std::size_t,const Coef&) for a version that initializes the new coefficients to a certain value.

order()

Get the order of the polynomial (the highest power). :rtype: int :return: the order.

property thisown

The membership flag

class sdurw_math.PolynomialSolver(*args)

Bases: object

Find solutions for roots of real and complex polynomial equations.

The solutions are found analytically if the polynomial is of maximum order 3. For polynomials of order 4 and higher, Laguerre’s Method is used to find roots until the polynomial can be deflated to order 3. The remaining roots will then be found analytically.

Some Polynomials are particularly easy to solve. A polynomial of the form \(a x^n + b = 0\) will be solved by taking the n’th roots of \(-\frac{b}{a}\) directly, giving n distinct roots in the complex plane.

To illustrate the procedure, consider the equation: \(10^{-15} x^8 - 10^{-15} x^7 + x^7 + 2 x^6 - x^4 - 2x^3 + 10^{-15} x= 0\)

The solver will use the following procedure (here with the precision \(\epsilon =10^{-14}\)):

  1. Remove terms that are small compared to \(\epsilon\): \(x^7 + 2 x^6 - x^4 - 2x^3 =0\)

2. Find zero roots and reduce the order: There is a triple root in x = 0 and the remaining polynomial becomes: \(x^4 + 2 x^3 - x - 2 = 0\).

  1. Use Laguerre to find a root of \(x^4 + 2 x^3 - x - 2 = 0\)

Depending on the initial guess for Laguerre, different roots might be found first. The algorithm will proceed differently depending on the found root:

1. If root x=-2 is found, remaining polynomial after deflation is \(x^3 -1 = 0\). The roots are found directly as the cubic root of 1, which is three distinct roots in the complex plane (one is on the real axis).

2. If root x=1 is found, remaining polynomial after deflation is \(x^3 + 3 x^2 +3 x + 2 =0\). The roots are found analytically, giving one real root x=-2 and two complex conjugate roots \(x = -0.5 \pm \frac{\sqrt{3}}{2} i\).

3. If other roots than x=1 or x=-2 is found (a complex root), remaining polynomial is a third order polynomial with complex coefficients. This polynomial is solved analytically to give remaining two real roots, and one remaining complex root.

Notice that cases 2+3 requires analytical solution of the third order polynomial equation. For higher order polynomials Laguerre would need to be used to find the next root. In this case it is particularly lucky to hit case 1, as this gives the solutions right away no matter what order the remaining polynomial is.

__init__(*args)

Overload 1:

Create a solver for a polynomial with real coefficients. :type polynomial: rw::math::Polynomial< double > :param polynomial: [in] the polynomial to find roots for.


Overload 2:

Create a solver for a polynomial with complex coefficients. :type polynomial: rw::math::Polynomial< std::complex< double > > :param polynomial: [in] the polynomial to find roots for.

getRealSolutions(epsilon=1e-14)

Get all real solutions of the equation. :type epsilon: float :param epsilon: [in] the root is considered a real root if \(|im(x)| \leq 2 \epsilon|real(x)|\) . :rtype: std::vector< double,std::allocator< double > > :return: a list of real solutions. :raises: rw::core::Exception if the Laguerre method fails, or the maximum number of

iterations has been reached.

See also: PolynomialSolver for more details about the method used.

getSolutions(epsilon=1e-14)

Get all solutions of the equation including complex solutions. :type epsilon: float :param epsilon: [in] highest order coefficients will be removed if they have absolute real

and imaginary values less than \(\epsilon\) .

Return type

std::vector< std::complex< double >,std::allocator< std::complex< double > > >

Returns

a list of complex solutions.

Raises

rw::core::Exception if the Laguerre method fails, or the maximum number of iterations has been reached.

See also: PolynomialSolver for more details about the method used.

setInitialGuess(guess=0)

Use a specific initial guess for a root. :type guess: std::complex< double > :param guess: [in] a complex initial guess for the algorithm.

setLaguerreIterations(iterations=10)

Set the number of iterations to take in the Laguerre method. :type iterations: int :param iterations: [in] the maximum number of iterations (default is 10).

property thisown

The membership flag

class sdurw_math.Pose2Dd(*args)

Bases: object

A Pose3D \(\mathbf{x}\in \mathbb{R}^6\) describes a position and orientation in 3-dimensions.

\({\mathbf{x}} = \left[ \begin{array}{c} x \\ y \\ z \\ \theta k_x \\ \theta k_y \\ \theta k_z \end{array} \right]\)

where \((x,y,z)\) is the 3d position and \((\theta k_x, \theta k_y,\theta k_z)\) describes the orientation in equal angle axis (EAA) format.

__init__(*args)
Overload 1:

Zero-initialized Pose2D.


Overload 2:

Constructor. :type pos: rw::math::Vector2D< double > :param pos: [in] the position. :type theta: float :param theta: [in] the angle.


Overload 3:

Constructor. :type x: float :param x: [in] the value of the first position dimension. :type y: float :param y: [in] the value of the second position dimension. :type theta: float :param theta: [in] the angle.


Overload 4:

Constructor. :type transform: rw::math::Transform2D< double > :param transform: [in] a 2D transform giving the pose.

e()

return a Eigen vector of (x, y, theta). :rtype: Eigen::Matrix< double,3,1 > :return: Eigen vector.

getPos()

Get the position vector. :rtype: rw::math::Vector2D< double > :return: the position.

theta()

Get the angle. :rtype: float :return: the angle.

property thisown

The membership flag

static transform(pose)

The transform corresponding to the pose. :type pose: rw::math::Pose2D< double > :param pose: [in] the pose. :rtype: rw::math::Transform2D< double > :return: equivalent 2D transform.

x()

Get the first dimension of the position vector. :rtype: float :return: the position in the first dimension.

y()

Get the second dimension of the position vector. :rtype: float :return: the position in the second dimension.

sdurw_math.Pose2Dd_transform(pose)

The transform corresponding to the pose. :type pose: rw::math::Pose2D< double > :param pose: [in] the pose. :rtype: rw::math::Transform2D< double > :return: equivalent 2D transform.

class sdurw_math.Pose2Df(*args)

Bases: object

A Pose3D \(\mathbf{x}\in \mathbb{R}^6\) describes a position and orientation in 3-dimensions.

\({\mathbf{x}} = \left[ \begin{array}{c} x \\ y \\ z \\ \theta k_x \\ \theta k_y \\ \theta k_z \end{array} \right]\)

where \((x,y,z)\) is the 3d position and \((\theta k_x, \theta k_y,\theta k_z)\) describes the orientation in equal angle axis (EAA) format.

__init__(*args)
Overload 1:

Zero-initialized Pose2D.


Overload 2:

Constructor. :type pos: rw::math::Vector2D< float > :param pos: [in] the position. :type theta: float :param theta: [in] the angle.


Overload 3:

Constructor. :type x: float :param x: [in] the value of the first position dimension. :type y: float :param y: [in] the value of the second position dimension. :type theta: float :param theta: [in] the angle.


Overload 4:

Constructor. :type transform: rw::math::Transform2D< float > :param transform: [in] a 2D transform giving the pose.

e()

return a Eigen vector of (x, y, theta). :rtype: Eigen::Matrix< float,3,1 > :return: Eigen vector.

getPos()

Get the position vector. :rtype: rw::math::Vector2D< float > :return: the position.

theta()

Get the angle. :rtype: float :return: the angle.

property thisown

The membership flag

static transform(pose)

The transform corresponding to the pose. :type pose: rw::math::Pose2D< float > :param pose: [in] the pose. :rtype: rw::math::Transform2D< float > :return: equivalent 2D transform.

x()

Get the first dimension of the position vector. :rtype: float :return: the position in the first dimension.

y()

Get the second dimension of the position vector. :rtype: float :return: the position in the second dimension.

sdurw_math.Pose2Df_transform(pose)

The transform corresponding to the pose. :type pose: rw::math::Pose2D< float > :param pose: [in] the pose. :rtype: rw::math::Transform2D< float > :return: equivalent 2D transform.

class sdurw_math.Pose6Dd(*args)

Bases: object

A Pose6D \(\mathbf{x}\in \mathbb{R}^6\) describes a position and orientation in 3-dimensions.

\({\mathbf{x}} = \left[ \begin{array}{c} x \\ y \\ z \\ \theta k_x \\ \theta k_y \\ \theta k_z \end{array} \right]\)

where \((x,y,z)\) is the 3d position and \((\theta k_x, \theta k_y,\theta k_z)\) describes the orientation in equal angle axis (EAA) format.

__init__(*args)

Overload 1:

Creates an “identity” Pose6D. Position is zero vector and orientation is zero vector


Overload 2:

Creates a Pose6D from 6 parameters. 3 defining the position and 3 defining the EAA orientation. :type x: float :param x: [in] The position in the \(x\) axis :type y: float :param y: [in] The position in the \(y\) axis :type z: float :param z: [in] The position in the \(z\) axis :type kx: float :param kx: [in] \(\theta k_x\) :type ky: float :param ky: [in] \(\theta k_y\) :type kz: float :param kz: [in] \(\theta k_z\)


Overload 3:

Creates a Pose6D from a Vector3D and a EAA :type v3d: rw::math::Vector3D< double > :param v3d: [in] Vector3D describing the 3D position of the Pose6D :type eaa: rw::math::EAA< double > :param eaa: [in] EAA describing the rotational component of the Pose6D.


Overload 4:

Creates a Pose6D from a Transform3D

Parameters

t3d (rw::math::Transform3D< double >) – [in] A Transform3D

get(i)

Returns the \(i\)’th element in the pose.

\(i\in\{0,1,2\}\) corresponds to \(\{x,y,z\}\) respectively. \(i\in\{3,4,5\}\) corresponds to the equivalent angle axis.

Parameters

i (int) – [in] index to return

Return type

float

Returns

the \(i\) in the index of the pose.

getEAA()

const

getPos()

const

property thisown

The membership flag

toTransform3D()

Converts the Pose6D into the corresponding Transform3D :rtype: rw::math::Transform3D< double > :return: the corresponding Transform3D

class sdurw_math.Pose6Df(*args)

Bases: object

A Pose6D \(\mathbf{x}\in \mathbb{R}^6\) describes a position and orientation in 3-dimensions.

\({\mathbf{x}} = \left[ \begin{array}{c} x \\ y \\ z \\ \theta k_x \\ \theta k_y \\ \theta k_z \end{array} \right]\)

where \((x,y,z)\) is the 3d position and \((\theta k_x, \theta k_y,\theta k_z)\) describes the orientation in equal angle axis (EAA) format.

__init__(*args)

Overload 1:

Creates an “identity” Pose6D. Position is zero vector and orientation is zero vector


Overload 2:

Creates a Pose6D from 6 parameters. 3 defining the position and 3 defining the EAA orientation. :type x: float :param x: [in] The position in the \(x\) axis :type y: float :param y: [in] The position in the \(y\) axis :type z: float :param z: [in] The position in the \(z\) axis :type kx: float :param kx: [in] \(\theta k_x\) :type ky: float :param ky: [in] \(\theta k_y\) :type kz: float :param kz: [in] \(\theta k_z\)


Overload 3:

Creates a Pose6D from a Vector3D and a EAA :type v3d: rw::math::Vector3D< float > :param v3d: [in] Vector3D describing the 3D position of the Pose6D :type eaa: rw::math::EAA< float > :param eaa: [in] EAA describing the rotational component of the Pose6D.


Overload 4:

Creates a Pose6D from a Transform3D

Parameters

t3d (rw::math::Transform3D< float >) – [in] A Transform3D

get(i)

Returns the \(i\)’th element in the pose.

\(i\in\{0,1,2\}\) corresponds to \(\{x,y,z\}\) respectively. \(i\in\{3,4,5\}\) corresponds to the equivalent angle axis.

Parameters

i (int) – [in] index to return

Return type

float

Returns

the \(i\) in the index of the pose.

getEAA()

const

getPos()

const

property thisown

The membership flag

toTransform3D()

Converts the Pose6D into the corresponding Transform3D :rtype: rw::math::Transform3D< float > :return: the corresponding Transform3D

class sdurw_math.ProjectionMatrix

Bases: object

projection matrix

__init__()

constructor

e()

get the boost matrix corresponding to this projection

getClipPlanes()

get near and far clipping plane :rtype: std::pair< double,double > :return:

getFrustum(left, right, bottom, top, zNear, zFar)

get the projection matrix to the viewing frustum :type left: float :param left: [out] distance in m near cutting plane from center to left edge :type right: float :param right: [out] distance in m near cutting plane from center to right edge :type bottom: float :param bottom: [out] distance in m near cutting plane from center to bottom edge :type top: float :param top: [out] distance in m near cutting plane from center to top edge :type zNear: float :param zNear: [out] distance in m along z-axis to near cutting plane :type zFar: float :param zFar: [out] distance in m along z-axis to far cutting plane

getOrtho(left, right, bottom, top, zNear, zFar)

get ortographic projection. Onli valid if isOrtographicProjection is true

getPerspective(fovy, aspectRatio, zNear, zFar)

get the projection matrix to perspective projection :type fovy: float :param fovy: [in] vertical field of view [degrees] :type aspectRatio: float :param aspectRatio: [in] aspect ratio between width and height of image :type zNear: float :param zNear: [in] distance to near cutting plane :type zFar: float :param zFar: [in] distance to far cutting plane :rtype: boolean :return: is it succesfull

isOrtographicProjection()

test if this is a ortographic projection

isPerspectiveProjection()

test if this is a perspective projection

static makeOrtho(left, right, bottom, top, zNear, zFar)

creates a projection matrix with a orthographic projection :type left: float :param left: :type right: float :param right: :type bottom: float :param bottom: :type top: float :param top: :type zNear: float :param zNear: :type zFar: float :param zFar: :rtype: ProjectionMatrix :return: new ProjectionMatrix.

static makePerspective(*args)

Overload 1:

creates a projection matrix with a perspective projection :type fovy: float :param fovy: :type aspectRatio: float :param aspectRatio: :type zNear: float :param zNear: :type zFar: float :param zFar: :rtype: ProjectionMatrix :return: new ProjectionMatrix.


Overload 2:

creates a projection matrix with a perspective projection :type fovy: float :param fovy: [in] :type width: float :param width: [in] of image :type height: float :param height: [in] of image :type zNear: float :param zNear: [in] :type zFar: float :param zFar: [in] :rtype: ProjectionMatrix :return: new ProjectionMatrix.

setFrustum(left, right, bottom, top, zNear, zFar)

set the projection matrix to the viewing frustum :type left: float :param left: [in] distance in m near cutting plane from center to left edge :type right: float :param right: [in] distance in m near cutting plane from center to right edge :type bottom: float :param bottom: [in] distance in m near cutting plane from center to bottom edge :type top: float :param top: [in] distance in m near cutting plane from center to top edge :type zNear: float :param zNear: [in] distance in m along z-axis to near cutting plane :type zFar: float :param zFar: [in] distance in m along z-axis to far cutting plane

setOrtho(left, right, bottom, top, zNear, zFar)

set the projection matrix to an ortographic projection by defining the box with length to all sides (left, right, bottom, top, near and far) :type left: float :param left: [in] length in m to left edge of image :type right: float :param right: [in] length in m to right edge of image :type bottom: float :param bottom: [in] length in m to bottom edge of image :type top: float :param top: [in] length in m to top edge of image :type zNear: float :param zNear: [in] length in m to near clipping plane :type zFar: float :param zFar: [in] length in m to far clipping plane

setPerspective(*args)

Overload 1:

set the projection matrix to perspective projection :type fovy: float :param fovy: [in] vertical field of view [degrees] :type aspectRatio: float :param aspectRatio: [in] aspect ratio between width and height of image :type zNear: float :param zNear: [in] distance to near cutting plane :type zFar: float :param zFar: [in] distance to far cutting plane


Overload 2:

set the projection matrix to perspective projection :type fovy: float :param fovy: [in] vertical field of view [degrees] :type width: float :param width: [in] width of image :type height: float :param height: [in] height of image :type zNear: float :param zNear: [in] distance to near cutting plane :type zFar: float :param zFar: [in] distance to far cutting plane

property thisown

The membership flag

sdurw_math.ProjectionMatrix_makeOrtho(left, right, bottom, top, zNear, zFar)

creates a projection matrix with a orthographic projection :type left: float :param left: :type right: float :param right: :type bottom: float :param bottom: :type top: float :param top: :type zNear: float :param zNear: :type zFar: float :param zFar: :rtype: ProjectionMatrix :return: new ProjectionMatrix.

sdurw_math.ProjectionMatrix_makePerspective(*args)

Overload 1:

creates a projection matrix with a perspective projection :type fovy: float :param fovy: :type aspectRatio: float :param aspectRatio: :type zNear: float :param zNear: :type zFar: float :param zFar: :rtype: ProjectionMatrix :return: new ProjectionMatrix.


Overload 2:

creates a projection matrix with a perspective projection :type fovy: float :param fovy: [in] :type width: float :param width: [in] of image :type height: float :param height: [in] of image :type zNear: float :param zNear: [in] :type zFar: float :param zFar: [in] :rtype: ProjectionMatrix :return: new ProjectionMatrix.

class sdurw_math.Q(*args)

Bases: object

Configuration vector

__init__(*args)

Overload 1:

A configuration of vector of length dim.


Overload 2:

Default constructor.

The vector will be of dimension zero.


Overload 3:

Construct a configuration vector from a std::vector expression.

Parameters

r (std::vector< double,std::allocator< double > >) – [in] An expression for a vector of doubles


Overload 4:

Construct from Eigen base. :type q: rw::math::Q::Base :param q: [in] Eigen base.

e()

Accessor for the internal Eigen vector state.

empty()

True if the configuration is of dimension zero.

getSubPart(start, cnt)

Extracts a sub part (range) of this Q. :type start: int :param start: [in] Start index :type cnt: int :param cnt: [in] the number of elements to include :rtype: Q :return:

norm1()

Returns the Manhatten norm (1-norm) of the configuration :rtype: float :return: the norm

norm2()

Returns the Euclidean norm (2-norm) of the configuration :rtype: float :return: the norm

normInf()

Returns the infinte norm (\(\inf\)-norm) of the configuration :rtype: float :return: the norm

setSubPart(index, part)

Set subpart of vector. :type index: int :param index: [in] the initial index. :type part: Q :param part: [in] the part to insert beginning from index.

size()

The dimension of the configuration vector.

property thisown

The membership flag

toStdVector(*args)

Overload 1:

Convert to a standard vector. :type v: std::vector< double,std::allocator< double > > :param v: [out] the result.


Overload 2:

Convert to a standard vector. :rtype: std::vector< double,std::allocator< double > > :return: the result.

static zero(n)

Returns Q of length n initialized with 0’s

sdurw_math.Q_zero(n)

Returns Q of length n initialized with 0’s

class sdurw_math.Quaterniond(*args)

Bases: sdurw_math.Rotation3DVectord

A Quaternion \(\mathbf{q}\in \mathbb{R}^4\) a complex number used to describe rotations in 3-dimensional space. \(q_w+{\bf i}\ q_x+ {\bf j} q_y+ {\bf k}\ q_z\)

Quaternions can be added and multiplied in a similar way as usual algebraic numbers. Though there are differences. Quaternion multiplication is not commutative which means \(Q\cdot P \neq P\cdot Q\)

__init__(*args)

Overload 1:

constuct Quaterinion of {0,0,0,1}


Overload 2:

Creates a Quaternion :type qx: float :param qx: [in] \(q_x\) :type qy: float :param qy: [in] \(q_y\) :type qz: float :param qz: [in] \(q_z\) :type qw: float :param qw: [in] \(q_w\)


Overload 3:

Creates a Quaternion from another Quaternion :type quat: rw::math::Quaternion< double > :param quat: [in] Quaternion


Overload 4:

Creates a Quaternion from another Rotation3DVector type :type rot: rw::math::Rotation3DVector< double > :param rot: [in] The Rotation3DVector type


Overload 5:

Extracts a Quaternion from Rotation matrix using setRotation(const Rotation3D<R>& rot) :type rot: rw::math::Rotation3D< double > :param rot: [in] A 3x3 rotation matrix \(\mathbf{rot}\)


Overload 6:

Creates a Quaternion from a Eigen quaternion :type r: Eigen::Quaternion< double > :param r: [in] a boost quaternion

copy(*args)

Overload 1:

copy a boost quaternion to this Quaternion :type r: Eigen::Quaternion< double > :param r: [in] - boost quaternion


Overload 2:

copyfrom rotaion matrix, same as setRotation. :type rhs: rw::math::Rotation3D< double > :param rhs: [in] the rotation that will be copyed

e()

Convert to an Eigen Quaternion. :rtype: Eigen::Quaternion< double > :return: Eigen Quaternion representation.

elemDivide(lhs)

element whise division :type lhs: float :param lhs: [in] the scalar to devide with :rtype: rw::math::Quaternion< double > :return: the result of elementwise devision

exp()
getLength()

get length of quaternion \(\sqrt{q_x^2+q_y^2+q_z^2+q_w^2}\) :rtype: float :return: the length og this quaternion

getLengthSquared()

get squared length of quaternion \(q_x^2+q_y^2+q_z^2+q_w^2\) :rtype: float :return: the length og this quaternion

getQw()

get method for the w component :rtype: float :return: the w component of the quaternion

getQx()

get method for the x component :rtype: float :return: the x component of the quaternion

getQy()

get method for the y component :rtype: float :return: the y component of the quaternion

getQz()

get method for the z component :rtype: float :return: the z component of the quaternion

inverse()

Calculate the inverse Quaternion :rtype: rw::math::Quaternion< double > :return: the inverse quaternion

ln()

calculates the natural logerithm of this quaternion :rtype: rw::math::Quaternion< double > :return: natural logetihm

normalize()

normalizes this quaternion so that \(normalze(Q)=\frac{Q}{\sqrt{q_x^2+q_y^2+q_z^2+q_w^2}}\)

pow(power)

calculates the quaternion lifted to the power of power :type power: float :param power: [in] the power the quaternion is lifted to :rtype: rw::math::Quaternion< double > :return: \(Quaternion^power\)

size()

The dimension of the quaternion (i.e. 4). This method is provided to help support generic algorithms using size() and operator[].

slerp(v, t)

Calculates a slerp interpolation between this and v.

The slerp interpolation ensures a constant velocity across the interpolation. For \(t=0\) the result is this and for \(t=1\) it is v.

Notes: Algorithm and implementation is thanks to euclideanspace.com

property thisown

The membership flag

toEigenVector()

convert to Eigen Vector :rtype: Eigen::Matrix< double,4,1 > :return: eigen Vector of quaternion

toRotation3D()

Calculates the \(3\times 3\) Rotation matrix

Return type

rw::math::Rotation3D< double >

Returns

A 3x3 rotation matrix \(\mathbf{rot}\) \(\mathbf{rot} = \left[ \begin{array}{ccc} 1-2(q_y^2-q_z^2) & 2(q_x\ q_y+q_z\ q_w)& 2(q_x\ q_z-q_y\ q_w) \\ 2(q_x\ q_y-q_z\ q_w) & 1-2(q_x^2-q_z^2) & 2(q_y\ q_z+q_x\ q_w)\\ 2(q_x\ q_z+q_y\ q_w) & 2(q_y\ q_z-q_x\ q_z) & 1-2(q_x^2-q_y^2) \end{array} \right]\)

class sdurw_math.Quaternionf(*args)

Bases: sdurw_math.Rotation3DVectorf

A Quaternion \(\mathbf{q}\in \mathbb{R}^4\) a complex number used to describe rotations in 3-dimensional space. \(q_w+{\bf i}\ q_x+ {\bf j} q_y+ {\bf k}\ q_z\)

Quaternions can be added and multiplied in a similar way as usual algebraic numbers. Though there are differences. Quaternion multiplication is not commutative which means \(Q\cdot P \neq P\cdot Q\)

__init__(*args)

Overload 1:

constuct Quaterinion of {0,0,0,1}


Overload 2:

Creates a Quaternion :type qx: float :param qx: [in] \(q_x\) :type qy: float :param qy: [in] \(q_y\) :type qz: float :param qz: [in] \(q_z\) :type qw: float :param qw: [in] \(q_w\)


Overload 3:

Creates a Quaternion from another Quaternion :type quat: rw::math::Quaternion< float > :param quat: [in] Quaternion


Overload 4:

Creates a Quaternion from another Rotation3DVector type :type rot: rw::math::Rotation3DVector< float > :param rot: [in] The Rotation3DVector type


Overload 5:

Extracts a Quaternion from Rotation matrix using setRotation(const Rotation3D<R>& rot) :type rot: rw::math::Rotation3D< float > :param rot: [in] A 3x3 rotation matrix \(\mathbf{rot}\)


Overload 6:

Creates a Quaternion from a Eigen quaternion :type r: Eigen::Quaternion< float > :param r: [in] a boost quaternion

copy(*args)

Overload 1:

copy a boost quaternion to this Quaternion :type r: Eigen::Quaternion< float > :param r: [in] - boost quaternion


Overload 2:

copyfrom rotaion matrix, same as setRotation. :type rhs: rw::math::Rotation3D< double > :param rhs: [in] the rotation that will be copyed

e()

Convert to an Eigen Quaternion. :rtype: Eigen::Quaternion< float > :return: Eigen Quaternion representation.

elemDivide(lhs)

element whise division :type lhs: float :param lhs: [in] the scalar to devide with :rtype: rw::math::Quaternion< float > :return: the result of elementwise devision

exp()
getLength()

get length of quaternion \(\sqrt{q_x^2+q_y^2+q_z^2+q_w^2}\) :rtype: float :return: the length og this quaternion

getLengthSquared()

get squared length of quaternion \(q_x^2+q_y^2+q_z^2+q_w^2\) :rtype: float :return: the length og this quaternion

getQw()

get method for the w component :rtype: float :return: the w component of the quaternion

getQx()

get method for the x component :rtype: float :return: the x component of the quaternion

getQy()

get method for the y component :rtype: float :return: the y component of the quaternion

getQz()

get method for the z component :rtype: float :return: the z component of the quaternion

inverse()

Calculate the inverse Quaternion :rtype: rw::math::Quaternion< float > :return: the inverse quaternion

ln()

calculates the natural logerithm of this quaternion :rtype: rw::math::Quaternion< float > :return: natural logetihm

normalize()

normalizes this quaternion so that \(normalze(Q)=\frac{Q}{\sqrt{q_x^2+q_y^2+q_z^2+q_w^2}}\)

pow(power)

calculates the quaternion lifted to the power of power :type power: float :param power: [in] the power the quaternion is lifted to :rtype: rw::math::Quaternion< float > :return: \(Quaternion^power\)

size()

The dimension of the quaternion (i.e. 4). This method is provided to help support generic algorithms using size() and operator[].

slerp(v, t)

Calculates a slerp interpolation between this and v.

The slerp interpolation ensures a constant velocity across the interpolation. For \(t=0\) the result is this and for \(t=1\) it is v.

Notes: Algorithm and implementation is thanks to euclideanspace.com

property thisown

The membership flag

toEigenVector()

convert to Eigen Vector :rtype: Eigen::Matrix< float,4,1 > :return: eigen Vector of quaternion

toRotation3D()

Calculates the \(3\times 3\) Rotation matrix

Return type

rw::math::Rotation3D< float >

Returns

A 3x3 rotation matrix \(\mathbf{rot}\) \(\mathbf{rot} = \left[ \begin{array}{ccc} 1-2(q_y^2-q_z^2) & 2(q_x\ q_y+q_z\ q_w)& 2(q_x\ q_z-q_y\ q_w) \\ 2(q_x\ q_y-q_z\ q_w) & 1-2(q_x^2-q_z^2) & 2(q_y\ q_z+q_x\ q_w)\\ 2(q_x\ q_z+q_y\ q_w) & 2(q_y\ q_z-q_x\ q_z) & 1-2(q_x^2-q_y^2) \end{array} \right]\)

class sdurw_math.RPYd(*args)

Bases: sdurw_math.Rotation3DVectord

A class for representing Roll-Pitch-Yaw Euler angle rotations.

__init__(*args)

Overload 1:

Constructs rotation in which all elements are initialized to 0


Overload 2:

Constructs an initialized roll-pitch-yaw euler angle vector :type roll: float :param roll: Rotation around z :type pitch: float :param pitch: Rotation around y :type yaw: float :param yaw: Rotation around x


Overload 3:

Constructs an RPY object initialized according to the specified Rotation3D

\(\beta = arctan2(-r_{31},\sqrt{r_{11}^2+r_{21}^2})\) \(\alpha = arctan2(r_{21}/cos(\beta), r_{11}/cos(\beta))\) \(\beta = arctan2(r_{32}/cos(\beta), r_{33}/cos(\beta)))\)

Parameters
  • R (rw::math::Rotation3D< double >) – [in] A 3x3 rotation matrix \(\mathbf{R}\)

  • epsilon (float) – [in] Value specifying the value for which \(cos(\beta)\) is assumed 0 and the special case solution assuming \(\alpha=0, \beta=\pi/2 and \gamma = arctan2(r_{21}, r_{22})\) is to be used.


Overload 4:

Constructs an RPY object initialized according to the specified Rotation3D

\(\beta = arctan2(-r_{31},\sqrt{r_{11}^2+r_{21}^2})\) \(\alpha = arctan2(r_{21}/cos(\beta), r_{11}/cos(\beta))\) \(\beta = arctan2(r_{32}/cos(\beta), r_{33}/cos(\beta)))\)

Parameters
  • R (rw::math::Rotation3D< double >) – [in] A 3x3 rotation matrix \(\mathbf{R}\)

  • epsilon – [in] Value specifying the value for which \(cos(\beta)\) is assumed 0 and the special case solution assuming \(\alpha=0, \beta=\pi/2 and \gamma = arctan2(r_{21}, r_{22})\) is to be used.

size()

size of this RPY. :rtype: int :return: the value 3

property thisown

The membership flag

toRotation3D()

Returns the corresponding \(3\times 3\) Rotation matrix :rtype: rw::math::Rotation3D< double > :return: The rotation matrix

class sdurw_math.RPYf(*args)

Bases: sdurw_math.Rotation3DVectorf

A class for representing Roll-Pitch-Yaw Euler angle rotations.

__init__(*args)

Overload 1:

Constructs rotation in which all elements are initialized to 0


Overload 2:

Constructs an initialized roll-pitch-yaw euler angle vector :type roll: float :param roll: Rotation around z :type pitch: float :param pitch: Rotation around y :type yaw: float :param yaw: Rotation around x


Overload 3:

Constructs an RPY object initialized according to the specified Rotation3D

\(\beta = arctan2(-r_{31},\sqrt{r_{11}^2+r_{21}^2})\) \(\alpha = arctan2(r_{21}/cos(\beta), r_{11}/cos(\beta))\) \(\beta = arctan2(r_{32}/cos(\beta), r_{33}/cos(\beta)))\)

Parameters
  • R (rw::math::Rotation3D< float >) – [in] A 3x3 rotation matrix \(\mathbf{R}\)

  • epsilon (float) – [in] Value specifying the value for which \(cos(\beta)\) is assumed 0 and the special case solution assuming \(\alpha=0, \beta=\pi/2 and \gamma = arctan2(r_{21}, r_{22})\) is to be used.


Overload 4:

Constructs an RPY object initialized according to the specified Rotation3D

\(\beta = arctan2(-r_{31},\sqrt{r_{11}^2+r_{21}^2})\) \(\alpha = arctan2(r_{21}/cos(\beta), r_{11}/cos(\beta))\) \(\beta = arctan2(r_{32}/cos(\beta), r_{33}/cos(\beta)))\)

Parameters
  • R (rw::math::Rotation3D< float >) – [in] A 3x3 rotation matrix \(\mathbf{R}\)

  • epsilon – [in] Value specifying the value for which \(cos(\beta)\) is assumed 0 and the special case solution assuming \(\alpha=0, \beta=\pi/2 and \gamma = arctan2(r_{21}, r_{22})\) is to be used.

size()

size of this RPY. :rtype: int :return: the value 3

property thisown

The membership flag

toRotation3D()

Returns the corresponding \(3\times 3\) Rotation matrix :rtype: rw::math::Rotation3D< float > :return: The rotation matrix

class sdurw_math.Random(*args, **kwargs)

Bases: object

Generation of random numbers.

__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

static ran(*args)

Overload 1:

A random double in the range [0, 1[ using a uniform distribution.

Notes: Uses boost::random


Overload 2:

A random double in the range [from, to[ using a uniform distribution.

Notes: Uses boost::random

static ranI(_from, to)

A random integer in the range [from, to[ using a uniform distribution.

Notes: Uses boost::random

static ranNormalDist(mean, sigma)

Returns a random sample around mean with standard deviation sigma using the normal distribution.

Notes: Uses boost::random

Parameters
  • mean (float) – [in] Means value

  • sigma (float) – [in] Standard deviation

Return type

float

Returns

Random sample

static seed(*args)

Overload 1:

Seeds the random number generator.

Notes: Uses boost::random


Overload 2:

Seeds the random number generator with current time of day

Notes: Uses boost::random

property thisown

The membership flag

sdurw_math.Random_ran(*args)

Overload 1:

A random double in the range [0, 1[ using a uniform distribution.

Notes: Uses boost::random


Overload 2:

A random double in the range [from, to[ using a uniform distribution.

Notes: Uses boost::random

sdurw_math.Random_ranI(_from, to)

A random integer in the range [from, to[ using a uniform distribution.

Notes: Uses boost::random

sdurw_math.Random_ranNormalDist(mean, sigma)

Returns a random sample around mean with standard deviation sigma using the normal distribution.

Notes: Uses boost::random

Parameters
  • mean (float) – [in] Means value

  • sigma (float) – [in] Standard deviation

Return type

float

Returns

Random sample

sdurw_math.Random_seed(*args)

Overload 1:

Seeds the random number generator.

Notes: Uses boost::random


Overload 2:

Seeds the random number generator with current time of day

Notes: Uses boost::random

class sdurw_math.Rotation2Dd(*args)

Bases: object

A 2x2 rotation matrix \(\mathbf{R}\in SO(2)\)

\(\mathbf{R}= \left[ \begin{array}{cc} {}^A\hat{X}_B & {}^A\hat{Y}_B \end{array} \right] = \left[ \begin{array}{cc} r_{11} & r_{12} \\ r_{21} & r_{22} \end{array} \right]\)

__init__(*args)

Overload 1:

A rotation matrix with uninitialized storage.


Overload 2:

Constructs an initialized 2x2 rotation matrix

Parameters
  • r11 (float) – \(r_{11}\)

  • r12 (float) – \(r_{12}\)

  • r21 (float) – \(r_{21}\)

  • r22 (float) – \(r_{22}\)

\(\mathbf{R} = \left[ \begin{array}{cc} r_{11} & r_{12} \\ r_{21} & r_{22} \end{array} \right]\)


Overload 3:

Constructs an initialized 2x2 rotation matrix \(\robabx{a}{b}{\mathbf{R}} =\left[ \begin{array}{cc} \robabx{a}{b}{\mathbf{i}} & \robabx{a}{b}{\mathbf{j}} \end{array}\right]\)

Parameters
  • i (rw::math::Vector2D< double >) – \(\robabx{a}{b}{\mathbf{i}}\)

  • j (rw::math::Vector2D< double >) – \(\robabx{a}{b}{\mathbf{j}}\)


Overload 4:

Constructs an initialized 2x2 rotation matrix \(\robabx{a}{b}{\mathbf{R}} =\left[ \begin{array}{cc} \robabx{a}{b}{\mathbf{i}} & \robabx{a}{b}{\mathbf{j}} \end{array}\right]\)

Parameters

theta (float) –


Overload 5:

Construct an initialized 2x2 rotation matrix.

The second of column of the matrix is deduced from the first column.

type i

rw::math::Vector2D< double >

param i

[in] The first column of the rotation matrix.

e()

Returns a boost 2x2 matrix \(\mathbf{M}\in SO(2)\) that represents this rotation

Return type

rw::math::Rotation2D< double >::EigenMatrix2x2

Returns

\(\mathbf{M}\in SO(2)\)

static identity()

Constructs a 2x2 rotation matrix set to identity :rtype: rw::math::Rotation2D< double > :return: a 2x2 identity rotation matrix

\(\mathbf{R} =\left[\begin{array}{cc}1 & 0\\0 & 1\end{array}\right]\)

property thisown

The membership flag

sdurw_math.Rotation2Dd_identity()

Constructs a 2x2 rotation matrix set to identity :rtype: rw::math::Rotation2D< double > :return: a 2x2 identity rotation matrix

\(\mathbf{R} =\left[\begin{array}{cc}1 & 0\\0 & 1\end{array}\right]\)

class sdurw_math.Rotation2Df(*args)

Bases: object

A 2x2 rotation matrix \(\mathbf{R}\in SO(2)\)

\(\mathbf{R}= \left[ \begin{array}{cc} {}^A\hat{X}_B & {}^A\hat{Y}_B \end{array} \right] = \left[ \begin{array}{cc} r_{11} & r_{12} \\ r_{21} & r_{22} \end{array} \right]\)

__init__(*args)

Overload 1:

A rotation matrix with uninitialized storage.


Overload 2:

Constructs an initialized 2x2 rotation matrix

Parameters
  • r11 (float) – \(r_{11}\)

  • r12 (float) – \(r_{12}\)

  • r21 (float) – \(r_{21}\)

  • r22 (float) – \(r_{22}\)

\(\mathbf{R} = \left[ \begin{array}{cc} r_{11} & r_{12} \\ r_{21} & r_{22} \end{array} \right]\)


Overload 3:

Constructs an initialized 2x2 rotation matrix \(\robabx{a}{b}{\mathbf{R}} =\left[ \begin{array}{cc} \robabx{a}{b}{\mathbf{i}} & \robabx{a}{b}{\mathbf{j}} \end{array}\right]\)

Parameters
  • i (rw::math::Vector2D< float >) – \(\robabx{a}{b}{\mathbf{i}}\)

  • j (rw::math::Vector2D< float >) – \(\robabx{a}{b}{\mathbf{j}}\)


Overload 4:

Constructs an initialized 2x2 rotation matrix \(\robabx{a}{b}{\mathbf{R}} =\left[ \begin{array}{cc} \robabx{a}{b}{\mathbf{i}} & \robabx{a}{b}{\mathbf{j}} \end{array}\right]\)

Parameters

theta (float) –


Overload 5:

Construct an initialized 2x2 rotation matrix.

The second of column of the matrix is deduced from the first column.

type i

rw::math::Vector2D< float >

param i

[in] The first column of the rotation matrix.

e()

Returns a boost 2x2 matrix \(\mathbf{M}\in SO(2)\) that represents this rotation

Return type

rw::math::Rotation2D< float >::EigenMatrix2x2

Returns

\(\mathbf{M}\in SO(2)\)

static identity()

Constructs a 2x2 rotation matrix set to identity :rtype: rw::math::Rotation2D< float > :return: a 2x2 identity rotation matrix

\(\mathbf{R} =\left[\begin{array}{cc}1 & 0\\0 & 1\end{array}\right]\)

property thisown

The membership flag

sdurw_math.Rotation2Df_identity()

Constructs a 2x2 rotation matrix set to identity :rtype: rw::math::Rotation2D< float > :return: a 2x2 identity rotation matrix

\(\mathbf{R} =\left[\begin{array}{cc}1 & 0\\0 & 1\end{array}\right]\)

class sdurw_math.Rotation3DVectord(*args, **kwargs)

Bases: object

An abstract base class for Rotation3D parameterisations

Classes that represents a parametrisation of a 3D rotation may inherit from this class

__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

property thisown

The membership flag

toRotation3D()

Returns the corresponding \(3\times 3\) Rotation matrix :rtype: rw::math::Rotation3D< double > :return: The rotation matrix

class sdurw_math.Rotation3DVectorf(*args, **kwargs)

Bases: object

An abstract base class for Rotation3D parameterisations

Classes that represents a parametrisation of a 3D rotation may inherit from this class

__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

property thisown

The membership flag

toRotation3D()

Returns the corresponding \(3\times 3\) Rotation matrix :rtype: rw::math::Rotation3D< float > :return: The rotation matrix

class sdurw_math.Rotation3Dd(*args)

Bases: object

A 3x3 rotation matrix \(\mathbf{R}\in SO(3)\)

\(\mathbf{R}= \left[ \begin{array}{ccc} {}^A\hat{X}_B & {}^A\hat{Y}_B & {}^A\hat{Z}_B \end{array} \right] = \left[ \begin{array}{ccc} r_{11} & r_{12} & r_{13} \\ r_{21} & r_{22} & r_{23} \\ r_{31} & r_{32} & r_{33} \end{array} \right]\)

__init__(*args)

Overload 1:

A rotation matrix with uninitialized storage.


Overload 2:

Constructs an initialized 3x3 rotation matrix

Parameters
  • r11 (float) – \(r_{11}\)

  • r12 (float) – \(r_{12}\)

  • r13 (float) – \(r_{13}\)

  • r21 (float) – \(r_{21}\)

  • r22 (float) – \(r_{22}\)

  • r23 (float) – \(r_{23}\)

  • r31 (float) – \(r_{31}\)

  • r32 (float) – \(r_{32}\)

  • r33 (float) – \(r_{33}\)

\(\mathbf{R} = \left[ \begin{array}{ccc} r_{11} & r_{12} & r_{13} \\ r_{21} & r_{22} & r_{23} \\ r_{31} & r_{32} & r_{33} \end{array} \right]\)


Overload 3:

Constructs an initialized 3x3 rotation matrix \(\robabx{a}{b}{\mathbf{R}} =\left[ \begin{array}{ccc} \robabx{a}{b}{\mathbf{i}} & \robabx{a}{b}{\mathbf{j}} & \robabx{a}{b}{\mathbf{k}} \end{array}\right]\)

Parameters
  • i (rw::math::Vector3D< double >) – \(\robabx{a}{b}{\mathbf{i}}\)

  • j (rw::math::Vector3D< double >) – \(\robabx{a}{b}{\mathbf{j}}\)

  • k (rw::math::Vector3D< double >) – \(\robabx{a}{b}{\mathbf{k}}\)


Overload 4:

Initialize Rotation3D from other rotation types :type rotVec: rw::math::Rotation3DVector< double > :param rotVec: [in] rotation type such as EAA, RPY, or Quaternion

e()

Returns a Eigen 3x3 matrix \(\mathbf{M}\in SO(3)\) that represents this rotation

Return type

rw::math::Rotation3D< double >::EigenMatrix3x3

Returns

\(\mathbf{M}\in SO(3)\)

equal(*args)

Compares rotations with a given precision

Performs an element wise comparison. Two elements are considered equal if the difference are less than precision.

Parameters
  • rot (rw::math::Rotation3D< double >) – [in] Rotation to compare with

  • precision (float) – [in] The precision to use for testing

Return type

boolean

Returns

True if all elements are less than precision apart.

getCol(i)

Returns the i’th column of the rotation matrix :type i: int :param i: [in] Index of the column to return. Only valid indices are 0, 1 and 2.

getRow(i)

Returns the i’th row of the rotation matrix :type i: int :param i: [in] Index of the row to return. Only valid indices are 0, 1 and 2.

static identity()

Constructs a 3x3 rotation matrix set to identity :rtype: rw::math::Rotation3D< double > :return: a 3x3 identity rotation matrix

\(\mathbf{R} =\left[\begin{array}{ccc}1 & 0 & 0 \\0 & 1 & 0 \\0 & 0 & 1\end{array}\right]\)

inverse(*args)

Overload 1:

Calculate the inverse. Notes: This function changes the object that it is invoked on, but this is about x5 faster than rot = inverse( rot ) See also: inverse(const Rotation3D< T > &) for the (slower) version that does not change the rotation object itself. :rtype: rw::math::Rotation3D< double > :return: the inverse rotation.


Overload 2:

Calculate the inverse. :type copy: boolean :param copy: [in] if coopy is false, This function changes the object that it is invoked

on, but this is about x5 faster than rot = inverse( rot ). else it changes the object, making it a bit slower.

Return type

rw::math::Rotation3D< double >

Returns

the inverse rotation.

isProperRotation(*args)

Overload 1:

Verify that this rotation is a proper rotation

Return type

boolean

Returns

True if this rotation is considered a proper rotation


Overload 2:

Verify that this rotation is a proper rotation

Return type

boolean

Returns

True if this rotation is considered a proper rotation

static multiply(*args)

Overload 1:

Write to result the product a * b.


Overload 2:

Write to result the product a * b.


Overload 3:

Calculates \(\robabx{a}{c}{\mathbf{R}} =\robabx{a}{b}{\mathbf{R}} \robabx{b}{c}{\mathbf{R}}\)

Parameters
  • aRb (rw::math::Rotation3D< double >) – [in] \(\robabx{a}{b}{\mathbf{R}}\)

  • bRc (rw::math::Rotation3D< double >) – [in] \(\robabx{b}{c}{\mathbf{R}}\)

Return type

rw::math::Rotation3D< double >

Returns

\(\robabx{a}{c}{\mathbf{R}}\)


Overload 4:

Calculates \(\robabx{a}{c}{\mathbf{v}} =\robabx{a}{b}{\mathbf{R}} \robabx{b}{c}{\mathbf{v}}\)

Parameters
  • aRb (rw::math::Rotation3D< double >) – [in] \(\robabx{a}{b}{\mathbf{R}}\)

  • bVc (rw::math::Vector3D< double >) – [in] \(\robabx{b}{c}{\mathbf{v}}\)

Return type

rw::math::Vector3D< double >

Returns

\(\robabx{a}{c}{\mathbf{v}}\)

normalize()

Normalizes the rotation matrix to satisfy SO(3).

Makes a normalization of the rotation matrix such that the columns are normalized and othogonal s.t. it belongs to SO(3).

static skew(v)

Creates a skew symmetric matrix from a Vector3D. Also known as the cross product matrix of v.

Parameters

v (rw::math::Vector3D< double >) – [in] vector to create Skew matrix from

property thisown

The membership flag

tr()
sdurw_math.Rotation3Dd_identity()

Constructs a 3x3 rotation matrix set to identity :rtype: rw::math::Rotation3D< double > :return: a 3x3 identity rotation matrix

\(\mathbf{R} =\left[\begin{array}{ccc}1 & 0 & 0 \\0 & 1 & 0 \\0 & 0 & 1\end{array}\right]\)

sdurw_math.Rotation3Dd_multiply(*args)

Overload 1:

Write to result the product a * b.


Overload 2:

Write to result the product a * b.


Overload 3:

Calculates \(\robabx{a}{c}{\mathbf{R}} =\robabx{a}{b}{\mathbf{R}} \robabx{b}{c}{\mathbf{R}}\)

Parameters
  • aRb (rw::math::Rotation3D< double >) – [in] \(\robabx{a}{b}{\mathbf{R}}\)

  • bRc (rw::math::Rotation3D< double >) – [in] \(\robabx{b}{c}{\mathbf{R}}\)

Return type

rw::math::Rotation3D< double >

Returns

\(\robabx{a}{c}{\mathbf{R}}\)


Overload 4:

Calculates \(\robabx{a}{c}{\mathbf{v}} =\robabx{a}{b}{\mathbf{R}} \robabx{b}{c}{\mathbf{v}}\)

Parameters
  • aRb (rw::math::Rotation3D< double >) – [in] \(\robabx{a}{b}{\mathbf{R}}\)

  • bVc (rw::math::Vector3D< double >) – [in] \(\robabx{b}{c}{\mathbf{v}}\)

Return type

rw::math::Vector3D< double >

Returns

\(\robabx{a}{c}{\mathbf{v}}\)

sdurw_math.Rotation3Dd_skew(v)

Creates a skew symmetric matrix from a Vector3D. Also known as the cross product matrix of v.

Parameters

v (rw::math::Vector3D< double >) – [in] vector to create Skew matrix from

class sdurw_math.Rotation3Df(*args)

Bases: object

A 3x3 rotation matrix \(\mathbf{R}\in SO(3)\)

\(\mathbf{R}= \left[ \begin{array}{ccc} {}^A\hat{X}_B & {}^A\hat{Y}_B & {}^A\hat{Z}_B \end{array} \right] = \left[ \begin{array}{ccc} r_{11} & r_{12} & r_{13} \\ r_{21} & r_{22} & r_{23} \\ r_{31} & r_{32} & r_{33} \end{array} \right]\)

__init__(*args)

Overload 1:

A rotation matrix with uninitialized storage.


Overload 2:

Constructs an initialized 3x3 rotation matrix

Parameters
  • r11 (float) – \(r_{11}\)

  • r12 (float) – \(r_{12}\)

  • r13 (float) – \(r_{13}\)

  • r21 (float) – \(r_{21}\)

  • r22 (float) – \(r_{22}\)

  • r23 (float) – \(r_{23}\)

  • r31 (float) – \(r_{31}\)

  • r32 (float) – \(r_{32}\)

  • r33 (float) – \(r_{33}\)

\(\mathbf{R} = \left[ \begin{array}{ccc} r_{11} & r_{12} & r_{13} \\ r_{21} & r_{22} & r_{23} \\ r_{31} & r_{32} & r_{33} \end{array} \right]\)


Overload 3:

Constructs an initialized 3x3 rotation matrix \(\robabx{a}{b}{\mathbf{R}} =\left[ \begin{array}{ccc} \robabx{a}{b}{\mathbf{i}} & \robabx{a}{b}{\mathbf{j}} & \robabx{a}{b}{\mathbf{k}} \end{array}\right]\)

Parameters
  • i (rw::math::Vector3D< float >) – \(\robabx{a}{b}{\mathbf{i}}\)

  • j (rw::math::Vector3D< float >) – \(\robabx{a}{b}{\mathbf{j}}\)

  • k (rw::math::Vector3D< float >) – \(\robabx{a}{b}{\mathbf{k}}\)


Overload 4:

Initialize Rotation3D from other rotation types :type rotVec: rw::math::Rotation3DVector< float > :param rotVec: [in] rotation type such as EAA, RPY, or Quaternion

e()

Returns a Eigen 3x3 matrix \(\mathbf{M}\in SO(3)\) that represents this rotation

Return type

rw::math::Rotation3D< float >::EigenMatrix3x3

Returns

\(\mathbf{M}\in SO(3)\)

equal(*args)

Compares rotations with a given precision

Performs an element wise comparison. Two elements are considered equal if the difference are less than precision.

Parameters
  • rot (rw::math::Rotation3D< float >) – [in] Rotation to compare with

  • precision (float) – [in] The precision to use for testing

Return type

boolean

Returns

True if all elements are less than precision apart.

getCol(i)

Returns the i’th column of the rotation matrix :type i: int :param i: [in] Index of the column to return. Only valid indices are 0, 1 and 2.

getRow(i)

Returns the i’th row of the rotation matrix :type i: int :param i: [in] Index of the row to return. Only valid indices are 0, 1 and 2.

static identity()

Constructs a 3x3 rotation matrix set to identity :rtype: rw::math::Rotation3D< float > :return: a 3x3 identity rotation matrix

\(\mathbf{R} =\left[\begin{array}{ccc}1 & 0 & 0 \\0 & 1 & 0 \\0 & 0 & 1\end{array}\right]\)

inverse(*args)

Overload 1:

Calculate the inverse. Notes: This function changes the object that it is invoked on, but this is about x5 faster than rot = inverse( rot ) See also: inverse(const Rotation3D< T > &) for the (slower) version that does not change the rotation object itself. :rtype: rw::math::Rotation3D< float > :return: the inverse rotation.


Overload 2:

Calculate the inverse. :type copy: boolean :param copy: [in] if coopy is false, This function changes the object that it is invoked

on, but this is about x5 faster than rot = inverse( rot ). else it changes the object, making it a bit slower.

Return type

rw::math::Rotation3D< float >

Returns

the inverse rotation.

isProperRotation(*args)

Overload 1:

Verify that this rotation is a proper rotation

Return type

boolean

Returns

True if this rotation is considered a proper rotation


Overload 2:

Verify that this rotation is a proper rotation

Return type

boolean

Returns

True if this rotation is considered a proper rotation

static multiply(*args)

Overload 1:

Write to result the product a * b.


Overload 2:

Write to result the product a * b.


Overload 3:

Calculates \(\robabx{a}{c}{\mathbf{R}} =\robabx{a}{b}{\mathbf{R}} \robabx{b}{c}{\mathbf{R}}\)

Parameters
  • aRb (rw::math::Rotation3D< float >) – [in] \(\robabx{a}{b}{\mathbf{R}}\)

  • bRc (rw::math::Rotation3D< float >) – [in] \(\robabx{b}{c}{\mathbf{R}}\)

Return type

rw::math::Rotation3D< float >

Returns

\(\robabx{a}{c}{\mathbf{R}}\)


Overload 4:

Calculates \(\robabx{a}{c}{\mathbf{v}} =\robabx{a}{b}{\mathbf{R}} \robabx{b}{c}{\mathbf{v}}\)

Parameters
  • aRb (rw::math::Rotation3D< float >) – [in] \(\robabx{a}{b}{\mathbf{R}}\)

  • bVc (rw::math::Vector3D< float >) – [in] \(\robabx{b}{c}{\mathbf{v}}\)

Return type

rw::math::Vector3D< float >

Returns

\(\robabx{a}{c}{\mathbf{v}}\)

normalize()

Normalizes the rotation matrix to satisfy SO(3).

Makes a normalization of the rotation matrix such that the columns are normalized and othogonal s.t. it belongs to SO(3).

static skew(v)

Creates a skew symmetric matrix from a Vector3D. Also known as the cross product matrix of v.

Parameters

v (rw::math::Vector3D< float >) – [in] vector to create Skew matrix from

property thisown

The membership flag

tr()
sdurw_math.Rotation3Df_identity()

Constructs a 3x3 rotation matrix set to identity :rtype: rw::math::Rotation3D< float > :return: a 3x3 identity rotation matrix

\(\mathbf{R} =\left[\begin{array}{ccc}1 & 0 & 0 \\0 & 1 & 0 \\0 & 0 & 1\end{array}\right]\)

sdurw_math.Rotation3Df_multiply(*args)

Overload 1:

Write to result the product a * b.


Overload 2:

Write to result the product a * b.


Overload 3:

Calculates \(\robabx{a}{c}{\mathbf{R}} =\robabx{a}{b}{\mathbf{R}} \robabx{b}{c}{\mathbf{R}}\)

Parameters
  • aRb (rw::math::Rotation3D< float >) – [in] \(\robabx{a}{b}{\mathbf{R}}\)

  • bRc (rw::math::Rotation3D< float >) – [in] \(\robabx{b}{c}{\mathbf{R}}\)

Return type

rw::math::Rotation3D< float >

Returns

\(\robabx{a}{c}{\mathbf{R}}\)


Overload 4:

Calculates \(\robabx{a}{c}{\mathbf{v}} =\robabx{a}{b}{\mathbf{R}} \robabx{b}{c}{\mathbf{v}}\)

Parameters
  • aRb (rw::math::Rotation3D< float >) – [in] \(\robabx{a}{b}{\mathbf{R}}\)

  • bVc (rw::math::Vector3D< float >) – [in] \(\robabx{b}{c}{\mathbf{v}}\)

Return type

rw::math::Vector3D< float >

Returns

\(\robabx{a}{c}{\mathbf{v}}\)

sdurw_math.Rotation3Df_skew(v)

Creates a skew symmetric matrix from a Vector3D. Also known as the cross product matrix of v.

Parameters

v (rw::math::Vector3D< float >) – [in] vector to create Skew matrix from

class sdurw_math.SwigPyIterator(*args, **kwargs)

Bases: object

__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

advance(n)
copy()
decr(n=1)
distance(x)
equal(x)
incr(n=1)
next()
previous()
property thisown

The membership flag

value()
class sdurw_math.Transform3Dd(*args)

Bases: object

A 4x4 homogeneous transform matrix \(\mathbf{T}\in SE(3)\)

\(\mathbf{T} =\left[ \begin{array}{cc} \mathbf{R} & \mathbf{d} \\ \begin{array}{ccc}0 & 0 & 0\end{array} & 1 \end{array}\right]\)

static DH(alpha, a, d, theta)

Constructs a homogeneous transform using the original Denavit-Hartenberg notation

Parameters
  • alpha (float) – [in] \(\alpha_i\)

  • a (float) – [in] \(a_i\)

  • d (float) – [in] \(d_i\)

  • theta (float) – [in] \(\theta_i\)

Return type

rw::math::Transform3D< double >

Returns

\(^{i-1}\mathbf{T}_i\)

\(\robabx{i-1}{i}{\mathbf{T}}= \left[ \begin{array}{cccc} c\theta_i & -s\theta_i c\alpha_i & s\theta_i s\alpha_i & a_i c\theta_i \\ s\theta_i & c\theta_i c\alpha_i & -c\theta_i s\alpha_i & a_i s\theta_i \\ 0 & s\alpha_i & c\alpha_i & d_i \\ 0 & 0 & 0 & 1 \end{array} \right]\)

static DHHGP(alpha, a, beta, b)

Constructs a homogeneous transform using the Gordon (modified) Denavit-Hartenberg notation

Parameters
  • alpha (float) – [in] \(\alpha_i\)

  • a (float) – [in] \(a_i\)

  • beta (float) – [in] \(\beta_i\)

  • b (float) – [in] \(b_i\)

Return type

rw::math::Transform3D< double >

Returns

\(^{i-1}\mathbf{T}_i\)

Notes: The Gordon (modified) Denavit-Hartenberg differs from the original Denavit-Hartenberg as it branches between parallel and non-parallel z-axes.

\(z_{i-1}\) is close to parallel to \(z_i\) \(\robabx{i-1}{i}{\mathbf{T}}= \left[ \begin{array}{cccc} c\beta_i & s\alpha_i s\beta_i & c\alpha_i s\beta_i & a_i c\beta_i \\ 0 & c\alpha_i & -s\alpha_i & b_i \\ -s\beta_i & s\alpha_i c\beta_i & c\alpha_i c\beta_i & -a_i s\beta \\ 0 & 0 & 0 & 1 \end{array} \right]\)

P()

Gets the position part \(\mathbf{d}\) from \(\mathbf{T}\) :rtype: rw::math::Vector3D< double > :return: \(\mathbf{d}\)

R()

Gets the rotation part \(\mathbf{R}\) from \(\mathbf{T}\) :rtype: rw::math::Rotation3D< double > :return: \(\mathbf{R}\)

__init__(*args)

Overload 1:

Default Constructor.

Initializes with 0 translation and Identity matrix as rotation


Overload 2:

Constructs a homogeneous transform :type d: rw::math::Vector3D< double > :param d: [in] \(\mathbf{d}\) A 3x1 translation vector :type R: rw::math::Rotation3D< double > :param R: [in] \(\mathbf{R}\) A 3x3 rotation matrix


Overload 3:

A homogeneous transform with a rotation of R and a translation of zero.


Overload 4:

A homogeneous transform with a rotation of zero and a translation of d.


Overload 5:

Constructs a homogeneous transform

Calling this constructor is equivalent to the transform Transform3D(d, r.toRotation3D()).

Parameters
  • d (rw::math::Vector3D< double >) – [in] \(\mathbf{d}\) A 3x1 translation vector

  • r (rw::math::Rotation3DVector< double >) – [in] \(\mathbf{r}\) A 3x1 rotation vector

static craigDH(alpha, a, d, theta)

Constructs a homogeneous transform using the Craig (modified) Denavit-Hartenberg notation

Parameters
  • alpha (float) – [in] \(\alpha_{i-1}\)

  • a (float) – [in] \(a_{i-1}\)

  • d (float) – [in] \(d_i\)

  • theta (float) – [in] \(\theta_i\)

Return type

rw::math::Transform3D< double >

Returns

\(\robabx{i-1}{i}{\mathbf{T}}\)

Notes: The Craig (modified) Denavit-Hartenberg notation differs from the original Denavit-Hartenberg notation and is given as

\(\robabx{i-1}{i}{\mathbf{T}} =\left[\begin{array}{cccc}c\theta_i & -s\theta_i & 0 & a_{i-1} \\s\theta_i c\alpha_{i-1} & c\theta_i c\alpha_{i-1} & -s\alpha_{i-1} & -s\alpha_{i-1}d_i \\s\theta_i s\alpha_{i-1} & c\theta_i s\alpha_{i-1} & c\alpha_{i-1} & c\alpha_{i-1}d_i \\0 & 0 & 0 & 1\end{array}\right]\)

e()

Returns a Eigen 4x4 matrix \(\mathbf{M}\in SE(3)\) that represents this homogeneous transformation

Return type

Eigen::Matrix< double,4,4 >

Returns

\(\mathbf{M}\in SE(3)\)

equal(*args)

Compares the transformations with a given precision

Performs an element wise comparison. Two elements are considered equal if the difference are less than precision.

Parameters
  • t3d (rw::math::Transform3D< double >) – [in] Transform to compare with

  • precision (float) – [in] The precision to use for testing

Return type

boolean

Returns

True if all elements are less than precision apart.

static identity()

Constructs the identity transform :rtype: rw::math::Transform3D< double > :return: the identity transform

\(\mathbf{T} =\left[\begin{array}{cccc}1 & 0 & 0 & 0\\0 & 1 & 0 & 0\\0 & 0 & 1 & 0\\0 & 0 & 0 & 1\end{array}\right]\)

static invMult(*args)

Overload 1:

computes the inverse of t1 and multiplies it with t2. The result is saved in t1. t1 = inv(t1) * t2


Overload 2:

computes the inverse of t1 and multiplies it with t2. The result is saved in t1. t1 = inv(t1) * t2

static makeLookAt(eye, center, up)

creates a transformation that is positioned in eye and looking toward center along -z where up indicates the upward direction along which the y-axis is placed. Same convention as for gluLookAt and is handy for placing a cameraview. :type eye: rw::math::Vector3D< double > :param eye: [in] position of view :type center: rw::math::Vector3D< double > :param center: [in] point to look toward :type up: rw::math::Vector3D< double > :param up: [in] the upward direction (the :rtype: rw::math::Transform3D< double > :return: Transformation

static multiply(a, b, result)

Write to result the product a * b.

property thisown

The membership flag

sdurw_math.Transform3Dd_DH(alpha, a, d, theta)

Constructs a homogeneous transform using the original Denavit-Hartenberg notation

Parameters
  • alpha (float) – [in] \(\alpha_i\)

  • a (float) – [in] \(a_i\)

  • d (float) – [in] \(d_i\)

  • theta (float) – [in] \(\theta_i\)

Return type

rw::math::Transform3D< double >

Returns

\(^{i-1}\mathbf{T}_i\)

\(\robabx{i-1}{i}{\mathbf{T}}= \left[ \begin{array}{cccc} c\theta_i & -s\theta_i c\alpha_i & s\theta_i s\alpha_i & a_i c\theta_i \\ s\theta_i & c\theta_i c\alpha_i & -c\theta_i s\alpha_i & a_i s\theta_i \\ 0 & s\alpha_i & c\alpha_i & d_i \\ 0 & 0 & 0 & 1 \end{array} \right]\)

sdurw_math.Transform3Dd_DHHGP(alpha, a, beta, b)

Constructs a homogeneous transform using the Gordon (modified) Denavit-Hartenberg notation

Parameters
  • alpha (float) – [in] \(\alpha_i\)

  • a (float) – [in] \(a_i\)

  • beta (float) – [in] \(\beta_i\)

  • b (float) – [in] \(b_i\)

Return type

rw::math::Transform3D< double >

Returns

\(^{i-1}\mathbf{T}_i\)

Notes: The Gordon (modified) Denavit-Hartenberg differs from the original Denavit-Hartenberg as it branches between parallel and non-parallel z-axes.

\(z_{i-1}\) is close to parallel to \(z_i\) \(\robabx{i-1}{i}{\mathbf{T}}= \left[ \begin{array}{cccc} c\beta_i & s\alpha_i s\beta_i & c\alpha_i s\beta_i & a_i c\beta_i \\ 0 & c\alpha_i & -s\alpha_i & b_i \\ -s\beta_i & s\alpha_i c\beta_i & c\alpha_i c\beta_i & -a_i s\beta \\ 0 & 0 & 0 & 1 \end{array} \right]\)

sdurw_math.Transform3Dd_craigDH(alpha, a, d, theta)

Constructs a homogeneous transform using the Craig (modified) Denavit-Hartenberg notation

Parameters
  • alpha (float) – [in] \(\alpha_{i-1}\)

  • a (float) – [in] \(a_{i-1}\)

  • d (float) – [in] \(d_i\)

  • theta (float) – [in] \(\theta_i\)

Return type

rw::math::Transform3D< double >

Returns

\(\robabx{i-1}{i}{\mathbf{T}}\)

Notes: The Craig (modified) Denavit-Hartenberg notation differs from the original Denavit-Hartenberg notation and is given as

\(\robabx{i-1}{i}{\mathbf{T}} =\left[\begin{array}{cccc}c\theta_i & -s\theta_i & 0 & a_{i-1} \\s\theta_i c\alpha_{i-1} & c\theta_i c\alpha_{i-1} & -s\alpha_{i-1} & -s\alpha_{i-1}d_i \\s\theta_i s\alpha_{i-1} & c\theta_i s\alpha_{i-1} & c\alpha_{i-1} & c\alpha_{i-1}d_i \\0 & 0 & 0 & 1\end{array}\right]\)

sdurw_math.Transform3Dd_identity()

Constructs the identity transform :rtype: rw::math::Transform3D< double > :return: the identity transform

\(\mathbf{T} =\left[\begin{array}{cccc}1 & 0 & 0 & 0\\0 & 1 & 0 & 0\\0 & 0 & 1 & 0\\0 & 0 & 0 & 1\end{array}\right]\)

sdurw_math.Transform3Dd_invMult(*args)

Overload 1:

computes the inverse of t1 and multiplies it with t2. The result is saved in t1. t1 = inv(t1) * t2


Overload 2:

computes the inverse of t1 and multiplies it with t2. The result is saved in t1. t1 = inv(t1) * t2

sdurw_math.Transform3Dd_makeLookAt(eye, center, up)

creates a transformation that is positioned in eye and looking toward center along -z where up indicates the upward direction along which the y-axis is placed. Same convention as for gluLookAt and is handy for placing a cameraview. :type eye: rw::math::Vector3D< double > :param eye: [in] position of view :type center: rw::math::Vector3D< double > :param center: [in] point to look toward :type up: rw::math::Vector3D< double > :param up: [in] the upward direction (the :rtype: rw::math::Transform3D< double > :return: Transformation

sdurw_math.Transform3Dd_multiply(a, b, result)

Write to result the product a * b.

class sdurw_math.Transform3Df(*args)

Bases: object

A 4x4 homogeneous transform matrix \(\mathbf{T}\in SE(3)\)

\(\mathbf{T} =\left[ \begin{array}{cc} \mathbf{R} & \mathbf{d} \\ \begin{array}{ccc}0 & 0 & 0\end{array} & 1 \end{array}\right]\)

static DH(alpha, a, d, theta)

Constructs a homogeneous transform using the original Denavit-Hartenberg notation

Parameters
  • alpha (float) – [in] \(\alpha_i\)

  • a (float) – [in] \(a_i\)

  • d (float) – [in] \(d_i\)

  • theta (float) – [in] \(\theta_i\)

Return type

rw::math::Transform3D< float >

Returns

\(^{i-1}\mathbf{T}_i\)

\(\robabx{i-1}{i}{\mathbf{T}}= \left[ \begin{array}{cccc} c\theta_i & -s\theta_i c\alpha_i & s\theta_i s\alpha_i & a_i c\theta_i \\ s\theta_i & c\theta_i c\alpha_i & -c\theta_i s\alpha_i & a_i s\theta_i \\ 0 & s\alpha_i & c\alpha_i & d_i \\ 0 & 0 & 0 & 1 \end{array} \right]\)

static DHHGP(alpha, a, beta, b)

Constructs a homogeneous transform using the Gordon (modified) Denavit-Hartenberg notation

Parameters
  • alpha (float) – [in] \(\alpha_i\)

  • a (float) – [in] \(a_i\)

  • beta (float) – [in] \(\beta_i\)

  • b (float) – [in] \(b_i\)

Return type

rw::math::Transform3D< float >

Returns

\(^{i-1}\mathbf{T}_i\)

Notes: The Gordon (modified) Denavit-Hartenberg differs from the original Denavit-Hartenberg as it branches between parallel and non-parallel z-axes.

\(z_{i-1}\) is close to parallel to \(z_i\) \(\robabx{i-1}{i}{\mathbf{T}}= \left[ \begin{array}{cccc} c\beta_i & s\alpha_i s\beta_i & c\alpha_i s\beta_i & a_i c\beta_i \\ 0 & c\alpha_i & -s\alpha_i & b_i \\ -s\beta_i & s\alpha_i c\beta_i & c\alpha_i c\beta_i & -a_i s\beta \\ 0 & 0 & 0 & 1 \end{array} \right]\)

P()

Gets the position part \(\mathbf{d}\) from \(\mathbf{T}\) :rtype: rw::math::Vector3D< float > :return: \(\mathbf{d}\)

R()

Gets the rotation part \(\mathbf{R}\) from \(\mathbf{T}\) :rtype: rw::math::Rotation3D< float > :return: \(\mathbf{R}\)

__init__(*args)

Overload 1:

Default Constructor.

Initializes with 0 translation and Identity matrix as rotation


Overload 2:

Constructs a homogeneous transform :type d: rw::math::Vector3D< float > :param d: [in] \(\mathbf{d}\) A 3x1 translation vector :type R: rw::math::Rotation3D< float > :param R: [in] \(\mathbf{R}\) A 3x3 rotation matrix


Overload 3:

A homogeneous transform with a rotation of R and a translation of zero.


Overload 4:

A homogeneous transform with a rotation of zero and a translation of d.


Overload 5:

Constructs a homogeneous transform

Calling this constructor is equivalent to the transform Transform3D(d, r.toRotation3D()).

Parameters
  • d (rw::math::Vector3D< float >) – [in] \(\mathbf{d}\) A 3x1 translation vector

  • r (rw::math::Rotation3DVector< float >) – [in] \(\mathbf{r}\) A 3x1 rotation vector

static craigDH(alpha, a, d, theta)

Constructs a homogeneous transform using the Craig (modified) Denavit-Hartenberg notation

Parameters
  • alpha (float) – [in] \(\alpha_{i-1}\)

  • a (float) – [in] \(a_{i-1}\)

  • d (float) – [in] \(d_i\)

  • theta (float) – [in] \(\theta_i\)

Return type

rw::math::Transform3D< float >

Returns

\(\robabx{i-1}{i}{\mathbf{T}}\)

Notes: The Craig (modified) Denavit-Hartenberg notation differs from the original Denavit-Hartenberg notation and is given as

\(\robabx{i-1}{i}{\mathbf{T}} =\left[\begin{array}{cccc}c\theta_i & -s\theta_i & 0 & a_{i-1} \\s\theta_i c\alpha_{i-1} & c\theta_i c\alpha_{i-1} & -s\alpha_{i-1} & -s\alpha_{i-1}d_i \\s\theta_i s\alpha_{i-1} & c\theta_i s\alpha_{i-1} & c\alpha_{i-1} & c\alpha_{i-1}d_i \\0 & 0 & 0 & 1\end{array}\right]\)

e()

Returns a Eigen 4x4 matrix \(\mathbf{M}\in SE(3)\) that represents this homogeneous transformation

Return type

Eigen::Matrix< float,4,4 >

Returns

\(\mathbf{M}\in SE(3)\)

equal(*args)

Compares the transformations with a given precision

Performs an element wise comparison. Two elements are considered equal if the difference are less than precision.

Parameters
  • t3d (rw::math::Transform3D< float >) – [in] Transform to compare with

  • precision (float) – [in] The precision to use for testing

Return type

boolean

Returns

True if all elements are less than precision apart.

static identity()

Constructs the identity transform :rtype: rw::math::Transform3D< float > :return: the identity transform

\(\mathbf{T} =\left[\begin{array}{cccc}1 & 0 & 0 & 0\\0 & 1 & 0 & 0\\0 & 0 & 1 & 0\\0 & 0 & 0 & 1\end{array}\right]\)

static invMult(*args)

Overload 1:

computes the inverse of t1 and multiplies it with t2. The result is saved in t1. t1 = inv(t1) * t2


Overload 2:

computes the inverse of t1 and multiplies it with t2. The result is saved in t1. t1 = inv(t1) * t2

static makeLookAt(eye, center, up)

creates a transformation that is positioned in eye and looking toward center along -z where up indicates the upward direction along which the y-axis is placed. Same convention as for gluLookAt and is handy for placing a cameraview. :type eye: rw::math::Vector3D< float > :param eye: [in] position of view :type center: rw::math::Vector3D< float > :param center: [in] point to look toward :type up: rw::math::Vector3D< float > :param up: [in] the upward direction (the :rtype: rw::math::Transform3D< float > :return: Transformation

static multiply(a, b, result)

Write to result the product a * b.

property thisown

The membership flag

sdurw_math.Transform3Df_DH(alpha, a, d, theta)

Constructs a homogeneous transform using the original Denavit-Hartenberg notation

Parameters
  • alpha (float) – [in] \(\alpha_i\)

  • a (float) – [in] \(a_i\)

  • d (float) – [in] \(d_i\)

  • theta (float) – [in] \(\theta_i\)

Return type

rw::math::Transform3D< float >

Returns

\(^{i-1}\mathbf{T}_i\)

\(\robabx{i-1}{i}{\mathbf{T}}= \left[ \begin{array}{cccc} c\theta_i & -s\theta_i c\alpha_i & s\theta_i s\alpha_i & a_i c\theta_i \\ s\theta_i & c\theta_i c\alpha_i & -c\theta_i s\alpha_i & a_i s\theta_i \\ 0 & s\alpha_i & c\alpha_i & d_i \\ 0 & 0 & 0 & 1 \end{array} \right]\)

sdurw_math.Transform3Df_DHHGP(alpha, a, beta, b)

Constructs a homogeneous transform using the Gordon (modified) Denavit-Hartenberg notation

Parameters
  • alpha (float) – [in] \(\alpha_i\)

  • a (float) – [in] \(a_i\)

  • beta (float) – [in] \(\beta_i\)

  • b (float) – [in] \(b_i\)

Return type

rw::math::Transform3D< float >

Returns

\(^{i-1}\mathbf{T}_i\)

Notes: The Gordon (modified) Denavit-Hartenberg differs from the original Denavit-Hartenberg as it branches between parallel and non-parallel z-axes.

\(z_{i-1}\) is close to parallel to \(z_i\) \(\robabx{i-1}{i}{\mathbf{T}}= \left[ \begin{array}{cccc} c\beta_i & s\alpha_i s\beta_i & c\alpha_i s\beta_i & a_i c\beta_i \\ 0 & c\alpha_i & -s\alpha_i & b_i \\ -s\beta_i & s\alpha_i c\beta_i & c\alpha_i c\beta_i & -a_i s\beta \\ 0 & 0 & 0 & 1 \end{array} \right]\)

sdurw_math.Transform3Df_craigDH(alpha, a, d, theta)

Constructs a homogeneous transform using the Craig (modified) Denavit-Hartenberg notation

Parameters
  • alpha (float) – [in] \(\alpha_{i-1}\)

  • a (float) – [in] \(a_{i-1}\)

  • d (float) – [in] \(d_i\)

  • theta (float) – [in] \(\theta_i\)

Return type

rw::math::Transform3D< float >

Returns

\(\robabx{i-1}{i}{\mathbf{T}}\)

Notes: The Craig (modified) Denavit-Hartenberg notation differs from the original Denavit-Hartenberg notation and is given as

\(\robabx{i-1}{i}{\mathbf{T}} =\left[\begin{array}{cccc}c\theta_i & -s\theta_i & 0 & a_{i-1} \\s\theta_i c\alpha_{i-1} & c\theta_i c\alpha_{i-1} & -s\alpha_{i-1} & -s\alpha_{i-1}d_i \\s\theta_i s\alpha_{i-1} & c\theta_i s\alpha_{i-1} & c\alpha_{i-1} & c\alpha_{i-1}d_i \\0 & 0 & 0 & 1\end{array}\right]\)

sdurw_math.Transform3Df_identity()

Constructs the identity transform :rtype: rw::math::Transform3D< float > :return: the identity transform

\(\mathbf{T} =\left[\begin{array}{cccc}1 & 0 & 0 & 0\\0 & 1 & 0 & 0\\0 & 0 & 1 & 0\\0 & 0 & 0 & 1\end{array}\right]\)

sdurw_math.Transform3Df_invMult(*args)

Overload 1:

computes the inverse of t1 and multiplies it with t2. The result is saved in t1. t1 = inv(t1) * t2


Overload 2:

computes the inverse of t1 and multiplies it with t2. The result is saved in t1. t1 = inv(t1) * t2

sdurw_math.Transform3Df_makeLookAt(eye, center, up)

creates a transformation that is positioned in eye and looking toward center along -z where up indicates the upward direction along which the y-axis is placed. Same convention as for gluLookAt and is handy for placing a cameraview. :type eye: rw::math::Vector3D< float > :param eye: [in] position of view :type center: rw::math::Vector3D< float > :param center: [in] point to look toward :type up: rw::math::Vector3D< float > :param up: [in] the upward direction (the :rtype: rw::math::Transform3D< float > :return: Transformation

sdurw_math.Transform3Df_multiply(a, b, result)

Write to result the product a * b.

class sdurw_math.Vector2Dd(*args)

Bases: object

A 2D vector \(\mathbf{v}\in \mathbb{R}^2\)

\(\robabx{i}{j}{\mathbf{v}} = \left[ \begin{array}{c} v_x \\ v_y \end{array} \right]\)

In addition, Vector2D supports the cross product operator: v3 = cross(v1, v2)

Usage example:

using namespace rw::math;

Vector2D v1(1.0, 2.0);
Vector2D v2(6.0, 7.0);
Vector2D v3 = cross( v1, v2 );
Vector2D v4 = v2 - v1;
__init__(*args)

Overload 1:

Creates a 2D vector initialized with 0’s


Overload 2:

Creates a 2D vector

Parameters
  • x (float) – [in] \(x\)

  • y (float) – [in] \(y\)

angle()

returns the counter clock-wise angle between this vector and the x-axis vector (1,0). The angle returned will be in the interval [-Pi,Pi]

e()

Returns Eigen vector equivalent to *this.

norm1()

Returns the Manhatten norm (1-norm) of the vector :rtype: float :return: the norm

norm2()

Returns the Euclidean norm (2-norm) of the vector :rtype: float :return: the norm

normInf()

Returns the infinte norm (\(\inf\)-norm) of the vector :rtype: float :return: the norm

size()

The dimension of the vector (i.e. 2).

This method is provided to help support generic algorithms using size() and operator[].

property thisown

The membership flag

class sdurw_math.Vector2Df(*args)

Bases: object

A 2D vector \(\mathbf{v}\in \mathbb{R}^2\)

\(\robabx{i}{j}{\mathbf{v}} = \left[ \begin{array}{c} v_x \\ v_y \end{array} \right]\)

In addition, Vector2D supports the cross product operator: v3 = cross(v1, v2)

Usage example:

using namespace rw::math;

Vector2D v1(1.0, 2.0);
Vector2D v2(6.0, 7.0);
Vector2D v3 = cross( v1, v2 );
Vector2D v4 = v2 - v1;
__init__(*args)

Overload 1:

Creates a 2D vector initialized with 0’s


Overload 2:

Creates a 2D vector

Parameters
  • x (float) – [in] \(x\)

  • y (float) – [in] \(y\)

angle()

returns the counter clock-wise angle between this vector and the x-axis vector (1,0). The angle returned will be in the interval [-Pi,Pi]

e()

Returns Eigen vector equivalent to *this.

norm1()

Returns the Manhatten norm (1-norm) of the vector :rtype: float :return: the norm

norm2()

Returns the Euclidean norm (2-norm) of the vector :rtype: float :return: the norm

normInf()

Returns the infinte norm (\(\inf\)-norm) of the vector :rtype: float :return: the norm

size()

The dimension of the vector (i.e. 2).

This method is provided to help support generic algorithms using size() and operator[].

property thisown

The membership flag

class sdurw_math.Vector3Dd(*args)

Bases: object

A 3D vector \(\mathbf{v}\in \mathbb{R}^3\)

\(\robabx{i}{j}{\mathbf{v}} = \left[ \begin{array}{c} v_x \\ v_y \\ v_z \end{array} \right]\)

Usage example:

const Vector3D v1(1.0, 2.0, 3.0);
const Vector3D v2(6.0, 7.0, 8.0);
const Vector3D v3 = cross(v1, v2);
const double d = dot(v1, v2);
const Vector3D v4 = v2 - v1;
__init__(*args)

Overload 1:

Creates a 3D vector initialized with 0’s


Overload 2:

Creates a 3D vector :type x: float :param x: [in] \(x\) :type y: float :param y: [in] \(y\) :type z: float :param z: [in] \(z\)


Overload 3:

construct vector from std::vector :type vec: std::vector< double,std::allocator< double > > :param vec: [in] the vector to construct from

cross(vec)

Calculate cross product :type vec: rw::math::Vector3D< double > :param vec: [in] the vector to cross with :rtype: rw::math::Vector3D< double > :return: the cross product

dot(vec)

calculate the dot product :type vec: rw::math::Vector3D< double > :param vec: [in] the vecor to be dotted :rtype: float :return: the dot product

e()

Returns Reference to Eigen Vector :rtype: rw::math::Vector3D< double >::EigenVector3D :return: reference to underling eigen

elemAdd(rhs)

Scalar addition.

elemDivide(rhs)

element wise division. :type rhs: rw::math::Vector3D< double > :param rhs: [in] the vector being devided with :rtype: rw::math::Vector3D< double > :return: the resulting Vector3D

elemMultiply(rhs)

Elementweise multiplication. :type rhs: rw::math::Vector3D< double > :param rhs: [in] vector :rtype: rw::math::Vector3D< double > :return: the element wise product

elemSubtract(rhs)

Scalar subtraction.

norm1()

Returns the Manhatten norm (1-norm) of the vector :rtype: float :return: the norm

norm2()

Returns the Euclidean norm (2-norm) of the vector :rtype: float :return: the norm

normInf()

Returns the infinte norm (\(\inf\)-norm) of the vector :rtype: float :return: the norm

normalize()

normalize vector to get length 1 :rtype: rw::math::Vector3D< double > :return: the normalized Vector

size()

The dimension of the vector (i.e. 3).

This method is provided to help support generic algorithms using size() and operator[]. :rtype: int :return: the size

property thisown

The membership flag

static x()

Get x vector (1,0,0) :rtype: rw::math::Vector3D< double > :return: vector.

static y()

Get y vector (0,1,0) :rtype: rw::math::Vector3D< double > :return: vector.

static z()

Get z vector (0,0,1) :rtype: rw::math::Vector3D< double > :return: vector.

static zero()

Get zero vector. :rtype: rw::math::Vector3D< double > :return: vector.

sdurw_math.Vector3Dd_x()

Get x vector (1,0,0) :rtype: rw::math::Vector3D< double > :return: vector.

sdurw_math.Vector3Dd_y()

Get y vector (0,1,0) :rtype: rw::math::Vector3D< double > :return: vector.

sdurw_math.Vector3Dd_z()

Get z vector (0,0,1) :rtype: rw::math::Vector3D< double > :return: vector.

sdurw_math.Vector3Dd_zero()

Get zero vector. :rtype: rw::math::Vector3D< double > :return: vector.

class sdurw_math.Vector3Df(*args)

Bases: object

A 3D vector \(\mathbf{v}\in \mathbb{R}^3\)

\(\robabx{i}{j}{\mathbf{v}} = \left[ \begin{array}{c} v_x \\ v_y \\ v_z \end{array} \right]\)

Usage example:

const Vector3D v1(1.0, 2.0, 3.0);
const Vector3D v2(6.0, 7.0, 8.0);
const Vector3D v3 = cross(v1, v2);
const double d = dot(v1, v2);
const Vector3D v4 = v2 - v1;
__init__(*args)

Overload 1:

Creates a 3D vector initialized with 0’s


Overload 2:

Creates a 3D vector :type x: float :param x: [in] \(x\) :type y: float :param y: [in] \(y\) :type z: float :param z: [in] \(z\)


Overload 3:

construct vector from std::vector :type vec: std::vector< float,std::allocator< float > > :param vec: [in] the vector to construct from

cross(vec)

Calculate cross product :type vec: rw::math::Vector3D< float > :param vec: [in] the vector to cross with :rtype: rw::math::Vector3D< float > :return: the cross product

dot(vec)

calculate the dot product :type vec: rw::math::Vector3D< float > :param vec: [in] the vecor to be dotted :rtype: float :return: the dot product

e()

Returns Reference to Eigen Vector :rtype: rw::math::Vector3D< float >::EigenVector3D :return: reference to underling eigen

elemAdd(rhs)

Scalar addition.

elemDivide(rhs)

element wise division. :type rhs: rw::math::Vector3D< float > :param rhs: [in] the vector being devided with :rtype: rw::math::Vector3D< float > :return: the resulting Vector3D

elemMultiply(rhs)

Elementweise multiplication. :type rhs: rw::math::Vector3D< float > :param rhs: [in] vector :rtype: rw::math::Vector3D< float > :return: the element wise product

elemSubtract(rhs)

Scalar subtraction.

norm1()

Returns the Manhatten norm (1-norm) of the vector :rtype: float :return: the norm

norm2()

Returns the Euclidean norm (2-norm) of the vector :rtype: float :return: the norm

normInf()

Returns the infinte norm (\(\inf\)-norm) of the vector :rtype: float :return: the norm

normalize()

normalize vector to get length 1 :rtype: rw::math::Vector3D< float > :return: the normalized Vector

size()

The dimension of the vector (i.e. 3).

This method is provided to help support generic algorithms using size() and operator[]. :rtype: int :return: the size

property thisown

The membership flag

static x()

Get x vector (1,0,0) :rtype: rw::math::Vector3D< float > :return: vector.

static y()

Get y vector (0,1,0) :rtype: rw::math::Vector3D< float > :return: vector.

static z()

Get z vector (0,0,1) :rtype: rw::math::Vector3D< float > :return: vector.

static zero()

Get zero vector. :rtype: rw::math::Vector3D< float > :return: vector.

sdurw_math.Vector3Df_x()

Get x vector (1,0,0) :rtype: rw::math::Vector3D< float > :return: vector.

sdurw_math.Vector3Df_y()

Get y vector (0,1,0) :rtype: rw::math::Vector3D< float > :return: vector.

sdurw_math.Vector3Df_z()

Get z vector (0,0,1) :rtype: rw::math::Vector3D< float > :return: vector.

sdurw_math.Vector3Df_zero()

Get zero vector. :rtype: rw::math::Vector3D< float > :return: vector.

class sdurw_math.Vector4Dd(*args, **kwargs)

Bases: sdurw_common.Serializable

A N-Dimensional Vector

__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

dot(vec)

calculate the dot product :type vec: rw::math::VectorND< 4,double > :param vec: [in] the vecor to be dotted :rtype: float :return: the dot product

e()

Accessor for the internal Eigen VectorND.

elemAdd(rhs)

Scalar addition.

elemDivide(rhs)

element wise division. :type rhs: rw::math::VectorND< 4,double > :param rhs: [in] the vector being devided with :rtype: rw::math::VectorND< 4,double > :return: the resulting Vector3D

elemMultiply(rhs)

Elementweise multiplication. :type rhs: rw::math::VectorND< 4,double > :param rhs: [in] vector :rtype: rw::math::VectorND< 4,double > :return: the element wise product

elemSubtract(rhs)

Scalar subtraction.

norm1()

Returns the Manhatten norm (1-norm) of the VectorND :rtype: float :return: the norm

norm2()

Returns the Euclidean norm (2-norm) of the VectorND :rtype: float :return: the norm

normInf()

Returns the infinte norm (\(\inf\)-norm) of the VectorND :rtype: float :return: the norm

normalize()

normalize vector to get length 1 :rtype: rw::math::VectorND< 4,double > :return: the normalized Vector

size()

The dimension of the VectorND (i.e. 3). This method is provided to help support generic algorithms using

size() and operator[].

property thisown

The membership flag

toStdVector()

converts the vector to a std:vector :rtype: std::vector< double,std::allocator< double > > :return: a std::vector

static zero()

Get zero-initialized vector. :rtype: rw::math::VectorND< 4,double > :return: vector.

sdurw_math.Vector4Dd_zero()

Get zero-initialized vector. :rtype: rw::math::VectorND< 4,double > :return: vector.

class sdurw_math.Vector4Df(*args, **kwargs)

Bases: sdurw_common.Serializable

A N-Dimensional Vector

__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

dot(vec)

calculate the dot product :type vec: rw::math::VectorND< 4,float > :param vec: [in] the vecor to be dotted :rtype: float :return: the dot product

e()

Accessor for the internal Eigen VectorND.

elemAdd(rhs)

Scalar addition.

elemDivide(rhs)

element wise division. :type rhs: rw::math::VectorND< 4,float > :param rhs: [in] the vector being devided with :rtype: rw::math::VectorND< 4,float > :return: the resulting Vector3D

elemMultiply(rhs)

Elementweise multiplication. :type rhs: rw::math::VectorND< 4,float > :param rhs: [in] vector :rtype: rw::math::VectorND< 4,float > :return: the element wise product

elemSubtract(rhs)

Scalar subtraction.

norm1()

Returns the Manhatten norm (1-norm) of the VectorND :rtype: float :return: the norm

norm2()

Returns the Euclidean norm (2-norm) of the VectorND :rtype: float :return: the norm

normInf()

Returns the infinte norm (\(\inf\)-norm) of the VectorND :rtype: float :return: the norm

normalize()

normalize vector to get length 1 :rtype: rw::math::VectorND< 4,float > :return: the normalized Vector

size()

The dimension of the VectorND (i.e. 3). This method is provided to help support generic algorithms using

size() and operator[].

property thisown

The membership flag

toStdVector()

converts the vector to a std:vector :rtype: std::vector< float,std::allocator< float > > :return: a std::vector

static zero()

Get zero-initialized vector. :rtype: rw::math::VectorND< 4,float > :return: vector.

sdurw_math.Vector4Df_zero()

Get zero-initialized vector. :rtype: rw::math::VectorND< 4,float > :return: vector.

class sdurw_math.Vector5Dd(*args, **kwargs)

Bases: sdurw_common.Serializable

A N-Dimensional Vector

__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

dot(vec)

calculate the dot product :type vec: rw::math::VectorND< 5,double > :param vec: [in] the vecor to be dotted :rtype: float :return: the dot product

e()

Accessor for the internal Eigen VectorND.

elemAdd(rhs)

Scalar addition.

elemDivide(rhs)

element wise division. :type rhs: rw::math::VectorND< 5,double > :param rhs: [in] the vector being devided with :rtype: rw::math::VectorND< 5,double > :return: the resulting Vector3D

elemMultiply(rhs)

Elementweise multiplication. :type rhs: rw::math::VectorND< 5,double > :param rhs: [in] vector :rtype: rw::math::VectorND< 5,double > :return: the element wise product

elemSubtract(rhs)

Scalar subtraction.

norm1()

Returns the Manhatten norm (1-norm) of the VectorND :rtype: float :return: the norm

norm2()

Returns the Euclidean norm (2-norm) of the VectorND :rtype: float :return: the norm

normInf()

Returns the infinte norm (\(\inf\)-norm) of the VectorND :rtype: float :return: the norm

normalize()

normalize vector to get length 1 :rtype: rw::math::VectorND< 5,double > :return: the normalized Vector

size()

The dimension of the VectorND (i.e. 3). This method is provided to help support generic algorithms using

size() and operator[].

property thisown

The membership flag

toStdVector()

converts the vector to a std:vector :rtype: std::vector< double,std::allocator< double > > :return: a std::vector

static zero()

Get zero-initialized vector. :rtype: rw::math::VectorND< 5,double > :return: vector.

sdurw_math.Vector5Dd_zero()

Get zero-initialized vector. :rtype: rw::math::VectorND< 5,double > :return: vector.

class sdurw_math.Vector5Df(*args, **kwargs)

Bases: sdurw_common.Serializable

A N-Dimensional Vector

__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

dot(vec)

calculate the dot product :type vec: rw::math::VectorND< 5,float > :param vec: [in] the vecor to be dotted :rtype: float :return: the dot product

e()

Accessor for the internal Eigen VectorND.

elemAdd(rhs)

Scalar addition.

elemDivide(rhs)

element wise division. :type rhs: rw::math::VectorND< 5,float > :param rhs: [in] the vector being devided with :rtype: rw::math::VectorND< 5,float > :return: the resulting Vector3D

elemMultiply(rhs)

Elementweise multiplication. :type rhs: rw::math::VectorND< 5,float > :param rhs: [in] vector :rtype: rw::math::VectorND< 5,float > :return: the element wise product

elemSubtract(rhs)

Scalar subtraction.

norm1()

Returns the Manhatten norm (1-norm) of the VectorND :rtype: float :return: the norm

norm2()

Returns the Euclidean norm (2-norm) of the VectorND :rtype: float :return: the norm

normInf()

Returns the infinte norm (\(\inf\)-norm) of the VectorND :rtype: float :return: the norm

normalize()

normalize vector to get length 1 :rtype: rw::math::VectorND< 5,float > :return: the normalized Vector

size()

The dimension of the VectorND (i.e. 3). This method is provided to help support generic algorithms using

size() and operator[].

property thisown

The membership flag

toStdVector()

converts the vector to a std:vector :rtype: std::vector< float,std::allocator< float > > :return: a std::vector

static zero()

Get zero-initialized vector. :rtype: rw::math::VectorND< 5,float > :return: vector.

sdurw_math.Vector5Df_zero()

Get zero-initialized vector. :rtype: rw::math::VectorND< 5,float > :return: vector.

class sdurw_math.Vector6Dd(*args, **kwargs)

Bases: sdurw_common.Serializable

A N-Dimensional Vector

__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

dot(vec)

calculate the dot product :type vec: rw::math::VectorND< 6,double > :param vec: [in] the vecor to be dotted :rtype: float :return: the dot product

e()

Accessor for the internal Eigen VectorND.

elemAdd(rhs)

Scalar addition.

elemDivide(rhs)

element wise division. :type rhs: rw::math::VectorND< 6,double > :param rhs: [in] the vector being devided with :rtype: rw::math::VectorND< 6,double > :return: the resulting Vector3D

elemMultiply(rhs)

Elementweise multiplication. :type rhs: rw::math::VectorND< 6,double > :param rhs: [in] vector :rtype: rw::math::VectorND< 6,double > :return: the element wise product

elemSubtract(rhs)

Scalar subtraction.

norm1()

Returns the Manhatten norm (1-norm) of the VectorND :rtype: float :return: the norm

norm2()

Returns the Euclidean norm (2-norm) of the VectorND :rtype: float :return: the norm

normInf()

Returns the infinte norm (\(\inf\)-norm) of the VectorND :rtype: float :return: the norm

normalize()

normalize vector to get length 1 :rtype: rw::math::VectorND< 6,double > :return: the normalized Vector

size()

The dimension of the VectorND (i.e. 3). This method is provided to help support generic algorithms using

size() and operator[].

property thisown

The membership flag

toStdVector()

converts the vector to a std:vector :rtype: std::vector< double,std::allocator< double > > :return: a std::vector

static zero()

Get zero-initialized vector. :rtype: rw::math::VectorND< 6,double > :return: vector.

sdurw_math.Vector6Dd_zero()

Get zero-initialized vector. :rtype: rw::math::VectorND< 6,double > :return: vector.

class sdurw_math.Vector6Df(*args, **kwargs)

Bases: sdurw_common.Serializable

A N-Dimensional Vector

__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

dot(vec)

calculate the dot product :type vec: rw::math::VectorND< 6,float > :param vec: [in] the vecor to be dotted :rtype: float :return: the dot product

e()

Accessor for the internal Eigen VectorND.

elemAdd(rhs)

Scalar addition.

elemDivide(rhs)

element wise division. :type rhs: rw::math::VectorND< 6,float > :param rhs: [in] the vector being devided with :rtype: rw::math::VectorND< 6,float > :return: the resulting Vector3D

elemMultiply(rhs)

Elementweise multiplication. :type rhs: rw::math::VectorND< 6,float > :param rhs: [in] vector :rtype: rw::math::VectorND< 6,float > :return: the element wise product

elemSubtract(rhs)

Scalar subtraction.

norm1()

Returns the Manhatten norm (1-norm) of the VectorND :rtype: float :return: the norm

norm2()

Returns the Euclidean norm (2-norm) of the VectorND :rtype: float :return: the norm

normInf()

Returns the infinte norm (\(\inf\)-norm) of the VectorND :rtype: float :return: the norm

normalize()

normalize vector to get length 1 :rtype: rw::math::VectorND< 6,float > :return: the normalized Vector

size()

The dimension of the VectorND (i.e. 3). This method is provided to help support generic algorithms using

size() and operator[].

property thisown

The membership flag

toStdVector()

converts the vector to a std:vector :rtype: std::vector< float,std::allocator< float > > :return: a std::vector

static zero()

Get zero-initialized vector. :rtype: rw::math::VectorND< 6,float > :return: vector.

sdurw_math.Vector6Df_zero()

Get zero-initialized vector. :rtype: rw::math::VectorND< 6,float > :return: vector.

class sdurw_math.VectorEigenMatrix3d(*args)

Bases: object

__init__(*args)

Initialize self. See help(type(self)) for accurate signature.

append(x)
assign(n, x)
back()
begin()
capacity()
clear()
empty()
end()
erase(*args)
front()
get_allocator()
insert(*args)
iterator()
pop()
pop_back()
push_back(x)
rbegin()
rend()
reserve(n)
resize(*args)
size()
swap(v)
property thisown

The membership flag

class sdurw_math.VectorEigenMatrix3f(*args)

Bases: object

__init__(*args)

Initialize self. See help(type(self)) for accurate signature.

append(x)
assign(n, x)
back()
begin()
capacity()
clear()
empty()
end()
erase(*args)
front()
get_allocator()
insert(*args)
iterator()
pop()
pop_back()
push_back(x)
rbegin()
rend()
reserve(n)
resize(*args)
size()
swap(v)
property thisown

The membership flag

class sdurw_math.VectorEigenMatrix3id(*args)

Bases: object

__init__(*args)

Initialize self. See help(type(self)) for accurate signature.

append(x)
assign(n, x)
back()
begin()
capacity()
clear()
empty()
end()
erase(*args)
front()
get_allocator()
insert(*args)
iterator()
pop()
pop_back()
push_back(x)
rbegin()
rend()
reserve(n)
resize(*args)
size()
swap(v)
property thisown

The membership flag

class sdurw_math.VectorEigenRowVector3d(*args)

Bases: object

__init__(*args)

Initialize self. See help(type(self)) for accurate signature.

append(x)
assign(n, x)
back()
begin()
capacity()
clear()
empty()
end()
erase(*args)
front()
get_allocator()
insert(*args)
iterator()
pop()
pop_back()
push_back(x)
rbegin()
rend()
reserve(n)
resize(*args)
size()
swap(v)
property thisown

The membership flag

class sdurw_math.VectorEigenRowVector3f(*args)

Bases: object

__init__(*args)

Initialize self. See help(type(self)) for accurate signature.

append(x)
assign(n, x)
back()
begin()
capacity()
clear()
empty()
end()
erase(*args)
front()
get_allocator()
insert(*args)
iterator()
pop()
pop_back()
push_back(x)
rbegin()
rend()
reserve(n)
resize(*args)
size()
swap(v)
property thisown

The membership flag

class sdurw_math.VectorEigenVector3d(*args)

Bases: object

__init__(*args)

Initialize self. See help(type(self)) for accurate signature.

append(x)
assign(n, x)
back()
begin()
capacity()
clear()
empty()
end()
erase(*args)
front()
get_allocator()
insert(*args)
iterator()
pop()
pop_back()
push_back(x)
rbegin()
rend()
reserve(n)
resize(*args)
size()
swap(v)
property thisown

The membership flag

class sdurw_math.VectorEigenVector3f(*args)

Bases: object

__init__(*args)

Initialize self. See help(type(self)) for accurate signature.

append(x)
assign(n, x)
back()
begin()
capacity()
clear()
empty()
end()
erase(*args)
front()
get_allocator()
insert(*args)
iterator()
pop()
pop_back()
push_back(x)
rbegin()
rend()
reserve(n)
resize(*args)
size()
swap(v)
property thisown

The membership flag

class sdurw_math.VectorEigenVector3id(*args)

Bases: object

__init__(*args)

Initialize self. See help(type(self)) for accurate signature.

append(x)
assign(n, x)
back()
begin()
capacity()
clear()
empty()
end()
erase(*args)
front()
get_allocator()
insert(*args)
iterator()
pop()
pop_back()
push_back(x)
rbegin()
rend()
reserve(n)
resize(*args)
size()
swap(v)
property thisown

The membership flag

class sdurw_math.VectorVector2D(*args)

Bases: object

__init__(*args)

Initialize self. See help(type(self)) for accurate signature.

append(x)
assign(n, x)
back()
begin()
capacity()
clear()
empty()
end()
erase(*args)
front()
get_allocator()
insert(*args)
iterator()
pop()
pop_back()
push_back(x)
rbegin()
rend()
reserve(n)
resize(*args)
size()
swap(v)
property thisown

The membership flag

class sdurw_math.VectorVector3D(*args)

Bases: object

__init__(*args)

Initialize self. See help(type(self)) for accurate signature.

append(x)
assign(n, x)
back()
begin()
capacity()
clear()
empty()
end()
erase(*args)
front()
get_allocator()
insert(*args)
iterator()
pop()
pop_back()
push_back(x)
rbegin()
rend()
reserve(n)
resize(*args)
size()
swap(v)
property thisown

The membership flag

class sdurw_math.VectorVector3DCPtr(*args)

Bases: object

Ptr stores a pointer and optionally takes ownership of the value.

__init__(*args)

Overload 1:

Default constructor yielding a NULL-pointer.


Overload 2:

Do not take ownership of ptr.

ptr can be null.

The constructor is implicit on purpose.

back()
capacity()
deref()

The pointer stored in the object.

empty()
front()
getDeref()

Member access operator.

get_allocator()
isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.

size()
property thisown

The membership flag

class sdurw_math.VectorVector3DPtr(*args)

Bases: object

Ptr stores a pointer and optionally takes ownership of the value.

__init__(*args)

Overload 1:

Default constructor yielding a NULL-pointer.


Overload 2:

Do not take ownership of ptr.

ptr can be null.

The constructor is implicit on purpose.

append(x)
assign(n, x)
back()
begin()
capacity()
clear()
cptr()
deref()

The pointer stored in the object.

empty()
end()
erase(*args)
front()
getDeref()

Member access operator.

get_allocator()
insert(*args)
isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.

iterator()
pop()
pop_back()
push_back(x)
rbegin()
rend()
reserve(n)
resize(*args)
size()
swap(v)
property thisown

The membership flag

class sdurw_math.VectorVector3D_f(*args)

Bases: object

__init__(*args)

Initialize self. See help(type(self)) for accurate signature.

append(x)
assign(n, x)
back()
begin()
capacity()
clear()
empty()
end()
erase(*args)
front()
get_allocator()
insert(*args)
iterator()
pop()
pop_back()
push_back(x)
rbegin()
rend()
reserve(n)
resize(*args)
size()
swap(v)
property thisown

The membership flag

class sdurw_math.VectorVector3D_fCPtr(*args)

Bases: object

Ptr stores a pointer and optionally takes ownership of the value.

__init__(*args)

Overload 1:

Default constructor yielding a NULL-pointer.


Overload 2:

Do not take ownership of ptr.

ptr can be null.

The constructor is implicit on purpose.

back()
capacity()
deref()

The pointer stored in the object.

empty()
front()
getDeref()

Member access operator.

get_allocator()
isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.

size()
property thisown

The membership flag

class sdurw_math.VectorVector3D_fPtr(*args)

Bases: object

Ptr stores a pointer and optionally takes ownership of the value.

__init__(*args)

Overload 1:

Default constructor yielding a NULL-pointer.


Overload 2:

Do not take ownership of ptr.

ptr can be null.

The constructor is implicit on purpose.

append(x)
assign(n, x)
back()
begin()
capacity()
clear()
cptr()
deref()

The pointer stored in the object.

empty()
end()
erase(*args)
front()
getDeref()

Member access operator.

get_allocator()
insert(*args)
isNull()

checks if the pointer is null :rtype: boolean :return: Returns true if the pointer is null

isShared()

check if this Ptr has shared ownership or none ownership :rtype: boolean :return: true if Ptr has shared ownership, false if it has no ownership.

iterator()
pop()
pop_back()
push_back(x)
rbegin()
rend()
reserve(n)
resize(*args)
size()
swap(v)
property thisown

The membership flag

class sdurw_math.Vectord(*args)

Bases: object

Configuration vector

__init__(*args)

Overload 1:

A configuration of vector of length dim.


Overload 2:

Default constructor.

The vector will be of dimension zero.


Overload 3:

Creates a Vector of length n and initialized with values from values

The method reads n values from values and do not check whether reading out of bounds.

Parameters
  • n (int) – [in] Length of q.

  • values (float) – [in] Values to initialize with


Overload 4:

Creates a Vector of length n and initialize all values in Vector to value

Parameters
  • n (int) – [in] Length of q.

  • value (float) – [in] Value to initialize

e()

Accessor for the internal Eigen vector state.

empty()

True if the configuration is of dimension zero.

getSubPart(start, cnt)

Start of sequence iterator.

End of sequence iterator.

Start of sequence iterator.

End of sequence iterator.

Extracts a sub part (range) of this Vector. :type start: int :param start: [in] Start index :type cnt: int :param cnt: [in] the number of elements to include :rtype: rw::math::Vector< double > :return:

norm1()

Returns the Manhatten norm (1-norm) of the configuration :rtype: float :return: the norm

norm2()

Returns the Euclidean norm (2-norm) of the configuration :rtype: float :return: the norm

normInf()

Returns the infinte norm (\(\inf\)-norm) of the configuration :rtype: float :return: the norm

setSubPart(index, part)

Set a part of the vector. :type index: int :param index: [in] first index. :type part: rw::math::Vector< double > :param part: [in] the subpart to set.

size()

The dimension of the configuration vector.

property thisown

The membership flag

static zero(n)

Returns Vector of length n initialized with 0’s

sdurw_math.Vectord_zero(n)

Returns Vector of length n initialized with 0’s

class sdurw_math.Vectorf(*args)

Bases: object

Configuration vector

__init__(*args)

Overload 1:

A configuration of vector of length dim.


Overload 2:

Default constructor.

The vector will be of dimension zero.


Overload 3:

Creates a Vector of length n and initialized with values from values

The method reads n values from values and do not check whether reading out of bounds.

Parameters
  • n (int) – [in] Length of q.

  • values (float) – [in] Values to initialize with


Overload 4:

Creates a Vector of length n and initialize all values in Vector to value

Parameters
  • n (int) – [in] Length of q.

  • value (float) – [in] Value to initialize

e()

Accessor for the internal Eigen vector state.

empty()

True if the configuration is of dimension zero.

getSubPart(start, cnt)

Start of sequence iterator.

End of sequence iterator.

Start of sequence iterator.

End of sequence iterator.

Extracts a sub part (range) of this Vector. :type start: int :param start: [in] Start index :type cnt: int :param cnt: [in] the number of elements to include :rtype: rw::math::Vector< float > :return:

norm1()

Returns the Manhatten norm (1-norm) of the configuration :rtype: float :return: the norm

norm2()

Returns the Euclidean norm (2-norm) of the configuration :rtype: float :return: the norm

normInf()

Returns the infinte norm (\(\inf\)-norm) of the configuration :rtype: float :return: the norm

setSubPart(index, part)

Set a part of the vector. :type index: int :param index: [in] first index. :type part: rw::math::Vector< float > :param part: [in] the subpart to set.

size()

The dimension of the configuration vector.

property thisown

The membership flag

static zero(n)

Returns Vector of length n initialized with 0’s

sdurw_math.Vectorf_zero(n)

Returns Vector of length n initialized with 0’s

class sdurw_math.VelocityScrew6Dd(*args)

Bases: object

Class for representing 6 degrees of freedom velocity screws.

\[\begin{split}\mathbf{\nu} = \left[ \begin{array}{c} v_x\\ v_y\\ v_z\\ \omega_x\\ \omega_y\\ \omega_z \end{array} \right]\end{split}\]

A VelocityScrew is the description of a frames linear and rotational velocity with respect to some reference frame.

__init__(*args)

Overload 1:

Constructs a 6 degrees of freedom velocity screw

Parameters
  • vx (float) – [in] \(v_x\)

  • vy (float) – [in] \(v_y\)

  • vz (float) – [in] \(v_z\)

  • wx (float) – [in] \(\omega_x\)

  • wy (float) – [in] \(\omega_y\)

  • wz (float) – [in] \(\omega_z\)


Overload 2:

Default Constructor. Initialized the velocity to 0


Overload 3:

Constructs a velocity screw in frame \(a\) from a transform \(\robabx{a}{b}{\mathbf{T}}\).

Parameters

transform (rw::math::Transform3D< double >) – [in] the corresponding transform.


Overload 4:

Constructs a velocity screw from a linear and angular velocity

Parameters
  • linear (rw::math::Vector3D< double >) – [in] linear velocity

  • angular (rw::math::EAA< double >) – [in] angular velocity

angular()

Extracts the angular velocity and represents it using an equivalent-angle-axis as \(\dot{\Theta}\mathbf{k}\)

Return type

rw::math::EAA< double >

Returns

the angular velocity

e()

Converter to Eigen vector

linear()

Extracts the linear velocity

Return type

rw::math::Vector3D< double >

Returns

the linear velocity

norm1()

Takes the 1-norm of the velocity screw. All elements both angular and linear are given the same weight.

Return type

float

Returns

the 1-norm

norm2()

Takes the 2-norm of the velocity screw. All elements both angular and linear are given the same weight

Return type

float

Returns

the 2-norm

normInf()

Takes the infinite norm of the velocity screw. All elements both angular and linear are given the same weight.

Return type

float

Returns

the infinite norm

property thisown

The membership flag

class sdurw_math.VelocityScrew6Df(*args)

Bases: object

Class for representing 6 degrees of freedom velocity screws.

\[\begin{split}\mathbf{\nu} = \left[ \begin{array}{c} v_x\\ v_y\\ v_z\\ \omega_x\\ \omega_y\\ \omega_z \end{array} \right]\end{split}\]

A VelocityScrew is the description of a frames linear and rotational velocity with respect to some reference frame.

__init__(*args)

Overload 1:

Constructs a 6 degrees of freedom velocity screw

Parameters
  • vx (float) – [in] \(v_x\)

  • vy (float) – [in] \(v_y\)

  • vz (float) – [in] \(v_z\)

  • wx (float) – [in] \(\omega_x\)

  • wy (float) – [in] \(\omega_y\)

  • wz (float) – [in] \(\omega_z\)


Overload 2:

Default Constructor. Initialized the velocity to 0


Overload 3:

Constructs a velocity screw in frame \(a\) from a transform \(\robabx{a}{b}{\mathbf{T}}\).

Parameters

transform (rw::math::Transform3D< float >) – [in] the corresponding transform.


Overload 4:

Constructs a velocity screw from a linear and angular velocity

Parameters
  • linear (rw::math::Vector3D< float >) – [in] linear velocity

  • angular (rw::math::EAA< float >) – [in] angular velocity

angular()

Extracts the angular velocity and represents it using an equivalent-angle-axis as \(\dot{\Theta}\mathbf{k}\)

Return type

rw::math::EAA< float >

Returns

the angular velocity

e()

Converter to Eigen vector

linear()

Extracts the linear velocity

Return type

rw::math::Vector3D< float >

Returns

the linear velocity

norm1()

Takes the 1-norm of the velocity screw. All elements both angular and linear are given the same weight.

Return type

float

Returns

the 1-norm

norm2()

Takes the 2-norm of the velocity screw. All elements both angular and linear are given the same weight

Return type

float

Returns

the 2-norm

normInf()

Takes the infinite norm of the velocity screw. All elements both angular and linear are given the same weight.

Return type

float

Returns

the infinite norm

property thisown

The membership flag

class sdurw_math.WeightedEuclideanMetricQ(weights)

Bases: sdurw_math.MetricQ

Weighted Euclidean metric for vector types.

Given a vector of weights \(\mathbf{\omega}\in\mathbb{R}^n\), the distance between two points \(P = (p_1, p_2, ..., p_n)\) and \(Q = (q_1, q_2, ..., q_n)\) is defined as \(\sqrt{\sum_{i=1}^{n}(\omega_i * (p_i - q_i))^2}\).

__init__(weights)

Weighted metric. :type weights: rw::math::Metric< rw::math::Q >::value_type :param weights: [in] Weights for the metric.

property thisown

The membership flag

class sdurw_math.WeightedEuclideanMetricVector2D(weights)

Bases: sdurw_math.MetricVector2D

Weighted Euclidean metric for vector types.

Given a vector of weights \(\mathbf{\omega}\in\mathbb{R}^n\), the distance between two points \(P = (p_1, p_2, ..., p_n)\) and \(Q = (q_1, q_2, ..., q_n)\) is defined as \(\sqrt{\sum_{i=1}^{n}(\omega_i * (p_i - q_i))^2}\).

__init__(weights)

Weighted metric. :type weights: rw::math::Metric< rw::math::Vector2D< double > >::value_type :param weights: [in] Weights for the metric.

property thisown

The membership flag

class sdurw_math.WeightedEuclideanMetricVector3D(weights)

Bases: sdurw_math.MetricVector3D

Weighted Euclidean metric for vector types.

Given a vector of weights \(\mathbf{\omega}\in\mathbb{R}^n\), the distance between two points \(P = (p_1, p_2, ..., p_n)\) and \(Q = (q_1, q_2, ..., q_n)\) is defined as \(\sqrt{\sum_{i=1}^{n}(\omega_i * (p_i - q_i))^2}\).

__init__(weights)

Weighted metric. :type weights: rw::math::Metric< rw::math::Vector3D< double > >::value_type :param weights: [in] Weights for the metric.

property thisown

The membership flag

class sdurw_math.WeightedInfinityMetricQ(weights)

Bases: sdurw_math.MetricQ

Weighted infinity norm metric for vector types.

Given a vector of weights \(\mathbf{\omega}\in\mathbb{R}^n\), the distance between two points \(P = (p_1, p_2, ..., p_n)\) and \(Q = (q_1, q_2, ..., q_n)\) is defined as \(max_i |\omega_i * (p_i - q_i)|\)

__init__(weights)

Weighted metric. :type weights: rw::math::Metric< rw::math::Q >::value_type :param weights: [in] Weights for the metric.

property thisown

The membership flag

class sdurw_math.WeightedInfinityMetricVector2D(weights)

Bases: sdurw_math.MetricVector2D

Weighted infinity norm metric for vector types.

Given a vector of weights \(\mathbf{\omega}\in\mathbb{R}^n\), the distance between two points \(P = (p_1, p_2, ..., p_n)\) and \(Q = (q_1, q_2, ..., q_n)\) is defined as \(max_i |\omega_i * (p_i - q_i)|\)

__init__(weights)

Weighted metric. :type weights: rw::math::Metric< rw::math::Vector2D< double > >::value_type :param weights: [in] Weights for the metric.

property thisown

The membership flag

class sdurw_math.WeightedInfinityMetricVector3D(weights)

Bases: sdurw_math.MetricVector3D

Weighted infinity norm metric for vector types.

Given a vector of weights \(\mathbf{\omega}\in\mathbb{R}^n\), the distance between two points \(P = (p_1, p_2, ..., p_n)\) and \(Q = (q_1, q_2, ..., q_n)\) is defined as \(max_i |\omega_i * (p_i - q_i)|\)

__init__(weights)

Weighted metric. :type weights: rw::math::Metric< rw::math::Vector3D< double > >::value_type :param weights: [in] Weights for the metric.

property thisown

The membership flag

class sdurw_math.WeightedManhattenMetricQ(weights)

Bases: sdurw_math.MetricQ

Weighted Manhattan distance metric for vector types.

Given a vector of weights \(\mathbf{\omega}\in\mathbb{R}^n\), the distance between two points \(P = (p_1, p_2, ..., p_n)\) and \(Q = (q_1, q_2, ..., q_n)\) is defined as \(\sum_{i=1}^{n} |\omega_i * (p_i - q_i)|\).

__init__(weights)

Weighted metric. :type weights: rw::math::Metric< rw::math::Q >::value_type :param weights: [in] Weights for the metric.

property thisown

The membership flag

class sdurw_math.WeightedManhattenMetricVector2D(weights)

Bases: sdurw_math.MetricVector2D

Weighted Manhattan distance metric for vector types.

Given a vector of weights \(\mathbf{\omega}\in\mathbb{R}^n\), the distance between two points \(P = (p_1, p_2, ..., p_n)\) and \(Q = (q_1, q_2, ..., q_n)\) is defined as \(\sum_{i=1}^{n} |\omega_i * (p_i - q_i)|\).

__init__(weights)

Weighted metric. :type weights: rw::math::Metric< rw::math::Vector2D< double > >::value_type :param weights: [in] Weights for the metric.

property thisown

The membership flag

class sdurw_math.WeightedManhattenMetricVector3D(weights)

Bases: sdurw_math.MetricVector3D

Weighted Manhattan distance metric for vector types.

Given a vector of weights \(\mathbf{\omega}\in\mathbb{R}^n\), the distance between two points \(P = (p_1, p_2, ..., p_n)\) and \(Q = (q_1, q_2, ..., q_n)\) is defined as \(\sum_{i=1}^{n} |\omega_i * (p_i - q_i)|\).

__init__(weights)

Weighted metric. :type weights: rw::math::Metric< rw::math::Vector3D< double > >::value_type :param weights: [in] Weights for the metric.

property thisown

The membership flag

class sdurw_math.Wrench6Dd(*args)

Bases: object

Class for representing 6 degrees of freedom wrenches.

\[\begin{split}\mathbf{\nu} = \left[ \begin{array}{c} f_x\\ f_y\\ f_z\\ \tau_x\\ \tau_y\\ \tau_z \end{array} \right]\end{split}\]

A Wrench is the description of a frames linear force and rotational torque with respect to some reference frame.

__init__(*args)

Overload 1:

Constructs a 6 degrees of freedom velocity screw

Parameters
  • fx (float) – [in] \(f_x\)

  • fy (float) – [in] \(f_y\)

  • fz (float) – [in] \(f_z\)

  • tx (float) – [in] \(\tau_x\)

  • ty (float) – [in] \(\tau_y\)

  • tz (float) – [in] \(\tau_z\)


Overload 2:

Default Constructor. Initialized the wrench to 0


Overload 3:

Constructs a wrench from a force and torque

Parameters
  • force (rw::math::Vector3D< double >) – [in] linear force

  • torque (rw::math::Vector3D< double >) – [in] angular torque

e()

Converter to Eigen data type

force()

Extracts the force

Return type

rw::math::Vector3D< double >

Returns

the force

norm1()

Takes the 1-norm of the wrench. All elements both force and torque are given the same weight. :rtype: float :return: the 1-norm

norm2()

Takes the 2-norm of the wrench. All elements both force and torque are given the same weight :rtype: float :return: the 2-norm

normInf()

Takes the infinite norm of the wrench. All elements both force and torque are given the same weight.

Return type

float

Returns

the infinite norm

setForce(force)

Sets the force component

Parameters

force (rw::math::Vector3D< double >) – [in] linear force

setTorque(torque)

Sets the torque component

Parameters

torque (rw::math::Vector3D< double >) – [in] angular torque

property thisown

The membership flag

torque()

Extracts the torque and represents it using an Vector3D<T>

Return type

rw::math::Vector3D< double >

Returns

the torque

class sdurw_math.Wrench6Df(*args)

Bases: object

Class for representing 6 degrees of freedom wrenches.

\[\begin{split}\mathbf{\nu} = \left[ \begin{array}{c} f_x\\ f_y\\ f_z\\ \tau_x\\ \tau_y\\ \tau_z \end{array} \right]\end{split}\]

A Wrench is the description of a frames linear force and rotational torque with respect to some reference frame.

__init__(*args)

Overload 1:

Constructs a 6 degrees of freedom velocity screw

Parameters
  • fx (float) – [in] \(f_x\)

  • fy (float) – [in] \(f_y\)

  • fz (float) – [in] \(f_z\)

  • tx (float) – [in] \(\tau_x\)

  • ty (float) – [in] \(\tau_y\)

  • tz (float) – [in] \(\tau_z\)


Overload 2:

Default Constructor. Initialized the wrench to 0


Overload 3:

Constructs a wrench from a force and torque

Parameters
  • force (rw::math::Vector3D< float >) – [in] linear force

  • torque (rw::math::Vector3D< float >) – [in] angular torque

e()

Converter to Eigen data type

force()

Extracts the force

Return type

rw::math::Vector3D< float >

Returns

the force

norm1()

Takes the 1-norm of the wrench. All elements both force and torque are given the same weight. :rtype: float :return: the 1-norm

norm2()

Takes the 2-norm of the wrench. All elements both force and torque are given the same weight :rtype: float :return: the 2-norm

normInf()

Takes the infinite norm of the wrench. All elements both force and torque are given the same weight.

Return type

float

Returns

the infinite norm

setForce(force)

Sets the force component

Parameters

force (rw::math::Vector3D< float >) – [in] linear force

setTorque(torque)

Sets the torque component

Parameters

torque (rw::math::Vector3D< float >) – [in] angular torque

property thisown

The membership flag

torque()

Extracts the torque and represents it using an Vector3D<T>

Return type

rw::math::Vector3D< float >

Returns

the torque

sdurw_math.cast(*args)

Overload 1:

Casts EAA<T> to EAA<Q> :type eaa: rw::math::EAA< double > :param eaa: [in] EAA with type T :rtype: rw::math::EAA< float > :return: EAA with type Q


Overload 2:

Casts InertiaMatrix<T> to InertiaMatrix<Q> :type rot: rw::math::InertiaMatrix< double > :param rot: [in] InertiaMatrix with type T :rtype: rw::math::InertiaMatrix< float > :return: InertiaMatrix with type Q


Overload 3:

Casts Pose6D<T> to Pose6D<Q> :type pose: rw::math::Pose6D< double > :param pose: [in] Pose6D with type T :rtype: rw::math::Pose6D< float > :return: Pose6D with type Q


Overload 4:

Casts Quaternion<T> to Quaternion<Q> :type quaternion: rw::math::Quaternion< double > :param quaternion: [in] Quarternion with type T :rtype: rw::math::Quaternion< float > :return: Quaternion with type Q


Overload 5:

Casts Rotation2D<T> to Rotation2D<Q> :type rot: rw::math::Rotation2D< double > :param rot: [in] Rotation2D with type T :rtype: rw::math::Rotation2D< float > :return: Rotation2D with type R


Overload 6:

Casts Wrench6D<T> to Wrench6D<Q>

Parameters

vs (rw::math::Wrench6D< double >) – [in] Wrench6D with type T

Return type

rw::math::Wrench6D< float >

Returns

Wrench6D with type Q


Overload 7:

Casts Rotation3D<T> to Rotation3D<Q>

Parameters

rot (rw::math::Rotation3D< double >) – [in] Rotation3D with type T

Return type

rw::math::Rotation3D< float >

Returns

Rotation3D with type Q


Overload 8:

Casts RPY<T> to RPY<Q>

Parameters

rpy (rw::math::RPY< double >) – [in] RPY with type T

Return type

rw::math::RPY< float >

Returns

RPY with type Q


Overload 9:

Cast Transform3D<T> to Transform3D<Q> :type trans: rw::math::Transform3D< double > :param trans: [in] Transform3D with type T :rtype: rw::math::Transform3D< float > :return: Transform3D with type Q


Overload 10:

Casts Vector2D<T> to Vector2D<Q>

Parameters

v (rw::math::Vector2D< double >) – [in] Vector2D with type T

Return type

rw::math::Vector2D< float >

Returns

Vector2D with type Q


Overload 11:

Casts Vector3D<T> to Vector3D<Q> :type v: rw::math::Vector3D< double > :param v: [in] Vector3D with type T :rtype: rw::math::Vector3D< float > :return: Vector3D with type Q


Overload 12:

Casts VelocityScrew6D<T> to VelocityScrew6D<Q>

Parameters

vs (rw::math::VelocityScrew6D< double >) – [in] VelocityScrew6D with type T

Return type

rw::math::VelocityScrew6D< float >

Returns

VelocityScrew6D with type Q


Overload 13:

Casts EAA<T> to EAA<Q> :type eaa: rw::math::EAA< float > :param eaa: [in] EAA with type T :rtype: rw::math::EAA< double > :return: EAA with type Q


Overload 14:

Casts InertiaMatrix<T> to InertiaMatrix<Q> :type rot: rw::math::InertiaMatrix< float > :param rot: [in] InertiaMatrix with type T :rtype: rw::math::InertiaMatrix< double > :return: InertiaMatrix with type Q


Overload 15:

Casts Pose6D<T> to Pose6D<Q> :type pose: rw::math::Pose6D< float > :param pose: [in] Pose6D with type T :rtype: rw::math::Pose6D< double > :return: Pose6D with type Q


Overload 16:

Casts Quaternion<T> to Quaternion<Q> :type quaternion: rw::math::Quaternion< float > :param quaternion: [in] Quarternion with type T :rtype: rw::math::Quaternion< double > :return: Quaternion with type Q


Overload 17:

Casts Rotation2D<T> to Rotation2D<Q> :type rot: rw::math::Rotation2D< float > :param rot: [in] Rotation2D with type T :rtype: rw::math::Rotation2D< double > :return: Rotation2D with type R


Overload 18:

Casts Wrench6D<T> to Wrench6D<Q>

Parameters

vs (rw::math::Wrench6D< float >) – [in] Wrench6D with type T

Return type

rw::math::Wrench6D< double >

Returns

Wrench6D with type Q


Overload 19:

Casts Rotation3D<T> to Rotation3D<Q>

Parameters

rot (rw::math::Rotation3D< float >) – [in] Rotation3D with type T

Return type

rw::math::Rotation3D< double >

Returns

Rotation3D with type Q


Overload 20:

Casts RPY<T> to RPY<Q>

Parameters

rpy (rw::math::RPY< float >) – [in] RPY with type T

Return type

rw::math::RPY< double >

Returns

RPY with type Q


Overload 21:

Cast Transform3D<T> to Transform3D<Q> :type trans: rw::math::Transform3D< float > :param trans: [in] Transform3D with type T :rtype: rw::math::Transform3D< double > :return: Transform3D with type Q


Overload 22:

Casts Vector2D<T> to Vector2D<Q>

Parameters

v (rw::math::Vector2D< float >) – [in] Vector2D with type T

Return type

rw::math::Vector2D< double >

Returns

Vector2D with type Q


Overload 23:

Casts Vector3D<T> to Vector3D<Q> :type v: rw::math::Vector3D< float > :param v: [in] Vector3D with type T :rtype: rw::math::Vector3D< double > :return: Vector3D with type Q


Overload 24:

Casts VelocityScrew6D<T> to VelocityScrew6D<Q>

Parameters

vs (rw::math::VelocityScrew6D< float >) – [in] VelocityScrew6D with type T

Return type

rw::math::VelocityScrew6D< double >

Returns

VelocityScrew6D with type Q

sdurw_math.concat(q1, q2)

concatenates q1 onto q2 such that the returned q has the configurations of q1 in [0;q1.size()[ and has q2 in [q1.size();q1.size()+q2.size()[ :type q1: Q :param q1: [in] the first Q :type q2: Q :param q2: [in] the second Q :rtype: Q :return: the concatenation of q1 and q2

sdurw_math.cross(*args)
sdurw_math.dot(a, b)

The dot product (inner product) of a and b.

class sdurw_math.doubleArray(nelements)

Bases: object

__init__(nelements)

Initialize self. See help(type(self)) for accurate signature.

cast()
static frompointer(t)
property thisown

The membership flag

sdurw_math.doubleArray_frompointer(t)
sdurw_math.inverse(*args)

Overload 1:

Calculates the inverse \(\robabx{b}{a}{\mathbf{R}} =\robabx{a}{b}{\mathbf{R}}^{-1}\) of a rotation matrix

Parameters

aRb (rw::math::InertiaMatrix< double >) – [in] the rotation matrix \(\robabx{a}{b}{\mathbf{R}}\)

Return type

rw::math::InertiaMatrix< double >

Returns

the matrix inverse \(\robabx{b}{a}{\mathbf{R}} =\robabx{a}{b}{\mathbf{R}}^{-1}\)

\(\robabx{b}{a}{\mathbf{R}} = \robabx{a}{b}{\mathbf{R}}^{-1} =\robabx{a}{b}{\mathbf{R}}^T\)