adam.parametric.pytorch
=======================

.. py:module:: adam.parametric.pytorch


Submodules
----------

.. toctree::
   :maxdepth: 1

   /autoapi/adam/parametric/pytorch/computations_parametric/index


Classes
-------

.. autoapisummary::

   adam.parametric.pytorch.KinDynComputationsParametric


Package Contents
----------------

.. py:class:: KinDynComputationsParametric(urdfstring: str, joints_name_list: list, links_name_list: list, device: torch.device = torch.device('cuda') if torch.cuda.is_available() else torch.device('cpu'), dtype: torch.dtype = torch.float64, root_link: str = None, gravity: numpy.array = torch.tensor([0, 0, -9.80665, 0, 0, 0]))

   This is a small class that retrieves robot quantities using Pytorch for Floating Base systems.
   This is parametric w.r.t the link length and densities.


   .. py:attribute:: math


   .. py:attribute:: g


   .. py:attribute:: links_name_list


   .. py:attribute:: joints_name_list


   .. py:attribute:: urdfstring


   .. py:attribute:: representation


   .. py:method:: set_frame_velocity_representation(representation: adam.core.constants.Representations) -> None

      Sets the representation of the velocity of the frames

      :param representation: The representation of the velocity
      :type representation: Representations



   .. py:method:: mass_matrix(base_transform: torch.Tensor, s: torch.Tensor, length_multiplier: torch.Tensor, densities: torch.Tensor) -> torch.Tensor

      Returns the Mass Matrix functions computed the CRBA

      :param base_transform: The homogenous transform from base to world frame
      :type base_transform: torch.tensor
      :param s: The joints position
      :type s: torch.tensor
      :param length_multiplier: The length multiplier of the parametrized links
      :type length_multiplier: torch.tensor
      :param densities: The densities of the parametrized links
      :type densities: torch.tensor

      :returns: Mass Matrix
      :rtype: M (torch.tensor)



   .. py:method:: centroidal_momentum_matrix(base_transform: torch.Tensor, s: torch.Tensor, length_multiplier: torch.Tensor, densities: torch.Tensor) -> torch.Tensor

      Returns the Centroidal Momentum Matrix functions computed the CRBA

      :param base_transform: The homogenous transform from base to world frame
      :type base_transform: torch.tensor
      :param s: The joints position
      :type s: torch.tensor
      :param length_multiplier: The length multiplier of the parametrized links
      :type length_multiplier: torch.tensor
      :param densities: The densities of the parametrized links
      :type densities: torch.tensor

      :returns: Centroidal Momentum matrix
      :rtype: Jcc (torch.tensor)



   .. py:method:: forward_kinematics(frame, base_transform: torch.Tensor, joint_positions: torch.Tensor, length_multiplier: torch.Tensor, densities: torch.Tensor) -> torch.Tensor

      Computes the forward kinematics relative to the specified frame

      :param frame: The frame to which the fk will be computed
      :type frame: str
      :param base_transform: The homogenous transform from base to world frame
      :type base_transform: torch.tensor
      :param joint_positions: The joints position
      :type joint_positions: torch.tensor
      :param length_multiplier: The length multiplier of the parametrized links
      :type length_multiplier: torch.tensor
      :param densities: The densities of the parametrized links
      :type densities: torch.tensor

      :returns: The fk represented as Homogenous transformation matrix
      :rtype: T_fk (torch.tensor)



   .. py:method:: jacobian(frame: str, base_transform: torch.Tensor, joint_positions: torch.Tensor, length_multiplier: torch.Tensor, densities: torch.Tensor) -> torch.Tensor

      Returns the Jacobian relative to the specified frame

      :param frame: The frame to which the jacobian will be computed
      :type frame: str
      :param base_transform: The homogenous transform from base to world frame
      :type base_transform: torch.tensor
      :param joint_positions: The joints position
      :type joint_positions: torch.tensor
      :param length_multiplier: The length multiplier of the parametrized links
      :type length_multiplier: torch.tensor
      :param densities: The densities of the parametrized links
      :type densities: torch.tensor

      :returns: The Jacobian relative to the frame
      :rtype: J_tot (torch.tensor)



   .. py:method:: relative_jacobian(frame, joint_positions: torch.Tensor, length_multiplier: torch.Tensor, densities: torch.Tensor) -> torch.Tensor

      Returns the Jacobian between the root link and a specified frame frames

      :param frame: The tip of the chain
      :type frame: str
      :param joint_positions: The joints position
      :type joint_positions: torch.tensor
      :param length_multiplier: The length multiplier of the parametrized links
      :type length_multiplier: torch.tensor
      :param densities: The densities of the parametrized links
      :type densities: torch.tensor

      :returns: The Jacobian between the root and the frame
      :rtype: J (torch.tensor)



   .. py:method:: jacobian_dot(frame: str, base_transform: torch.Tensor, joint_positions: torch.Tensor, base_velocity: torch.Tensor, joint_velocities: torch.Tensor, length_multiplier: torch.Tensor, densities: torch.Tensor) -> torch.Tensor

      Returns the Jacobian derivative relative to the specified frame

      :param frame: The frame to which the jacobian will be computed
      :type frame: str
      :param base_transform: The homogenous transform from base to world frame
      :type base_transform: torch.Tensor
      :param joint_positions: The joints position
      :type joint_positions: torch.Tensor
      :param base_velocity: The base velocity
      :type base_velocity: torch.Tensor
      :param joint_velocities: The joint velocities
      :type joint_velocities: torch.Tensor
      :param length_multiplier: The length multiplier of the parametrized links
      :type length_multiplier: torch.tensor
      :param densities: The densities of the parametrized links
      :type densities: torch.tensor

      :returns: The Jacobian derivative relative to the frame
      :rtype: Jdot (torch.Tensor)



   .. py:method:: CoM_position(base_transform: torch.Tensor, joint_positions: torch.Tensor, length_multiplier: torch.Tensor, densities: torch.Tensor) -> torch.Tensor

      Returns the CoM position

      :param base_transform: The homogenous transform from base to world frame
      :type base_transform: torch.tensor
      :param joint_positions: The joints position
      :type joint_positions: torch.tensor
      :param length_multiplier: The length multiplier of the parametrized links
      :type length_multiplier: torch.tensor
      :param densities: The densities of the parametrized links
      :type densities: torch.tensor

      :returns: The CoM position
      :rtype: com (torch.tensor)



   .. py:method:: bias_force(base_transform: torch.Tensor, s: torch.Tensor, base_velocity: torch.Tensor, joint_velocities: torch.Tensor, length_multiplier: torch.Tensor, densities: torch.Tensor) -> torch.Tensor

      Returns the bias force of the floating-base dynamics ejoint_positionsuation,
      using a reduced RNEA (no acceleration and external forces)

      :param base_transform: The homogenous transform from base to world frame
      :type base_transform: torch.tensor
      :param s: The joints position
      :type s: torch.tensor
      :param base_velocity: The base velocity
      :type base_velocity: torch.tensor
      :param joint_velocities: The joints velocity
      :type joint_velocities: torch.tensor
      :param length_multiplier: The length multiplier of the parametrized links
      :type length_multiplier: torch.tensor
      :param densities: The densities of the parametrized links
      :type densities: torch.tensor

      :returns: the bias force
      :rtype: h (torch.tensor)



   .. py:method:: coriolis_term(base_transform: torch.Tensor, joint_positions: torch.Tensor, base_velocity: torch.Tensor, joint_velocities: torch.Tensor, length_multiplier: torch.Tensor, densities: torch.Tensor) -> torch.Tensor

      Returns the coriolis term of the floating-base dynamics ejoint_positionsuation,
      using a reduced RNEA (no acceleration and external forces)

      :param base_transform: The homogenous transform from base to world frame
      :type base_transform: torch.tensor
      :param joint_positions: The joints position
      :type joint_positions: torch.tensor
      :param base_velocity: The base velocity
      :type base_velocity: torch.tensor
      :param joint_velocities: The joints velocity
      :type joint_velocities: torch.tensor
      :param length_multiplier: The length multiplier of the parametrized links
      :type length_multiplier: torch.tensor
      :param densities: The densities of the parametrized links
      :type densities: torch.tensor

      :returns: the Coriolis term
      :rtype: C (torch.tensor)



   .. py:method:: gravity_term(base_transform: torch.Tensor, base_positions: torch.Tensor, length_multiplier: torch.Tensor, densities: torch.Tensor) -> torch.Tensor

      Returns the gravity term of the floating-base dynamics ejoint_positionsuation,
      using a reduced RNEA (no acceleration and external forces)

      :param base_transform: The homogenous transform from base to world frame
      :type base_transform: torch.tensor
      :param base_positions: The joints position
      :type base_positions: torch.tensor
      :param length_multiplier: The length multiplier of the parametrized links
      :type length_multiplier: torch.tensor
      :param densities: The densities of the parametrized links
      :type densities: torch.tensor

      :returns: the gravity term
      :rtype: G (torch.tensor)



   .. py:method:: get_total_mass(length_multiplier: torch.Tensor, densities: torch.Tensor) -> float

      Returns the total mass of the robot

      :param length_multiplier: The length multiplier of the parametrized links
      :type length_multiplier: torch.tensor
      :param densities: The densities of the parametrized links
      :type densities: torch.tensor

      :returns: The total mass
      :rtype: mass



   .. py:method:: get_original_densities() -> list[float]

      Returns the original densities of the parametric links

      :returns: The original densities of the parametric links
      :rtype: densities



