Changeset 214 in flair-src for trunk/lib/FlairSimulator
- Timestamp:
- Feb 7, 2018, 5:49:27 PM (7 years ago)
- Location:
- trunk/lib/FlairSimulator/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairSimulator/src/Model_impl.cpp
r202 r214 25 25 #include "SpinBox.h" 26 26 #include "CheckBox.h" 27 #include " cvmatrix.h"27 #include "Matrix.h" 28 28 #include "Euler.h" 29 29 #include <math.h> … … 134 134 desc->SetElementName(17, 0, "my"); 135 135 desc->SetElementName(18, 0, "mz"); 136 output = new cvmatrix(this, desc, floatType, "state");136 output = new Matrix(this, desc, floatType, "state"); 137 137 delete desc; 138 138 -
trunk/lib/FlairSimulator/src/SimuLaserGL.cpp
r158 r214 20 20 #include "Model.h" 21 21 #include "Gui.h" 22 #include < cvmatrix.h>22 #include <Matrix.h> 23 23 #include <SharedMem.h> 24 24 #include <TabWidget.h> -
trunk/lib/FlairSimulator/src/SimuUsGL.cpp
r167 r214 17 17 #include "SimuUsGL.h" 18 18 #include "Model.h" 19 #include < cvmatrix.h>19 #include <Matrix.h> 20 20 #include <SharedMem.h> 21 21 #include <TabWidget.h> … … 54 54 #endif 55 55 // todo: utiliser le placement de l'us dans le drone et sa portée 56 cvmatrix *input = (cvmatrix *)data;56 Matrix *input = (Matrix *)data; 57 57 value = input->Value(9, 0); 58 58 shmem->Write((char *)&value, sizeof(float)); -
trunk/lib/FlairSimulator/src/X4.cpp
r167 r214 20 20 #include <Tab.h> 21 21 #include <DoubleSpinBox.h> 22 #include <SpinBox.h> 22 23 #include <GroupBox.h> 23 24 #include <math.h> … … 73 74 j_yaw = new DoubleSpinBox(setup_tab->LastRowLastCol(), "j_yaw:", 0, 1, 0.001, 74 75 5); // moment d'inertie d'un axe (N.m.s²/rad) 76 77 motorTimeout = new SpinBox(setup_tab->NewRow(), "motor timeout:","ms", 0, 1000, 100,100); 75 78 76 79 motors = new SimuBldc(this, name, 4, modelId,0); … … 199 202 float fl_speed, fr_speed, rl_speed, rr_speed; 200 203 float u_roll, u_pitch, u_yaw, u_thrust; 204 Time motorTime; 201 205 #ifdef GL 202 206 motor_speed_mutex->GetMutex(); 203 207 #endif // GL 204 motors->GetSpeeds(motor_speed); 208 motors->GetSpeeds(motor_speed,&motorTime); 209 if((GetTime()-motorTime)/1000000>motorTimeout->Value()) { 210 for(int i=0;i<4;i++) { 211 if(motor_speed[i]!=0) { 212 //Printf("timout\n"); 213 for(int i=0;i<4;i++) motor_speed[i]=0; 214 break; 215 } 216 } 217 } 205 218 #ifdef GL 206 219 motor_speed_mutex->ReleaseMutex(); 207 220 #endif // GL 221 208 222 fl_speed = motor_speed[0]; 209 223 fr_speed = motor_speed[1]; … … 212 226 213 227 /* 214 215 216 217 218 228 ** =================================================================== 229 ** u roll: roll torque 230 ** 231 ** =================================================================== 232 */ 219 233 u_roll = arm_length->Value() * k_mot->Value() * 220 234 (fl_speed * fl_speed + rl_speed * rl_speed - fr_speed * fr_speed - -
trunk/lib/FlairSimulator/src/X4.h
r158 r214 26 26 namespace gui { 27 27 class DoubleSpinBox; 28 class SpinBox; 28 29 } 29 30 namespace actuator { … … 63 64 gui::DoubleSpinBox *f_air_vert, *f_air_lat; 64 65 gui::DoubleSpinBox *j_roll, *j_pitch, *j_yaw; 66 gui::SpinBox *motorTimeout; 65 67 }; 66 68 } // end namespace simulator -
trunk/lib/FlairSimulator/src/X8.cpp
r167 r214 20 20 #include <Tab.h> 21 21 #include <DoubleSpinBox.h> 22 #include <SpinBox.h> 22 23 #include <GroupBox.h> 23 24 #include <math.h> … … 81 82 setup_tab->LastRowLastCol(), "S:", 1, 2, 82 83 0.1); // coefficient de forme des helices 1<S=1+Ss/Sprop<2 (sans unite) 84 85 motorTimeout = new SpinBox(setup_tab->NewRow(), "motor timeout:","ms", 0, 1000, 100,100); 83 86 84 87 motors = new SimuBldc(this, name, 8, modelId,0); … … 231 234 float u_roll, u_pitch, u_yaw, u_thrust; 232 235 float omega; 236 Time motorTime; 233 237 #ifdef GL 234 238 motor_speed_mutex->GetMutex(); 235 239 #endif // GL 236 motors->GetSpeeds(motor_speed); 240 motors->GetSpeeds(motor_speed,&motorTime); 241 if((GetTime()-motorTime)/1000000>motorTimeout->Value()) { 242 for(int i=0;i<8;i++) { 243 if(motor_speed[i]!=0) { 244 //Printf("timout\n"); 245 for(int i=0;i<8;i++) motor_speed[i]=0; 246 break; 247 } 248 } 249 } 237 250 #ifdef GL 238 251 motor_speed_mutex->ReleaseMutex(); -
trunk/lib/FlairSimulator/src/X8.h
r158 r214 26 26 namespace gui { 27 27 class DoubleSpinBox; 28 class SpinBox; 28 29 } 29 30 namespace actuator { … … 65 66 gui::DoubleSpinBox *j_roll, *j_pitch, *j_yaw; 66 67 gui::DoubleSpinBox *j_r, *sigma, *S; 68 gui::SpinBox *motorTimeout; 67 69 }; 68 70 } // end namespace simulator -
trunk/lib/FlairSimulator/src/unexported/Model_impl.h
r167 r214 25 25 namespace flair { 26 26 namespace core { 27 class cvmatrix;27 class Matrix; 28 28 class Mutex; 29 29 class ConditionVariable; … … 101 101 flair::gui::CheckBox *enable_opti; 102 102 flair::simulator::Model *self; 103 flair::core:: cvmatrix *output;103 flair::core::Matrix *output; 104 104 flair::core::Mutex *states_mutex; 105 105
Note:
See TracChangeset
for help on using the changeset viewer.