diff --git a/doc/APIreference.rst b/doc/APIreference.rst index 6c7e4daf..f5711c6f 100644 --- a/doc/APIreference.rst +++ b/doc/APIreference.rst @@ -23,7 +23,7 @@ MuJoCo defines a large number of primitive types described here. Except for :ref rest of the API does not use these enum types directly. Instead it uses ints, and only the documentation/comments state that certain ints correspond to certain enum types. This is because we want the API to be compiler-independent, and the C standard does not dictate how many bytes must be used to represent an enum type. Nevertheless we recommend using these -types when calling the API functions (and letting the compiler do the enum-to-int type cast.) +types when calling the API functions (and letting the compiler do the enum-to-int type cast). .. _mjtNum: @@ -38,7 +38,8 @@ mjtNum typedef float mjtNum; #endif -| Defined in `mjmodel.h `_ +| Defined in `mjtnum.h `_ + | This is the floating-point type used throughout the simulator. If the symbol ``mjUSEDOUBLE`` is defined in ``mjmodel.h``, this type is defined as ``double``, otherwise it is defined as ``float``. Currently only the double-precision version of MuJoCo is distributed, although the entire code base works with single-precision as well. @@ -47,7 +48,7 @@ mjtNum write code that works with either single or double precision. To this end we provide math utility functions that are always defined with the correct floating-point type. -| Note that changing ``mjUSEDOUBLE`` in ``mjmodel.h`` will not change how the library was compiled, and instead will +| Note that changing ``mjUSEDOUBLE`` in ``mjtnum.h`` will not change how the library was compiled, and instead will result in numerous link errors. In general, the header files distributed with precompiled MuJoCo should never be changed by the user. @@ -61,6 +62,7 @@ mjtByte typedef unsigned char mjtByte; | Defined in `mjmodel.h `_ + | Byte type used to represent boolean variables. .. _mjtDisableBit: @@ -89,6 +91,7 @@ mjtDisableBit } mjtDisableBit; | Defined in `mjmodel.h `_ + | Constants which are powers of 2. They are used as bitmasks for the field ``disableflags`` of :ref:`mjOption`. At runtime this field is ``m->opt.disableflags``. The number of these constants is given by ``mjNDISABLE`` which is also the length of the global string array :ref:`mjDISABLESTRING` with text descriptions of these @@ -112,6 +115,7 @@ mjtEnableBit } mjtEnableBit; | Defined in `mjmodel.h `_ + | Constants which are powers of 2. They are used as bitmasks for the field ``enableflags`` of :ref:`mjOption`. At runtime this field is ``m->opt.enableflags``. The number of these constants is given by ``mjNENABLE`` which is also the length of the global string array :ref:`mjENABLESTRING` with text descriptions of these flags. @@ -132,6 +136,7 @@ mjtJoint } mjtJoint; | Defined in `mjmodel.h `_ + | Primitive joint types. These values are used in ``m->jnt_type``. The numbers in the comments indicate how many positional coordinates each joint type has. Note that ball joints and rotational components of free joints are represented as unit quaternions - which have 4 positional coordinates but 3 degrees of freedom each. @@ -169,6 +174,7 @@ mjtGeom } mjtGeom; | Defined in `mjmodel.h `_ + | Geometric types supported by MuJoCo. The first group are "official" geom types that can be used in the model. The second group are geom types that cannot be used in the model but are used by the visualizer to add decorative elements. These values are used in ``m->geom_type`` and ``m->site_type``. @@ -190,6 +196,7 @@ mjtCamLight } mjtCamLight; | Defined in `mjmodel.h `_ + | Dynamic modes for cameras and lights, specifying how the camera/light position and orientation are computed. These values are used in ``m->cam_mode`` and ``m->light_mode``. @@ -208,6 +215,7 @@ mjtTexture } mjtTexture; | Defined in `mjmodel.h `_ + | Texture types, specifying how the texture will be mapped. These values are used in ``m->tex_type``. .. _mjtIntegrator: @@ -224,6 +232,7 @@ mjtIntegrator } mjtIntegrator; | Defined in `mjmodel.h `_ + | Numerical integrator types. These values are used in ``m->opt.integrator``. .. _mjtCollision: @@ -241,7 +250,8 @@ mjtCollision } mjtCollision; | Defined in `mjmodel.h `_ -| Collision modes specifying how candidate geom pair are generated for near-phase collision checking. These values are + +| Collision modes specifying how candidate geom pairs are generated for near-phase collision checking. These values are used in ``m->opt.collision``. .. _mjtCone: @@ -258,6 +268,7 @@ mjtCone } mjtCone; | Defined in `mjmodel.h `_ + | Available friction cone types. These values are used in ``m->opt.cone``. .. _mjtJacobian: @@ -275,6 +286,7 @@ mjtJacobian } mjtJacobian; | Defined in `mjmodel.h `_ + | Available Jacobian types. These values are used in ``m->opt.jacobian``. .. _mjtSolver: @@ -292,6 +304,7 @@ mjtSolver } mjtSolver; | Defined in `mjmodel.h `_ + | Available constraint solver algorithms. These values are used in ``m->opt.solver``. .. _mjtEq: @@ -311,6 +324,7 @@ mjtEq } mjtEq; | Defined in `mjmodel.h `_ + | Equality constraint types. These values are used in ``m->eq_type``. .. _mjtWrap: @@ -331,6 +345,7 @@ mjtWrap } mjtWrap; | Defined in `mjmodel.h `_ + | Tendon wrapping object types. These values are used in ``m->wrap_type``. .. _mjtTrn: @@ -352,6 +367,7 @@ mjtTrn } mjtTrn; | Defined in `mjmodel.h `_ + | Actuator transmission types. These values are used in ``m->actuator_trntype``. .. _mjtDyn: @@ -371,6 +387,7 @@ mjtDyn } mjtDyn; | Defined in `mjmodel.h `_ + | Actuator dynamics types. These values are used in ``m->actuator_dyntype``. .. _mjtGain: @@ -388,6 +405,7 @@ mjtGain } mjtGain; | Defined in `mjmodel.h `_ + | Actuator gain types. These values are used in ``m->actuator_gaintype``. .. _mjtBias: @@ -406,6 +424,7 @@ mjtBias } mjtBias; | Defined in `mjmodel.h `_ + | Actuator bias types. These values are used in ``m->actuator_biastype``. .. _mjtObj: @@ -444,6 +463,7 @@ mjtObj } mjtObj; | Defined in `mjmodel.h `_ + | MuJoCo object types. These values are used in the support functions :ref:`mj_name2id` and :ref:`mj_id2name` to convert between object names and integer ids. @@ -467,6 +487,7 @@ mjtConstraint } mjtConstraint; | Defined in `mjmodel.h `_ + | Constraint types. These values are not used in mjModel, but are used in the mjData field ``d->efc_type`` when the list of active constraints is constructed at each simulation time step. @@ -487,6 +508,7 @@ mjtConstraintState } mjtConstraintState; | Defined in `mjmodel.h `_ + | These values are used by the solver internally to keep track of the constraint states. .. _mjtSensor: @@ -550,6 +572,7 @@ mjtSensor } mjtSensor; | Defined in `mjmodel.h `_ + | Sensor types. These values are used in ``m->sensor_type``. .. _mjtStage: @@ -568,6 +591,7 @@ mjtStage } mjtStage; | Defined in `mjmodel.h `_ + | These are the compute stages for the skipstage parameters of :ref:`mj_forwardSkip` and :ref:`mj_inverseSkip`. @@ -587,6 +611,7 @@ mjtDataType } mjtDataType; | Defined in `mjmodel.h `_ + | These are the possible sensor data types, used in ``mjData.sensor_datatype``. .. _mjtWarning: @@ -611,6 +636,7 @@ mjtWarning } mjtWarning; | Defined in `mjdata.h `_ + | Warning types. The number of warning types is given by ``mjNWARNING`` which is also the length of the array ``mjData.warning``. @@ -646,6 +672,7 @@ mjtTimer } mjtTimer; | Defined in `mjdata.h `_ + | Timer types. The number of timer types is given by ``mjNTIMER`` which is also the length of the array ``mjData.timer``, as well as the length of the string array :ref:`mjTIMERSTRING` with timer names. @@ -665,6 +692,7 @@ mjtCatBit } mjtCatBit; | Defined in `mjvisualize.h `_ + | These are the available categories of geoms in the abstract visualizer. The bitmask can be used in the function :ref:`mjr_render` to specify which categories should be rendered. @@ -687,8 +715,9 @@ mjtMouse } mjtMouse; | Defined in `mjvisualize.h `_ + | These are the mouse actions that the abstract visualizer recognizes. It is up to the user to intercept mouse events - and translate them into these actions, as illustrated in simulate.cc. + and translate them into these actions, as illustrated in ``simulate.cc``. .. _mjtPertBit: @@ -704,8 +733,9 @@ mjtPertBit } mjtPertBit; | Defined in `mjvisualize.h `_ + | These bitmasks enable the translational and rotational components of the mouse perturbation. For the regular mouse, - only one can be enabled at a time. For the 3D mouse (SpaceNavigator) both can be enabled simultaneously. Tehy are used + only one can be enabled at a time. For the 3D mouse (SpaceNavigator) both can be enabled simultaneously. They are used in ``mjvPerturb.active``. .. _mjtCamera: @@ -724,6 +754,7 @@ mjtCamera } mjtCamera; | Defined in `mjvisualize.h `_ + | These are the possible camera types, used in ``mjvCamera.type``. .. _mjtLabel: @@ -754,6 +785,7 @@ mjtLabel } mjtLabel; | Defined in `mjvisualize.h `_ + | These are the abstract visualization elements that can have text labels. Used in ``mjvOption.label``. .. _mjtFrame: @@ -777,6 +809,7 @@ mjtFrame } mjtFrame; | Defined in `mjvisualize.h `_ + | These are the MuJoCo objects whose spatial frames can be rendered. Used in ``mjvOption.frame``. .. _mjtVisFlag: @@ -815,6 +848,7 @@ mjtVisFlag } mjtVisFlag; | Defined in `mjvisualize.h `_ + | These are indices in the array ``mjvOption.flags``, whose elements enable/disable the visualization of the corresponding model or decoration element. @@ -841,6 +875,7 @@ mjtRndFlag } mjtRndFlag; | Defined in `mjvisualize.h `_ + | These are indices in the array ``mjvScene.flags``, whose elements enable/disable OpenGL rendering effects. .. _mjtStereo: @@ -858,6 +893,7 @@ mjtStereo } mjtStereo; | Defined in `mjvisualize.h `_ + | These are the possible stereo rendering types. They are used in ``mjvScene.stereo``. .. _mjtGridPos: @@ -876,6 +912,7 @@ mjtGridPos } mjtGridPos; | Defined in `mjrender.h `_ + | These are the possible grid positions for text overlays. They are used as an argument to the function :ref:`mjr_overlay`. @@ -893,6 +930,7 @@ mjtFramebuffer } mjtFramebuffer; | Defined in `mjrender.h `_ + | These are the possible framebuffers. They are used as an argument to the function :ref:`mjr_setBuffer`. .. _mjtFontScale: @@ -913,6 +951,7 @@ mjtFontScale } mjtFontScale; | Defined in `mjrender.h `_ + | These are the possible font sizes. The fonts are predefined bitmaps stored in the dynamic library at three different sizes. @@ -931,6 +970,7 @@ mjtFont } mjtFont; | Defined in `mjrender.h `_ + | These are the possible font types. .. _mjtButton: @@ -949,6 +989,7 @@ mjtButton } mjtButton; | Defined in `mjui.h `_ + | Mouse button IDs used in the UI framework. .. _mjtEvent: @@ -970,6 +1011,7 @@ mjtEvent } mjtEvent; | Defined in `mjui.h `_ + | Event types used in the UI framework. .. _mjtItem: @@ -1002,6 +1044,7 @@ mjtItem } mjtItem; | Defined in `mjui.h `_ + | Item types used in the UI framework. .. _tyFunction: @@ -1118,6 +1161,7 @@ mjVFS typedef struct _mjVFS mjVFS; | Defined in `mjmodel.h `_ + | This is the data structure with the virtual file system. It can only be constructed programmatically, and does not have an analog in MJCF. @@ -1167,6 +1211,7 @@ mjOption typedef struct _mjOption mjOption; | Defined in `mjmodel.h `_ + | This is the data structure with simulation options. It corresponds to the MJCF element :ref:`option