Creating models using GrxUI

In this section we describe how to create VRML models for OpenHRP using GrxUI.
(Note: Following screeshots may somewhat differ from the actual appearence.)

Required data

Please be prepared with following data.

  • Mass, barycenter position relative to the link origin, inertial matrix around the barycenter and shape data of each link.
    Prepare the shape data using CAD software(No extensions available through OpenHRP) and export the output file in VRML97 file format.
  • Positional relation of each link
  • Attaching position and orientation of each sensor

Let's begin model making

Right-click on "Model" item displaying on in GrxUI's ItemView panel and select "create".

Robot(note the robot icon) and its root link is generated as shown below.

Generating tree

Right-clicking link item opens a menu as shown below. Select "add joint", "add sensor", "add segment", to add child link, sensor or segment to this link. Moreover, the already created model file can be read by choosing "add robot".

Robot's link tree will be generated by adding necessary items through these menus.

Adding child link

Right-click on link item and select "add joint" from menu. Enter the child link name in the poping up dialog box and press OK.

Adding sensor

Right-click on link item and select "add sensor" from menu. Enter the sensor name in the poping up dialog box and press OK.

Adding segment

Right-click on link item and select "add segment" from menu. Enter the segment name in the poping up dialog box and press OK.

Adding robot

Right-click on link item and select "add robot" from menu. Please choose a file in a file dialog. The file must be defined according to the model description of OpenHRP3. The route link of the read file is added as a child link of the selected link. If jointType of the route link of the read file is "free", a simulation cannot be performed correctly. Please be sure to rewrite in another types, such as "fixed", by setup of the property explained below.

Adding shape

Right-click on segment item or sensor item and select "add shape from VRML97", "add primitive shape" from menu, to add shape.

Adding shape by VRML97 file

If you select "add shape from VRML97", file-select dialog box will be opened. Select the previously prepared VRML97 file that contain shape data and press OK.

Adding primitive shape

If you select "add primitive shape", Furthermore, the menu of Box", "Cone", "Cylinder", and "Sphere" is showed. Please choose either.

Configuring item properties

When you select link or sensor item, its properties are displayed in "PropertyView" panel. There you can edit the properties and input the predefined parameters of the robot. All the property values are in SI units.

Link properties

Each link contains following properties.

"translation" and "rotation" are for position and orientation of this link relative to the parent link. For "translation", set the position of this link with x,y,z coordinates relative to the parent link's coordinate system and for "rotation", set the orientation of this link by defining rotation vector with 3 elements relative to the parent link and the rotation angle, as total of 4 elements. These position and orientation parameters are same to the sensor and shape items. Numbers below the decimal point are omitted for some properties such as "translation", to prevent the view being complicated.

"centerOfMass", "inertia" and "mass" each indicates barycenter position, inertial matrix around the barycenter, and mass of this link. When the link item is selected in ItemView, the ellipsoids that correspond to these mass characteristics are displayed in translucent orange. These values cannot be edited. These can be edited in the property of a segment item.

"encoderPulse", "rotorResistor" and "torqueConst" each indicates pulse count, rotor resistance and torque constant that the encoder outputs when the motor makes one rotation. These properties are used by controller, but not in simulation.

"gearRatio" and "rotorInertia" each indicates gear ratio of the joint which this link and parent link are connected and the inertia of the motor. These parameters have to be set appropriately, if joint is controlling torque, or simultaion would be unstable.

"jointAxis", "jointId" and "jointType" each indicates direction of joint-axis, joint-number and type of the joint. Direction of joint-axis is specified relative to this link's coordinate system. Joint number is the index of this link, when all the joint data is arranged on a vector. Therefore, the number should not be duplicate. JointType can be selected from free-joint(free), rotate-joint(rotate), slide-joint(slide) or fixed-joint(fixed).

"llimit", "ulimit", "lvlimit", "uvlimit" each indicates minimum value of movable range, maximum value of movable range, minimum value of speed and the maximum value of speed of this link. These are also for controller to use, but not in simulation.

Sensor properties

Each sensor has following properties.

"type" means type of the sensor that can be selected from acceleration-sensor(Acceleration), angular-velocity-sensor(Gyro), force/torque-sensor(Force) or camera(Vision).

Specify the position and orientation for "translation" and "rotation" relative to the link which this sensor is attached.

Segment properties

Each segment has following properties.

"centerOfMass", "inertia" and "mass" each indicates barycenter position, inertial matrix around the barycenter, and mass of this segment. Specify the position and orientation for "translation" and "rotation" relative to the link which this segment belongs.

Shape properties

Each shape has following properties.
Specify the position and orientation for "translation" and "rotation" relative to the segment which this shape belongs.

Since primitive shape has a property according to each feature, edit of size, a color, etc. is possible for it.

Saving the model

Right-click the robot-item at the top of the item tree; a menu will be popped-up as shown below. Select "save as"; file saving dialog box will be displayed. Provide the model file saving location and file name; then press OK. The created model file will be saved in VRML97 format which is supported in OpenHRP.

Warning

  • Although now it is possible to edit various properties using PropertyView, it does not have any control on property editing. Current PropertyView allows to edit any property and input any format of data, without caring the property's input conditions. (For instance, a user may enter string format data into a property that should actually contain numarical data, by mistake). This may cause to occur errors on simulation, if user does not notice these kind of mistakes.

    We are now planning to implement an exclusive view to avoid these kind of problems in future. Until please pay beware to input property values in correct format.

  • You can not start simulation, right after you edit the model. Once you edit, save the model in VRML format and reload again into the simulation.

Model making tutorial

In this section we explain step-by-step procedure of how to create the cart model placed in "sample/model/simple_vehicle" directory.

  1. First be prepare the shape data. The robot is composed of body part, three wheels and a camera. We can use same shape data for wheels, because all three wheels are equal in shape. We have preprared 3 types of shape data for robot bady, wheels and camera and saved them as model files called "body.wrl", "wheel.wrl" and "camera.wrl". If you select any of the item (link, sensor or shape) in ItemView, its local coordinate system will be displayed with red, green and blue lines. Origin of this coordinate sysytem represents item position and red, green, blue lines represent X, Y, Z axes respectively.

  2. Now right-click the "Model" item folder in ItemView and select "create" from the menu; model item will be created.

  3. Even a default name is automatically assigned to the model, here we rename the model and assign as "simple_vehicle" to make it easy to understand.Right-click the generated "newmodel0" and select "rename". A dialog box to enter the new name will be appeared; enter the new name as "simple_vehicle".

  4. Right-click the generated root link and select "add segment" and name a segment "root_segment". Furthermore, right-click this segment and select "add shape fromVRML97". File-select dialog box will be appeared. Select the model file "simple_vehicle/body.wrl", which contains shape data of robot body and press OK. "body.wrl" will be loaded and displayed in 3DView.

  5. Next we add camera, which is the sensor fixed to the robot body. Right-click the "root" link and select "add sensor" from menu. A dialog box to enter the sensor name will be appeared; enter as "Camera".

  6. Sensor is generated as ForceSensor by default. Select "Camera" item and change the sensor type to "Vision" in PropertyView.

    Still the Camera is buried inside the robot body, since it is placed at the origin of the parent node by default. Select the Camera and change the "translation" and "rotation" to (0.0 -0.3 0.1) and (0 0.7071 0.7071 3.1415) respectively. And change the "id" to '0'.

  7. Sensor may have shape if necessary. Right-click the Camera and select "add shape from VRML97" from the menu. File-select dialog box will be appeared and select the model file "camera.wrl" which contains shape data of camera.

  8. Still the robot body is partially buried in the floor. Changing the "translation" property of "root" to (0.0 0.0 0.1) will place the robot body on the floor. Set the "mass" and "inertia" of "root" to (10.0) and (0.1 0.0 0.0 0.0 0.1 0.0 0.0 0.0 0.5) respectively.

  9. There are 3 more links to joint with robot(root) to complete the cart model, those are right-wheel, left-wheel and the steering wheel. Right-click on "root" and select "add joint" from the menu. Add each item naming "WheelR", "WheelL" and "Steering" respectively.

  10. Front-wheel comes in front svn addof Steering. Therefore right-click on "Steering", select "add joint" from menu and add "WheelC".

  11. Add a segment to Steering, WheelC, WheelR, and WheelL.

  12. WheelC, WheelR and WheelL all has same wheel shape defined as "wheel.wrl". Therefore right-click on each wheel item, select "add shape from VRML97" from menu and add shapes.

  13. Set the property values of Steering, Steering_segment, WheelC, WheelC_segment, WheelR, WheelR_segment, WheelL, WheelL_segment as shown in following figures respectively, and you are done.

  14. Finally save the created model as a model file of VRML97 format. Right-click on "simple_vehicle" and select "save as" from menu. File saving dialog box will be appeared. Move to the location where you want to save the model file and enter the file name to save. There you have created the the cart model.

Combination of a model

Since one set of cart model was created, let's create the robot which connected one more set of the same cart model.

    Right-click the first robot's route link and select "add robot". If you chose the file saved previously, one more robot will overlap and will be displayed.

  1. Rewritten the property of the 2nd robot's route link. First, set the type of a route link to fixed. Next, the value of translation is adjusted and keep a robot from overlapping. It is completion. Please save at a file.