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);
31 void setAcceleration(float acceleration);
33 void getLaunchbarMount(float* out);
34 void getHoldbackMount(float* out);
35 const char* getState(void);
36 float getLength(void);
37 float getHoldbackLength(void);
38 float getDownAngle(void);
39 float getUpAngle(void);
40 float getExtension(void);
43 void getTipPosition(float* out);
44 void getHoldbackTipPosition(float* out);
45 float getTipPos(int i);
46 float getHoldbackTipPos(int i);
47 void getTipGlobalPosition(State* s, double* out);
49 float getPercentPosOnCat(float* lpos, float off, float lends[2][3]);
50 void getPosOnCat(float perc, float* lpos, float* lvel,
51 float lends[2][3], float lendvels[2][3]);
53 // Takes a velocity of the aircraft relative to ground, a rotation
54 // vector, and a ground plane (all specified in local coordinates)
55 // and make a force and point of application (i.e. ground contact)
56 // available via getForce().
57 void calcForce(Ground *g_cb, RigidBody* body, State* s,
58 float* lv, float* lrot);
60 // Computed values: total force, weight-on-wheels (force normal to
61 // ground) and compression fraction.
62 void getForce(float* force1, float* off1, float* force2, float* off2);
63 float getCompressFraction(void);
64 float getHoldbackCompressFraction(void);
66 float getHoldbackAngle(void);
67 float getLaunchbarPos(int i);
68 float getHoldbackPos(int j);
71 float _launchbar_mount[3];
72 float _holdback_mount[3];
74 float _holdback_length;
80 float _launchbar_force[3];
81 float _holdback_force[3];
87 double _global_ground[4];
93 #endif // _LAUNCHBAR_HPP