SimpleTankモデルファイル全記述内容

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

  1format: ChoreonoidBody
  2formatVersion: 1.0
  3angleUnit: degree
  4name: SimpleTank
  5
  6links:
  7  -
  8    name: CHASSIS
  9    translation: [ 0, 0, 0.1 ]
 10    jointType: free
 11    centerOfMass: [ 0, 0, 0 ]
 12    mass: 8.0
 13    inertia: [
 14      0.1, 0,   0,
 15      0,   0.1, 0,
 16      0,   0,   0.5 ]
 17    elements:
 18      Shape:
 19        geometry:
 20          type: Box
 21          size: [ 0.45, 0.3, 0.1 ]
 22        appearance: &BodyAppearance
 23          material:
 24            diffuseColor: [ 0, 0.6, 0 ]
 25            specularColor: [ 0.2, 0.8, 0.2 ]
 26            shininess: 0.6
 27  -
 28    name: TURRET_Y
 29    parent: CHASSIS
 30    translation: [ -0.04, 0, 0.1 ]
 31    jointType: revolute
 32    jointAxis: -Z
 33    jointRange: unlimited
 34    maxJointVelocity: 90
 35    jointId: 0
 36    centerOfMass: [ 0, 0, 0.025 ]
 37    mass: 4.0
 38    inertia: [
 39      0.1, 0,   0,
 40      0,   0.1, 0,
 41      0,   0,   0.1 ]
 42    elements:
 43      Shape:
 44        geometry:
 45          type: Box
 46          size: [ 0.2, 0.2, 0.1 ]
 47        appearance: *BodyAppearance
 48  -
 49    name: TURRET_P
 50    parent: TURRET_Y
 51    translation: [ 0, 0, 0.05 ]
 52    jointType: revolute
 53    jointAxis: -Y
 54    jointRange: [ -10, 45 ]
 55    maxJointVelocity: 90
 56    jointId: 1
 57    elements:
 58      -
 59        # Turret
 60        type: RigidBody
 61        centerOfMass: [ 0, 0, 0 ]
 62        mass: 3.0
 63        inertia: [
 64          0.1, 0,   0,
 65          0,   0.1, 0,
 66          0,   0,   0.1 ]
 67        elements:
 68          Shape:
 69            geometry:
 70              type: Cylinder
 71              height: 0.1
 72              radius: 0.1
 73            appearance: *BodyAppearance
 74      -
 75        # Gun
 76        type: Transform
 77        translation: [ 0.2, 0, 0 ]
 78        rotation: [ 0, 0, 1, 90 ]
 79        elements:
 80          RigidBody:
 81            centerOfMass: [ 0, 0, 0 ]
 82            mass: 1.0
 83            inertia: [
 84              0.01, 0,   0,
 85              0,    0.1, 0,
 86              0,    0,   0.1 ]
 87            elements:
 88              Shape:
 89                geometry:
 90                  type: Cylinder
 91                  height: 0.2
 92                  radius: 0.02
 93                appearance: *BodyAppearance
 94      -
 95        type: SpotLight
 96        name: Light
 97        translation: [ 0.08, 0, 0.1 ]
 98        direction: [ 1, 0, 0 ]
 99        beamWidth: 36
100        cutOffAngle: 40
101        cutOffExponent: 6
102        attenuation: [ 1, 0, 0.01 ]
103        elements:
104          Shape:
105            rotation: [ 0, 0, 1, 90 ]
106            translation: [ -0.02, 0, 0 ]
107            geometry:
108              type: Cone
109              height: 0.04
110              radius: 0.025
111            appearance:
112              material:
113                diffuseColor: [ 1.0, 1.0, 0.4 ]
114                ambientIntensity: 0.3
115                emissiveColor: [ 0.8, 0.8, 0.3 ]
116      -
117        type: Camera
118        name: Camera
119        translation: [ 0.1, 0, 0.05 ]
120        rotation: [ [ 1, 0, 0, 90 ], [ 0, 1, 0, -90 ] ]
121        format: COLOR_DEPTH
122        fieldOfView: 65
123        width: 320
124        height: 240
125        frameRate: 30
126        elements:
127          Shape:
128            translation: [ 0, 0, 0.005 ]
129            rotation: [ 1, 0, 0, 90 ]
130            geometry:
131              type: Cylinder
132              radius: 0.02
133              height: 0.02
134            appearance:
135              material:
136                diffuseColor: [ 0.2, 0.2, 0.8 ]
137                specularColor: [ 0.6, 0.6, 1.0 ]
138                shininesss: 0.6
139  -
140    name: TRACK_L
141    parent: CHASSIS
142    translation: [ 0, 0.2, 0 ]
143    jointType: fixed
144    jointAxis: Y
145    actuationMode: jointSurfaceVelocity
146    centerOfMass: [ 0, 0, 0 ]
147    mass: 1.0
148    inertia: [
149      0.02, 0,    0,
150      0,    0.02, 0,
151      0,    0,    0.02 ]
152    elements:
153      Shape: &TRACK
154        geometry:
155          type: Extrusion
156          crossSection: [
157            -0.22, -0.1,
158             0.22, -0.1,
159             0.34,  0.06,
160            -0.34,  0.06,
161            -0.22, -0.1
162            ]
163          spine: [ 0, -0.05, 0, 0, 0.05, 0 ]
164        appearance:
165          material:
166            diffuseColor: [ 0.2, 0.2, 0.2 ]
167  -
168    name: TRACK_R
169    parent: CHASSIS
170    translation: [ 0, -0.2, 0 ]
171    jointType: fixed
172    jointAxis: Y
173    actuationMode: jointSurfaceVelocity
174    centerOfMass: [ 0, 0, 0 ]
175    mass: 1.0
176    inertia: [
177      0.02, 0,    0,
178      0,    0.02, 0,
179      0,    0,    0.02 ]
180    elements:
181      Shape: *TRACK