OpenHRP Model Files

Choreonoid can also load model files in OpenHRP format.

OpenHRP is an open architecture robot simulator that originated from the “Humanoid Robotics Project” by the Ministry of Economy, Trade and Industry from 1998 to 2002. Since the release of OpenHRP3 in 2007, it has been published as open source software. It has been widely used particularly in the research and development of bipedal robots, and has been utilized in the development of AIST’s bipedal humanoid robots including HRP-2. Choreonoid’s simulation functionality was developed based on the achievements of OpenHRP3.

Since the current standard format for Choreonoid is the Body format, it is preferable to use that format unless there is a specific reason not to. However, you may want to use model files developed for OpenHRP, so we summarize the specifications of OpenHRP format model files here.

Overview

OpenHRP format model files are based on “VRML97”, a language for describing 3D models. Each model file describes one robot or environment model. The file extension should be “.wrl”, which is the VRML97 extension.

The basic structure of a model file consists of:

  • PROTO declaration section (structure declaration section)

  • Actual model definition section (instance notation section using PROTO)

In the PROTO declaration section, we use nodes called “PROTO”, which correspond to structures in C language, to define new nodes not defined in VRML97. The following PROTO nodes are defined, and models are created by assembling instances of these.

The following nodes are defined for defining link structures and dynamics/mechanism parameters. (These nodes are extensions/modifications based on those established in the “h-anim1.1” format for describing human figures.)

  • Humanoid node

  • Joint node

  • Segment node

  • ExtraJoint node

In the actual model definition section, models are created by combining instances of these nodes to create hierarchical structures. For example, in the case of a humanoid robot, the structure would be as follows:

Humanoid sample (root of the model)
  + Joint WAIST (center of humanoid. Floating non-fixed point in the air)
  | ....
  |
  |  + Joint CHEST
  |    + Joint HEAD
  |    + Joint LARM
  |    + Joint RARM
  |
  + Joint LLEG
  |
  + Joint RLEG

In other words, there is a “WAIST” floating in the air, with chains corresponding to “left leg” and “right leg” connected to it, as well as a chain leading to the “CHEST”, and from the “CHEST”, chains of “HEAD”, “left arm”, and “right arm” are connected.

The following PROTO nodes are also available for defining various sensors:

  • AccelerationSensor node

  • GyroSensor node

  • VisionSensor node

  • ForceSensor node

  • RangeSensor node

Using these nodes, it is possible to include sensor information in the model.

The details of each node are explained below.

Nodes for defining various sensors

AccelerationSensor node

The 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
  }
}
Fields of AccelerationSensor node

Field

Content

maxAcceleration

Specify the maximum measurable acceleration.

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.

sensorId

Specify the sensor ID. Sensor IDs should be set sequentially starting from 0 for the same type of sensors within one model, without gaps or duplicates. This ID is used to determine the order when arranging data from the same type of sensors.

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

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

GyroSensor node

The 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
  }
}
Fields of GyroSensor node

Field

Content

maxAngularVelocity

Specify the maximum measurable angular velocity.

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.

sensorId

Specify the sensor ID.

VisionSensor node

The 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
  }
}
Fields of VisionSensor node

Field

Content

translation

Specify the position of the viewpoint as a relative position from the parent node coordinate system.

rotation

Specify the orientation of the viewpoint as a relative orientation from the parent node coordinate system. The viewpoint orientation is defined as follows. Forward direction of view … Negative Z-axis direction in local coordinate system, Upward direction of view … Positive Y-axis direction in local coordinate system. View vector

fieldOfView

Specify the camera’s field of view angle. The unit is rad, and values in (0, pi) can be set.

name

Specify the sensor name.

frontClipDistance

Specify the distance from the viewpoint to the front clip plane.

backClipDistance

Specify the distance from the viewpoint to the back clip plane.

type

Specify the type of information to acquire from the sensor. “COLOR” acquires color information. “DEPTH” acquires depth information. “COLOR_DEPTH” acquires both color and depth information. “NONE” does not acquire any information.

sensorId

Specify the sensor ID.

width

Specify the image width.

height

Specify the image height.

frameRate

Specify how many images per second the camera outputs.

ForceSensor node

The 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
  }
}
Fields of ForceSensor node

Field

Content

maxForce

Set the maximum measurable force value.

maxTorque

Set the maximum measurable torque value.

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.

sensorId

Specify the sensor ID.

RangeSensor node

The 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
   }
}
Fields of RangeSensor node

Field

Content

translation

Position of this sensor relative to the link to which this sensor is attached

rotation

Orientation of this sensor relative to the link to which this sensor is attached. In the sensor coordinate system, the negative Z-axis direction is the measurement front, and the measurement plane when scanning is the XZ plane. This is the same as VisionSensor, so if you change a model that was previously substituted with VisionSensor, the position and orientation can be used as is.

sensorId

Serial number among RangeSensors attached to this robot

scanAngle

Angle [rad] for scanning distance. Centered at 0 degrees, angles within the range of scanAngle at multiples of scanStep on both sides are measured. Set to 0 if the sensor does not have a scanning function.

scanStep

Angular increment [rad] at which distance is measured during scanning

scanRate

Number of scans per second [Hz]

maxDistance

Maximum measurable distance [m]