10 // A launchbar has the following parameters:
12 // position: a point in the aircraft's local coordinate system where the
13 // fully-extended wheel will be found.
17 enum LBState { Arrested, Launch, Unmounted, Completed };
21 // Externally set values
22 void setLaunchbarMount(float* position);
23 void setHoldbackMount(float* position);
24 void setLength(float length);
25 void setHoldbackLength(float length);
26 void setDownAngle(float ang);
27 void setUpAngle(float ang);
28 void setExtension(float extension);
29 void setLaunchCmd(bool cmd);
30 void setGlobalGround(double *global_ground);
32 void getLaunchbarMount(float* out);
33 void getHoldbackMount(float* out);
34 const char* getState(void);
35 float getLength(void);
36 float getHoldbackLength(void);
37 float getDownAngle(void);
38 float getUpAngle(void);
39 float getExtension(void);
42 void getTipPosition(float* out);
43 void getHoldbackTipPosition(float* out);
44 float getTipPos(int i);
45 float getHoldbackTipPos(int i);
46 void getTipGlobalPosition(State* s, double* out);
48 float getPercentPosOnCat(float* lpos, float off, float lends[2][3]);
49 void getPosOnCat(float perc, float* lpos, float* lvel,
50 float lends[2][3], float lendvels[2][3]);
52 // Takes a velocity of the aircraft relative to ground, a rotation
53 // vector, and a ground plane (all specified in local coordinates)
54 // and make a force and point of application (i.e. ground contact)
55 // available via getForce().
56 void calcForce(Ground *g_cb, RigidBody* body, State* s,
57 float* lv, float* lrot);
59 // Computed values: total force, weight-on-wheels (force normal to
60 // ground) and compression fraction.
61 void getForce(float* force1, float* off1, float* force2, float* off2);
62 float getCompressFraction(void);
63 float getHoldbackCompressFraction(void);
65 float getHoldbackAngle(void);
66 float getLaunchbarPos(int i);
67 float getHoldbackPos(int j);
70 float _launchbar_mount[3];
71 float _holdback_mount[3];
73 float _holdback_length;
79 float _launchbar_force[3];
80 float _holdback_force[3];
86 double _global_ground[4];
91 #endif // _LAUNCHBAR_HPP