adam.jax.jax_like#

Classes#

JaxLike

Wrapper class for Jax types

JaxLikeFactory

Abstract class for a generic Array wrapper. Every method should be implemented for every data type.

SpatialMath

Class implementing the main geometric functions used for computing rigid-body algorithm

Module Contents#

class adam.jax.jax_like.JaxLike[source]#

Bases: adam.core.spatial_math.ArrayLike

Wrapper class for Jax types

array: jax.numpy.array[source]#
__setitem__(idx, value: JaxLike | numpy.typing.ArrayLike)[source]#

Overrides set item operator

__getitem__(idx) JaxLike[source]#

Overrides get item operator

property shape[source]#
reshape(*args)[source]#
property T: JaxLike[source]#

Returns: JaxLike: transpose of the array

__matmul__(other: JaxLike | numpy.typing.ArrayLike) JaxLike[source]#

Overrides @ operator

__rmatmul__(other: JaxLike | numpy.typing.ArrayLike) JaxLike[source]#

Overrides @ operator

__mul__(other: JaxLike | numpy.typing.ArrayLike) JaxLike[source]#

Overrides * operator

__rmul__(other: JaxLike | numpy.typing.ArrayLike) JaxLike[source]#

Overrides * operator

__truediv__(other: JaxLike | numpy.typing.ArrayLike) JaxLike[source]#

Overrides / operator

__add__(other: JaxLike | numpy.typing.ArrayLike) JaxLike[source]#

Overrides + operator

__radd__(other: JaxLike | numpy.typing.ArrayLike) JaxLike[source]#

Overrides + operator

__sub__(other: JaxLike | numpy.typing.ArrayLike) JaxLike[source]#

Overrides - operator

__rsub__(other: JaxLike | numpy.typing.ArrayLike) JaxLike[source]#

Overrides - operator

__neg__() JaxLike[source]#

Overrides - operator

class adam.jax.jax_like.JaxLikeFactory[source]#

Bases: adam.core.spatial_math.ArrayLikeFactory

Abstract class for a generic Array wrapper. Every method should be implemented for every data type.

static zeros(*x) JaxLike[source]#
Returns:

Matrix of zeros of dim *x

Return type:

JaxLike

static eye(x) JaxLike[source]#
Returns:

Identity matrix of dimension x

Return type:

JaxLike

static array(x) JaxLike[source]#
Returns:

Vector wrapping *x

Return type:

JaxLike

class adam.jax.jax_like.SpatialMath[source]#

Bases: SpatialMath

Class implementing the main geometric functions used for computing rigid-body algorithm

Parameters:

ArrayLike – abstract class describing a generic Array wrapper. It needs to be implemented for every data type

static sin(x: numpy.typing.ArrayLike) JaxLike[source]#
Parameters:

x (npt.ArrayLike) – angle value

Returns:

sin of x

Return type:

JaxLike

static cos(x: numpy.typing.ArrayLike) JaxLike[source]#
Parameters:

x (npt.ArrayLike) – angle value

Returns:

cos of x

Return type:

JaxLike

static outer(x: numpy.typing.ArrayLike, y: numpy.typing.ArrayLike) JaxLike[source]#
Parameters:
  • x (npt.ArrayLike) – vector

  • y (npt.ArrayLike) – vector

Returns:

outer product between x and y

Return type:

JaxLike

static skew(x: JaxLike | numpy.typing.ArrayLike) JaxLike[source]#
Parameters:

x (Union[JaxLike, npt.ArrayLike]) – vector

Returns:

the skew symmetric matrix from x

Return type:

JaxLike

static vertcat(*x) JaxLike[source]#
Returns:

Vertical concatenation of elements

Return type:

JaxLike

static horzcat(*x) JaxLike[source]#
Returns:

Horizontal concatenation of elements

Return type:

JaxLike