Changeset 198 in flair-src for trunk/lib/FlairSensorActuator/src
- Timestamp:
- Sep 14, 2017, 3:52:29 PM (7 years ago)
- Location:
- trunk/lib/FlairSensorActuator/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairSensorActuator/src/Imu.cpp
r187 r198 33 33 namespace sensor { 34 34 35 Imu::Imu(string name ) : IODevice(getFrameworkManager(), name) {35 Imu::Imu(string name,bool needRotation) : IODevice(getFrameworkManager(), name) { 36 36 imuData = new ImuData(this); 37 37 … … 41 41 sensorTab = new Tab(tab, "Reglages"); 42 42 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 } 44 48 AddDataToLog(imuData); 45 49 } … … 66 70 67 71 OneAxisRotation *Imu::GetOneAxisRotation(void) const { 72 if (rotation == NULL) { 73 Err("not applicable\n"); 74 } 68 75 return rotation; 69 76 } … … 71 78 void Imu::ApplyRotation(Vector3Df& vector) { 72 79 if (rotation == NULL) { 73 Err("not applicable for simulation part.\n");80 Err("not applicable\n"); 74 81 return; 75 82 } … … 79 86 void Imu::ApplyRotation(Quaternion& quaternion) { 80 87 if (rotation == NULL) { 81 Err("not applicable for simulation part.\n");88 Err("not applicable\n"); 82 89 return; 83 90 } -
trunk/lib/FlairSensorActuator/src/Imu.h
r179 r198 53 53 * 54 54 * \param name name 55 * \param needRotation true will enable post rotation in GCS. Post rotation must be applied manually in reimplemented code 55 56 */ 56 Imu(std::string name );57 Imu(std::string name,bool needRotation=true); 57 58 58 59 /*! -
trunk/lib/FlairSensorActuator/src/SimuImu.cpp
r186 r198 36 36 SimuImu::SimuImu(string name, uint32_t modelId,uint32_t deviceId, 37 37 uint8_t priority) 38 : Imu(name ), Thread(getFrameworkManager(), name, priority) {38 : Imu(name,false), Thread(getFrameworkManager(), name, priority) { 39 39 dataRate = 40 40 new SpinBox(GetGroupBox()->NewRow(), "data rate", " Hz", 1, 500, 1, 200); … … 117 117 Vector3Df rawMag(state.mx, state.my, state.mz); 118 118 Vector3Df rawGyr(state.wx, state.wy, state.wz); 119 //we do not need rotation in simulation 120 /* 119 121 ApplyRotation(angRate); 120 122 ApplyRotation(quaternion); 121 123 ApplyRotation(rawAcc); 122 124 ApplyRotation(rawMag); 123 ApplyRotation(rawGyr); 125 ApplyRotation(rawGyr);*/ 124 126 ahrsData->SetQuaternionAndAngularRates(quaternion,angRate); 125 127 imuData->SetRawAccMagAndGyr(rawAcc,rawMag,rawGyr);
Note:
See TracChangeset
for help on using the changeset viewer.