PLANNING AND CONTROL METHOD FOR LEGGED ROBOT, APPARATUS, ROBOT, AND STORAGE MEDIUM

20260097488 ยท 2026-04-09

    Inventors

    Cpc classification

    International classification

    Abstract

    Provided are a planning and control method for a legged robot, an apparatus, a robot, and a storage medium. The method includes: determining, based on the movement state and the swing parameter of each leg at the next moment, a foot-end reference state of each leg, and planning, based on a foot-end dynamic model and a discrete collision model, an impact-aware swing leg trajectory for a leg that starts to swing at the next moment; and performing, based on the movement state, the reference state sequence, and the foot-end reference state, whole-body control on the legged robot, and performing, based on a whole-body dynamic model and the discrete collision model, impact-aware whole-body control for a leg that is a supporting leg in planning but does not touch the ground.

    Claims

    1. A planning and control method for a legged robot, comprising: obtaining a movement instruction and a movement state of the legged robot; generating, based on the movement instruction and the movement state, a reference state sequence of the legged robot and a swing parameter of each leg at a next moment; determining, based on the movement state and the swing parameter of each leg at the next moment, a foot-end reference state of each leg, and planning, based on a foot-end dynamic model and a discrete collision model, an impact-aware swing leg trajectory for a leg that starts to swing at the next moment, to enable an influence caused by an early collision to be within a target constraint range; and performing, based on the movement state, the reference state sequence, and the foot-end reference state, whole-body control on the legged robot, and performing, based on a whole-body dynamic model and the discrete collision model, impact-aware whole-body control for a leg that is a supporting leg in planning but does not touch the ground, to enable an influence caused by a delayed collision to be within the target constraint range.

    2. The planning and control method for the legged robot according to claim 1, wherein the foot-end dynamic model is: c , l x .Math. c , l + h c , l = F j , where x.sub.c,lcustom-character is a linear acceleration of a foot end of an l-th leg in an inertial system I, .sub.c,l is a mass matrix in an operation space, h.sub.c,l is a term comprising a Coriolis force, a centripetal force, and a gravitational force in the operation space, and F.sub.jcustom-character is a foot-end driving force obtained by mapping a torque .sub.j of a driving joint to the operation space; and the discrete collision model is: x c , l = P n ( x 1 + - x 1 - ) = - ( 1 + c r ) P n x c , l - , where P.sub.n=nn.sup.Tcustom-character is a projection operator on a collision normal vector, ncustom-character is a unit normal vector of a collision surface, x 1 + , x 1 - are a velocity of a first object before collision and a velocity of the first object after the collision respectively, x 2 + , x 2 - are a velocity of a second object before collision and a velocity of the second object after the collision respectively, c.sub.r is a restitution coefficient, x c , l - is a velocity of the foot-end of the l-th leg before collision in the inertial system, and {dot over (x)}.sub.c,l is a velocity change amount between the velocity of the foot-end of the l-th leg before collision in the inertial system and a velocity of the foot-end of the l-th leg after collision in the inertial system.

    3. The planning and control method for the legged robot according to claim 1, wherein said planning, based on the foot-end dynamic model and the discrete collision model, the impact-aware swing leg trajectory comprises: obtaining a pre-defined state variable and a target constraint condition; constructing, based on the foot-end dynamic model, the pre-defined state variable, and the target constraint condition, a continuous-time trajectory optimization problem for the leg that starts to swing at the next moment; and discretizing the continuous-time trajectory optimization problem to obtain a discrete-time trajectory optimization problem for a foot end of a swing leg, and solving the discrete-time trajectory optimization problem to obtain the impact-aware swing leg trajectory.

    4. The planning and control method for the legged robot according to claim 3, wherein: the pre-defined state variable comprises one or more of: an initial state of the foot end of the swing leg, a touchdown state of the foot end of the swing leg, a swing duration, and a desired maximum height of the foot end of the swing leg from the ground; and the target constraint condition comprises one or more of: a state equation equality constraint, a driving force inequality constraint, a trajectory height inequality constraint, an initial state equality constraint, a terminal state equality constraint, an impact-aware inequality constraint, and a terminal velocity direction inequality constraint.

    5. The planning and control method for the legged robot according to claim 3, wherein: an objective function of the continuous-time trajectory optimization problem is: min x ( t ) , u ( t ) f T O = .Math. x ( t F ) - [ x c , F ref x c , F ref ] .Math. Q x F + t 0 t F .Math. u ( ) .Math. Q u d + t h 1 t h 2 .Math. z c ( ) - z h ref .Math. Q z d , where x(t) is a state vector about time t, u(t) is a control vector about time t, Q.sub.x.sub.Fcustom-character, Q.sub.ucustom-character, and Q.sub.zcustom-character are weight matrices (mostly diagonal matrices) with different dimensions, a.sub.Q=a.sup.TQa represents a weighted norm of a vector a under a weight matrix Q, .Math. x ( t F ) - [ x c , F ref x c , F ref ] .Math. Q x F reflects a task of a touchdown state of the foot end of the swing leg, x c , F ref and x c , F ref are a known terminal position of the foot end of the swing leg and a known linear velocity of the foot end of the swing leg respectively, t 0 t F .Math. u ( ) .Math. Q u d is a minimum control variable (i.e., a linear acceleration) in an entire swing process, and t.sub.0=0, t.sub.F=T.sub.sw, where T.sub.sw is a swing duration, t h 1 t h 2 .Math. z c ( ) - z h ref .Math. Q z d reflects a task of a maximum height of the swing leg from the ground, t.sub.h1 and t.sub.h2 are parameters specifying a time period to reach the maximum height, satisfying t.sub.0t.sub.h1th.sub.2t.sub.F, and z.sub.c is a third component of the state variable, i.e., a component representing a height of the foot end from the ground in the state variable; and the discrete-time trajectory optimization problem is: min U f c , TO = .Math. x N - x N ref .Math. Q x N + .Math. k = 0 N - 1 .Math. u k .Math. Q u K + .Math. k = k h 1 k h 2 .Math. S z x k - z h ref .Math. Q z k , s . t . [ x c , k + 1 x . c , k + 1 ] x k + 1 = [ I 3 3 tI 3 3 0 3 3 I 3 3 ] A [ x c , k x . c , k ] x k + [ 1 2 t 2 I 3 3 tI 3 3 ] B x .Math. c , k u k , k = 0 , 1 , .Math. , N - 1 , f min c u k + h c f max , k = 0 , 1 , .Math. , N - 1 , z c , min S z x k z c , max , k = 1 , 2 , .Math. , N - 1 , x 0 = x 0 fb , S z , z . x N = S z , z . x N ref , .Math. c , min c [ - ( 1 + c r ) P n S x k ] .Math. c , max , k = k imp , k imp + 1 , .Math. , N , ( C 1 + 1 cos c , max D n ) S v x . k 0 4 1 , k = k imp , k imp + 1 , .Math. , N , where N represents a total number of frames in the discrete-time trajectory optimization problem, S.sub.z is a selection matrix used for selecting a position component of a state vector in a Z-axis direction, A is a state matrix in a state equation, B is an input matrix in the state equation, u.sub.k is a control variable of a k-th frame, .sub.min and .sub.max are an artificially specified lower limit foot-end driving force and an artificially specified upper limit foot-end driving force in an operation space respectively, z.sub.c,min and z.sub.c,max are a minimum height of the swing leg from the ground and the maximum height of the swing leg from the ground respectively, S.sub.z, is a selection matrix used for selecting the position component and a velocity component of the state vector in the Z-axis direction, l.sub.c,min and l.sub.c,max are an artificially specified lower limit of an allowable collision impulse and an artificially specified upper limit of the allowable collision impulse respectively, .sub.c,max is an artificially specified maximum allowable angle between a velocity vector before touchdown of the foot end of the swing leg and a unit normal vector of a collision surface, custom-character is a terminal velocity direction constraint matrix, D.sub.n is a matrix formed by the unit normal vector of the collision surface, .sub.c,TO is an objective function of the discrete-time trajectory optimization problem, x.sub.N is a state vector of an N-th frame, Z h ref is a reference value of the maximum height of the swing leg from the ground, x.sub.c,k+1 is a foot-end position state of a (k+1)-th frame, {dot over (x)}.sub.c,k+1 is a foot-end velocity state of the (k+1)-th frame, t is a time interval between adjacent frames, .sub.c is a mass matrix in the operation space, h.sub.c is a term comprising a Coriolis force, a centripetal force, and a gravitational force in the operation space, x.sub.k is a state vector of the k-th frame, U = [ u 0 T , u 1 T , .Math. , u N - 1 T ] T is a vector composed of a control variable of each frame, Q.sub.x.sub.Ncustom-character, Q.sub.u.sub.kcustom-character, and Q.sub.z.sub.kcustom-character are diagonal weight matrices with different dimensions, x 0 fb = [ x c , 0 fb x c , 0 fb ] is a feedback of a foot-end state (comprising a position and a velocity) at a current moment, x N ref = [ x c , F ref x c , F ref ] is a reference terminal foot-end state (comprising the position and the velocity), S.sub.=[0.sub.33I.sub.33]custom-character is a selection matrix of a foot-end linear velocity, k.sub.h.sub.1 and k.sub.h.sub.2 are an artificially specified start frame and an artificially specified end frame for maintaining a swing height, satisfying 0k.sub.h.sub.1k.sub.h.sub.2<N, and k.sub.imp is a start frame for enabling an impact-aware constraint and a terminal velocity direction constraint, satisfying 0k.sub.impN.

    6. The planning and control method for the legged robot according to claim 1, wherein an optimization problem of the whole-body control is: min .Math. i = 1 n task .Math. W i ( A i - b i ) .Math. 2 2 , s . t . lb j C j ub j , j = 1 , 2 , .Math. , n constraint , where is an optimization variable of the optimization problem of the whole-body control, A.sub.i is a task matrix, b.sub.i is a task vector, c.sub.j is a constraint matrix, lb.sub.j and ub.sub.j are a lower constraint bound and an upper constraint bound, W.sub.i is a weight matrix, n.sub.task is a quantity of tasks, and n.sub.constraint is a quantity of constraints.

    7. The planning and control method for the legged robot according to claim 1, wherein tasks processed simultaneously by the whole-body control comprise two or more of: a trunk trajectory tracking task, a foot-end trajectory tracking task, a foot-sole force tracking task, a task of minimizing variation of a joint torque, and a task of minimizing variation of a foot-sole force; and constraints processed simultaneously by the impact-aware whole-body control comprise two or more of: a floating-base dynamic equality constraint, a foot-sole force inequality constraint, a joint output torque saturation inequality constraint, a joint rotational speed saturation inequality constraint, a joint output power saturation inequality constraint, and an impact-aware constraint.

    8. The planning and control method for the legged robot according to claim 7, wherein said performing, based on the movement state, the reference state sequence, and the foot-end reference state, whole-body control on the legged robot comprises: if a leg is a swing leg in planning, setting the foot-end trajectory tracking task as tracking the impact-aware swing leg trajectory, setting a target foot-sole force of the foot-sole force tracking task as a predetermined value, setting a foot-sole force constraint in the foot-sole force inequality constraint as a predetermined value, and disabling the impact-aware constraint; if a leg is the supporting leg in planning and touches the ground, setting a target linear acceleration of the foot-end trajectory tracking task as a predetermined value, setting the target foot-sole force of the foot-sole force tracking task as a foot-sole force provided by MPC or another module, setting the foot-sole force constraint as a friction cone constraint, and disabling the impact-aware constraint; and if a leg is a supporting leg in planning but does not touch the ground, setting a target of the foot-end trajectory tracking task as tracking a velocity pointing to a collision surface, setting the target foot-sole force of the foot-sole force tracking task as a predetermined value, setting the foot-sole force constraint as a predetermined value, and enabling the impact-aware constraint.

    9. The planning and control method for the legged robot according to claim 1, wherein: the whole-body dynamic model is: M ( q g ) q .Math. + h ( q g , q ) = [ 0 6 1 j ] + J c T ( q g ) F c , where M(q.sub.g)custom-character is a generalized mass matrix, h(q.sub.g,{dot over (q)})custom-character is a term comprising a Coriolis force, a centripetal force, and a gravitational force, jcustom-character represents an output torque of a driving joint, 0.sub.nm represents a zero matrix with a size of nm, J c T ( q g ) and F.sub.c are an augmented Jacobian matrix formed by stacking a contact Jacobian matrix of each supporting leg and an augmented foot-sole force formed by stacking a ground reaction force on a foot sole of each supporting leg respectively, q.sub.g is a generalized joint space position, {dot over (q)} is a generalized joint space velocity, {umlaut over (q)} is a generalized joint space acceleration, and n.sub.q is a dimension size of the generalized joint space acceleration {umlaut over (q)}; and expressions for a matrix and a vector of the impact-aware constraint are: C 6 , l = [ - t ( 1 + c r ) c , l ( q g fb ) P n J c , l ( q g fb ) 0 3 n F ] lb 6 = .Math. c , l , min + ( 1 + c r ) c , l ( q g fb ) P n ( J c , l ( q g fb ) q . fb + t J . c , l ( q g fb ) q . fb ) ub 6 = .Math. c , l , max + ( 1 + c r ) c , l ( q g fb ) P n ( J c , l ( q g fb ) q . fb + t J . c , l ( q g fb ) q . fb ) , where l.sub.c,l,min, l.sub.c,l,maxcustom-character are an artificially specified lower limit of an allowable collision impulse and an artificially specified upper limit of the allowable collision impulse respectively, t represents a time interval between a current moment and the next moment, C.sub.6,l the matrix of the impact-aware constraint, lb.sub.6 is a lower limit vector of the impact-aware constraint, ub.sub.6 is an upper limit vector of the impact-aware constraint, n.sub. is a dimension size of the optimization variable, a variable marked with fb in its top right corner represents that the variable is a feedback variable, J.sub.c,l represent the contact Jacobian matrix of an l-th leg, {dot over (J)}.sub.c,l is a derivative of the contact Jacobian matrix of the l-th leg with respect to time.

    10. A legged robot, comprising: a memory; a processor; and a computer program stored in the memory and executable on the processor, wherein the processor is configured to execute the program to implement a planning and control method for a legged robot, the method comprising: obtaining a movement instruction and a movement state of the legged robot; generating, based on the movement instruction and the movement state, a reference state sequence of the legged robot and a swing parameter of each leg at a next moment; determining, based on the movement state and the swing parameter of each leg at the next moment, a foot-end reference state of each leg, and planning, based on a foot-end dynamic model and a discrete collision model, an impact-aware swing leg trajectory for a leg that starts to swing at the next moment, to enable an influence caused by an early collision to be within a target constraint range; and performing, based on the movement state, the reference state sequence, and the foot-end reference state, whole-body control on the legged robot, and performing, based on a whole-body dynamic model and the discrete collision model, impact-aware whole-body control for a leg that is a supporting leg in planning but does not touch the ground, to enable an influence caused by a delayed collision to be within the target constraint range.

    11. The legged robot according to claim 10, wherein the foot-end dynamic model is: A c , l x .Math. c , l + h c , l = F j , where {umlaut over (x)}.sub.c,lcustom-character is a linear acceleration of a foot end of an l-th leg in an inertial system I, .sub.c,l is a mass matrix in an operation space, h.sub.c,l is a term comprising a Coriolis force, a centripetal force, and a gravitational force in the operation space, and F.sub.jcustom-character is a foot-end driving force obtained by mapping a torque .sub.j of a driving joint to the operation space; and the discrete collision model is: x . c , l = P n ( x . 1 + - x . 1 - ) = - ( 1 + c r ) P n x . c , l - , where P.sub.n=nn.sup.Tcustom-character is a projection operator on a collision normal vector, ncustom-character is a unit normal vector of a collision surface, x 1 + , x 1 - are a velocity of a first object before collision and a velocity of the first object after the collision respectively, x . 2 + , x . 2 - are a velocity of a second object before collision and a velocity of the second object after the collision respectively, c.sub.r is a restitution coefficient, x . c , l - is a velocity of the foot-end of the l-th leg before collision in the inertial system, and {dot over (x)}.sub.c,l is a velocity change amount between the velocity of the foot-end of the l-th leg before collision in the inertial system and a velocity of the foot-end of the l-th leg after collision in the inertial system.

    12. The legged robot according to claim 10, wherein said planning, based on the foot-end dynamic model and the discrete collision model, the impact-aware swing leg trajectory comprises: obtaining a pre-defined state variable and a target constraint condition; constructing, based on the foot-end dynamic model, the pre-defined state variable, and the target constraint condition, a continuous-time trajectory optimization problem for the leg that starts to swing at the next moment; and discretizing the continuous-time trajectory optimization problem to obtain a discrete-time trajectory optimization problem for a foot end of a swing leg, and solving the discrete-time trajectory optimization problem to obtain the impact-aware swing leg trajectory.

    13. The legged robot according to claim 12, wherein: the pre-defined state variable comprises one or more of: an initial state of the foot end of the swing leg, a touchdown state of the foot end of the swing leg, a swing duration, and a desired maximum height of the foot end of the swing leg from the ground; and the target constraint condition comprises one or more of: a state equation equality constraint, a driving force inequality constraint, a trajectory height inequality constraint, an initial state equality constraint, a terminal state equality constraint, an impact-aware inequality constraint, and a terminal velocity direction inequality constraint.

    14. The legged robot according to claim 12, wherein: an objective function of the continuous-time trajectory optimization problem is: min x ( t ) , u ( t ) f T O = .Math. x ( t F ) - [ x c , F ref x c , F ref ] .Math. Q x F + t 0 t F .Math. u ( ) .Math. Q u d + t h 1 t h 2 .Math. z c ( ) - z h ref .Math. Q z d , where x(t) is a state vector about time t, u(t) is a control vector about time t, Q.sub.x.sub.Fcustom-character, Q.sub.ucustom-character, and Q.sub.zcustom-character are weight matrices (mostly diagonal matrices) with different dimensions, a.sub.Q=a.sup.TQa represents a weighted norm of a vector a under a weight matrix Q, Q , .Math. x ( t F ) - [ x c , F ref x c , F ref ] .Math. Q x F reflects a task of a touchdown state of the foot end of the swing leg, x c , F ref and x c , F ref are a known terminal position of the foot end of the swing leg and a known linear velocity of the foot end of the swing leg respectively, t 0 t F .Math. u ( ) .Math. Q u d is a minimum control variable (i.e., a linear acceleration) in an entire swing process, and t.sub.0=0, t.sub.F=T.sub.sw, where T.sub.sw is a swing duration, t h 1 t h 2 .Math. z c ( ) - z h ref .Math. Q z d reflects a task of a maximum height of the swing leg from the ground, t.sub.h1 and t.sub.h2 are parameters specifying a time period to reach the maximum height, satisfying t.sub.0t.sub.h1t.sub.h2t.sub.F, and z.sub.c is a third component of the state variable, i.e., a component representing a height of the foot end from the ground in the state variable; and the discrete-time trajectory optimization problem is: min U f c , T O = .Math. x N - x N r e f .Math. Q x N + .Math. k = 0 N - 1 .Math. u k .Math. Q u k + .Math. k = k h 1 k h 2 .Math. S z x k - z h ref .Math. Q z k , s . t . [ x c , k + 1 x . c , k + 1 ] x k + 1 = [ I 3 3 tI 3 3 0 3 3 I 3 3 ] A [ x c , k x . c , k ] x k + [ 1 2 t 2 I 3 3 tI 3 3 ] B x .Math. c , k u k , k = 0 , 1 , .Math. , N - 1 , f min c u k + h c f max , k = 0 , 1 , .Math. , N - 1 , z c , min S z x k z c , max , k = 1 , 2 , .Math. , N - 1 , x 0 = x 0 fb , S z , z . x N = S z , z . x N ref , .Math. c , min A c [ - ( 1 + c r ) P n S v x k ] .Math. c , max , k = k imp , k imp + 1 , .Math. , N , ( C 1 + 1 cos c , max D n ) S v x k 0 4 1 , k = k imp , k imp + 1 , .Math. , N , Where N represents a total number of frames in the discrete-time trajectory optimization problem, S.sub.z is a selection matrix used for selecting a position component of a state vector in a Z-axis direction, A is a state matrix in a state equation, B is an input matrix in the state equation, u.sub.k is a control variable of a k-th frame, .sub.min and .sub.max are an artificially specified lower limit foot-end driving force and an artificially specified upper limit foot-end driving force in an operation space respectively, z.sub.c,min and z.sub.c,max are a minimum height of the swing leg from the ground and the maximum height of the swing leg from the ground respectively, S.sub.z, is a selection matrix used for selecting the position component and a velocity component of the state vector in the Z-axis direction, l.sub.c,min and l.sub.c,max are an artificially specified lower limit of an allowable collision impulse and an artificially specified upper limit of the allowable collision impulse respectively, .sub.c,max is an artificially specified maximum allowable angle between a velocity vector before touchdown of the foot end of the swing leg and a unit normal vector of a collision surface, custom-character is a terminal velocity direction constraint matrix, D.sub.n is a matrix formed by the unit normal vector of the collision surface, .sub.c,T0 is an objective function of the discrete-time trajectory optimization problem, x.sub.N is a state vector of an N-th frame, z h ref is a reference value of the maximum height of the swing leg from the ground, x.sub.c,k+1 is a foot-end position state of a (k+1)-th frame, {dot over (x)}.sub.c,k+1 is a foot-end velocity state of the (k+1)-th frame, t is a time interval between adjacent frames, .sub.c is a mass matrix in the operation space, h.sub.c is a term comprising a Coriolis force, a centripetal force, and a gravitational force in the operation space, x.sub.k is a state vector of the k-th frame, U = [ u 0 T , u 1 T , .Math. , u N - 1 T ] T is a vector composed of a control variable of each frame, Q.sub.x.sub.Ncustom-character, Q.sub.u.sub.kcustom-character, and Q.sub.z.sub.kcustom-character are diagonal weight matrices with different dimensions, x 0 fb = [ x c , 0 fb x c , 0 fb ] is a feedback of a foot-end state (comprising a position and a velocity) at a current moment, x N ref = [ x c , F ref x c , F ref ] is a reference terminal foot-end state (comprising the position and the velocity), S.sub.=[0.sub.33I.sub.33]custom-character is a selection matrix of a foot-end linear velocity, k.sub.h.sub.1 and k.sub.h.sub.2 are an artificially specified start frame and an artificially specified end frame for maintaining a swing height, satisfying 0<k.sub.h.sub.1k.sub.h.sub.2<N, and k.sub.imp is a start frame for enabling an impact-aware constraint and a terminal velocity direction constraint, satisfying 0k.sub.impN.

    15. The legged robot according to claim 10, wherein an optimization problem of the whole-body control is: min .Math. i = 1 n task .Math. W i ( A i - b i ) .Math. 2 2 , s . t . lb j C j ub j , j = 1 , 2 , .Math. , n constraint , where is an optimization variable of the optimization problem of the whole-body control, A.sub.i is a task matrix, b.sub.i is a task vector, c.sub.j is a constraint matrix, lb.sub.j and ub.sub.j are a lower constraint bound and an upper constraint bound, W.sub.i is a weight matrix, n.sub.task is a quantity of tasks, and n.sub.constraint is a quantity of constraints.

    16. The legged robot according to claim 10, wherein tasks processed simultaneously by the whole-body control comprise two or more of a trunk trajectory tracking task, a foot-end trajectory tracking task, a foot-sole force tracking task, a task of minimizing variation of a joint torque, and a task of minimizing variation of a foot-sole force; and constraints processed simultaneously by the impact-aware whole-body control comprise two or more of: a floating-base dynamic equality constraint, a foot-sole force inequality constraint, a joint output torque saturation inequality constraint, a joint rotational speed saturation inequality constraint, a joint output power saturation inequality constraint, and an impact-aware constraint.

    17. The legged robot according to claim 16, wherein said performing, based on the movement state, the reference state sequence, and the foot-end reference state, whole-body control on the legged robot comprises: if a leg is a swing leg in planning, setting the foot-end trajectory tracking task as tracking the impact-aware swing leg trajectory, setting a target foot-sole force of the foot-sole force tracking task as a predetermined value, setting a foot-sole force constraint in the foot-sole force inequality constraint as a predetermined value, and disabling the impact-aware constraint; if a leg is the supporting leg in planning and touches the ground, setting a target linear acceleration of the foot-end trajectory tracking task as a predetermined value, setting the target foot-sole force of the foot-sole force tracking task as a foot-sole force provided by MPC or another module, setting the foot-sole force constraint as a friction cone constraint, and disabling the impact-aware constraint; and if a leg is a supporting leg in planning but does not touch the ground, setting a target of the foot-end trajectory tracking task as tracking a velocity pointing to a collision surface, setting the target foot-sole force of the foot-sole force tracking task as a predetermined value, setting the foot-sole force constraint as a predetermined value, and enabling the impact-aware constraint.

    18. The legged robot according to claim 10, wherein: the whole-body dynamic model is: M ( q g ) q .Math. + h ( q g , q ) = [ 0 6 1 j ] + J c T ( q g ) F c , where M(q.sub.g)custom-character is a generalized mass matrix, h(q.sub.g,{dot over (q)})custom-character is a term comprising a Coriolis force, a centripetal force, and a gravitational force, jcustom-character represents an output torque of a driving joint, 0.sub.nm represents a zero matrix with a size of nm, J c T ( q g ) and F.sub.c are an augmented Jacobian matrix formed by stacking a contact Jacobian matrix of each supporting leg and an augmented foot-sole force formed by stacking a ground reaction force on a foot sole of each supporting leg respectively, q.sub.g is a generalized joint space position, {dot over (q)} is a generalized joint space velocity, {umlaut over (q)} is a generalized joint space acceleration, and n.sub.q is a dimension size of the generalized joint space acceleration {umlaut over (q)}; and expressions for a matrix and a vector of the impact-aware constraint are: C 6 , l = [ - ( 1 + c r ) c , l ( q g fb ) P n J c , l ( q g fb ) 0 3 n F ] , lb 6 = .Math. c , l , min + ( 1 + c r ) c , l ( q g fb ) P n ( J c , l ( q g fb ) q fb + t J . c , l ( q g fb ) q fb ) , ub 6 = .Math. c , l , max + ( 1 + c r ) c , l ( q g fb ) P n ( J c , l ( q g fb ) q fb + t J . c , l ( q g fb ) q fb ) , where l.sub.c,l,min, l.sub.c,l,maxcustom-character are an artificially specified lower limit of an allowable collision impulse and an artificially specified upper limit of the allowable collision impulse respectively, t represents a time interval between a current moment and the next moment, C.sub.6,l the matrix of the impact-aware constraint, lb.sub.6 is a lower limit vector of the impact-aware constraint, ub.sub.6 is an upper limit vector of the impact-aware constraint, n, is a dimension size of the optimization variable, a variable marked with fb in its top right corner represents that the variable is a feedback variable, J.sub.c,l represent the contact Jacobian matrix of an l-th leg, {dot over (J)}.sub.c,l is a derivative of the contact Jacobian matrix of the l-th leg with respect to time.

    19. A non-transitory computer-readable storage medium, having a computer program stored thereon, wherein the program is configured to, when executed by a processor, implement a planning and control method for a legged robot, the method comprising: obtaining a movement instruction and a movement state of the legged robot; generating, based on the movement instruction and the movement state, a reference state sequence of the legged robot and a swing parameter of each leg at a next moment; determining, based on the movement state and the swing parameter of each leg at the next moment, a foot-end reference state of each leg, and planning, based on a foot-end dynamic model and a discrete collision model, an impact-aware swing leg trajectory for a leg that starts to swing at the next moment, to enable an influence caused by an early collision to be within a target constraint range; and performing, based on the movement state, the reference state sequence, and the foot-end reference state, whole-body control on the legged robot, and performing, based on a whole-body dynamic model and the discrete collision model, impact-aware whole-body control for a leg that is a supporting leg in planning but does not touch the ground, to enable an influence caused by a delayed collision to be within the target constraint range.

    Description

    BRIEF DESCRIPTION OF THE DRAWINGS

    [0029] The above and/or additional aspects and advantages of the present disclosure will become more apparent and more understandable from the following description of embodiments taken in conjunction with the accompanying drawings.

    [0030] FIG. 1 is a flowchart illustrating a planning and control method for a legged robot according to an embodiment of the present disclosure.

    [0031] FIG. 2 is a schematic diagram of a gait control system for an impact-aware quadruped robot according to an embodiment of the present disclosure.

    [0032] FIG. 3 is a schematic diagram of a decision tree for impact-aware whole-body control according to an embodiment of the present disclosure.

    [0033] FIG. 4 is an exemplary diagram of a planning and control apparatus for a legged robot according to an embodiment of the present disclosure.

    [0034] FIG. 5 is a schematic structural diagram of a legged robot according to an embodiment of the present disclosure.

    DETAILED DESCRIPTION

    [0035] Embodiments of the present disclosure will be described in detail below with reference to examples thereof as illustrated in the accompanying drawings, throughout which same or similar elements, or elements having same or similar functions, are denoted by same or similar reference numerals. The embodiments described below with reference to the drawings are illustrative only, and are intended to explain, rather than limiting, the present disclosure.

    [0036] In recent years, the field of a legged robot has developed rapidly. An increasing number of mature and stable methods are applied to movement planning and control for the legged robot. The legged robot from many research institutions is no longer confined to static walking but is evolving towards faster, more agile, more robust, safer, and more multifunctional robots. When the legged robot performs a highly dynamic movement, some problems that may be ignored under low-dynamic movement conditions become non-negligible, such as a collision problem between the foot sole and the ground when the legged robot runs at a high speed. Movement of the legged robot relies on continuous switching of a supporting leg. Each step of walking requires contact between the foot sole and the ground, which is an intentional collision with an environment and is also a common collision problem when the legged robot interacts with the environment. Improper control strategies may cause a violent collision between the foot sole and the ground, affecting a subsequent movement state of the robot, causing the robot to lose balance and fall, and even potentially resulting in a reduced hardware service life or hardware damage.

    [0037] In the related art, solutions to the collision problem for the legged robot can be provided from two aspects: hardware and a control algorithm.

    [0038] In terms of the hardware, a foot pad with a certain degree of flexibility may be mount at a foot sole of the robot. Alternatively, a buffer device such as a spring-damper may be mounted at a driving joint of the robot. Alternatively, a VIA or a VSA may be adopted. The VIA and the VSA can provide a desired passive mechanical impedance, achieving an effect of changing a joint impedance at a mechanical level, allowing a buffering effect to be adjusted as desired. A practice of mounting the buffer devices for the robot is commonly referred to as a passive compliance method.

    [0039] In terms of the control algorithm, to minimize a negative influence of a collision between the foot sole and the ground on the robot's state during walking of the legged robot, a contact velocity between the foot sole and the ground can be planned to approach zero in movement planning. When a small or lightweight legged robot walks slowly on a flat terrain, performance of a controller may usually ensure that an actual movement trajectory of a swing leg is substantially consistent with a planned trajectory. Therefore, this solution works well. When a terrain is uneven, a visual sensor such as a camera or a laser radar may be used to estimate the terrain. A foot movement trajectory, where the contact velocity between the foot sole and the ground approaches zero, may be planned based on the estimated terrain, avoiding a collision impact caused by premature ground contact or delayed ground contact of the foot sole.

    [0040] However, the methods in the related art have certain limitations.

    [0041] In terms of the hardware, the passive compliance method can reduce an effect of the collision to some extent, which can also bring some problems. Firstly, introduction of these passive flexible materials may affect a response frequency of a robot system. If the control algorithm does not take this effect into account, unstable vibrations during movement of the robot may easily occur. On the other hand, a buffering effect of the passive compliance method is limited. When a material of the buffer device is determined, stiffness, damping, and inertia characteristics of the material are also determined, and thus the buffering effect cannot be adjusted as desired. When using the VIA method or the VSA method, two motors may be used. One motor is configured to independently control mechanical stiffness of a joint, while another motor is configured to generate a torque, which may result in an overly complex overall structure with a large volume and a large weight, making it difficult to apply such actuators to the legged robot that needs to perform the highly dynamic movement.

    [0042] In terms of the control algorithm, when the legged robot performs a highly dynamic movement such as a high-speed running, there may be a significant error between the actual movement trajectory of the swing leg and the planned trajectory of the swing leg, causing the premature ground contact of the foot sole or the delayed ground contact of the foot sole. In an exemplary embodiment, in the case of the delayed ground contact, when the foot sole has not yet landed but is required by the planning to support a torso, this leg may rapidly step onto the ground, causing a violent collision and generating an enormous foot-sole impact force at an instant of the collision. For a heavy-duty legged robot, an impact force caused by such collisions is often even greater. When the legged robot runs at the high speed, a violent impact may cause zero drift in the joint, and a long-term frequent collision of the foot-sole may accelerate hardware aging.

    [0043] In summary, control strategies in the related art consider the impact force during the collision as a disturbance, focusing an emphasis on balance control of the robot after the collision, while neglecting an effect of such frequent, intentional collisions on a hardware service life of the robot.

    [0044] For the problems mentioned in the above background technology, the present disclosure provides a planning and control method for a legged robot. The planning and control method for the legged robot, the planning and control apparatus for the legged robot, the robot, and the storage medium according to the embodiments of the present disclosure are described below with reference to the accompanying drawings.

    [0045] In an exemplary embodiment of the present disclosure, FIG. 1 is a schematic flowchart illustrating a planning and control method for a legged robot according to an embodiment of the present disclosure. As illustrated in FIG. 1, the planning and control method for the legged robot includes operations at blocks.

    [0046] At block S101, a movement instruction and a movement state of the legged robot are obtained.

    [0047] The movement instruction may include a movement velocity instruction and a movement direction instruction inputted by a user, etc. The movement state may include a robot trunk state, a foot-end state of each leg, and a touchdown state of each leg, etc.

    [0048] It should be understood that embodiments of the present disclosure may obtain the movement instruction and the movement state of the legged robot in at least one way. An actuator of the legged robot in the embodiments of the present disclosure is a force-controllable motor, which is equipped with a sensor including an Inertial Measurement Unit (IMU), a motor angle encoder, a motor torque sensor, etc. The following embodiments are elaborated based on this.

    [0049] For example, FIG. 2 is a block diagram of a gait control system for an impact-aware quadruped robot according to an embodiment of the present disclosure. The block diagram is applicable to both simulation and actual robots. An entire control framework mainly consists of 5 modules: a State Estimator module, a Rough Planning module, a Single Rigid Body Model Predictive Control (SRB-MPC) module, an Impact-aware Trajectory Optimization (IA-TO) module, and an Impact-aware Whole-body Control (IA-WBC) module. This system operates at a high frequency (e.g., 500 Hz, 1 kHz, etc). The IA-WBC operates at a same frequency. The SRB-MPC operates at around 40 Hz. An optimization problem in the IA-TO is calculated only once each time a leg needs to start swinging. In the following embodiments, this system as an example is described.

    [0050] In an exemplary embodiment of the present disclosure, as illustrated in FIG. 2, the embodiments of the present disclosure may estimate a trunk state of the legged robot based on read IMU data and motor state information. The IMU data may include a three-dimensional Euler angle, a three-dimensional angular velocity, and a three-dimensional linear acceleration, etc. The motor state information may include a motor rotation angle, a rotational speed, and a feedback torque, etc. The trunk state of the legged robot may include a point position of a trunk, an attitude unit quaternion, a linear velocity, and an angular velocity, etc. The foot-end state of each leg may include the point position and the linear velocity. The embodiments of the present disclosure may use an Extended Kalman Filter (EKF) to estimate the trunk state. The present disclosure is not limited in this regard.

    [0051] In the embodiments of the present disclosure, state estimation transfers corresponding information according to different needs. As illustrated in FIG. 2, for the SRB-MPC, only the trunk state is transferred. For the IA-TO, the trunk state, the foot-end state of each leg, and the joint state are transferred. For the IA-WBC, the trunk state, the foot-end state of each leg, the joint state, and a touchdown state of each leg are transferred. For the Rough Planning module, the trunk state and the foot-end state of each leg may be transferred. These transferring processes may be described in detail in the following embodiments, and thus details thereof will be omitted here.

    [0052] At block S102, a reference state sequence of the legged robot and a swing parameter of each leg at a next moment are generated based on the movement instruction and the movement state.

    [0053] The reference state sequence may be a series of reference variables from a current moment to a future time period. The reference state sequence may include a trunk reference state sequence, a reference position sequence of a foot end of the supporting leg, a reference contact state sequence, and an MPC reference frame interval sequence, etc. The swing parameter may include an initial state of a foot end of the swing leg (an initial position and a linear velocity), the touchdown state (a touchdown point position and a linear velocity), a swing duration, and the desired maximum height of the foot end of the swing leg from the ground, etc.

    [0054] It should be understood that the embodiments of the present disclosure may utilize the obtained movement instruction and the obtained movement state to generate the reference state sequence of the legged robot and the swing parameter of each leg at the next moment. The embodiments of the present disclosure may perform generation on the reference state sequence and the swing parameter at the next moment in at least one way, such as utilizing the obtained information for movement planning.

    [0055] In an exemplary embodiment of the present disclosure, as illustrated in FIG. 2, the Rough Planning module may perform a rough movement planning on the quadruped robot based on feedback information from the state estimation and the movement velocity instruction (including a forward/backward walking velocity, a left and right lateral translational velocity) and the movement direction instruction (i.e., a yaw angular velocity) inputted by the user (such as inputted via a remote controller). The Rough Planning module needs to provide the reference state sequence for the SRB-MPC. A quantity of the reference state sequences is the same as a predicted quantity of frames of the SRB-MPC. The Rough Planning module also needs to provide a touchdown point position for a next swing of each leg, a swing duration, and the current reference contact state for the IA-TO.

    [0056] At block S103, a foot-end reference state of each leg is determined based on the movement state and the swing parameter of each leg at the next moment. Based on a foot-end dynamic model and a discrete collision model, an impact-aware swing leg trajectory is planned for a leg that starts to swing at the next moment, to enable an influence caused by an early collision to be within a target constraint range.

    [0057] It should be understood that the embodiments of the present disclosure may determine the foot-end reference state of each leg based on the obtained movement state and the swing parameter of each leg of the legged robot at the next moment. When there is the leg starts to swing at the next moment, the impact-aware swing leg trajectory is planned using the foot-end dynamic model and the discrete collision model, to enable the influence caused by the early collision during movement of the swing leg to be within the target constraint range.

    [0058] It should be noted that factors such as slight ground unevenness, state estimation errors, and control errors may cause the foot-end of the swing leg of the legged robot to contact with the ground before the planned touchdown time, resulting in an early collision. This unexpected early contact often brings unexpected collision impacts. This issue may actually be addressed during planning by planning an impact-aware food-end movement trajectory of the swing leg, causing that even if the early collision occurs, the impact force of the collision is within an expected range. Therefore, the embodiments of the present disclosure may formulate a trajectory optimization problem applicable to the swing leg of the legged robot. The employed robot dynamic model is a linearized dynamic model of the foot end of the swing leg in the operation space. The discrete collision model is a discrete collision dynamic model. In the trajectory optimization problem, a prediction time window depends on a planned foot-end swing duration, i.e., a pre-specified foot-end swing duration. To enable online trajectory optimization on the robot's computer, a corresponding optimization problem is designed as an easily solvable Quadratic Programming (QP) problem.

    [0059] In an exemplary embodiment of the present disclosure, as illustrated in FIG. 2, the Rough Planning module may be configured to provide the IA-TO with the touchdown point position for the next swing of each leg, the swing duration, and the current reference contact state. The IA-TO module may be configured to receive feedback information from the state estimation and reference information from the Rough Planning, generate an appropriate reference state (including a reference point position and a linear velocity) for the foot end of each leg. The SRB-MPC module may be configured to solve an optimization problem in model predictive control based on the reference information from the Rough Planning, obtain an optimal trunk reference state and an optimal reference foot-sole force, which are directly transferred to the IA-WBC. The SRB-MPC may be configured to solve the optimization problem approximately every frame. When the optimization problem has no need to be solved, an output of the SRB-MPC is not updated, i.e., output data is zero-order held.

    [0060] For the supporting leg, a reference state thereof is to remain stationary on the ground. For the leg that starts to swing, the impact-aware trajectory optimization problem is solved. For a leg already in swing, an optimal solution for the trajectory optimization is interpolated to obtain a reference state at a current moment. The IA-TO module is configured to solve the trajectory optimization only once before a leg needs to start swinging, requiring minimal computation at other times. The IA-TO module ultimately may transfer the reference state of the foot end of each leg, along with the reference contact state provided by the Rough Planning, to the IA-WBC.

    [0061] In the embodiments of the present disclosure, the planning, based on the foot-end dynamic model and the discrete collision model, the impact-aware swing leg trajectory includes: obtaining a pre-defined state variable and a target constraint condition; constructing, based on the foot-end dynamic model, the pre-defined state variable, and the target constraint condition, a continuous-time trajectory optimization problem for the leg that starts to swing at a next moment; and discretizing the continuous-time trajectory optimization problem to obtain a discrete-time trajectory optimization problem for a foot end of a swing leg, and solving the discrete-time trajectory optimization problem to obtain the impact-aware swing leg trajectory.

    [0062] The pre-defined state variable may include: an initial state of the foot end of the swing leg, including an initial point position and the linear velocity; a touchdown state of the foot end of the swing leg, including the touchdown point position and the linear velocity; a swing duration T.sub.swcustom-character; and a desired maximum height

    [00036] z h ref

    of the foot end of the swing leg from the ground.

    [0063] The pre-specified state variable in the embodiments of the present disclosure includes one or more of: an initial state of the foot end of the swing leg, a touchdown state of the foot end of the swing leg, a swing duration, and a desired maximum height of the foot end of the swing leg from the ground. The target constraint condition includes one or more of: a state equation equality constraint, a driving force inequality constraint, a trajectory height inequality constraint, an initial state equality constraint, a terminal state equality constraint, an impact-aware inequality constraint, and a terminal velocity direction inequality constraint.

    [0064] It should be understood that before each leg starts to swing, a trajectory optimization problem needs to be solved to obtain an optimal foot swing trajectory. Considering a limited computing power on an actual robot, trajectory optimization problem for the same leg is not solved repeatedly during swinging of the foot end. Since an expression of the trajectory optimization problem for each leg is essentially identical, for the sake of simplicity in expression, all subscripts l used to indicate a leg index are omitted where no ambiguity exists in the embodiments of the disclosure.

    [0065] In an exemplary embodiment of the present disclosure, the linear acceleration of the foot end of the swing leg may be used as a control variable, i.e., u={umlaut over (x)}.sub.ccustom-character. A state variable is selected as a point position and a linear velocity of the foot end, i.e.,

    [00037] x = [ x c T x . c T ] T 6 .

    Based on this, an objective function, a constraint condition, and a discrete-time trajectory optimization problem of the embodiments of the present disclosure are described below.

    I. Objective Function

    [0066] In the embodiments of the present disclosure, the foot-end dynamic model is:

    [00038] c , l x .Math. c , l + h c , l = F j ,

    where {umlaut over (x)}.sub.c,lcustom-character is a linear acceleration of a foot end of an l-th leg in an inertial system I, .sub.c,l is a mass matrix in an operation space, h.sub.c,l is a term including a Coriolis force, a centripetal force, and a gravitational force in the operation space, and F.sub.jcustom-character is a foot-end driving force obtained by mapping a torque .sub.j of a driving joint to the operation space. A process for obtaining the foot-end dynamic model in the embodiments of the present disclosure is as follows.

    [0067] In the embodiments of the present disclosure, a point position, a linear velocity, and the linear acceleration of the foot end of the l-th leg in the inertial system I may be denoted as x.sub.c,l, {dot over (x)}.sub.c,l, {umlaut over (x)}.sub.c,lcustom-character, respectively. Then, a dynamic equation for the foot end in the operation space is:

    [00039] c , l ( q g ) x .Math. c , l + h c , l ( q g , q . ) = F j + F c , l

    where F.sub.j, F.sub.c,lcustom-character are the foot-end driving force obtained by mapping the torque .sub.j of the driving joint to the operation space and a ground reaction force on the foot end (the latter exists only during contact with the ground) respectively, .sub.c,l(q.sub.g) is a mass matrix in the operation space, and h.sub.c,l(q.sub.g,{dot over (q)}) is a term including the Coriolis force, the centripetal force, and the gravitational force in the operation space.

    [0068] Considering that even if the legged robot performs a dynamic movement, the swing leg of the legged robot mostly remains within certain ranges under a trunk. The embodiments of the present disclosure may assume that a range of leg configuration variation in a single swing phase is not excessively large. Therefore, .sub.c,l(q.sub.g) may be approximately considered as configuration-independent and treated as a constant matrix. Experimental evidence shows that a nonlinear term h.sub.c,l(q.sub.g,{dot over (q)}) also varies insignificantly during leg swing and may be approximately as a constant vector.

    [0069] Consequently, the simplified foot-end dynamic model is obtained as:

    [00040] c , l x .Math. c , l + h c , l = F j ,

    treating a foot sole of the l-th leg as a first object and the ground as a second object, and considering that a ground mass is much larger than a robot mass and that a ground velocity remains zero before the collision and after the collision, the discrete collision model of the embodiments of the present disclosure is further derived as:

    [00041] x . c , l = P n ( x . 1 + - x . 1 - ) = - ( 1 + c r ) P n x . c , l - ,

    where P.sub.n=nn.sup.Tcustom-character is a projection operator on a collision normal vector, ncustom-character is a unit normal vector of a collision surface,

    [00042] x . 1 + , x . 1 - 3

    are a velocity of a first object before collision and a velocity of the first object after the collision respectively,

    [00043] x . 2 + , x . 2 - 3

    are a velocity of a second object before collision and a velocity of the second object after the collision respectively, and c.sub.r is a restitution coefficient, which is defined as

    [00044] c r = def - n T ( x . 2 + - x . 1 + ) n T ( x . 2 - - x . 1 - ) .

    [0070] In the embodiments of the present disclosure, an objective function of the continuous-time trajectory optimization problem is:

    [00045] min x ( t ) , u ( t0 f TO = .Math. x ( t F ) - [ x c , F ref x . c , F ref ] .Math. Q x F + t 0 t F .Math. u ( ) .Math. Q u d + t h 1 t h 2 .Math. z c ( ) - z h ref .Math. Q z d ,

    where Q.sub.x.sub.Fcustom-character, Q.sub.ucustom-character, and Q.sub.zcustom-character are weight matrices (mostly diagonal matrices) with different dimensions, a.sub.Q=a.sup.TQa represents a weighted norm of a vector a under a weight matrix Q,

    [00046] .Math. x ( t F ) - [ x c , F ref x . c , F ref ] .Math. Q x F

    reflects a task of a touchdown state of the foot end of the swing leg,

    [00047] x c , F ref 3 and x c , F ref 3

    are a known terminal position of the foot end of the swing leg and a known linear velocity of the foot end of the swing leg respectively,

    [00048] t 0 t F .Math. u ( ) .Math. Q u d

    is a minimum control variable (i.e., a linear acceleration) in an entire swing process, and t.sub.0=0, t.sub.F=T.sub.sw, where T.sub.sw is a swing duration,

    [00049] t h 1 t h 2 .Math. z c ( ) - z h ref .Math. Q z d

    reflects a task of a maximum height of the swing leg from the ground, t.sub.h1 and t.sub.h2 are parameters specifying a time period to reach the maximum height, satisfying t.sub.0t.sub.h1t.sub.h2t.sub.F, and z.sub.c is a third component of the state variable, i.e., a component representing a height of the foot end from the ground in the state variable.

    II. Constraints

    [0071] (1) State Equation Equality Constraint: since the control variable is selected as the linear acceleration of the foot end, the state equation is straightforward. Define:

    [00050] A c = [ 0 3 3 I 3 3 0 3 3 0 3 3 ] , B c = [ 0 3 3 I 3 3 ] ,

    Then, a state equation of a system can be written as:

    [00051] d dt x ( t ) = A c x ( t ) + B c u ( t ) , for t [ t 0 , t F ] .

    [0072] (2) Driving Force Constraint: due to output torque limits of an actual actuator, i.e., an upper limit of an output torque and a lower limit of the output torque, correspondingly the foot-end driving force in the operation space has a lower limit .sub.mincustom-character and an upper limit .sub.maxcustom-character. Therefore, the driving force constraint can be written as:

    [00052] f min S 2 x ( t ) c , max , for t [ t 0 , t F ] ,

    [0073] (3) Trajectory Height Constraint: to prevent an optimized trajectory from being below the ground or higher than the desired maximum height from the ground, constraints on a trajectory height are needed, i.e.,

    [00053] z c , min S 2 x ( t ) z c , max , for t [ t 0 , t F ] ,

    where z.sub.c,min, z.sub.c,maxcustom-character are an upper limit and a lower limit of the trajectory height, and S.sub.z=[0,0,1,0,0,0]custom-character is a selection matrix used to select a third component of a state.

    [0074] (4) Initial State Constraint: the initial state in the trajectory optimization of the foot end of the swing leg is a state just before the foot end leaves the ground. Therefore, the initial state constraint is:

    [00054] x ( t 0 ) = [ x c , 0 fb x . c , 0 fb ] ,

    where

    [00055] x c , 0 fb , x . c , 0 fb 3

    are a latest feedback point position and a latest linear velocity of the foot end of the swing leg before solving the trajectory optimization problem, respectively.

    [0075] (5) Terminal State Constraint: although the objective function already incorporates a task of a terminal state, the objective function cannot guarantee that a height of an end of the optimized foot-end trajectory from the ground is zero. That is, the end of the trajectory may be suspended in the air or penetrate the ground. Therefore, a terminal state constraint is needed, i.e.,

    [00056] S z , z . x ( t F ) = [ z c , F ref z . c , F ref ] ,

    where

    [00057] z c , F ref and z . c , F ref

    are a reference height and a vertical direction reference velocity at the trajectory's end, respectively, and where

    [00058] z . c , F ref = 0.

    S.sub.z, is a corresponding selection matrix, i.e.,

    [00059] S z , z . = [ 001000 000001 ] .

    [0076] It should be noted that the terminal state constraint in the embodiments of the present disclosure does not constrain a component of a horizontal direction in the state. This is because, under conditions with many constraints, a desired terminal state in the horizontal direction may be unattainable. Enforcing the terminal state constraint in the horizontal direction may result in an infeasible optimization problem.

    [0077] (6) Impact-aware Constraint: to ensure sufficient deceleration of the swing leg before touchdown to reach a safe velocity, an impact-aware constraint is considered at an end of the trajectory in the embodiments of the present disclosure. Assuming a collision process starts at a time of t.sub.c and ends at a time of t.sub.c+t, both sides of an equation of .sub.c,l(q.sub.g){umlaut over (x)}.sub.c,l+h.sub.c,l(q.sub.g,{dot over (q)})=F.sub.j+F.sub.c,l is integrated, it follows that:

    [00060] t c t c + t c ( q g ) x .Math. c + h c ( q c , q . ) dt = t c t c + t F j + F c dt .

    [0078] Since a configuration of the robot remains almost unchanged before the collision and after the collision, i.e.,

    [00061] q g + = q g - .

    In addition, a collision process is extremely short, i.e., t.fwdarw.0. In this case, an impulse from a limited force (such as the gravitational force, the Coriolis force, and the centripetal force) may appear in this limit, leaving only an impulse generated by the collision. Therefore, the above formula becomes

    [00062] c x . c = c ( x . c + - x . c - ) = .Math. c

    where t.fwdarw.0, where l.sub.ccustom-character represents an impulse exerted by the ground on the foot end. Substituting this expression into a pre-collision model yields the impact-aware constraint:

    [00063] .Math. c , min c ( - ( 1 + c r ) P n x . c ( t ) ) .Math. c , max , for t [ t imp , t F ] ,

    where l.sub.c,min, l.sub.c,maxcustom-character are an artificially specified lower limit of an allowable collision impulse and an artificially specified upper limit of the allowable collision impulse respectively, and t.sub.imp is an artificially specified duration to activate the impact-aware constraint, satisfying t.sub.0t.sub.impt.sub.F.

    [0079] It should be understood that a formula of the impact-aware constraint may indicate that if the early collision occurs due to certain reasons during a time period of [t.sub.imp, t.sub.F] immediately before the foot end of the swing leg touches the ground, an impulse caused by the collision may fall within a constraint range of this equation. Further, this constraint cannot be activated throughout the entire swing process. Otherwise, the entire swing movement may become excessively slow, resulting in a failure in realizing normal running movement.

    [0080] (7) Terminal Velocity Direction Constraint: if a velocity direction of the foot end of the swing leg is nearly horizontal just before touchdown, then due to errors in controlling a height of the foot end, the foot sole touching the ground prematurely may occur, resulting in the foot end of the swing leg not reaching the planned foot point position, which may potentially affect stability of a center of mass of the robot. Therefore, the embodiments of the present disclosure can design the terminal velocity direction constraint for the foot end, in such a manner that an angle .sub.c between a velocity {dot over (x)}.sub.c(t) of the foot end of the swing leg before touchdown and a unit normal vector n (a negative sign indicates a direction pointing inwardly) of the collision surface is within a certain specified range, i.e.:

    [00064] cos c , max - n T x . c ( t ) .Math. x . c ( t ) .Math. 2 , for t [ t imp , t F ] ,

    where

    [00065] c , max ( 0 , 2 )

    is an artificially specified maximum allowable angle. The above nonlinear expression may be linearized through scaling. Based on a relationship between a norm custom-character and a norm custom-character of the vector, it follows that:

    [00066] - n T x . c ( t ) .Math. x . c ( t ) .Math. 1 - n T x . c ( t ) .Math. x . c ( t ) .Math. 2 , x c ( t ) 0 3 1 and x c ( t )

    [0081] Therefore, the rewritten

    [00067] cos c , max - n T x . c ( t ) .Math. x . c ( t ) .Math. 2 , for t [ t imp , t F ] ,

    may be obtained. Any solution that satisfies the rewritten formula also satisfies the original formula. Therefore, the rewritten formula may be used as the terminal velocity direction constraint for TO, which can be further written as:

    [00068] .Math. "\[LeftBracketingBar]" x . c , x ( t ) .Math. "\[RightBracketingBar]" + .Math. "\[LeftBracketingBar]" x . c , y ( t ) .Math. "\[RightBracketingBar]" + .Math. "\[LeftBracketingBar]" x . c , z ( t ) .Math. "\[RightBracketingBar]" - 1 cos c , max n T x . c ( t ) , for t [ t imp , t F ] ,

    where {dot over (x)}.sub.c,x(t),{dot over (x)}.sub.c,y(t),{dot over (x)}.sub.c,z(t) is respective components of {dot over (x)}.sub.c(t). By traversing all cases within absolute value symbols, the above expression can be further written as eight equivalent inequalities, which are:

    [00069] [ 1 1 1 - 1 1 1 1 - 1 1 - 1 - 1 1 1 1 - 1 - 1 1 - 1 1 - 1 - 1 - 1 - 1 - 1 ] x . c ( t ) - 1 cos c , max [ n T n T n T n T n T n T n T n T ] x . c ( t ) , for t [ t imp , t F ]

    [0082] However, during a short time period before the swing leg touches the ground, it is usually the case that {dot over (x)}.sub.c,z(t)0. The first four rows of the equation are typically redundant. Therefore, the terminal velocity direction constraint can be simplified to:

    [00070] ( C 1 + 1 cos c , max D n ) x c ( t ) 0 4 1 , for t [ t imp , t F ] , where C 1 = [ 1 1 - 1 - 1 1 - 1 1 - 1 - 1 - 1 - 1 - 1 ] , D n = [ n T n T n T n T ] .

    III. Discrete-Time Trajectory Optimization Problem

    [0083] It should be understood that, to facilitate the solution of the above continuous-time trajectory optimization problem on a computer, the embodiments of the present disclosure may also perform discretization. In particular, at least one discretization method can be used in the embodiments of the present disclosure. For example, an integral term in the objective function can be replaced by a finite sum, and the state equation constraint can be replaced by a Taylor expansion formula with higher-order terms neglected.

    [0084] In the embodiments of the present disclosure, assume that a swing process is evenly divided into N segments over time, i.e., there are N frames, with a frame interval of t=T.sub.sw/N. Let t.sub.k=t.sub.0+k(t.sub.Ft.sub.0)/N, k=1, 2, . . . , N, then we can denote x.sub.k=x(t.sub.k) and u.sub.k=u(t.sub.k). The entire discrete-time trajectory optimization problem can be formulated as.

    [00071] g z c , min S z x k z c , max , k = 1 , 2 , .Math. , N - 1 , x 0 = x 0 fb , S Z , Z . x N = S Z , Z . x N ref , .Math. c , min c [ - ( 1 + c r ) P n S v x k ] .Math. c , max , k = k imp , k imp + 1 , .Math. , N , ( C 1 + 1 cos c , max D n ) S v x k 0 4 1 , k = k imp , k imp + 1 , .Math. , N ,

    where

    [00072] U = [ u 0 T , u 1 T , .Math. , u N - 1 T ] T

    is a vector composed of a control variable of each frame, Q.sub.x.sub.Ncustom-character, Q.sub.u.sub.kcustom-character, and Q.sub.zcustom-character are diagonal weight matrices with different dimensions,

    [00073] x 0 fb = [ x c , 0 fb x . c , 0 fb ]

    is a feedback of a foot-end state (including a position and a velocity) at a current moment,

    [00074] x N ref = [ x c , F ref x . c , F ref ]

    is a reference terminal foot-end state (including the position and the velocity), S.sub.=[0.sub.33I.sub.33]custom-character is a selection matrix of a foot-end linear velocity, k.sub.h.sub.1 and k.sub.h.sub.2 are an artificially specified start frame and an artificially specified end frame for maintaining a swing height, satisfying 0k.sub.h.sub.1k.sub.h.sub.2<N, and k.sub.imp is a start frame for enabling an impact-aware constraint and a terminal velocity direction constraint, satisfying 0k.sub.impN.

    [0085] It should be understood that, since trajectory optimization problems in many studies are highly nonlinear and typically belong to non-convex optimization problems, using some professional nonlinear solvers can help find local optimal solutions for the trajectory optimization problems, but cannot guarantee a global optimal solution. In the embodiments of the present disclosure, the trajectory optimization problem is a QP problem, which belongs to a typical convex optimization problem. Therefore, as long as the problem has a non-empty solution set, an optimal solution found by the optimizer is the global optimal solution.

    [0086] For the objective function of the discrete-time trajectory optimization problem of the foot end of the swing leg described above, some QP solvers can be used for solving the function. For example, in the embodiments of the present disclosure, an open-source library of qpOASES based on C++ can be used, which requires the QP problem to be converted into a standard form:

    [00075] min U 1 2 U T HU + g T U , s . t . l b CU ub .

    [0087] After solving the optimal solution of the above equation, only an optimal control variable U* of N frames is obtained, which is used to determine an optimal position and a velocity trajectory. The above N rows of discrete dynamic equations are written as a linear expression in terms of an initial state and an optimization variable, i.e.,

    [00076] X = A QP x 0 fb + B QP U , where X = [ x 0 T , x 1 T , .Math. , x N T ] T 6 N , and A QP and B QP are A QP = [ A A 2 .Math. A N ] 6 N 6 and B QP = [ B 0 6 3 .Math. 0 6 3 AB B .Math. 0 6 3 .Math. .Math. .Math. A N - 1 B A N - 2 B .Math. B ] 6 N 3 N .

    Therefore, by substituting U* into the above linear expression, a corresponding optimal position and a corresponding velocity for the N frames are obtained.

    [0088] Since the subsequent control program may require a corresponding reference trajectory at any moment, in this case it is necessary to convert N discrete points into a continuous curve by an interpolation method. In the embodiments of the present disclosure, at least one method can be used to achieve interpolation. For a maximum computational efficiency, a simplest linear interpolation can be employed in the embodiment of the disclosure.

    [0089] For example, assume that from the moment when the swing leg leaves the ground, in this case a time of t.sub.sw, has elapsed, where t.sub.sw[0, T.sub.sw]. A closest previous frame to this moment is a k-th frame, with the corresponding optimal position being

    [00077] x c , k * .

    Using a linear interpolation method, an optimal reference position in this case is:

    [00078] x c * ( t sw ) = x c , k * + t sw - k t t x c , k + 1 * .

    Similarly, a corresponding optimal reference velocity

    [00079] x . c * ( t sw )

    may be obtained.

    [0090] It should be noted that this interpolation method fails to guarantee that a time integral of the velocity trajectory is a position curve. To achieve this, a higher-order interpolation function may be required. In this case, a trade-off is made by sacrificing some interpolation accuracy to maximize a computational efficiency.

    [0091] At block S104, whole-body control is performed on the legged robot based on the movement state, the reference state sequence, and the foot-end reference state. Based on a whole-body dynamic model and the discrete collision model, impact-aware whole-body control is performed for a leg that is a supporting leg in planning but does not touch the ground, to enable an influence caused by a delayed collision to be within the target constraint range

    [0092] It should be understood that, as illustrated in FIG. 2, the embodiments of the present disclosure can solve a Weighted Quadratic Programming (WQP) problem and calculate an optimal joint torque instruction based on feedback information from state estimation and reference information from the SRB-MPC module and the IA-TO module, achieving whole-body control of the legged robot and addressing an issue of the delayed collision.

    [0093] It should be noted that the term delayed collision refers to a situation where, due to certain reasons (e.g., the slight ground unevenness, errors in state estimation, or control inaccuracies), the foot end has not yet made contact with the ground at an originally planned time point, in this case contact between the foot end and the ground necessarily occurs later than the originally planned time point. Without an appropriate control strategy, such unintended delayed collisions can easily result in unintended collision impact. The problem of delayed collision is substantially different from that of early collision, in that the delayed collision occurs outside a planned swing process. Therefore, a distance between the foot sole and the ground (which is expected to be zero) cannot be accurately determined, and also an exact timing of ground contact (which is supposed to occur at a specific moment) becomes uncertain, which may be effectively solved in a control stage. Therefore, based on a core concept of one step predictive control, the embodiments of the present disclosure may use an impact-aware Whole Body Control (WBC) method.

    [0094] In the following embodiments, the quadruped robot is used as an example to describe the WBC method of the embodiments of the present disclosure. The impact-aware constraint is not always enabled. Depending on different situations, a task objective and constraint setting of whole-body control vary accordingly. Therefore, the embodiments of the present disclosure may be expressed using a decision tree as illustrated in FIG. 3. The impact-aware whole-body control in the embodiment of the present disclosure is detailed as follows.

    I. Whole-Body Control Based on Weighted Quadratic Programming

    [0095] It should be understood that, to enable the whole-body control to properly handle an inequality constraint such as the impact-aware constraint, an optimization-based approach is selected for implementation of the whole-body control. Also, considering limited computational resources available on the actual robot and thus there are multiple programs (e.g., communication, control algorithms) that need to operate simultaneously, the embodiments of the present disclosure may adopt a whole-body control method implemented based on the WQP.

    [0096] In the embodiments of the present disclosure, an optimization problem of the whole-body control is:

    [00080] min .Math. i = 1 n task .Math. W i ( A i - b i ) .Math. 2 2 , s . t . l b j C j ub j , j = 1 , TagBox[",", "NumberComma", Rule[SyntaxForm, "0"]] 2 , .Math. , n constraint ,

    where A.sub.i is a task matrix, b.sub.i is a task vector, c.sub.j is a constraint matrix, lb.sub.j and ub.sub.j are a lower constraint bound and an upper constraint bound, W.sub.i is a weight matrix, n.sub.task is a quantity of tasks, and n.sub.constraint is a quantity of constraints.

    [0097] It should be understood that, in the WQP, all tasks that need to be completed are represented in the objective function in a form of A.sub.ib.sub.i, and a relative priority of tasks is adjusted by the weight matrix W.sub.i. All constraints are expressed in a form of lb.sub.jc.sub.jub.sub.j. The equality constraint may be achieved by setting lb.sub.j=ub.sub.j. In the embodiments of the present disclosure, optimization variables of the WBC are selected as a generalized joint space acceleration of {umlaut over (q)} and an augmented foot-sole force of F.sub.c formed by stacking forces acting on foot ends of four feet, i.e.,

    [00081] = [ q .Math. T , F c T ] T n ,

    where

    [00082] n = n q + n F .

    [0098] When the quadruped robot is in a stationary standing state, the whole-body dynamic model of the legged robot in the embodiments of the present disclosure is:

    [00083] M ( q g ) q .Math. + h ( q g , q . ) = [ 0 6 1 j ] + J c T ( q g ) F c ,

    where M(q.sub.q)custom-character is a generalized mass matrix, h(q.sub.g,{dot over (q)})custom-character is a term including a Coriolis force, a centripetal force, and a gravitational force, .sub.jcustom-character represents an output torque of a driving joint, 0.sub.nm represents a zero matrix with a size of nm,

    [00084] J c T ( q g )

    and F.sub.c are an augmented Jacobian matrix formed by stacking a contact Jacobian matrix of each supporting leg and an augmented foot-sole force formed by stacking a ground reaction force on a foot sole of each supporting leg, respectively, q.sub.g is a generalized joint space position, {dot over (q)} is a generalized joint space velocity, and {umlaut over (q)} is a generalized joint space acceleration.

    [0099] By solving the above QP problem, the optimal solution * may be obtained. Combining with a complete dynamic equation, the optimal joint torque instruction

    [00085] j cmd

    can be easily calculated as:

    [00086] j cmd = ( S j M ( q g fb ) - S j J c T ( q g fb ) ) * + S j h ( q g fb , q . fb ) ,

    where S.sub.j=[0.sub.n.sub.j.sub.6I.sub.n.sub.j.sub.n.sub.j]custom-character is a selection matrix of the driving joint, and

    [00087] q g fb

    and {dot over (q)}.sup.fb are the generalized joint space position and a velocity feedback provided by the state estimation respectively.

    II. Task Setting

    [0100] In the embodiments of the present disclosure, tasks processed simultaneously by the whole-body control include two or more of: a trunk trajectory tracking task, a foot-end trajectory tracking task, a foot-sole force tracking task, a task of minimizing variation of a joint torque, and a task of minimizing variation of a foot-sole force. Constraints processed simultaneously by the impact-aware whole-body control include two or more of: a floating-base dynamic equality constraint, a foot-sole force inequality constraint, a joint output torque saturation inequality constraint, a joint rotational speed saturation inequality constraint, a joint output power saturation inequality constraint, and an impact-aware constraint.

    [0101] In an exemplary embodiment of the present disclosure, (1) a trunk tracking task: the trunk trajectory tracking task is a basic task allowing for movement of the quadruped robot, which is indispensable. In the embodiments of the present disclosure, a trunk reference movement trajectory provided by the Model Predictive Control (MPC) may be used. The trajectory includes an optimal reference point position

    [00088] r b MPC

    of a trunk, an optimal reference linear velocity

    [00089] r . b MPC ,

    and an optimal ZYX Euler angle

    [00090] b M P C

    in the inertial system I, and an optimal reference angular velocity

    [00091] B b MPC

    of the trunk under a floating-base system B.

    [0102] In the WBC, PD control is performed based on an optimal reference trajectory provided by the MPC and a feedback state provided by the state estimation to obtain a linear acceleration instruction

    [00092] r .Math. b cmd

    of the trunk in the inertial system I and an angular acceleration instruction

    [00093] B . b cmd

    under the floating-base system B. Then, corresponding tasks are designed to complete these instructions. The PD control is:

    [00094] r .Math. b cmd = K p , r b ( r b MPC - r b tb ) + K d , r b ( r . b MPC - r . b fb ) , B . b cmd = K p , b B e + K d , b ( B b MPC - B b fb ) ,

    where K.sub.p,r.sub.b, K.sub.d,r.sub.b, K.sub.p,.sub.b, K.sub.d,.sub.bcustom-character are PD gain coefficient matrices, all of which are diagonal matrices, and B.sub.e.sub.custom-character is an axis angle representing a pose error calculated based on a reference ZYX Euler angle

    [00095] b MPC

    and a feedback ZYX Euler angle

    [00096] b fb .

    [0103] Since the first 6 rows of {umlaut over (q)} correspond to a linear acceleration and an angular acceleration of a floating base, a corresponding matrix and a corresponding vector for the trunk trajectory tracking task are written as:

    [00097] A 1 = [ I 6 6 0 6 ( n j + n F ) ] and b 1 = [ r .Math. b cmd B . b cmd ] .

    [0104] (2) Foot-end trajectory tracking task: the foot end trajectory tracking task is also a basic task for the movement of the quadruped robot, which is indispensable. For a foot end of the l-th leg, according to (non-rotational) acceleration-level kinematics, it follows that:

    [00098] x .Math. c , l = J c , l ( q g ) q .Math. + J . c , l ( q g ) q .

    [0105] Therefore, a corresponding matrix and a corresponding vector for a foot-end trajectory tracking subtask of the l-th leg can be written as:

    [00099] A 2 , l = [ J c , l ( q g fb ) 0 3 n F ] , b 2 , l = x .Math. c , l cmd - J . c , l ( q g fb ) q . fb , and l = 1 , 2 , 3 , 4 ,

    where

    [00100] x .Math. c , l cmd

    is a linear acceleration instruction of the foot end of the l-th leg in the inertial system I. When the leg is under different states, the instruction varies.

    [0106] For example, when the leg acts as the supporting leg, the foot end should be fixed on the ground without movement, i.e.,

    [00101] x .Math. c , l cmd = 0 3 1 .

    When the leg acts as the supporting leg but does not touch the ground (delayed contact with the ground),

    [00102] x .Math. c , l cmd

    is micro-control to track a velocity pointing to the collision surface, and

    [00103] x .Math. c , l cmd = K p , x c , l ( - imp n - x c , l fb ) ,

    where .sub.impcustom-character is an artificially specified desired collision velocity, and ncustom-character is the unit normal vector of the collision surface previously mentioned, pointing outwardly from the collision surface. When the leg acts as the swing leg,

    [00104] x .Math. c , l cmd

    is obtained by the PD control:

    [00105] x .Math. c , l cmd = K p , x c , l ( x c , l TO - x c , l fb ) + K d , x c , l ( x . c , l TO - x . c , l fb ) ,

    where K.sub.p,x.sub.c,l, K.sub.d,x.sub.c,lcustom-character is the PD gain coefficient matrices, both of which are diagonal matrices.

    [00106] x c , l TO , x . c , l TO

    are the optimal reference point position and the linear velocity of the foot end of the swing leg calculated in the above embodiments.

    [0107] It should be noted that foot-end trajectory tracking subtasks of four legs in the embodiments of the present disclosure together constitute a complete foot-end trajectory tracking task. Therefore, the corresponding matrix and the corresponding vector can be written as:

    [00107] A 2 = [ A 2 , 1 A 2 , 2 A 2 , 3 A 2 , 4 ] and b 2 = [ b 2 , 1 b 2 , 2 b 2 , 3 b 2 , 4 ] , respectively .

    [0108] (3) Foot-sole Force Tracking Task: a linear momentum and an angular momentum of a center of mass of the quadruped robot are affected not only by the gravitational force but also by the ground reaction force on the foot end (i.e., the foot-sole force). During high-dynamic movement, appropriate foot-sole forces are very important.

    [0109] The embodiments of the present disclosure may provide a method to optimize reference-valuable foot-sole forces

    [00108] F c MPC

    using a single-rigid-body model MPC. Corresponding tasks need to be set in the WBC to achieve foot-sole force tracking.

    [0110] Since the quadruped robot used in the embodiments of the present disclosure does not have a force/torque sensor at the foot end of the quadruped robot, it is difficult to implement foot-sole force feedback control in the WBC. Therefore, the foot-sole force tracking task can only be set as a pure feedforward force task. The corresponding matrix and the corresponding vector can be written as:

    [00109] A 3 = [ 0 n k n q I n F n F ] and b 3 = F c ref ,

    respectively,

    [00110] F c ref = [ F c , 1 ref F c , 2 ref F c , 3 ref F c , 4 ref ] .

    where
    When the l-th leg touches the ground and acts as the supporting leg, the leg may execute the reference foot-sole force provided by the MPC. Therefore,

    [00111] F c , l ref = F c , l MPC .

    When the leg is the swing leg or is the supporting leg in planning but does not touch the ground (i.e., delayed contact with the ground), the foot end of the leg is not subjected to an external force. Therefore,

    [00112] F c , l ref = 0 3 1 .

    [0111] (4) Task of Minimizing Variation of Joint Torque: due to a limited bandwidth of actual motor force control, excessively drastic changes in the output torque are difficult for practical implementation. When the actual motor cannot execute actions according to an optimal solution of the WBC, the control error tends to increase. Therefore, the embodiments of the present disclosure can incorporate consideration of reducing variation of the joint torque into the WBC, making it easier for the actual motor to execute actions according to the optimal solution of the WBC.

    [0112] Assuming that an optimal joint torque instruction calculated by the WBC in a previous control cycle is

    [00113] j pre ,

    a matrix and a vector for the task of minimizing variation of a joint Torque in this control cycle can be written as:

    [00114] A 4 = [ S j M ( q g fb ) - S j J c T ( q g fb ) ] and b 4 = j pre .fwdarw. S j h ( q g f b , q . fb ) , respectively .

    [0113] It should be noted that this task may potentially conflict with the previously mentioned tasks, including the trunk trajectory tracking task, the foot-end trajectory tracking task, and the foot-sole force tracking task. Therefore, in the embodiments of the present disclosure, a weight assigned to this task may not be too high. Otherwise, execution performance of the above tasks may be affected.

    [0114] (4) Task of Minimizing Variation of Foot-sole Force: to make variation in the foot-sole force smoother (thus making state variation of the center of mass smoother), the embodiments of the present disclosure can incorporate a task of reducing variation of the foot-sole force in the WBC.

    [0115] Assume that an optimal foot-sole force calculated by the WBC in the previous control cycle is

    [00115] F c pre ,

    a matrix and a vector for the task of minimizing variation of the foot-sole force in this control cycle can be written as:

    [00116] A 5 = [ 0 n F n q I n F n F ] and b 5 = F c pre ,

    respectively.

    [0116] It should be noted that, similarly, this task may potentially conflict with the previously mentioned tasks, including the trunk trajectory tracking task, the foot-end trajectory tracking task, and the foot-sole force tracking task. Therefore, the weight assigned to this task may not be too high. Otherwise, execution performance of the other tasks may be affected.

    III. Constraint Settings

    [0117] (1) Floating Base Dynamic Equality Constraint: a trunk of the quadruped robot does not have a direct driving force and a torque. Therefore, the first six rows of a complete movement equation do not include a joint output torque. These six rows are floating base dynamic equations, which are equality constraints that need to be satisfied. A corresponding matrix and a corresponding vector are:

    [00117] C 1 = [ S b M ( q g fb ) - S b J c T ( q g fb ) ] and lb 1 = u b 1 = - S b h ( q g fb , q . fg ) , repectively ,

    where S.sub.b=[I.sub.66 0.sub.6n.sub.j]custom-character is a selection matrix of the floating base.

    [0118] (2) Foot-sole Force Inequality Constraint: to avoid sliding of the foot end of the supporting leg relative to the ground, a ratio of a magnitude of a component parallel to a contact surface in the foot-sole force to a magnitude of a component perpendicular to the contact surface in the foot-sole force is smaller than a friction coefficient. That is, a foot-sole force of F.sub.c,l of the l-th leg may satisfy the following constraint to avoid slipping: (I.sub.33nn.sup.T)F.sub.c,l.sub.2|n.sup.TF.sub.c,l|, where is the friction coefficient.

    [0119] It should be understood that the above formula describes a conical region. Therefore, this constraint for avoiding foot-end slippage is also called a friction cone constraint. Since the formula includes a norm custom-character.sub.2, which is a nonlinear expression, for the convenience of solving the WBC optimization problem, the embodiments of the present disclosure can simplify the formula.

    [0120] In the embodiments of the present disclosure, the formula can be linearized, i.e., using a tetrahedral cone instead of a circular cone. Then, assuming that the quadruped robot usually walks on a flat ground with a slope close to zero, a Z-axis component of F.sub.c,l can be considered as the component perpendicular to the contact surface. Therefore, the above formula can be rewritten as:

    [00118] { .Math. "\[LeftBracketingBar]" F c , l , x .Math. "\[RightBracketingBar]" .Math. "\[LeftBracketingBar]" F c , l , z .Math. "\[RightBracketingBar]" .Math. "\[LeftBracketingBar]" F c , l , y .Math. "\[RightBracketingBar]" .Math. "\[LeftBracketingBar]" F c , l , z .Math. "\[RightBracketingBar]" .

    [0121] It should be noted that the foot-sole force is the ground reaction force on the foot sole, and thus the Z-axis component is always greater than zero. To avoid an excessively large foot-sole force from being optimized and causing hardware damage, the embodiments of the present disclosure may also have a limit on a magnitude of the Z-axis component of F.sub.c,l. Therefore, a foot-sole force inequality constraint for the l-th leg can be written as:

    [00119] { .Math. "\[LeftBracketingBar]" F c , l , x .Math. "\[RightBracketingBar]" F c , l , z .Math. "\[LeftBracketingBar]" F c , l , y .Math. "\[RightBracketingBar]" F c , l , z 0 F c , l , z F c , l , z max ,

    where F.sub.c,l,z.sub.maxcustom-character is an artificially specified maximum foot-sole force in a Z-axis direction. When this leg is already the supporting leg, F.sub.c,l,z.sub.max is a predetermined positive number. When this leg is the swing leg or is the supporting leg in planning but does not touch the ground (delayed contact with the ground), a foot-sole force of this leg is zero. Therefore, F.sub.c,l,z.sub.max=0. In the embodiments of the present disclosure, the above expression can equivalently be represented in matrix form as:

    [00120] 0 5 1 C F F c , l u b F , where C F = [ 1 0 - 1 0 0 1 0 - 1 0 0 1 ] , ub F = [ + + + + F c , l , z max ] .

    [0122] The final foot-sole force constraints for all four legs, when combined, constitute a complete foot force inequality constraint. A corresponding matrix and a corresponding vector can be written as:

    [00121] C 2 = [ C F C F 0 20 n q C F C F ] and lb 2 = 0 20 1 , ub 2 = [ ub F ub F ub F ub F ] , respectively .

    [0123] (3) Joint Output Torque Saturation Inequality Constraint: performance of the actual motor is limited. Even in a stalled state, there is an upper limit to the output torque thereof. In the WBC, output torque limits of the actual motor need to be considered to better coordinate various joints to simultaneously complete multiple desired tasks. Therefore, a matrix and a vector for the joint output torque saturation inequality constraint can be written as:

    [00122] C 3 = [ S j M ( q g fb ) - S j J c T ( q g fb ) ] n j n l b 3 = j , min - S j h ( q g fb , q . fb ) n j , and ub 3 = j , max - S j h ( q g fb , q . fb ) n j , respectively ,

    where .sub.j,min, .sub.j,max are a lower limit and an upper limit of the joint output torque, respectively.

    [0124] (4) Joint Rotational Speed Saturation Inequality Constraint: similar to the joint output torque saturation inequality constraint, even under no-load conditions, there is an upper limit to the rotational speed of the actual motor. In the WBC, rotational speed limits of the actual motor need to be considered to better coordinate various joints to simultaneously complete multiple desired tasks.

    [0125] Performing a Taylor expansion on the joint rotational speed at a moment of t and ignoring a higher-order term beyond acceleration, in the embodiments of the present disclosure, {dot over (q)}.sub.j(t+t) can be linearly predicted:

    [00123] q . j ( t + t ) q . j ( t ) + t q .Math. j ( t ) .

    [0126] In a same control cycle, the embodiments of the present disclosure can take a joint rotational speed

    [00124] q . j fb

    from a latest feedback as a joint rotational speed {dot over (q)}.sub.j(t) at a current moment, and use a joint acceleration from an optimization variable as a joint acceleration {umlaut over (q)}.sub.j(t) at the current moment. In this way, using the above formula, a joint rotational speed at a moment t+t can be linearly represented by the optimization variable. Therefore, a corresponding matrix and a corresponding vector for the joint rotational speed saturation inequality constraint are:

    [00125] C 4 = [ 0 n j 6 I n j n j 0 n j n F ] n j n l b 4 = q . j , min - q . j fb n j , and ub 4 = q . j , max - q . j fb n j , respectively ,

    where {dot over (q)}.sub.j,min,{dot over (q)}.sub.j,max are a lower limit and an upper limit of the joint rotational speed, respectively.

    [0127] (5) Joint Output Power Saturation Inequality Constraint: similar to the joint output torque saturation inequality constraint, an output power of the actual motor also has an upper limit. In the WBC, output power limits of the actual motor need to be considered to better coordinate various joints to simultaneously complete multiple desired tasks. Considering that an environment may also do work on the motor, the embodiments of the present disclosure do not constrain an input power of the joint but only constrain an output power of the joint.

    [0128] For an -th joint, let an output torque of the -th joint be .sub.custom-character, and an output rotational speed of the -th joint be {dot over (q)}.sub.custom-character, then, the output power of this joint is P.sub.=.sub.{dot over (q)}.sub.. Let an output power of n.sub.j-th joint be P.sub.jcustom-character, then it follows that:

    [00126] P j = diag ( q . j ) j .

    [0129] The rotational speed of the joint can be represented by

    [00127] q . j fb ,

    and the output torque of the joint can be linearly expressed using the optimization variable. Therefore, a matrix and a vector corresponding to the joint output power saturation inequality constraint are:

    [00128] C 5 = diag ( q . j ) [ S j M ( q g fb ) - S j J c T ( q g fb ) ] n j n l b 5 = - n j 1 , and ub 5 = P j , max - diag ( q . j ) S j h ( q g fb , q . fb ) n j , respectively ,

    where P.sub.j,maxcustom-character is an upper limit of the joint output power.

    [0130] (6) Impact-aware Constraint: the impact-aware constraint in the WBC is similar to that in the TO, and the same discrete collision model, i.e., the discrete collision dynamic model, is used.

    [0131] It should be understood that in the WBC, assuming the collision occurs at the next moment (i.e., a moment t+t), in the embodiments of the present disclosure, the Taylor expansion formula can be used to predict a linear velocity of the foot end before a next collision. Then, a sudden change in the foot-sole linear velocity caused by the collision is predicted, followed by predicting an impulse generated by the collision. Finally, this impulse is constrained in a current control cycle. Therefore, a joint acceleration optimized by the WBC can cause the linear velocity of the foot end to be sufficiently small, in such a manner that if a collision really occurs at the next moment, the resulting impulse may fall within an impact-aware constraint range of the WBC. If no collision occurs at the next moment, the robot may show a significant reduction in a movement velocity of the foot end.

    [0132] In an exemplary embodiment of the present disclosure, for the l-th leg, according to kinematics of the robot and the Taylor expansion formula, the pre-collision foot-end linear velocity

    [00129] x . c , l , next -

    at the moment t+t may be predicted linearly using the joint acceleration in the optimization variable:

    [00130] x . c , l , next - x . c , l fb + t x .Math. c , l = J c , l ( q g fb ) q . fb + t ( J . c , l ( q g fb ) q . fb + J c , l ( q g fb ) q .Math. ) ,

    [0133] Substituting the above equation into the discrete collision dynamic model and

    [00131] c x . c = c ( x . c + - x . c - ) = .Math. c ,

    the predicted sudden change in the foot-sole linear velocity {dot over (x)}.sub.c,l,next caused by the collision can be expressed linearly using the joint acceleration in the optimization variable:

    [00132] x . c , l , next = - ( 1 + c r ) P n x . c , l , next - - ( 1 + c r ) P n ( J c , l ( q g fb ) q . fb + t ( J . c , l ( q g fb ) q . fb + J c , l ( q g fb ) q .Math. ) ) ,

    a predicted collision impulse of l.sub.c,l,next can be expressed linearly using the joint acceleration in the optimization variable:

    [00133] .Math. c , l , next = c , l ( q g fb ) x . c , l , next - ( 1 + c r ) c , l ( q g fb ) P n ( J c , l ( q g fb ) q . fb + t ( J . c , l ( q g fb ) q . fb + J c , l ( q g fb ) q .Math. ) ) .

    [0134] Therefore, the impact-aware constraint is obtained, and expressions of a matrix and a vector thereof are:

    [00134] C 6 , l = [ - t ( 1 + c r ) c , l ( q g fb ) P n J c , l ( q g fb ) 0 3 n F ] 3 n , l b 6 = .Math. c , l , min + ( 1 + c r ) c , l ( q g fb ) P n ( J c , l ( q g fb ) q . fb + t J . c , l ( q g fb ) q . fb ) 3 , ub 6 = .Math. c , l , max + ( 1 + c r ) c , l ( q g fb ) P n ( J c , l ( q g fb ) q . fb + t J . c , l ( q g fb ) q . fb ) 3 ,

    where l.sub.c,l,min, l.sub.c,l,maxcustom-character are an artificially specified lower limit and an artificially specified upper limit of the allowable collision impulse, respectively, and t represents a time interval between the current moment and the next moment.

    [0135] It should be understood that when the leg is the swing leg in planning or already makes contact with the ground and becomes the supporting leg, the leg does not need the impact-aware constraint. Conversely, when the leg is the supporting leg in planning but does not touch the ground (i.e., delayed contact with the ground), the leg needs to enable a corresponding impact-aware constraint.

    [0136] In an exemplary embodiment of the present disclosure, the performing, based on the movement state, the reference state sequence, and the foot-end reference state, whole-body control on the legged robot includes: if a leg is a swing leg in planning, setting the foot-end trajectory tracking task as tracking the impact-aware swing leg trajectory, setting a target foot-sole force of the foot-sole force tracking task as a predetermined value, setting a foot-sole force constraint in the foot-sole force inequality constraint as a predetermined value, and disabling the impact-aware constraint; if a leg is the supporting leg in planning and touches the ground, setting a target linear acceleration of the foot-end trajectory tracking task as a predetermined value, setting the target foot-sole force of the foot-sole force tracking task as a foot-sole force provided by MPC or another module, setting the foot-sole force constraint as a friction cone constraint, and disabling the impact-aware constraint; and if a leg is a supporting leg in planning but does not touch the ground, setting a target of the foot-end trajectory tracking task as tracking a velocity pointing to an collision surface, setting the target foot-sole force of the foot-sole force tracking task as a predetermined value, setting the foot-sole force constraint as a predetermined value, and enabling the impact-aware constraint.

    [0137] A module that can provide the target foot-sole force for the foot-sole force tracking task may include the above MPC module. The predetermined value of the target foot-sole force of the foot-sole force tracking task, the predetermined value of the foot-sole force constraint in the inequality constraint, and the predetermined value of the target line acceleration for the tracking task may be 0. In the embodiments of the present disclosure, a predetermined value of 0 as an example is described.

    [0138] It should be noted that the embodiments of the present disclosure can further predict an effect of the collision on a joint space, such as predicting a torque effect of the collision on the joint caused by a collision impulse mapped onto each joint. However, under normal circumstances, as long as an impulse caused by the collision in the operation space is small enough, the effect of the collision in the joint space may also not be significant. To maximize a computational efficiency of the WBC, the impact-aware constraint in the embodiments of the present disclosure is only limited to the operation space, which is consistent with the trajectory optimization method in the above embodiments.

    IV. Implementation Decision of Whole-Body Control

    [0139] It should be understood that in the WBC of the embodiments of the present disclosure, there are always three unchanging task settings, namely the trunk trajectory tracking task, the task of minimizing variation of the joint torque, and the task of minimizing variation of the foot-sole force. There are always four unchanging constraint settings, namely the floating-base dynamic equality constraint, a motor output torque saturation inequality constraint, a motor output rotational speed saturation inequality constraint, and a motor output power saturation inequality constraint. Other tasks and constraints vary under different circumstances, specifically the foot-end trajectory tracking task, the foot-sole force tracking task, the foot-sole force inequality constraint, and the impact-aware constraint.

    [0140] It should be noted that as illustrated in FIG. 3, when the leg is the swing leg in planning, if the WBC enables the corresponding impact-aware constraint while the leg acts as the swing leg, there are following two scenarios. In one scenario, since the TO already includes the impact-aware constraint, a reference linear velocity of the foot end of the leg is inherently very small, in this case, the optimal solution from WBC optimization does not lie on a boundary of the corresponding impact-aware constraint, that is, the corresponding impact-aware constraint in the WBC does not take effect. In another scenario, the optimal solution from WBC optimization lies on the boundary of the corresponding impact-aware constraint, meaning this constraint takes effect, a movement velocity of the foot end of the leg may be even lower than the reference linear velocity given by the TO, therefore, ground contact cannot be achieved by the foot end of the leg at a designated ground contact time point by the TO, that is, delayed contact with the ground occurs. From this, it may be concluded that when the leg is the swing leg in planning, if the impact-aware constraint of the leg is enabled in the WBC, no effect or a negative effect may occur. Therefore, the impact-aware constraint in the WBC may only be enabled upon occurrence of contact with the ground.

    [0141] Further, when the leg is the supporting leg in planning but does not touch the ground (i.e., delayed contact with the ground), a target of the foot-end trajectory tracking task is to track a velocity .sub.impn pointing to the collision surface, where .sub.imp does not need to be set too small, otherwise significant delayed contact with the ground may occur. However, there is no need to consider setting a large .sub.imp which may lead to a large collision velocity, since the impact-aware constraint can limit a velocity of the foot end. Each leg of the legged robot in the embodiments of the present disclosure can perform judgment according to the decision tree illustrated in FIG. 3, thereby determining expressions of all tasks and constraints, i.e., determining an expression of the WQP.

    [0142] In summary, with the planning and control method for the legged robot according to the embodiments of the present disclosure, simplification of the foot-end dynamic model and the trajectory optimization of the discrete collision model can be performed. For an issue of an early collision, planning is performed during swinging to enable an influence caused by the early collision to be within the target constraint range. Also, the whole-body control can be performed on the legged robot based on the whole-body dynamic model and the discrete collision model. For an issue of the delayed collision, processing is performed at a control stage to enable an influence caused by the delayed collision to be within the target constraint range. By concurrently addressing the early collision and the delayed collision, the embodiments of the present disclosure can mitigate an impact force generated at an instant of collision between the foot sole and the ground, which can further reduce an influence of the collision. Therefore, stability of the movement state of the robot can be enhanced, improving a hardware service life of the robot.

    [0143] Then, a planning and control apparatus for the legged robot according to the embodiments of the present disclosure is described with reference to the accompanying drawings.

    [0144] FIG. 4 is a block diagram of the planning and control apparatus for the legged robot according to an embodiment of the present disclosure.

    [0145] As illustrated in FIG. 4, a planning and control apparatus 10 for the legged robot includes: an obtaining module 100, a generation module 200, a planning module 300, and a control module 400.

    [0146] The obtaining module 100 is configured to obtain a movement instruction and a movement state of the legged robot. The generation module 200 is configured to generate, based on the movement instruction and the movement state, a reference state sequence of the legged robot and a swing parameter of each leg at a next moment. The planning module 300 is configured to determine, based on the movement state and the swing parameter of each leg at the next moment, a foot-end reference state of each leg, and plan, based on a foot-end dynamic model and a discrete collision model, an impact-aware swing leg trajectory for a leg that starts to swing at the next moment, to enable an influence caused by an early collision to be within a target constraint range. The control module 400 is configured to perform, based on the movement state, the reference state sequence, and the foot-end reference state, whole-body control on the legged robot, and perform, based on a whole-body dynamic model and the discrete collision model, impact-aware whole-body control for a leg that is a supporting leg in planning but does not touch the ground, to enable an influence caused by a delayed collision to be within the target constraint range.

    [0147] In the embodiments of the present disclosure, the foot-end dynamic model of the planning and control apparatus for the legged robot is:

    [00135] c , l x .Math. c , l + h c , l = F j ,

    where {umlaut over (x)}.sub.c,lcustom-character is the linear acceleration of the foot end of the l-th leg in the inertial system I, .sub.c,l is the mass matrix in the operation space, h.sub.c,l is the term including the Coriolis force, the centripetal force, and the gravitational force in the operation space, and F.sub.jcustom-character is the foot-end driving force obtained by mapping the torque .sub.j of the driving joint to the operation space. The discrete collision model is:

    [00136] x . c , l = P n ( x . 1 + - x . 1 - ) = - ( 1 + c r ) P n x . c , l - ,

    [0148] where P.sub.n=nn.sup.Tcustom-character is the projection operator on the collision normal vector, ncustom-character is the unit normal vector of the collision surface,

    [00137] x . 1 + x . 1 - 3

    are the velocity of the first object before collision and the velocity of the first object after the collision, respectively,

    [00138] x . 2 + , x . 2 - 3

    are the velocity of the second object before collision and the velocity of the second object after the collision, respectively, and c.sub.r is the restitution coefficient.

    [0149] In the embodiments of the present disclosure, the planning module is further configured to: obtain the pre-defined state variable and the target constraint condition; construct, based on the foot-end dynamic model, the pre-defined state variable, and the target constraint condition, the continuous-time trajectory optimization problem for the leg that starts to swing at the next moment; and discretize the continuous-time trajectory optimization problem to obtain the discrete-time trajectory optimization problem for the foot end of the swing leg, and solve the discrete-time trajectory optimization problem to obtain the impact-aware swing leg trajectory.

    [0150] In the embodiments of the present disclosure, the pre-defined state variable of the planning module includes one or more of: the initial state of the foot end of the swing leg, the touchdown state of the foot end of the swing leg, the swing duration, and the desired maximum height of the foot end of the swing leg from the ground. The target constraint condition includes one or more of: the state equation equality constraint, the driving force inequality constraint, the trajectory height inequality constraint, the initial state equality constraint, the terminal state equality constraint, the impact-aware inequality constraint, and the terminal velocity direction inequality constraint.

    [0151] In the embodiments of the present disclosure, the objective function of the continuous-time trajectory optimization problem of the planning module is:

    [00139] min x ( t ) , u ( t ) f TO = .Math. x ( t F ) - [ x c , F ref x . c , F ref ] .Math. Q x F + t 0 t F .Math. u ( ) .Math. Q u d + t h 1 t h 2 .Math. z c ( ) - z h ref .Math. Q z d ,

    where Q.sub.x.sub.Fcustom-character, Q.sub.ucustom-character, and Q.sub.zcustom-character are weight matrices (mostly diagonal matrices) with different dimensions, a=a.sup.TQa represents the weighted norm of the vector a under the weight matrix Q,

    [00140] .Math. x ( t F ) - [ x c , F ref x . c , F ref ] .Math. Q x F

    reflects the task of the touchdown state of the foot end of the swing leg,

    [00141] x c , F ref 3 and x . c , F ref 3

    are the known terminal position of the foot end of the swing leg and the known linear velocity of the foot end of the swing leg, respectively,

    [00142] t 0 t F .Math. u ( ) .Math. Q u d

    is the minimum control variable (i.e., the linear acceleration) in the entire swing process, and t.sub.0=0, t.sub.F=T.sub.sw, where T.sub.sw is the swing duration,

    [00143] t h 1 t h 2 .Math. z c ( ) - z h ref .Math. Q z d

    reflects the task of the maximum height of the swing leg from the ground, t.sub.h1 and t.sub.h2 are parameters specifying the time period to reach the maximum height, satisfying t.sub.0t.sub.h1t.sub.h2t.sub.F, and z.sub.c is the third component of the state variable, i.e., the component representing the height of the foot end from the ground in the state variable. The discrete-time trajectory optimization problem is:

    [00144] min U f c , TO = .Math. x N - x N ref .Math. Q x N + .Math. k = 0 N - 1 .Math. u k .Math. Q u k + .Math. k = k h 1 k h 2 .Math. S z x k - z h ref .Math. Q z k , s . t . [ x c , k + 1 x . c , k + 1 ] x k + 1 = [ I 3 3 tI 3 3 0 3 3 I 3 3 ] A [ x c , k x . c , k ] x k + [ 1 2 t 2 I 3 3 tI 3 3 ] B x .Math. c , k u k , k = 0 , TagBox[",", "NumberComma", Rule[SyntaxForm, "0"]] 1 , .Math. , N - 1 , f min c u k + h c f max , k = 0 , TagBox[",", "NumberComma", Rule[SyntaxForm, "0"]] 1 , .Math. , N - 1 ,

    [00145] z c , min S z x k z c , max , k = 1 , TagBox[",", "NumberComma", Rule[SyntaxForm, "0"]] 2 , .Math. , N - 1 , x 0 = x 0 fb , S z , z . x N = S z , z . x N ref , .Math. c , min c [ - ( 1 + c r ) P n S v x k ] .Math. c , max , k = k imp , k imp + 1 , .Math. , N , ( C 1 + 1 cos c , max D n ) S v x . k 0 4 1 , k = k imp , k imp + 1 , .Math. , N .

    where

    [00146] U = [ u 0 T , u 1 T , .Math. , u N - 1 T ] T 3 N

    is the vector composed of the control variable of each frame, Q.sub.x.sub.Ncustom-character, Q.sub.u.sub.kcustom-character, and Q.sub.z.sub.kcustom-character are diagonal weight matrices with different dimensions,

    [00147] x 0 f b = [ x c , 0 fb x . c , 0 fb ] 6

    is the feedback of the foot-end state (including the position and the velocity) at the current moment,

    [00148] x N ref = [ x c , F ref x . c , F ref ] 6

    is the reference terminal foot-end state (including the position and the velocity), S.sub.[0.sub.33I.sub.33]custom-character is the selection matrix of the foot-end linear velocity, k.sub.h.sub.1 and k.sub.h.sub.2 are the artificially specified start frame and the artificially specified end frame for maintaining the swing height, satisfying 0k.sub.h1k.sub.h.sub.2<N, and k.sub.imp is the start frame for enabling the impact-aware constraint and the terminal velocity direction constraint, satisfying 0k.sub.impN.

    [0152] In the embodiments of the present disclosure, the optimization problem of the whole-body control of the planning and control apparatus for the legged robot is:

    [00149] min .Math. i = 1 n task .Math. W i ( A i - b i ) .Math. 2 2 , s . t . l b j C j ub j , j = 1 , TagBox[",", "NumberComma", Rule[SyntaxForm, "0"]] 2 , .Math. , n constraint ,

    where A.sub.i is the task matrix, b.sub.i is the task vector, c.sub.j is the constraint matrix, lb.sub.j and ub.sub.j are the lower constraint bound and the upper constraint bound, W.sub.i is the weight matrix, n.sub.task is the quantity of tasks, and n.sub.constraint is the quantity of constraints.

    [0153] In the embodiments of the present disclosure, the tasks processed simultaneously by the whole-body control include the two or more of: the trunk trajectory tracking task, the foot-end trajectory tracking task, the foot-sole force tracking task, the task of minimizing variation of a joint torque, and the task of minimizing variation of the foot-sole force. The constraints processed simultaneously by the impact-aware whole-body control include the two or more of: the floating-base dynamic equality constraint, the foot-sole force inequality constraint, the joint output torque saturation inequality constraint, the joint rotational speed saturation inequality constraint, the joint output power saturation inequality constraint, and the impact-aware constraint.

    [0154] In the embodiments of the present disclosure, the performing, based on the movement state, the reference state sequence, and the foot-end reference state, whole-body control on the legged robot includes: if the leg is the swing leg in planning, setting the foot-end trajectory tracking task as tracking the impact-aware swing leg trajectory, setting the target foot-sole force of the foot-sole force tracking task as the predetermined value, setting the foot-sole force constraint in the foot-sole force inequality constraint as the predetermined value, and disabling the impact-aware constraint; if the leg is the supporting leg in planning and touches the ground, setting the target linear acceleration of the foot-end trajectory tracking task as the predetermined value, setting the target foot-sole force of the foot-sole force tracking task as the foot-sole force provided by the MPC or another module, setting the foot-sole force constraint as the friction cone constraint, and disabling the impact-aware constraint; and if the leg is the supporting leg in planning but does not touch the ground, setting the target of the foot-end trajectory tracking task as tracking the velocity pointing to the collision surface, setting the target foot-sole force of the foot-sole force tracking task as the predetermined value, setting the foot-sole force constraint as the predetermined value, and enabling the impact-aware constraint.

    [0155] In the embodiments of the present disclosure, the whole-body dynamic model of the planning and control apparatus for the legged robot is:

    [00150] M ( q g ) q .Math. + h ( q g , q ) = [ 0 6 1 j ] + J c T ( q g ) F c ,

    where M(q.sub.g)custom-character is the generalized mass matrix, h(q.sub.g,{dot over (q)})custom-character is the term including the Coriolis force, the centripetal force, and the gravitational force, .sub.jcustom-character represents the output torque of the driving joint, 0.sub.nm represents the zero matrix with the size of nm,

    [00151] J c T ( q g )

    and F.sub.c are the augmented Jacobian matrix formed by stacking the contact Jacobian matrix of each supporting leg and the augmented foot-sole force formed by stacking the ground reaction force on the foot sole of each supporting leg, respectively, q.sub.g is the generalized joint space position, {dot over (q)} is the generalized joint space velocity, and {umlaut over (q)} is the generalized joint space acceleration. Expressions for a matrix and a vector of the impact-aware constraint are:

    [00152] C 6 , l = [ - t ( 1 + c r ) c , l ( q g fb ) P n J c , l ( q g fb ) 0 3 n F ] 3 n , l b 6 = .Math. c , l , min + ( 1 + c r ) c , l ( q g fb ) P n ( J c , l ( q g fb ) q . fb + t J . c , l ( q g fb ) q . fb ) 3 , u b 6 = .Math. c , l , max + ( 1 + c r ) c , l ( q g fb ) P n ( J c , l ( q g fb ) q . fb + t J . c , l ( q g fb ) q . fb ) 3 ,

    where l.sub.c,l,min, l.sub.c,l,maxcustom-character are the artificially specified lower limit of the allowable collision impulse and the artificially specified upper limit of the allowable collision impulse, respectively, and t represents the time interval between the current moment and the next moment.

    [0156] It should be noted that explanation and description for the embodiment of the planning and control method of the legged robot mentioned above is also applicable to the planning and control apparatus of the legged robot of the embodiment, and thus details thereof will be omitted here.

    [0157] With the planning and control apparatus for the legged robot according to the embodiments of the present disclosure, simplification of the foot-end dynamic model and the trajectory optimization of the discrete collision model can be performed. For an issue of an early collision, planning is performed during swinging to enable an influence caused by the early collision to be within the target constraint range. Also, the whole-body control can be performed on the legged robot based on the whole-body dynamic model and the discrete collision model. For an issue of the delayed collision, processing is performed at a control stage to enable an influence caused by the delayed collision to be within the target constraint range. By concurrently addressing the early collision and the delayed collision, the embodiments of the present disclosure can mitigate an impact force generated at an instant of collision between the foot sole and the ground, which can further reduce an influence of the collision. Therefore, stability of the movement state of the robot can be enhanced, improving a hardware service life of the robot.

    [0158] FIG. 5 is a schematic structural diagram of a legged robot according to an embodiment of the present disclosure. The legged robot may include a memory 501, a processor 502, and a computer program stored on the memory 501 and executable on the processor 502. The processor 502 is configured to, when executing the program, implement the planning and control method for the legged robot according to the above embodiments.

    [0159] Further, the legged robot further includes a communication interface 503 for communication between the memory 501 and the processor 502. The memory 501 is configured to store the computer program executable on the processor 502. The memory 501 may include a high-speed Random Access Memory (RAM), and may also include a non-volatile memory, such as at least one magnetic disk memory.

    [0160] If the memory 501, the processor 502, and the communication interface 503 are implemented independently, the communication interface 503, the memory 501, and the processor 502 can be connected to one another and in communication with one another through a bus. The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be classified into an address bus, a data bus, a control bus, etc. For ease of representation, in FIG. 5, the bus is represented by only one thick line, which does not mean that there is only one bus or one type of bus.

    [0161] In another exemplary embodiment of the present disclosure, in a specific implementation, if the memory 501, the processor 502, and the communication interface 503 are integrated at a chip to be implemented, mutual communication between the memory 501, the processor 502, and the communication interface 503 can be completed through an internal interface.

    [0162] The processor 502 may be a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present disclosure.

    [0163] The embodiments of the present disclosure further provide a computer-readable storage medium. The computer-readable storage medium has a computer program stored thereon. The program is configured to, when executed by a processor, implement the planning and control method for the legged robot according to the above.

    [0164] In the present disclosure, the description with reference to the terms one embodiment, some embodiments, an example, a specific example, or some examples, etc., means that specific features, structures, materials, or characteristics described in conjunction with the embodiment(s) or example(s) are included in at least one embodiment or example of the present disclosure. In the present disclosure, any illustrative reference of the above terms does not necessarily refer to the same embodiment(s) or example(s). Further, the particular features, structures, materials, or characteristics may be combined in any suitable manner in any one or N embodiments or examples. In addition, different embodiments or examples and features of different embodiments or examples described in the specification may be combined by those skilled in the art without mutual contradiction.

    [0165] In addition, the terms such as first and second are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Therefore, the features associated with first and second may explicitly or implicitly include at least one of the features. In the description of the present disclosure, N means at least two, for example, two or three, unless otherwise specifically defined.

    [0166] Any process or method described in the flowchart or otherwise depicted herein may be construed as representing modules, segments, or portions of code which include one or N executable instructions for implementing custom logic functions or processes. In addition, a scope of preferred embodiments of the present disclosure includes alternative implementations in which functions may be executed in an order different from that shown or discussed, instead in a substantially concurrently order or in a reverse order, which should be appreciated by those skilled in the art to which the embodiments of the present disclosure pertain.

    [0167] It can be appreciated that each part of the present disclosure can be implemented in hardware, software, firmware or any combination thereof. In the above embodiments, N steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, when implemented in hardware, as in another embodiment, it can be implemented by any one or combination of the following technologies known in the art: a discrete logic circuit having logic gate circuits for implementing logic functions on data signals, an application-specific integrated circuit with suitable combined logic gates, a programmable gate array, a field programmable gate array, etc.

    [0168] Those skilled in the art can appreciate that all or part of the steps carried by the method of implementing the above embodiments can be performed by instructing the relevant hardware through the program that can be stored in a computer-readable storage medium. The program, when being executed, includes one or a combination of the steps of the method embodiment.

    [0169] Although the embodiments of the present disclosure have been shown and described above, it should be understood that the above-mentioned embodiments are exemplary and should not be construed as limiting the present disclosure. Those skilled in the art can make changes, modifications, substitutions, and alternations to the above-mentioned embodiments within the scope of the present disclosure.