Changeset 198 in flair-src for trunk/lib/FlairSensorActuator/src/Imu.cpp


Ignore:
Timestamp:
09/14/17 15:52:29 (4 years ago)
Author:
Sanahuja Guillaume
Message:

modifs imu

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairSensorActuator/src/Imu.cpp

    r187 r198  
    3333namespace sensor {
    3434
    35 Imu::Imu(string name) : IODevice(getFrameworkManager(), name) {
     35Imu::Imu(string name,bool needRotation) : IODevice(getFrameworkManager(), name) {
    3636  imuData = new ImuData(this);
    3737
     
    4141  sensorTab = new Tab(tab, "Reglages");
    4242  setupGroupbox = new GroupBox(sensorTab->NewRow(), name);
    43   rotation = new OneAxisRotation(sensorTab->NewRow(), "post rotation",OneAxisRotation::PostRotation);
     43  if(needRotation) {
     44    rotation = new OneAxisRotation(sensorTab->NewRow(), "post rotation",OneAxisRotation::PostRotation);
     45  } else {
     46    rotation=NULL;
     47  }
    4448  AddDataToLog(imuData);
    4549}
     
    6670
    6771OneAxisRotation *Imu::GetOneAxisRotation(void) const {
     72  if (rotation == NULL) {
     73    Err("not applicable\n");
     74  }
    6875  return rotation;
    6976}
     
    7178void Imu::ApplyRotation(Vector3Df& vector) {
    7279  if (rotation == NULL) {
    73     Err("not applicable for simulation part.\n");
     80    Err("not applicable\n");
    7481    return;
    7582  }
     
    7986void Imu::ApplyRotation(Quaternion& quaternion) {
    8087  if (rotation == NULL) {
    81     Err("not applicable for simulation part.\n");
     88    Err("not applicable\n");
    8289    return;
    8390  }
Note: See TracChangeset for help on using the changeset viewer.