Changeset 158 in flair-src for trunk/lib/FlairSimulator/src/X8.cpp


Ignore:
Timestamp:
Mar 5, 2017, 10:50:56 AM (5 years ago)
Author:
Sanahuja Guillaume
Message:

corrected simu/device id for sensors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairSimulator/src/X8.cpp

    r157 r158  
    1616
    1717#include "X8.h"
    18 #include "Simulator.h"
    1918#include <SimuBldc.h>
    2019#include <TabWidget.h>
     
    4645namespace simulator {
    4746
    48 X8::X8(const Simulator *parent, std::string name, int dev_id)
    49     : Model(parent, name) {
     47X8::X8(std::string name, uint32_t modelId): Model( name,modelId) {
    5048  Tab *setup_tab = new Tab(GetTabWidget(), "model");
    5149  m = new DoubleSpinBox(setup_tab->NewRow(), "mass (kg):", 0, 20, 0.1);
     
    8482      0.1); // coefficient de forme des helices 1<S=1+Ss/Sprop<2 (sans unite)
    8583
    86   motors = new SimuBldc(this, name, 8, dev_id);
     84  motors = new SimuBldc(this, name, 8, modelId,0);
    8785 
    8886  SetIsReady(true);
     
    10199
    102100  // cylinders are aligned with y axis
    103   red_arm = geo->createCylinderMesh(2.5, 100, 16, SColor(0, 255, 0, 0));
    104   black_arm = geo->createCylinderMesh(2.5, 100, 16, SColor(0, 128, 128, 128));
    105   motor = geo->createCylinderMesh(7.5, 15, 16); //,SColor(0, 128, 128, 128));
     101  IMesh *red_arm = geo->createCylinderMesh(2.5, 100, 16, SColor(0, 255, 0, 0));
     102  IMesh *black_arm = geo->createCylinderMesh(2.5, 100, 16, SColor(0, 128, 128, 128));
     103  IMesh *motor = geo->createCylinderMesh(7.5, 15, 16); //,SColor(0, 128, 128, 128));
    106104  // geo->drop();
    107105
    108106  ITexture *texture = getGui()->getTexture("carbone.jpg");
    109   fl_arm = new MeshSceneNode(this, red_arm, vector3df(0, 0, 0),
     107  MeshSceneNode *fl_arm = new MeshSceneNode(this, red_arm, vector3df(0, 0, 0),
    110108                             vector3df(0, 0, -135));
    111   fr_arm = new MeshSceneNode(this, red_arm, vector3df(0, 0, 0),
     109  MeshSceneNode *fr_arm = new MeshSceneNode(this, red_arm, vector3df(0, 0, 0),
    112110                             vector3df(0, 0, -45));
    113   rl_arm = new MeshSceneNode(this, black_arm, vector3df(0, 0, 0),
     111  MeshSceneNode *rl_arm = new MeshSceneNode(this, black_arm, vector3df(0, 0, 0),
    114112                             vector3df(0, 0, 135), texture);
    115   rr_arm = new MeshSceneNode(this, black_arm, vector3df(0, 0, 0),
     113  MeshSceneNode *rr_arm = new MeshSceneNode(this, black_arm, vector3df(0, 0, 0),
    116114                             vector3df(0, 0, 45), texture);
    117115
    118116  texture = getGui()->getTexture("metal047.jpg");
    119   tfl_motor = new MeshSceneNode(this, motor, vector3df(70.71, -70.71, 2.5),
    120                                 vector3df(90, 0, 0), texture);
    121   tfr_motor = new MeshSceneNode(this, motor, vector3df(70.71, 70.71, 2.5),
    122                                 vector3df(90, 0, 0), texture);
    123   trl_motor = new MeshSceneNode(this, motor, vector3df(-70.71, -70.71, 2.5),
    124                                 vector3df(90, 0, 0), texture);
    125   trr_motor = new MeshSceneNode(this, motor, vector3df(-70.71, 70.71, 2.5),
    126                                 vector3df(90, 0, 0), texture);
    127 
    128   bfl_motor = new MeshSceneNode(this, motor, vector3df(70.71, -70.71, -17.5),
    129                                 vector3df(90, 0, 0), texture);
    130   bfr_motor = new MeshSceneNode(this, motor, vector3df(70.71, 70.71, -17.5),
    131                                 vector3df(90, 0, 0), texture);
    132   brl_motor = new MeshSceneNode(this, motor, vector3df(-70.71, -70.71, -17.5),
    133                                 vector3df(90, 0, 0), texture);
    134   brr_motor = new MeshSceneNode(this, motor, vector3df(-70.71, 70.71, -17.5),
     117  MeshSceneNode *tfl_motor = new MeshSceneNode(this, motor, vector3df(70.71, -70.71, 2.5),
     118                                vector3df(90, 0, 0), texture);
     119  MeshSceneNode *tfr_motor = new MeshSceneNode(this, motor, vector3df(70.71, 70.71, 2.5),
     120                                vector3df(90, 0, 0), texture);
     121  MeshSceneNode *trl_motor = new MeshSceneNode(this, motor, vector3df(-70.71, -70.71, 2.5),
     122                                vector3df(90, 0, 0), texture);
     123  MeshSceneNode *trr_motor = new MeshSceneNode(this, motor, vector3df(-70.71, 70.71, 2.5),
     124                                vector3df(90, 0, 0), texture);
     125
     126  MeshSceneNode *bfl_motor = new MeshSceneNode(this, motor, vector3df(70.71, -70.71, -17.5),
     127                                vector3df(90, 0, 0), texture);
     128  MeshSceneNode *bfr_motor = new MeshSceneNode(this, motor, vector3df(70.71, 70.71, -17.5),
     129                                vector3df(90, 0, 0), texture);
     130  MeshSceneNode *brl_motor = new MeshSceneNode(this, motor, vector3df(-70.71, -70.71, -17.5),
     131                                vector3df(90, 0, 0), texture);
     132  MeshSceneNode *brr_motor = new MeshSceneNode(this, motor, vector3df(-70.71, 70.71, -17.5),
    135133                                vector3df(90, 0, 0), texture);
    136134
Note: See TracChangeset for help on using the changeset viewer.