Body File Reference Manual

Overview

This is a reference manual for Choreonoid’s standard Body format model files (Body files).

Model File Conventions

Each model file describes one model of a robot or environment. The file extension should be “.body” to distinguish it from regular YAML format files (“.yaml”).

Key Notation Style

Regarding the notation style of keys in YAML files used in Choreonoid, we have traditionally used “lowerCamelCase” but are gradually switching to “snake_case”. However, the transition is not complete, and some keys are still in camelCase. Therefore, YAML files used in Choreonoid may contain a mixture of camelCase and snake_case. This also applies to Body files.

In this manual, keys that have been migrated to snake_case are written in snake_case. For keys that were previously defined in camelCase, the latest version can still read keys in the old format to maintain compatibility. However, this compatibility measure may be discontinued in the future, so please use the new format when creating new files.

Angle Units

Basically, the degree unit is used. For details, please refer to the “angle_unit” item in Header.

YAML Syntax

For YAML syntax, please refer to The Official YAML Web Site.

Node List

The following nodes are defined, and models are created by combining instances of these nodes. In the actual model definition part, these nodes are combined to create hierarchical structures, thereby creating models.

The following nodes are defined for link structure and dynamics/mechanism parameters:

The following nodes are defined for link shape and appearance:

The following nodes are defined for various sensors and devices:

The following nodes are defined for closed-link mechanisms:

The following nodes are defined for grouping nodes:

The details of each node are explained below.

Nodes for Defining Various Sensors and Devices

Device Node

Shows common configuration items for various devices.

Common Fields for Device Node

Key

Content

name

Device name

id

Device ID

translation

Specify the position of the local coordinate system as an offset value from the parent node coordinate system.

rotation

Specify the orientation of the local coordinate system as an offset value from the parent node coordinate system ([x, y, z, θ] rotation by θ around vector [x, y, z]).

Note

Various sensor nodes are attached under the Link node to which the sensor is attached. For example, when an acceleration sensor is attached to the waist (WAIST) of a sample model, it is described as follows:

links:
  -
    name: WAIST
    elements:
      -
        type: AccelerationSensor
        id: 0

AccelerationSensor Node

The AccelerationSensor node defines a 3-axis acceleration sensor.

AccelerationSensor Node Fields

Field

Content

type

AccelerationSensor

max_acceleration

Maximum measurable acceleration. Specify as a list of 3 elements of a 3D vector.

RateGyroSensor Node

The RateGyroSensor node defines a 3-axis angular velocity sensor.

RateGyroSensor Node Fields

Key

Content

type

RateGyroSensor

max_angular_velocity

Maximum measurable angular velocity. Specify as a list of 3 elements of a 3D vector.

Imu Node

The Imu node defines an IMU (Inertial Measurement Unit) that integrates a 3-axis acceleration sensor and a 3-axis angular velocity sensor.

Imu Node Fields

Key

Content

type

Imu

max_acceleration

Maximum measurable acceleration. Specify as a list of 3 elements of a 3D vector.

max_angular_velocity

Maximum measurable angular velocity. Specify as a list of 3 elements of a 3D vector.

ForceSensor Node

The ForceSensor node defines a force/torque sensor.

ForceSensor Node Fields

Key

Content

type

ForceSensor

max_force

Maximum measurable force. Specify as a list of 3 elements of a 3D vector.

max_torque

Maximum measurable torque. Specify as a list of 3 elements of a 3D vector.

Camera Node

The Camera node defines a vision sensor.

Camera Node Fields

Key

Content

type

Camera

format

Specify the type of information to be acquired from the sensor
COLOR : Acquire color information
DEPTH : Acquire depth information
COLOR_DEPTH : Acquire color and depth information
POINT_CLOUD : Acquire 3D point cloud
COLOR_POINT_CLOUD : Acquire color information and 3D point cloud
Note: Internally, when format is COLOR, it is treated as Camera, and when format is other than COLOR, it is treated as RangeCamera.

lens_type

Specify the type of lens (only valid when format is COLOR)
NORMAL : Normal lens (default)
FISHEYE : Fisheye lens
DUAL_FISHEYE : Omnidirectional camera

on

Specify camera ON/OFF with true/false

width

Image width

height

Image height (automatically determined from width value when lens_type=”FISHEYE”,”DUAL_FISHEYE”)

field_of_view

Camera field of view angle (cannot be specified when lensType=”DUAL_FISHEYE”)

near_clip_distance

Distance from viewpoint to near clipping plane

far_clip_distance

Distance from viewpoint to far clipping plane

frame_rate

How many images per second the camera outputs

optical_frame

Specify the camera coordinate system
gl : OpenGL coordinate system (default)
cv : OpenCV coordinate system
robotics : Robotics coordinate system

The details of each coordinate system for optical_frame are shown in the table below. In the default “gl” coordinate system, the negative Z-axis direction is the camera lens front direction, and the Y-axis is the camera upward direction. In the “robotics” coordinate system, the lens orientation matches the coordinate system commonly used in robotics with the forward X-axis and upward Z-axis, making it easier to handle when you want to point the lens forward.

../../_images/optical_frame.png

Note that the gl coordinate system is used in Choreonoid’s internal implementation. When optical_frame is other than gl, coordinate transformation to the gl coordinate system is performed internally.

RangeSensor Node

The RangeSensor node defines a distance sensor.

RangeSensor Node Fields

Key

Content

type

RangeSensor

on

yaw_range

Horizontal plane angle for distance scanning. Centered on 0 degrees, angles within the yaw_range on both sides are measured at angles that are multiples of yaw_step. Set to 0 if the sensor has no horizontal scanning capability. Specify in multiples of yaw_step within the range of 0 to 360 degrees.

yaw_step

Horizontal plane angle increment for distance measurement during scanning

pitch_range

Vertical plane angle for distance scanning. Centered on 0 degrees, angles within the pitch_range on both sides are measured at angles that are multiples of pitch_step. Set to 0 if the sensor has no vertical scanning capability. Specify in multiples of pitch_step within the range of 0 to 170 degrees. (Specifying large values increases processing time and reduces measurement accuracy.)

pitch_step

Vertical plane angle increment for distance measurement during scanning

scan_rate

Number of scans per second [Hz]

min_distance

Minimum measurable distance [m]

max_distance

Maximum measurable distance [m]

optical_frame

Specify the sensor coordinate system
gl : OpenGL coordinate system (default)
cv : OpenCV coordinate system
robotics : Robotics coordinate system

Note

The optical_frame is the same as for Camera node. When scanning in both horizontal and vertical directions, the rotation order is yaw, pitch.

SpotLight Node

The SpotLight node defines a light.

SpotLight Node Fields

Key

Content

type

SpotLight

on

Specify light ON/OFF with true/false.

color

Light color (specify R, G, B values from 0.0 to 1.0)

intensity

Specify brightness from 0.0 to 1.0.

direction

Light direction. Specify direction as a list of 3 elements of a 3D vector.

beam_width

Angle of light spread at maximum brightness. Default is 90 degrees.

cut_off_angle

Angle at which light is completely blocked. Default is 45 degrees.

cut_off_exponent

Specify a non-negative value. Default is 1.0.

attenuation

Attenuation rate. Specify a list of 3 non-negative elements.

Nodes for Grouping Nodes

Group Node

Used to group some nodes.

Group Node Fields

Key

Content

name

Group name

(Usage example)
elements:
  - &SUBSYSTEM
    type: Group
    name: SUBSYSTEM
    elements:
      -
        (One element of the group)
      -
        (One element of the group)
       :

By assigning an alias to the group node, when there is the same configuration as SUBSYSTEM in another location, it can be described as:

elements: *SUBSYSTEM