Mujoco模型学习记录

Mujoco模型学习记录_第1张图片


asset 连杆纹理配置

 <mesh name='toro' scale='1 1 1' file='l_lglut.STL' />

1 name 纹理名称,用于跟连杆关联

2 scale 控制纹理在x-y-z方向上的放大缩小,原始是 1 1 1

scale: real(3), “1 1 1”
This attribute specifies the scaling that will be applied to the vertex data along each coordinate axis. Negative values are allowed, resulting in flipping the mesh along the corresponding axis.

3 file 纹理文件,默认是在meshes里面找


body

1 worldbody 特殊的body,作为世界的frame

This element is used to construct the kinematic tree via nesting. The element worldbody is used for the top-level body, while the element body is used for all other bodies. The top-level body is a restricted type of body: it cannot have child elements inertial and joint, and also cannot have any attributes. It corresponds to the origin of the world frame, within which the rest of the kinematic tree is defined. Its body name is automatically defined as “world”.

不能配置属性

2 body 机器人连杆和关节的实现对象

2.1 name: string, optional

Name of the body.

mesh和auctor需要通过name跟连杆或关节关联起来

2.2 pos: real(3), optional

The 3D position of the body frame, in local or global coordinates as determined by the coordinate attribute of compiler. Recall the earlier discussion of local and global coordinates in Coordinate frames. In local coordinates, if the body position is left undefined it defaults to (0,0,0). In global coordinates, an undefined body position is inferred by the compiler through the following steps:

  1. If the inertial frame is not defined via the inertial element, it is inferred from the geoms attached to the body. If there are no geoms, the inertial frame remains undefined. This step is applied in both local and global coordinates.

  2. If both the body frame and the inertial frame are undefined, a compile error is generated.

  3. If one of these two frames is defined and the other is not, the defined one is copied into the undefined one. At this point both frames are defined, in global coordinates.

  4. The inertial frame as well as all elements defined in the body are converted to local coordinates, relative to the body frame.

Note that whether a frame is defined or not depends on its pos attribute, which is in the special undefined state by default. Orientation cannot be used to make this determination because it has an internal default (the unit quaternion).

这里需要注意一下,这里的pos是本连杆的体坐标系在上一个连杆的体坐标系中的坐标,
而不是本连杆的末端在上一个体坐标系中的坐标
看例子就很容易明白了,l_leg,pelvis的长度是0.2,l_leg在pelvis的坐标是0 0 -0.22
两个体坐标系的原点质检的差异是0.22,所以两个连杆之间会有0.02的空隙

   
      
      
      
         
           
      
  
  

Mujoco模型学习记录_第2张图片

2.3 geom body外观属性

This element creates a geom, and attaches it rigidly to the body within which the geom is defined. Multiple geoms can be attached to the same body. At runtime they determine the appearance and collision properties of the body. At compile time they can also determine the inertial properties of the body, depending on the presence of the inertial element and the setting of the inertiafromgeom attribute of compiler. This is done by summing the masses and inertias of all geoms attached to the body with geom group in the range specified by the inertiagrouprange attribute of compiler. The geom masses and inertias are computed using the geom shape, a specified density or a geom mass which implies a density, and the assumption of uniform density.
Geoms are not strictly required for physics simulation. One can create and simulate a model that only has bodies and joints. Such a model can even be visualized, using equivalent inertia boxes to represent bodies. Only contact forces would be missing from such a simulation. We do not recommend using such models, but knowing that this is possible helps clarify the role of bodies and geoms in MuJoCo.

2.3.1 type: [plane, hfield, sphere, capsule, ellipsoid, cylinder, box, mesh], “sphere”


contact (*)

你可能感兴趣的:(Mujoco,Mujoco)