Operating a Leg-Type Model

Choreonoid provides useful functions to operate the posture of a leg-type robot, including a biped humanoid robot. This section introduces these functions.

Sample Models

As a sample to introduce the functions, we use the model of the biped humanoid robot “GR001” here. The model is stored as the “GR001.yaml” file in the “model/GR001” directory in the share directory of Choreonoid. In addition, the project file “project/GR001Sample.cnoid” is available as a sample project to handle the model.

Load the project file as a preparation. Then, the following model of the GR001 robot should be displayed in the scene view.

../_images/GR001Scene.png

Operating the Waist Using Preset Kinematics

When editing the posture of a leg-type model, sometimes you want to move the position of the waist or the posture while the grounding positions of the legs are fixed. If only one leg needs to be fixed, this can be achieved using normal inverse kinematics (moving the waist using the leg as the base link). However, you often want to move the waist while multiple legs are fixed.

Actually, moving the waist of a leg-type model in “preset kinematics mode” (see Switching Kinematics Modes ) is normally an inverse kinematics operation that moves the waist while multiple legs are fixed. This enables you to efficiently edit the position of the waist or the posture.

Displaying the Center of Gravity

When editing the posture of a leg-type model, sometimes you want to check whether the robot is balanced by viewing the position of the center of gravity of the whole robot. The scene view can display markers for this purpose.

You can switch the display from the context menu of the scene view. Right-click in edit mode while the mouse cursor points to the target model. The following menu appears.

../_images/GR001_context_menu.png

You can see that there is the “Gravity Center” and “Projected Gravity Center Point” items in the “Marker” sub-menu. Click an item to check the item and to turn on the display of the marker. (Click the item again to remove the check and to turn off the display.)

When the “Gravity Center” is checked, the position of the center of gravity is displayed as green cross lines (the intersection point represents the position of the center of gravity). The “Projected Gravity Center Point” item displays the point of the center of gravity projected onto the floor surface (point where Z = 0). This is used when, for example, you check whether the center of gravity is within the sole area.

Zero Moment Point (ZMP)

As with the marker for the center of gravity, you can also display the marker for “zero moment point (ZMP)” by checking “Marker” - “ZMP” in the context menu. The marker, which consists of a green ball and cross lines, normally is located near the feet of the robot.

../_images/GR001_context_menu_ZMP.png

Note

The ZMP is a point at which the moment the sole receives from the floor surface is zero (center of pressure of floor reaction force), which is one of the basic concepts of biped walking control. Since the ZMP of an actual robot is present in the “specified area” consisting of the convex hull of the sole ground plane, you can use this condition for target motion trajectory planning and walking stabilization control. For details, see relevant documents, such as “Humanoid Robot” by Shuuji Kajita.

In Choreonoid, the ZMP marker is used in the following two ways:

One use is to display the ZMP calculated from certain motion trajectory data or obtained from the state of a sensor of the actual machine. This enables you to check whether the motion trajectory data or the state of the actual machine is normal.

The other use is for the user to give the target position of the ZMP (target ZMP) when editing the posture or motion of a model. In this case, the user can arbitrarily set the position of the ZMP marker.

One of the methods to move the ZMP marker is to directly drag the ZMP marker with the mouse in the scene view. In this case, you can change the two-dimensional position (X and Y coordinates) of the ZMP on the floor surface while the vertical position is fixed onto the floor surface (Z = 0).

Or, you can also change the position of the ZMP using the following “ZMP panel” displayed in the Body/Link View for a leg-type model.

../_images/BodyLinkView_ZMP.png

In this case, you can precisely check and change the position of the ZMP using coordinate values.

Leg-type Body Bar

The following “leg-type body bar”, which is useful for editing the posture of a leg-type model, is provided as a toolbar for a set of operations related to the markers for the center of gravity, ZMP, etc.

../_images/LeggedBodyBar.png

Note

This toolbar is not displayed by default. To use it, first display it by following the description in How to Show/Hide Tool Bars .

The function of each icon is as follows:

i0 Horizontally moves the center of gravity in such a way that the projected gravity center point matches the center of both soles.
i1 Horizontally moves the center of gravity in such a way that the projected gravity center point matches the ZMP.
i2 Sets the ZMP at the position of the projected gravity center point.
i3 Sets the ZMP at the center of the right foot.
i4 Sets the ZMP at the center of both feet.
i5 Sets the ZMP at the center of the left foot.
i6 Adjusts the width between both feet. Set the length of the width in the numerical value input box next to the icon.

You can also set a posture in which the center of gravity is put over either the left or right foot by combining the function to set the ZMP at the center of the right or left foot with the function to match the projected gravity center point with the ZMP.

Floor Grid and Floor Model

The scene view displays the “floor grid” by default as shown in the figure below.

../_images/floorgrid.png

This assumes a floor surface of Z = 0 and is provided to enable you to easily perceive the position of the floor in the scene view.

However, the floor grid is only displayed and not handled as the model of the floor surface by internal processing, that is, it is handled as if nothing is present there. Therefore, you cannot check collision with a Body model present in the scene. In this state, you also cannot use the penetration block function for the floor surface, and an object passes through and drops from the floor surface when a kinetics simulation is performed. Pay attention to this point before using the floor grid.

To make the floor surface effective for internal processing, you must load the model corresponding to the floor surface as a Body item beforehand. Floor models include, for example, the model file “model/misc/floor.wrl” in the share directory of Choreonoid. Load and display the file to display the blue floor as shown in the figure below.

../_images/floor_model_grid.png

Installing such a floor model enables you to use functions related to collision with the floor surface. The GR001 sample project is also designed to load this floor model.

However, when a floor model is displayed in the scene view, sometimes it may be harder to perform operations to edit the posture of a robot. This is because, for example, you cannot view the condition of a sole from the underside since it is hidden by the backside of the floor, or you cannot change the viewpoint the way you want since the mouse cursor points to the floor surface. That is, the floor surface interferes with operations on a robot.

In such a case, there is an option to use only the floor grid to perceive the floor surface by only loading the model of the floor and leaving the display of it off. If this is done, the floor surface does not interferes with operations while collision with the floor surface is processed. This setup is recommended for work focused on editing the posture of a robot. The GR001 sample project also has this setup.