OpenHRP Model File

Overview

Model files in OpenHRP format is based on “VRML97”, which is a language to describe three-dimensional models. One robot or environment model is described per model file. The VRML97 extension of “.wrl” is appended as the file extension.

The basic configuration of a model file consists of:

  • PROTO declaration part (structure declaration part)

  • Real-model definition part (instance notation part using PROTO)

The PROTO declaration part uses the node called “PROTO”, which corresponds to the structure in C language, to define new nodes that are not defined by VRML97. The following nodes are defined as PROTO nodes. A model is created by building up these instances.

The following nodes are defined as nodes that define the link structure and kinetics/mechanical parameters. (These nodes are extended/modified from ones established by the “h-anim1.1” format, which is for description of human figures.)

  • Humanoid node

  • Joint node

  • Segment node

  • ExtraJoint node

A model is created through the creation of a hierarchy structure by combining instances of these nodes in the real-model definition part. For example, a humanoid robot has a structure as shown below.

Humanoid sample(The root node of the whole model)
  + Joint Waist (The center of the humanoid. A free point floats in the s)
  | ....
  |
  |  + Joint Chest
  |    + Joint Head
  |    + Joint Left Arm
  |    + Joint Right Arm
  |
  + Joint Left Leg
  |
  + Joint Right Leg

This is a structure where “Waist” has a chain connected to “Left Leg” and “Right Leg” and a chain connected to “Chest”, and “Chest” has a chain connected to “Head”, “Left Arm”, and “Right Arm”.

In addition, the following PROTO nodes are available to define various sensors.

  • AccelerationSensor node

  • GyroSensor node

  • VisionSensor node

  • ForceSensor node

  • RangeSensor node

You can include sensor information in a model by using these nodes.

The following describes the details of each node.

Nodes that Define Various Sensors

AccelerationSensor Node

An AccelerationSensor node defines a 3-axis acceleration sensor.

PROTO AccelerationSensor [
  exposedField SFVec3f    maxAcceleration -1 -1 -1
  exposedField SFVec3f    translation     0 0 0
  exposedField SFRotation rotation        0 0 1 0
  exposedField SFInt32    sensorId        -1
]
{
  Transform {
    translation IS translation
    rotation    IS rotation
  }
}
AccelerationSensor Node Fields

Field

Description

maxAcceleration

Specifies the maximum acceleration that can be measured.

translation

Specifies the position in the local coordinate system, using an offset value relative to the parent node coordinate system.

rotation

Specifies the posture in the local coordinate system, using an offset value relative to the parent node coordinate system.

sensorId

Specifies the ID of the sensor. Assign a continuous sequence of sensor ID numbers in the order from 0 to the sensors of the same type in a model, ensuring that there is no gap or overlap. These IDs are used to determine the order in which data from sensors of the same type is arranged.

Put a sensor node under the Joint node to which the corresponding sensor is attached. For example, if an acceleration sensor is attached to the WAIST of the sample model, write as follows:

DEF WAIST Joint
{
     :
  children [
    DEF gsensor AccelerationSensor
    {
        :
    }
     :
  ]
}

GyroSensor Node

A Gyro node defines a 3-axis angular velocity sensor.

PROTO Gyro [
  exposedField SFVec3f    maxAngularVelocity -1 -1 -1
  exposedField SFVec3f    translation        0 0 0
  exposedField SFRotation rotation           0 0 1 0
  exposedField SFInt32    sensorId           -1
]
{
  Transform {
    translation IS translation
    rotation    IS rotation
  }
}

VisionSensor Node

An VisionSensor node defines a vision sensor.

PROTO VisionSensor
[
  exposedField  SFVec3f     translation       0 0 0
  exposedField  SFRotation  rotation          0 0 1 0
  exposedField  SFFloat     fieldOfView       0.785398
  field         SFString    name              ""
  exposedField  SFFloat     frontClipDistance 0.01
  exposedField  SFFloat     backClipDistance  10.0
  exposedField  SFString    type              "NONE"
  exposedField  SFInt32     sensorId          -1
  exposedField  SFInt32     width             320
  exposedField  SFInt32     height            240
  exposedField  SFFloat     frameRate         30
]
{
  Transform
  {
    translation IS translation
    rotation    IS rotation
  }
}
VisionSensor Node Fields

Field

Description

translation

Specifies the position of the viewpoint relative to the parent node coordinate system.

rotation

Specifies the posture of the viewpoint relative to the parent node coordinate system. The posture of the viewpoint is defined as follows: Forward viewing direction: Negative direction of the Z-axis in the local coordinate system; Upper viewing direction: Positive direction of the Y-axis in the local coordinate system. Sight line vector

fieldOfView

Specifies the viewing angle of the camera. The unit is rad, and a value of (0, pi) can be set.

name

Specifies the name of the sensor.

frontClipDistance

Specifies the distance from the viewpoint to the front clip surface.

backClipDistance

Specifies the distance from the viewpoint to the rear clip surface.

type

Specifies the type of information to be acquired from the sensor. “COLOR”: Acquires color information. “DEPTH”: Acquires depth information. “COLOR_DEPTH”: Acquires color and depth information. “NONE”: Does not acquire none of the information.

sensorId

Specifies the ID of the sensor.

width

Specifies the width of images.

height

Specifies the height of images.

frameRate

Specifies how many images the camera outputs per second.

ForceSensor Node

A ForceSensor node defines a force-torque sensor.

PROTO ForceSensor [
  exposedField SFVec3f maxForce -1 -1 -1
  exposedField SFVec3f maxTorque -1 -1 -1
  exposedField SFVec3f translation 0 0 0
  exposedField SFRotation rotation 0 0 1 0
  exposedField SFInt32 sensorId -1
]
{
  Transform {
translation IS translation
    rotation IS rotation
  }
}
ForceSensor Node Fields

Field

Description

maxForce

Sets the maximum value of force that can be measured.

maxTorque

Sets the maximum value of torque that can be measured.

translation

Specifies the position in the local coordinate system, using an offset value relative to the parent node coordinate system.

rotation

Specifies the posture in the local coordinate system, using an offset value relative to the parent node coordinate system.

sensorId

Specifies the ID of the sensor.

RangeSensor Node

A RangeSensor node defines a range sensor.

PROTO RangeSensor [
   exposedField SFVec3f    translation       0 0 0
   exposedField SFRotation rotation          0 0 1 0
   exposedField MFNode     children          [ ]
   exposedField SFInt32    sensorId          -1
   exposedField SFFloat    scanAngle         3.14159 #[rad]
   exposedField SFFloat    scanStep          0.1     #[rad]
   exposedField SFFloat    scanRate          10      #[Hz]
   exposedField SFFloat    maxDistance      10
]
{
   Transform {
     rotation         IS rotation
     translation      IS translation
     children         IS children
   }
}
RangeSensor Node Fields

Field

Description

translation

The position of the sensor relative to the link to which this sensor is attached.

rotation

The posture of the sensor relative to the link to which this sensor is attached. In the sensor coordinate system, the Z-axis negative direction is the measurement front, and the measurement surface at the time of scanning is the X-Z plane. Since this is the same as for VisionSensor, if you modify a model for which VisionSensor has been used alternatively, the posture can be used without change.

sensorId

The serial number of RangeSensor. The serial numbers are assigned to RangeSensors attached to this robot.

scanAngle

The angle at which the range is scanned [rad]. Angles in the range of scanAngle are measured in steps of an angle of multiples of scanStep in both directions from 0 degrees. If the sensor has no scan function, set a value of 0.

scanStep

Step size in degrees with which distance measured during scanning.

scanRate

The number of scans to be performed per second [Hz].

maxDistance

The maximum distance that can be measured [m].