A gait generating device of a legged mobile robot, which generates a desired gait, including a desired motion of a legged robot, and a target related to an external force to be applied to the robot to cause the robot to implement a motion while having a plurality of portions of the robot in contact with a plurality of different surfaces to be contacted, which exists in an operating environment of the robot, including:
- a gait basic element generating unit which generates a desired motion of the robot and a provisional external force action point, which is the provisional value of a desired position of the action point of an external force in each surface to be contacted, the external force acting from each of the plurality of surfaces to be contacted onto the robot;
- a virtual surface group setting unit which uses a virtual surface group composed of a plurality of virtual surfaces having a predetermined mutual posture relationship in order to virtually set the virtual surface group in the space of the operating environment of the robot such that the plurality of virtual surfaces of the virtual surface group matches or approximates the plurality of surfaces to be contacted;
- a required total external force determining unit which determines, on the basis of the generated desired motion, a required total translational external force, which is a translational force component in a total external force to be applied to the robot to implement the desired motion and a required total moment external force, which is a moment component in the total external force about a predetermined reference point fixed relative to the virtual surface group;
- a provisional required virtual surface translational force determining unit, which is a unit that determines the provisional value of a required virtual surface translational force, which is the translational force to be applied to the robot from each of the plurality of virtual surfaces of the virtual surface group to attain the determined required total translational external force, and determines the provisional value of the required virtual surface translational force in each virtual surface such that at least a first requirement that the resultant force of the required virtual surface translational forces in the plurality of virtual surfaces coincide with the determined required total translational external force, and, regarding a virtual surface normal force component of a required virtual surface translational force in each virtual surface, which is a component perpendicular to the virtual surface, and a virtual surface frictional force component, which is a component parallel to the virtual surface, a second requirement that the magnitude of the virtual surface frictional force component be not more than a first predetermined value set on the basis of at least the virtual surface normal force component, are satisfied;
- a provisional required virtual surface translational force dependent moment calculating unit which calculates the provisional value of a required virtual surface translational force dependent moment, which is a total moment generated about the predetermined reference point by a required virtual surface translational force in each of the plurality of virtual surfaces, assuming that the provisional value of the determined required virtual surface translational force in each virtual surface acts on a provisional on-virtual-surface external force action point, which is a point obtained by projecting the provisional external force action point on the surface to be contacted corresponding to the virtual surface onto the virtual surface;
- a moment compensation amount determining unit that calculates a moment error, which is a difference between the determined required total moment external force and the calculated provisional value of the required virtual surface translational force dependent moment, and determines, by using the moment error, a moment compensation amount which is formed of the correction amount of one or more of the provisional on-virtual-surface external force action point and includes at least one of a first compensation amount which satisfies an external force action point existence region condition that each provisional on-virtual-surface external force action point after having been corrected using the correction amount exists in an on-virtual-surface external force action point permissible region obtained by projecting an external force action point existence permissible region set on the surface to be contacted corresponding to a virtual surface, on which the provisional on-virtual-surface external force action point exists, onto the virtual surface, a second compensation amount which is composed of the correction amounts of virtual surface frictional force components in two or more virtual surfaces and the total sum of the correction amounts is zero, and a third compensation amount composed of a twisting force additionally applied to the robot from the virtual surface about an axis in a direction perpendicular to one or more virtual surfaces, as a compensation amount for canceling the moment error;
- and
- a desired surface-to-be-contacted external force and action point determining unit which determines a desired external force to be applied to the robot from a surface to be contacted corresponding to each virtual surface and a desired external force action point, which indicates the desired position of the action point of the desired external force, on the basis of at least the provisional value of the required virtual surface translational force determined in association with each virtual surface and the determined moment compensation amount, then outputs the determined desired external force and the determined desired external force action point as constituent elements of the desired gait.