# Tankモデルファイル全記述内容

新YAML形式モデルファイルチュートリアル で解説したTankモデルを記述しているモデルファイルの全テキストを以下に掲載します。本モデルは Choreonoid インストール先の “share/model/tank/tank.body” というファイルに格納されています。

      1
      2
      3
      4
      5
      6
      7
      8
      9
     10
     11
     12
     13
     14
     15
     16
     17
     18
     19
     20
     21
     22
     23
     24
     25
     26
     27
     28
     29
     30
     31
     32
     33
     34
     35
     36
     37
     38
     39
     40
     41
     42
     43
     44
     45
     46
     47
     48
     49
     50
     51
     52
     53
     54
     55
     56
     57
     58
     59
     60
     61
     62
     63
     64
     65
     66
     67
     68
     69
     70
     71
     72
     73
     74
     75
     76
     77
     78
     79
     80
     81
     82
     83
     84
     85
     86
     87
     88
     89
     90
     91
     92
     93
     94
     95
     96
     97
     98
     99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    format: ChoreonoidBody
    formatVersion: 1.0
    angleUnit: degree
    name: Tank

    links:
      -
        name: CHASSIS
        translation: [ 0, 0, 0.1 ]
        jointType: free
        centerOfMass: [ 0, 0, 0 ]
        mass: 8.0
        inertia: [
          0.1, 0,   0,
          0,   0.1, 0,
          0,   0,   0.5 ]
        elements:
          Shape:
            geometry:
              type: Box
              size: [ 0.45, 0.3, 0.1 ]
            appearance: &BodyAppearance
              material:
                diffuseColor: [ 0, 0.6, 0 ]
                specularColor: [ 0.2, 0.8, 0.2 ]
                shinines: 0.6
      -
        name: TURRET_Y
        parent: CHASSIS
        translation: [ -0.04, 0, 0.1 ]
        jointType: revolute
        jointAxis: -Z
        jointRange: unlimited
        maxJointVelocity: 90
        jointId: 0
        centerOfMass: [ 0, 0, 0.025 ]
        mass: 4.0
        inertia: [
          0.1, 0,   0,
          0,   0.1, 0,
          0,   0,   0.1 ]
        elements:
          Shape:
            geometry:
              type: Box
              size: [ 0.2, 0.2, 0.1 ]
            appearance: *BodyAppearance
      -
        name: TURRET_P
        parent: TURRET_Y
        translation: [ 0, 0, 0.05 ]
        jointType: revolute
        jointAxis: -Y
        jointRange: [ -10, 45 ]
        maxJointVelocity: 90
        jointId: 1
        elements:
          -
            # Turret
            type: RigidBody
            centerOfMass: [ 0, 0, 0 ]
            mass: 3.0
            inertia: [
              0.1, 0,   0,
              0,   0.1, 0,
              0,   0,   0.1 ]
            elements:
              Shape:
                geometry:
                  type: Cylinder
                  height: 0.1
                  radius: 0.1
                appearance: *BodyAppearance
          -
            # Gun
            type: Transform
            translation: [ 0.2, 0, 0 ]
            rotation: [ 0, 0, 1, 90 ]
            elements:
              RigidBody:
                centerOfMass: [ 0, 0, 0 ]
                mass: 1.0
                inertia: [
                  0.01, 0,   0,
                  0,    0.1, 0,
                  0,    0,   0.1 ]
                elements:
                  Shape:
                    geometry:
                      type: Cylinder
                      height: 0.2
                      radius: 0.02
                    appearance: *BodyAppearance
          -
            type: SpotLight
            name: Light
            translation: [ 0.08, 0, 0.1 ]
            direction: [ 1, 0, 0 ]
            beamWidth: 36
            cutOffAngle: 40
            cutOffExponent: 6
            attenuation: [ 1, 0, 0.01 ]
            elements:
              Shape:
                rotation: [ 0, 0, 1, 90 ]
                translation: [ -0.02, 0, 0 ]
                geometry:
                  type: Cone
                  height: 0.04
                  radius: 0.025
                appearance:
                  material:
                    diffuseColor: [ 1.0, 1.0, 0.4 ]
                    ambientIntensity: 0.3
                    emissiveColor: [ 0.8, 0.8, 0.3 ]
          -
            type: Transform
            translation: [ 0.1, 0, 0.05 ]
            rotation: [ [ 1, 0, 0, 90 ], [ 0, 1, 0, -90 ] ]
            elements:
              -
                type: Camera
                name: Camera
                format: COLOR_DEPTH
                fieldOfView: 65
                width: 320
                height: 240
                frameRate: 30
              -
                type: RangeSensor
                name: RangeSensor
                scanAngle: 90
                scanStep:  0.5
                scanRate:  10
                maxDistance: 10
              -
                type: Shape
                geometry:
                  type: Box
                  size: [ 0.04, 0.015, 0.01 ]
                appearance:
                  material:
                    diffuseColor: [ 0.2, 0.2, 0.8 ]
                    specularColor: [ 0.6, 0.6, 1.0 ]
                    shininess: 0.6
      -
        name: TRACK_L
        parent: CHASSIS
        translation: [ 0, 0.2, 0 ]
        jointType: pseudoContinuousTrack
        jointAxis: Y
        centerOfMass: [ 0, 0, 0 ]
        mass: 1.0
        inertia: [
          0.02, 0,    0,
          0,    0.02, 0,
          0,    0,    0.02 ]
        elements:
          Shape: &TRACK
            geometry:
              type: Extrusion
              crossSection: [
                -0.22, -0.1,
                 0.22, -0.1,
                 0.34,  0.06,
                -0.34,  0.06,
                -0.22, -0.1
                ]
              spine: [ 0, -0.05, 0, 0, 0.05, 0 ]
            appearance:
              material:
                diffuseColor: [ 0.2, 0.2, 0.2 ]
      -
        name: TRACK_R
        parent: CHASSIS
        translation: [ 0, -0.2, 0 ]
        jointType: pseudoContinuousTrack
        jointAxis: Y
        centerOfMass: [ 0, 0, 0 ]
        mass: 1.0
        inertia: [
          0.02, 0,    0,
          0,    0.02, 0,
          0,    0,    0.02 ]
        elements:
          Shape: *TRACK