Changeset 214 in flair-src for trunk/lib/FlairMeta
- Timestamp:
- Feb 7, 2018, 5:49:27 PM (7 years ago)
- Location:
- trunk/lib/FlairMeta/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairMeta/src/MetaDualShock3.cpp
r157 r214 22 22 #include <Tab.h> 23 23 #include <FrameworkManager.h> 24 #include < cvmatrix.h>24 #include <Matrix.h> 25 25 #include <Ahrs.h> 26 26 #include <AhrsData.h> -
trunk/lib/FlairMeta/src/MetaDualShock3_impl.cpp
r38 r214 20 20 #include <JoyReference.h> 21 21 #include <Tab.h> 22 #include < cvmatrix.h>22 #include <Matrix.h> 23 23 #include <FrameworkManager.h> 24 24 … … 43 43 // receives updates from the controler 44 44 void MetaDualShock3_impl::UpdateFrom(const io_data *data) { 45 cvmatrix *input = (cvmatrix *)data; 45 const Matrix* input = dynamic_cast<const Matrix*>(data); 46 47 if (!input) { 48 self->Warn("casting %s to Matrix failed\n",data->ObjectName().c_str()); 49 return; 50 } 46 51 47 52 // on prend une fois pour toute le mutex et on fait des accès directs -
trunk/lib/FlairMeta/src/MetaUsRangeFinder.cpp
r170 r214 27 27 #include <EulerDerivative.h> 28 28 #include <GroupBox.h> 29 #include < cvmatrix.h>29 #include <Matrix.h> 30 30 31 31 using std::string; … … 53 53 us->UseDefaultPlot(); 54 54 55 us->GetPlot()->AddCurve(pbas_z-> Matrix()->Element(0), DataPlot::Blue);55 us->GetPlot()->AddCurve(pbas_z->GetMatrix()->Element(0), DataPlot::Blue); 56 56 57 57 vz_plot = new DataPlot1D(us->GetPlotTab()->LastRowLastCol(), "vz", -2, 2); 58 vz_plot->AddCurve(vz_euler-> Matrix()->Element(0));59 vz_plot->AddCurve(pbas_vz-> Matrix()->Element(0), DataPlot::Blue);58 vz_plot->AddCurve(vz_euler->GetMatrix()->Element(0)); 59 vz_plot->AddCurve(pbas_vz->GetMatrix()->Element(0), DataPlot::Blue); 60 60 } 61 61 -
trunk/lib/FlairMeta/src/MetaVrpnObject.cpp
r170 r214 27 27 #include <Tab.h> 28 28 #include <TabWidget.h> 29 #include < cvmatrix.h>29 #include <Matrix.h> 30 30 31 31 using std::string; … … 54 54 desc->SetElementName(i, 0, Output()->Name(i, 0)); 55 55 } 56 cvmatrix *prev_value = new cvmatrix(this, desc, floatType, name);56 Matrix *prev_value = new Matrix(this, desc, floatType, name); 57 57 delete desc; 58 58 … … 65 65 desc->SetElementName(i, 0, "d" + Output()->Name(i, 0)); 66 66 } 67 prev_value = new cvmatrix(this, desc, floatType, name);67 prev_value = new Matrix(this, desc, floatType, name); 68 68 delete desc; 69 69 … … 73 73 74 74 vx_opti_plot = new DataPlot1D(GetPlotTab()->NewRow(), "vx", -3, 3); 75 vx_opti_plot->AddCurve(euler-> Matrix()->Element(4));75 vx_opti_plot->AddCurve(euler->GetMatrix()->Element(4)); 76 76 vy_opti_plot = new DataPlot1D(GetPlotTab()->LastRowLastCol(), "vy", -3, 3); 77 vy_opti_plot->AddCurve(euler-> Matrix()->Element(5));77 vy_opti_plot->AddCurve(euler->GetMatrix()->Element(5)); 78 78 vz_opti_plot = new DataPlot1D(GetPlotTab()->LastRowLastCol(), "vz", -2, 2); 79 vz_opti_plot->AddCurve(euler-> Matrix()->Element(6));79 vz_opti_plot->AddCurve(euler->GetMatrix()->Element(6)); 80 80 81 81 plot_tab = new Tab(GetVrpnClient()->GetTabWidget(), "Mesures (xy) " + name); -
trunk/lib/FlairMeta/src/Uav.cpp
r186 r214 28 28 #include <NmeaGps.h> 29 29 #include <Bldc.h> 30 #include < cvmatrix.h>30 #include <Matrix.h> 31 31 #include "MetaUsRangeFinder.h" 32 32 #include "MetaVrpnObject.h" -
trunk/lib/FlairMeta/src/UavStateMachine.cpp
r206 r214 39 39 #include <Vector3D.h> 40 40 #include <Vector2D.h> 41 #include < cvmatrix.h>41 #include <Matrix.h> 42 42 #include <stdio.h> 43 43 #include <TrajectoryGenerator1D.h> … … 109 109 new TrajectoryGenerator1D(uavTab->NewRow(), "alt cons", "m"); 110 110 uav->GetMetaUsRangeFinder()->GetZPlot()->AddCurve( 111 altitudeTrajectory-> Matrix()->Element(0), DataPlot::Green);111 altitudeTrajectory->GetMatrix()->Element(0), DataPlot::Green); 112 112 uav->GetMetaUsRangeFinder()->GetVzPlot()->AddCurve( 113 altitudeTrajectory-> Matrix()->Element(1), DataPlot::Green);113 altitudeTrajectory->GetMatrix()->Element(1), DataPlot::Green); 114 114 } 115 115 … … 459 459 void UavStateMachine::TakeOff(void) { 460 460 flagZTrajectoryFinished = false; 461 462 if((altitudeState==AltitudeState_t::Stopped) && safeToFly && uav->isReadyToFly() && uav->GetBatteryMonitor()->IsBatteryLow()==false && !flagConnectionLost) { 461 462 if(altitudeState!=AltitudeState_t::Stopped) { 463 Warn("cannot takeoff, altitudeState!=AltitudeState_t::Stopped\n"); 464 joy->ErrorNotify(); 465 } else if(!safeToFly) { 466 Warn("cannot takeoff, uav is not safe to fly\n"); 467 joy->ErrorNotify(); 468 } else if(!uav->isReadyToFly()) { 469 Warn("cannot takeoff, uav is not ready\n"); 470 joy->ErrorNotify(); 471 } else if(uav->GetBatteryMonitor()->IsBatteryLow()) { 472 Warn("cannot takeoff, battery is low\n"); 473 joy->ErrorNotify(); 474 } else if(flagConnectionLost) { 475 Warn("cannot takeoff, connection with flairgcs lost\n"); 476 joy->ErrorNotify(); 477 } else { 463 478 //The uav always takes off in fail safe mode 464 479 flagBatteryLow=false; … … 480 495 altitudeState = AltitudeState_t::TakingOff; 481 496 SignalEvent(Event_t::TakingOff); 482 } else {483 Warn("cannot takeoff\n");484 joy->ErrorNotify();485 497 } 486 498 } … … 511 523 altitudeState=AltitudeState_t::FinishLanding; 512 524 safeToFly=false; 513 Printf("Emergency landing!\n"); 525 Warn("Emergency landing!\n"); 526 Warn("You will not be able to take off again\n"); 514 527 } 515 528
Note:
See TracChangeset
for help on using the changeset viewer.