Changeset 158 in flair-src for trunk/lib/FlairSimulator/src/X4.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/X4.cpp

    r157 r158  
    1616
    1717#include "X4.h"
    18 #include "Simulator.h"
    1918#include <SimuBldc.h>
    2019#include <TabWidget.h>
     
    4645namespace simulator {
    4746
    48 X4::X4(const Simulator *parent, std::string name, int dev_id)
    49     : Model(parent, name) {
     47X4::X4(std::string name, uint32_t modelId)
     48    : Model(name,modelId) {
    5049  Tab *setup_tab = new Tab(GetTabWidget(), "model");
    5150  m = new DoubleSpinBox(setup_tab->NewRow(), "mass (kg):", 0, 20, 0.1);
     
    7574                            5); // moment d'inertie d'un axe (N.m.s²/rad)
    7675
    77   motors = new SimuBldc(this, name, 4, dev_id);
     76  motors = new SimuBldc(this, name, 4, modelId,0);
    7877 
    7978  SetIsReady(true);
     
    9695
    9796  // cylinders are aligned with y axis
    98   red_arm = geo->createCylinderMesh(2.5, 100, 16, SColor(0, 255, 0, 0));
    99   black_arm = geo->createCylinderMesh(2.5, 100, 16, SColor(0, 128, 128, 128));
    100   motor = geo->createCylinderMesh(7.5, 15, 16); //,SColor(0, 128, 128, 128));
     97  IMesh *red_arm = geo->createCylinderMesh(2.5, 100, 16, SColor(0, 255, 0, 0));
     98  IMesh *black_arm = geo->createCylinderMesh(2.5, 100, 16, SColor(0, 128, 128, 128));
     99  IMesh *motor = geo->createCylinderMesh(7.5, 15, 16); //,SColor(0, 128, 128, 128));
    101100  // geo->drop();
    102101
    103102  ITexture *texture = getGui()->getTexture("carbone.jpg");
    104   fl_arm = new MeshSceneNode(this, red_arm, vector3df(0, 0, 0),
     103  MeshSceneNode *fl_arm = new MeshSceneNode(this, red_arm, vector3df(0, 0, 0),
    105104                             vector3df(0, 0, -135));
    106   fr_arm = new MeshSceneNode(this, red_arm, vector3df(0, 0, 0),
     105  MeshSceneNode *fr_arm = new MeshSceneNode(this, red_arm, vector3df(0, 0, 0),
    107106                             vector3df(0, 0, -45));
    108   rl_arm = new MeshSceneNode(this, black_arm, vector3df(0, 0, 0),
     107  MeshSceneNode *rl_arm = new MeshSceneNode(this, black_arm, vector3df(0, 0, 0),
    109108                             vector3df(0, 0, 135), texture);
    110   rr_arm = new MeshSceneNode(this, black_arm, vector3df(0, 0, 0),
     109  MeshSceneNode *rr_arm = new MeshSceneNode(this, black_arm, vector3df(0, 0, 0),
    111110                             vector3df(0, 0, 45), texture);
    112111
    113112  texture = getGui()->getTexture("metal047.jpg");
    114   fl_motor = new MeshSceneNode(this, motor, vector3df(70.71, -70.71, 2.5),
     113  MeshSceneNode *fl_motor = new MeshSceneNode(this, motor, vector3df(70.71, -70.71, 2.5),
    115114                               vector3df(90, 0, 0), texture);
    116   fr_motor = new MeshSceneNode(this, motor, vector3df(70.71, 70.71, 2.5),
     115  MeshSceneNode *fr_motor = new MeshSceneNode(this, motor, vector3df(70.71, 70.71, 2.5),
    117116                               vector3df(90, 0, 0), texture);
    118   rl_motor = new MeshSceneNode(this, motor, vector3df(-70.71, -70.71, 2.5),
     117  MeshSceneNode *rl_motor = new MeshSceneNode(this, motor, vector3df(-70.71, -70.71, 2.5),
    119118                               vector3df(90, 0, 0), texture);
    120   rr_motor = new MeshSceneNode(this, motor, vector3df(-70.71, 70.71, 2.5),
     119  MeshSceneNode *rr_motor = new MeshSceneNode(this, motor, vector3df(-70.71, 70.71, 2.5),
    121120                               vector3df(90, 0, 0), texture);
    122121
Note: See TracChangeset for help on using the changeset viewer.