franky.Modelยถ

class franky.Modelยถ

Bases: pybind11_object

A wrapper around franka::Model that uses Eigen types.

This class exposes the same functionality as franka::Model, but uses Eigen types for inputs and outputs instead of std::array. All 2D arrays are returned as Eigen matrices.

__init__(*args, **kwargs)ยถ
body_jacobian(*args, **kwargs)ยถ

Overloaded function.

  1. body_jacobian(self: franky._franky.Model, frame: franky._franky.Frame, state: franky._franky.RobotState) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], โ€œ[6, 7]โ€]

Calculates the body Jacobian in the given frame.

Parameters:
  • frame โ€“ The frame for which the Jacobian is computed.

  • state โ€“ The current robot state.

Returns:

The 6x7 body Jacobian matrix.

  1. body_jacobian(self: franky._franky.Model, frame: franky._franky.Frame, q: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, โ€œ[7, 1]โ€], F_T_EE: franky._franky.Affine, EE_T_K: franky._franky.Affine) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], โ€œ[6, 7]โ€]

Calculates the body Jacobian in the given frame.

Parameters:
  • frame โ€“ The frame for which the Jacobian is computed.

  • q โ€“ Robot joint angles [rad].

  • F_T_EE โ€“ Transformation from flange to end-effector frame.

  • EE_T_K โ€“ Transformation from end-effector frame to stiffness frame.

Returns:

The 6x7 body Jacobian matrix.

coriolis(*args, **kwargs)ยถ

Overloaded function.

  1. coriolis(self: franky._franky.Model, state: franky._franky.RobotState) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], โ€œ[7, 1]โ€]

Calculates the Coriolis force vector.

Parameters:

state โ€“ The current robot state.

Returns:

The Coriolis vector [Nm].

  1. coriolis(self: franky._franky.Model, q: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, โ€œ[7, 1]โ€], dq: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, โ€œ[7, 1]โ€], I_total: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, โ€œ[3, 3]โ€], m_total: typing.SupportsFloat | typing.SupportsIndex, F_x_Ctotal: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, โ€œ[3, 1]โ€]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], โ€œ[7, 1]โ€]

Calculates the Coriolis force vector.

Parameters:
  • q โ€“ Robot joint angles [rad].

  • dq โ€“ Robot joint velocities [rad/s].

  • I_total โ€“ Combined load and robot inertia [kgยทmยฒ].

  • m_total โ€“ Combined mass of robot and load [kg].

  • F_x_Ctotal โ€“ Center of mass relative to flange frame [m].

Returns:

The Coriolis vector [Nm].

gravity(*args, **kwargs)ยถ

Overloaded function.

  1. gravity(self: franky._franky.Model, state: franky._franky.RobotState, gravity_earth: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, โ€œ[3, 1]โ€]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], โ€œ[7, 1]โ€]

Calculates the gravity vector.

Parameters:
  • state โ€“ The current robot state.

  • gravity_earth โ€“ Gravity vector in base frame [m/sยฒ].

Returns:

The gravity vector [Nm].

  1. gravity(self: franky._franky.Model, state: franky._franky.RobotState) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], โ€œ[7, 1]โ€]

Calculates the gravity vector using default gravity direction (0, 0, -9.81).

Parameters:

state โ€“ The current robot state.

Returns:

The gravity vector [Nm].

  1. gravity(self: franky._franky.Model, q: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, โ€œ[7, 1]โ€], m_total: typing.SupportsFloat | typing.SupportsIndex, F_x_Ctotal: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, โ€œ[3, 1]โ€], gravity_earth: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, โ€œ[3, 1]โ€] = array([ 0. , 0. , -9.81])) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], โ€œ[7, 1]โ€]

Calculates the gravity vector.

Parameters:
  • q โ€“ Robot joint angles [rad].

  • m_total โ€“ Combined mass of robot and load [kg].

  • F_x_Ctotal โ€“ Center of mass relative to flange frame [m].

  • gravity_earth โ€“ Gravity vector in base frame [m/sยฒ], default is (0, 0, -9.81).

Returns:

The gravity vector [Nm].

mass(*args, **kwargs)ยถ

Overloaded function.

  1. mass(self: franky._franky.Model, state: franky._franky.RobotState) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], โ€œ[7, 7]โ€]

Calculates the mass matrix.

Parameters:

state โ€“ The current robot state.

Returns:

The 7x7 mass matrix.

  1. mass(self: franky._franky.Model, q: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, โ€œ[7, 1]โ€], I_total: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, โ€œ[3, 3]โ€], m_total: typing.SupportsFloat | typing.SupportsIndex, F_x_Ctotal: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, โ€œ[3, 1]โ€]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], โ€œ[7, 7]โ€]

Calculates the mass matrix.

Parameters:
  • q โ€“ Robot joint angles [rad].

  • I_total โ€“ Combined load and robot inertia [kgยทmยฒ].

  • m_total โ€“ Combined mass of robot and load [kg].

  • F_x_Ctotal โ€“ Center of mass relative to flange frame [m].

Returns:

The 7x7 mass matrix.

pose(*args, **kwargs)ยถ

Overloaded function.

  1. pose(self: franky._franky.Model, frame: franky._franky.Frame, state: franky._franky.RobotState) -> franky._franky.Affine

Calculates the pose of a frame relative to the base frame.

Parameters:
  • frame โ€“ The frame whose pose should be returned.

  • state โ€“ The current robot state.

Returns:

The pose as an affine transformation matrix.

  1. pose(self: franky._franky.Model, frame: franky._franky.Frame, q: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, โ€œ[7, 1]โ€], F_T_EE: franky._franky.Affine, EE_T_K: franky._franky.Affine) -> franky._franky.Affine

Calculates the pose of a frame relative to the base frame.

Parameters:
  • frame โ€“ The frame whose pose should be returned.

  • q โ€“ Robot joint angles [rad].

  • F_T_EE โ€“ Transformation from flange to end-effector frame.

  • EE_T_K โ€“ Transformation from end-effector frame to stiffness frame.

Returns:

The pose as an affine transformation matrix.

zero_jacobian(*args, **kwargs)ยถ

Overloaded function.

  1. zero_jacobian(self: franky._franky.Model, frame: franky._franky.Frame, state: franky._franky.RobotState) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], โ€œ[6, 7]โ€]

Calculates the zero Jacobian in base frame.

Parameters:
  • frame โ€“ The frame for which the Jacobian is computed.

  • state โ€“ The current robot state.

Returns:

The 6x7 zero Jacobian matrix.

  1. zero_jacobian(self: franky._franky.Model, frame: franky._franky.Frame, q: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, โ€œ[7, 1]โ€], F_T_EE: franky._franky.Affine, EE_T_K: franky._franky.Affine) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], โ€œ[6, 7]โ€]

Calculates the zero Jacobian in base frame.

Parameters:
  • frame โ€“ The frame for which the Jacobian is computed.

  • q โ€“ Robot joint angles [rad].

  • F_T_EE โ€“ Transformation from flange to end-effector frame.

  • EE_T_K โ€“ Transformation from end-effector frame to stiffness frame.

Returns:

The 6x7 zero Jacobian matrix.