@margoengine/ragdoll 0.1.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/balance.d.ts CHANGED
@@ -67,10 +67,13 @@ export declare class RagdollBalance {
67
67
  private readonly gravity;
68
68
  private readonly hipsOverFeet;
69
69
  private readonly off;
70
+ private readonly offForces;
70
71
  private disposed;
71
72
  /** How far through {@link SETTLE_TIME}, 0 to 1. */
72
73
  private settled;
73
74
  private stanceNow;
75
+ /** The height the hips are held to over the ankles at this step: `stance`, or lower while a step needs it, see {@link control}. */
76
+ private held;
74
77
  /** False until the first step, when added inertia takes effect: see {@link control}. */
75
78
  private primed;
76
79
  /** Each bone's force and torque for this step, xyz each, and what the bodies hold from the last. */
@@ -103,6 +106,14 @@ export declare class RagdollBalance {
103
106
  /** Adds to what bone `part` is given this step, N and N m. */
104
107
  private give;
105
108
  private control;
109
+ /** The hip joint to ankle length at its longest as {@link driveLeg} drives it: 0.999 of thigh and shin, or as the knee's limit allows. */
110
+ private longest;
111
+ /** The hips' height over the ankles at which `leg`, its hip joint over `hips` across the ground, reaches `foot` at its {@link longest}. */
112
+ private reachHeight;
113
+ /** How far a step may reach from the stance foot `leg`: {@link LONGEST_STEP} of the stature its hip joint over its sole gives. */
114
+ private stepLength;
115
+ /** Where over a planted foot the body is held: the ankle, or forward of it until {@link STANCE_HEEL} of the sole is behind. */
116
+ private aim;
106
117
  /** The centre of mass of the whole body, and its velocity. */
107
118
  private massCentre;
108
119
  /**
@@ -149,10 +160,53 @@ export declare class RagdollBalance {
149
160
  private carryWeight;
150
161
  /** The turn this step gives the upper body toward how it stood, about its own centre of mass. */
151
162
  private uprightTurn;
163
+ /**
164
+ * How far the sole reaches from the ankle across the ground as the foot lies now: its four corners turned with the foot. A foot
165
+ * tipped onto its heel has the heel nearer under the ankle than flat (back cos a - h sin a, h the ankle over the sole), so the
166
+ * turn its heel can answer is that much less. Reckoned flat, the bound let a tipped foot be turned further onto its heel than
167
+ * the heel could hold, and a stance foot through a step had no bound at all: Seed-san's stance foot rolled to 0.9 rad on its
168
+ * heel through one step (KB2208, fault 3).
169
+ */
170
+ private soleNow;
152
171
  /** The capture point: the centre of mass plus its velocity over the pendulum's natural frequency, on the ground. */
153
172
  private capturePoint;
154
173
  /** How far the capture point lies from the line between two planted feet, across the ground. */
155
174
  private outside;
175
+ /** True when the capture point lies inside the sole of one planted foot, across the ground. */
176
+ private over;
177
+ /**
178
+ * Brings the feet back beside each other once a step has caught the body. With no step called for and the capture point
179
+ * inside one planted sole, that foot alone stops the fall (zero-step capturable: T. Koolen et al., "Capturability-based
180
+ * analysis and control of legged locomotion, Part 1", IJRR 2012), so the other foot is free: if it stands farther than
181
+ * `stepTrigger` from its rest place beside that one, it steps there, and the stance is two feet wide again for the next push.
182
+ * A foot the capture point is also over, carrying more of the weight, is the one that stays. With the step-time bound of
183
+ * {@link stepDuration}, the KB2208 speed bands fall fewer and no band falls more (docs/known-bugs.md).
184
+ */
185
+ private gather;
186
+ /**
187
+ * The foot to carry the weight over before the feet are gathered, or null. {@link gather} frees a foot once the other alone
188
+ * stops the fall, the capture point inside its sole (zero-step capturable: T. Koolen et al., IJRR 2012). A body held at the
189
+ * midpoint of two feet whose soles do not reach it never meets that: no step is called for, the point being near the line
190
+ * between the feet, and none is gathered. Holding it over the stood-on point ({@link aim}) of the foot nearer the capture point
191
+ * is the least that does. It acts only with both feet down, the capture point over neither sole and the feet farther than
192
+ * `stepTrigger` from their rest stance, the measure `gather` uses.
193
+ *
194
+ * It is gated on a foot whose heel is shorter than {@link STANCE_HEEL} of its sole, the test `aim` already makes, so it acts
195
+ * for Seed-san alone: a short heel cannot hold the capture point fore and aft. On every other figure the same carry costs
196
+ * steps and falls, since a landed foot that bears no load still skates. The gate is a special case until the follow-through
197
+ * for every figure lifts it (KB-RAGDOLL-FOLLOWTHROUGH1, docs/known-bugs.md).
198
+ */
199
+ private carryOver;
200
+ /**
201
+ * True when the capture point lies outside the base of support, the convex hull of both planted soles across the ground.
202
+ * With both feet down the body is zero-step capturable only while the capture point lies in the base of support (J. Rebula,
203
+ * T. Koolen, T. de Boer, J. Pratt, draft of "Capturability-based analysis and control of legged locomotion", Part 1, March
204
+ * 2011, Corollaries 2 and 3, in T. Koolen, MSc thesis, TU Delft, 2011), and the ankle strategy holds only that long (B.
205
+ * Stephens, "Push recovery control for force-controlled humanoid robots", PhD thesis, CMU-RI-TR-11-15, 2011, eq. 3.15); past
206
+ * it a step is the one way back. Without this the step waited on `stepTrigger` from the line between the feet: Seed-san
207
+ * pushed backward at 0.4 m/s had its capture point behind both heels from frame 1 and stepped at frame 35, its trunk let go.
208
+ */
209
+ private offSupport;
156
210
  private startStep;
157
211
  /**
158
212
  * How long this step may take. The capture point runs away from the stance foot as e^(omega t) (J. Pratt et al., "Capture
@@ -162,6 +216,9 @@ export declare class RagdollBalance {
162
216
  * under it. The step takes no longer than the capture point needs to run from d, its distance from the stance foot now, to the
163
217
  * edge of the step's reach, ln(reach / d) / omega, as step timing adaptation chooses it (M. Khadiv, A. Herzog, S. A. A. Moosavian,
164
218
  * L. Righetti, "Walking Control Based on Step Timing Adaptation", IEEE T-RO 2020), and no less than half a natural period.
219
+ * Nor longer than the capture point takes to run past the sole put down for it: the step aims where the point is now, and
220
+ * once the point lies e outside the stance sole it runs away from that sole's edge as e e^(omega t), so it has crossed the
221
+ * m the new sole reaches beyond its ankle that way after ln(1 + m / e) / omega.
165
222
  */
166
223
  private stepDuration;
167
224
  /** True when a planted foot's ankle stands well above the ground: a push lifted it, and it carries nothing. */