Mujoco模型学习记录

在这里插入图片描述


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的空隙

   <body name="pelvis" pos="0 0 0.45">
      <joint type="hinge" limited='false' axis="1 0 0" />
      <geom  type="cylinder"  size="0.005 0.1"/>
      <body name="l_leg" pos="0 0.0 -0.22" euler="0 0 0">
         <joint type="hinge" limited='false'  axis="1 0 0"  pos="0 0 0"/>
           <geom  type="cylinder" size="0.01 0.1"/>
      </body>
  </body>
  

在这里插入图片描述

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 (*)

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值