Changeset 214 in flair-src for trunk/lib/FlairMeta


Ignore:
Timestamp:
Feb 7, 2018, 5:49:27 PM (7 years ago)
Author:
Sanahuja Guillaume
Message:

matrix

Location:
trunk/lib/FlairMeta/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairMeta/src/MetaDualShock3.cpp

    r157 r214  
    2222#include <Tab.h>
    2323#include <FrameworkManager.h>
    24 #include <cvmatrix.h>
     24#include <Matrix.h>
    2525#include <Ahrs.h>
    2626#include <AhrsData.h>
  • trunk/lib/FlairMeta/src/MetaDualShock3_impl.cpp

    r38 r214  
    2020#include <JoyReference.h>
    2121#include <Tab.h>
    22 #include <cvmatrix.h>
     22#include <Matrix.h>
    2323#include <FrameworkManager.h>
    2424
     
    4343// receives updates from the controler
    4444void 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  }
    4651
    4752  // on prend une fois pour toute le mutex et on fait des accès directs
  • trunk/lib/FlairMeta/src/MetaUsRangeFinder.cpp

    r170 r214  
    2727#include <EulerDerivative.h>
    2828#include <GroupBox.h>
    29 #include <cvmatrix.h>
     29#include <Matrix.h>
    3030
    3131using std::string;
     
    5353  us->UseDefaultPlot();
    5454
    55   us->GetPlot()->AddCurve(pbas_z->Matrix()->Element(0), DataPlot::Blue);
     55  us->GetPlot()->AddCurve(pbas_z->GetMatrix()->Element(0), DataPlot::Blue);
    5656
    5757  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);
    6060}
    6161
  • trunk/lib/FlairMeta/src/MetaVrpnObject.cpp

    r170 r214  
    2727#include <Tab.h>
    2828#include <TabWidget.h>
    29 #include <cvmatrix.h>
     29#include <Matrix.h>
    3030
    3131using std::string;
     
    5454    desc->SetElementName(i, 0, Output()->Name(i, 0));
    5555  }
    56   cvmatrix *prev_value = new cvmatrix(this, desc, floatType, name);
     56  Matrix *prev_value = new Matrix(this, desc, floatType, name);
    5757  delete desc;
    5858
     
    6565    desc->SetElementName(i, 0, "d" + Output()->Name(i, 0));
    6666  }
    67   prev_value = new cvmatrix(this, desc, floatType, name);
     67  prev_value = new Matrix(this, desc, floatType, name);
    6868  delete desc;
    6969
     
    7373
    7474  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));
    7676  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));
    7878  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));
    8080
    8181  plot_tab = new Tab(GetVrpnClient()->GetTabWidget(), "Mesures (xy) " + name);
  • trunk/lib/FlairMeta/src/Uav.cpp

    r186 r214  
    2828#include <NmeaGps.h>
    2929#include <Bldc.h>
    30 #include <cvmatrix.h>
     30#include <Matrix.h>
    3131#include "MetaUsRangeFinder.h"
    3232#include "MetaVrpnObject.h"
  • trunk/lib/FlairMeta/src/UavStateMachine.cpp

    r206 r214  
    3939#include <Vector3D.h>
    4040#include <Vector2D.h>
    41 #include <cvmatrix.h>
     41#include <Matrix.h>
    4242#include <stdio.h>
    4343#include <TrajectoryGenerator1D.h>
     
    109109      new TrajectoryGenerator1D(uavTab->NewRow(), "alt cons", "m");
    110110  uav->GetMetaUsRangeFinder()->GetZPlot()->AddCurve(
    111       altitudeTrajectory->Matrix()->Element(0), DataPlot::Green);
     111      altitudeTrajectory->GetMatrix()->Element(0), DataPlot::Green);
    112112  uav->GetMetaUsRangeFinder()->GetVzPlot()->AddCurve(
    113       altitudeTrajectory->Matrix()->Element(1), DataPlot::Green);
     113      altitudeTrajectory->GetMatrix()->Element(1), DataPlot::Green);
    114114}
    115115
     
    459459void UavStateMachine::TakeOff(void) {
    460460  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 {
    463478    //The uav always takes off in fail safe mode
    464479    flagBatteryLow=false;
     
    480495    altitudeState = AltitudeState_t::TakingOff;
    481496    SignalEvent(Event_t::TakingOff);
    482   } else {
    483     Warn("cannot takeoff\n");
    484     joy->ErrorNotify();
    485497  }
    486498}
     
    511523    altitudeState=AltitudeState_t::FinishLanding;
    512524    safeToFly=false;
    513 Printf("Emergency landing!\n");
     525    Warn("Emergency landing!\n");
     526    Warn("You will not be able to take off again\n");
    514527}
    515528
Note: See TracChangeset for help on using the changeset viewer.