模型名称
美文网首页
在mujoco中构造自己的机器人模型

在mujoco中构造自己的机器人模型

作者: 东流十月 | 来源:发表于2021-01-25 17:41 被阅读0次

    1、以下的文字内容 都是注解,正式代码中没有
    <mujoco model="VSBR2dir"> 模型名称
    <compiler angle="degree" coordinate="local" inertiafromgeom="true"/> 角度、本地坐标系、地球惯性
    <option integrator="RK4" timestep="0.01"/>
    <custom>
    <numeric data="0.0 0.0 0.55 1.0 0.0 0.0 0.0 0.0 1.0 0.0 -1.0 0.0 -1.0 0.0 1.0" name="init_qpos"/>初始化数字数据
    </custom>
    <default>默认值
    <joint armature="1" damping="1" limited="true"/>关节电枢、阻尼
    <geom conaffinity="0" condim="3" density="500.0" friction="1 0.5 0.5" margin="0.01" rgba="0.8 0.6 0.4 1"/>
    </default>
    <asset>一些变量定义
    <texture builtin="gradient" height="100" rgb1="1 1 1" rgb2="0 0 0" type="skybox" width="100"/>
    <texture builtin="flat" height="1278" mark="cross" markrgb="1 1 1" name="texgeom" random="0.01" rgb1="0.8 0.6 0.4"
    rgb2="0.8 0.6 0.4" type="cube" width="127"/>
    <texture builtin="checker" height="100" name="texplane" rgb1="0 0 0" rgb2="0.8 0.8 0.8" type="2d" width="100"/>
    <material name="MatPlane" reflectance="0.5" shininess="1" specular="1" texrepeat="60 60" texture="texplane"/>
    <material name="geom" texture="texgeom" texuniform="true"/>
    <mesh file="wheelL.STL"/>
    <mesh file="wheelR.STL"/>
    </asset>

    <worldbody>
    <light cutoff="100" diffuse="1 1 1" dir="-0 0 -1.3" directional="true" exponent="1" pos="0 0 1.3"
    specular=".1 .1 .1"/>
    <geom conaffinity="1" condim="3" material="MatPlane" name="floor" pos="0 0 0" rgba="0.8 0.9 0.8 1" size="40 40 40"
    type="plane"/>

    <body name="VSBR" pos="0 0 0.1">
      <geom name="frame1" fromto="-1 0 1 1 0 1" size="0.1" type="capsule" rgba="1 1 0 1"/>
    
    
      <joint armature="0" damping="0" limited="false" margin="0.01" name="root" pos="0 0 0" type="free"/>
    
      <body name="leftwheel" pos="0 0 0">
        <geom name="frameL" pos="-1 0 1" size="0.05 0.05 0.5" type="box" rgba="1 1 0 1"/>
        <body name="lwheel">
          <geom mass="1" name="leftwheel" type="mesh" mesh="wheelL"/>
          <joint axis="0 1 0" name="hingeLY" pos="-1 0 0.5" limited="false" type="hinge"/>
        </body>
        <joint axis="0 0 1" name="hingeLZ" pos="-1 0 0" limited="true" range="-45 45" type="hinge"/>
      </body>
    
    
      <body name="rightwheel" pos="0 0 0">
        <geom name="frameR" pos="1 0 1" size="0.05 0.05 0.5" type="box" rgba="1 1 0 1"/>
        <body name="rwheel">
          <geom mass="1" name="rightwheel" type="mesh" mesh="wheelR" />
          <joint axis="0 1 0" name="hingeRY" pos="1 0 0.5" limited="false" type="hinge"/>
        </body>
        <joint axis="0 0 1" name="hingeRZ" pos="1 0 0" limited="true" range="-45 45" type="hinge"/>
      </body>
    </body>
    

    </worldbody>
    <actuator>
    <motor ctrllimited="true" ctrlrange="-1 1" gear="100" joint="hingeRY" name="hingeRYa"/>
    <motor ctrllimited="true" ctrlrange="-1 1" gear="100" joint="hingeRZ" name="hingeRZa"/>
    <motor ctrllimited="true" ctrlrange="-1 1" gear="100" joint="hingeLY" name="hingeLYa"/>
    <motor ctrllimited="true" ctrlrange="-1 1" gear="100" joint="hingeLZ" name="hingeLZa"/>
    </actuator>
    </mujoco>

    相关文章

      网友评论

          本文标题:在mujoco中构造自己的机器人模型

          本文链接:https://www.haomeiwen.com/subject/qaxmnctx.html