[9] | 1 | // %flair:license{
|
---|
[13] | 2 | // This file is part of the Flair framework distributed under the
|
---|
| 3 | // CECILL-C License, Version 1.0.
|
---|
[9] | 4 | // %flair:license}
|
---|
[8] | 5 | // created: 2014/04/03
|
---|
| 6 | // filename: X8.h
|
---|
| 7 | //
|
---|
| 8 | // author: Majd Saied, Guillaume Sanahuja
|
---|
| 9 | // Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
| 10 | //
|
---|
| 11 | // version: $Id: $
|
---|
| 12 | //
|
---|
| 13 | // purpose: classe definissant un X8
|
---|
| 14 | //
|
---|
| 15 | /*********************************************************************/
|
---|
| 16 |
|
---|
| 17 | #ifndef X8_H
|
---|
| 18 | #define X8_H
|
---|
| 19 |
|
---|
| 20 | #include <Model.h>
|
---|
| 21 | #include <stdint.h>
|
---|
| 22 |
|
---|
[13] | 23 | namespace flair {
|
---|
| 24 | namespace core {
|
---|
| 25 | class Mutex;
|
---|
[8] | 26 | }
|
---|
[13] | 27 | namespace gui {
|
---|
| 28 | class DoubleSpinBox;
|
---|
| 29 | }
|
---|
| 30 | namespace actuator {
|
---|
| 31 | class SimuBldc;
|
---|
| 32 | }
|
---|
| 33 | }
|
---|
[8] | 34 |
|
---|
| 35 | #ifdef GL
|
---|
[13] | 36 | namespace irr {
|
---|
| 37 | namespace scene {
|
---|
| 38 | class IMesh;
|
---|
[8] | 39 | }
|
---|
[13] | 40 | }
|
---|
[8] | 41 | #endif
|
---|
| 42 |
|
---|
[13] | 43 | namespace flair {
|
---|
| 44 | namespace simulator {
|
---|
| 45 | class Simulator;
|
---|
| 46 | class Blade;
|
---|
| 47 | class MeshSceneNode;
|
---|
[8] | 48 |
|
---|
[13] | 49 | class X8 : public Model {
|
---|
| 50 | public:
|
---|
| 51 | X8(const Simulator *parent, std::string name, int dev_id);
|
---|
| 52 | ~X8();
|
---|
| 53 | virtual void Draw(void);
|
---|
| 54 | virtual void ExtraDraw(void){};
|
---|
| 55 |
|
---|
| 56 | protected:
|
---|
[8] | 57 | #ifdef GL
|
---|
[13] | 58 | irr::scene::IMesh *red_arm, *black_arm, *motor;
|
---|
| 59 | MeshSceneNode *fl_arm, *fr_arm, *rl_arm, *rr_arm;
|
---|
| 60 | MeshSceneNode *tfl_motor, *tfr_motor, *trl_motor, *trr_motor;
|
---|
| 61 | MeshSceneNode *bfl_motor, *bfr_motor, *brl_motor, *brr_motor;
|
---|
| 62 | Blade *tfl_blade, *tfr_blade, *trl_blade, *trr_blade;
|
---|
| 63 | Blade *bfl_blade, *bfr_blade, *brl_blade, *brr_blade;
|
---|
[8] | 64 | #endif
|
---|
[13] | 65 | private:
|
---|
| 66 | void CalcModel(void);
|
---|
| 67 | #ifdef GL
|
---|
| 68 | bool OnEvent(const irr::SEvent &event){};
|
---|
| 69 | void AnimateModel(void);
|
---|
| 70 | size_t dbtSize(void) const;
|
---|
| 71 | void WritedbtBuf(char *dbtbuf);
|
---|
| 72 | void ReaddbtBuf(char *dbtbuf);
|
---|
| 73 | core::Mutex *motor_speed_mutex;
|
---|
| 74 | #endif
|
---|
[8] | 75 |
|
---|
[13] | 76 | actuator::SimuBldc *motors;
|
---|
| 77 | float motor_speed[8];
|
---|
| 78 | gui::DoubleSpinBox *m, *arm_length, *l_cg;
|
---|
| 79 | gui::DoubleSpinBox *k_mot, *c_mot;
|
---|
| 80 | gui::DoubleSpinBox *f_air_vert, *f_air_lat;
|
---|
| 81 | gui::DoubleSpinBox *j_roll, *j_pitch, *j_yaw;
|
---|
| 82 | gui::DoubleSpinBox *j_r, *sigma, *S;
|
---|
| 83 | };
|
---|
[8] | 84 | } // end namespace simulator
|
---|
| 85 | } // end namespace flair
|
---|
| 86 | #endif // X8_H
|
---|