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

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

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