adam.model.mj_factory.mujoco_model
==================================

.. py:module:: adam.model.mj_factory.mujoco_model


Classes
-------

.. autoapisummary::

   adam.model.mj_factory.mujoco_model.MujocoOrigin
   adam.model.mj_factory.mujoco_model.MujocoInertia
   adam.model.mj_factory.mujoco_model.MujocoInertial
   adam.model.mj_factory.mujoco_model.MujocoLink
   adam.model.mj_factory.mujoco_model.MujocoJoint
   adam.model.mj_factory.mujoco_model.MujocoModelFactory


Functions
---------

.. autoapisummary::

   adam.model.mj_factory.mujoco_model._normalize_quaternion
   adam.model.mj_factory.mujoco_model._rotate_vector


Module Contents
---------------

.. py:class:: MujocoOrigin

   .. py:attribute:: xyz
      :type:  numpy.ndarray


   .. py:attribute:: rpy
      :type:  numpy.ndarray


.. py:class:: MujocoInertia

   .. py:attribute:: ixx
      :type:  float


   .. py:attribute:: ixy
      :type:  float


   .. py:attribute:: ixz
      :type:  float


   .. py:attribute:: iyy
      :type:  float


   .. py:attribute:: iyz
      :type:  float


   .. py:attribute:: izz
      :type:  float


.. py:class:: MujocoInertial

   .. py:attribute:: mass
      :type:  float


   .. py:attribute:: inertia
      :type:  MujocoInertia


   .. py:attribute:: origin
      :type:  MujocoOrigin


.. py:class:: MujocoLink

   .. py:attribute:: name
      :type:  str


   .. py:attribute:: inertial
      :type:  MujocoInertial


   .. py:attribute:: visuals
      :type:  list


   .. py:attribute:: collisions
      :type:  list


.. py:class:: MujocoJoint

   .. py:attribute:: name
      :type:  str


   .. py:attribute:: parent
      :type:  str


   .. py:attribute:: child
      :type:  str


   .. py:attribute:: joint_type
      :type:  str


   .. py:attribute:: axis
      :type:  Optional[numpy.ndarray]


   .. py:attribute:: origin
      :type:  MujocoOrigin


   .. py:attribute:: limit
      :type:  Optional[adam.model.abc_factories.Limits]


.. py:function:: _normalize_quaternion(quat: numpy.ndarray) -> numpy.ndarray

.. py:function:: _rotate_vector(quat: numpy.ndarray, vec: numpy.ndarray) -> numpy.ndarray

   Rotate a vector using quaternion [w, x, y, z].


.. py:class:: MujocoModelFactory(mj_model: mujoco.MjModel, math: adam.core.spatial_math.SpatialMath)

   Bases: :py:obj:`adam.model.abc_factories.ModelFactory`


   Factory that builds a model starting from a mujoco.MjModel.


   .. py:attribute:: math


   .. py:attribute:: mujoco


   .. py:attribute:: mj_model


   .. py:attribute:: name


   .. py:attribute:: _links
      :value: []



   .. py:attribute:: _child_map


   .. py:attribute:: _joints
      :value: []



   .. py:method:: _import_mujoco()


   .. py:method:: _model_exists(mj_model)


   .. py:method:: _body_name(body_id: int) -> str


   .. py:method:: _joint_name(joint_id: int) -> str


   .. py:method:: _link_inertial(body_id: int) -> MujocoInertial


   .. py:method:: _build_links() -> list[adam.model.std_factories.std_link.StdLink]


   .. py:method:: _build_child_map() -> dict[str, list[str]]


   .. py:method:: _joint_origin(body_id: int, joint_id: Optional[int]) -> MujocoOrigin


   .. py:method:: _build_limits(joint_id: int, joint_type: str) -> Optional[adam.model.abc_factories.Limits]


   .. py:method:: _joint_type(mj_type: int) -> str


   .. py:method:: _build_joint(body_id: int, joint_id: Optional[int], parent_name: str, joint_type: str) -> adam.model.std_factories.std_joint.StdJoint


   .. py:method:: _build_joints() -> list[adam.model.std_factories.std_joint.StdJoint]


   .. py:method:: build_joint(joint) -> adam.model.std_factories.std_joint.StdJoint
      :abstractmethod:


      build the single joint

      :returns: Joint



   .. py:method:: build_link(link) -> adam.model.std_factories.std_link.StdLink
      :abstractmethod:


      build the single link
      :returns: Link



   .. py:method:: get_joints() -> list[adam.model.std_factories.std_joint.StdJoint]

      :returns: the list of the joints
      :rtype: list[Joint]



   .. py:method:: _has_non_fixed_joint(link_name: str) -> bool


   .. py:method:: get_links() -> list[adam.model.std_factories.std_link.StdLink]

      :returns: the list of the link
      :rtype: list[Link]



   .. py:method:: get_frames() -> list[adam.model.std_factories.std_link.StdLink]

      :returns: the list of the frames
      :rtype: list[Link]



