[10] | 1 | // %flair:license{
|
---|
[15] | 2 | // This file is part of the Flair framework distributed under the
|
---|
| 3 | // CECILL-C License, Version 1.0.
|
---|
[10] | 4 | // %flair:license}
|
---|
[8] | 5 | // created: 2012/08/21
|
---|
| 6 | // filename: X4.h
|
---|
| 7 | //
|
---|
| 8 | // author: Osamah Saif, Guillaume Sanahuja
|
---|
| 9 | // Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
| 10 | //
|
---|
| 11 | // version: $Id: $
|
---|
| 12 | //
|
---|
| 13 | // purpose: classe definissant un x4
|
---|
| 14 | //
|
---|
| 15 | /*********************************************************************/
|
---|
| 16 |
|
---|
| 17 | #ifndef X4_H
|
---|
| 18 | #define X4_H
|
---|
| 19 |
|
---|
| 20 | #include <Model.h>
|
---|
| 21 | #include <stdint.h>
|
---|
| 22 | #include <stdio.h>
|
---|
| 23 |
|
---|
[15] | 24 | namespace flair {
|
---|
| 25 | namespace core {
|
---|
| 26 | class Mutex;
|
---|
[8] | 27 | }
|
---|
[15] | 28 | namespace gui {
|
---|
| 29 | class DoubleSpinBox;
|
---|
| 30 | }
|
---|
| 31 | namespace actuator {
|
---|
| 32 | class SimuBldc;
|
---|
| 33 | }
|
---|
| 34 | }
|
---|
[8] | 35 |
|
---|
| 36 | #ifdef GL
|
---|
[15] | 37 | namespace irr {
|
---|
| 38 | namespace scene {
|
---|
| 39 | class IMesh;
|
---|
[8] | 40 | }
|
---|
[15] | 41 | }
|
---|
[8] | 42 | #endif
|
---|
| 43 |
|
---|
[15] | 44 | namespace flair {
|
---|
| 45 | namespace simulator {
|
---|
| 46 | class Simulator;
|
---|
| 47 | class Blade;
|
---|
| 48 | class MeshSceneNode;
|
---|
[8] | 49 |
|
---|
[15] | 50 | class X4 : public Model {
|
---|
| 51 | public:
|
---|
| 52 | X4(const Simulator *parent, std::string name, int dev_id);
|
---|
| 53 | ~X4();
|
---|
[8] | 54 | #ifdef GL
|
---|
[15] | 55 | virtual void Draw(void);
|
---|
| 56 | virtual void ExtraDraw(void){};
|
---|
[8] | 57 |
|
---|
[15] | 58 | protected:
|
---|
| 59 | irr::scene::IMesh *red_arm, *black_arm, *motor;
|
---|
| 60 | MeshSceneNode *fl_arm, *fr_arm, *rl_arm, *rr_arm;
|
---|
| 61 | MeshSceneNode *fl_motor, *fr_motor, *rl_motor, *rr_motor;
|
---|
| 62 | Blade *fl_blade, *fr_blade, *rl_blade, *rr_blade;
|
---|
| 63 | core::Mutex *motor_speed_mutex;
|
---|
[8] | 64 | #endif
|
---|
[15] | 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 | #endif
|
---|
[8] | 74 |
|
---|
[15] | 75 | actuator::SimuBldc *motors;
|
---|
| 76 | float motor_speed[4];
|
---|
| 77 | gui::DoubleSpinBox *m, *arm_length, *l_cg;
|
---|
| 78 | gui::DoubleSpinBox *k_mot, *c_mot;
|
---|
| 79 | gui::DoubleSpinBox *f_air_vert, *f_air_lat;
|
---|
| 80 | gui::DoubleSpinBox *j_roll, *j_pitch, *j_yaw;
|
---|
| 81 | };
|
---|
[8] | 82 | } // end namespace simulator
|
---|
| 83 | } // end namespace flair
|
---|
| 84 | #endif // X4_H
|
---|