Changeset 214 in flair-src for trunk/demos


Ignore:
Timestamp:
02/07/18 17:49:27 (6 years ago)
Author:
Sanahuja Guillaume
Message:

matrix

Location:
trunk/demos
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/demos/CircleFollower/simulator/build_x86_64/bin/setup_x4.xml

    r157 r214  
    2727    <DoubleSpinBox value="0.006" name="j_pitch:"/>
    2828    <DoubleSpinBox value="0.1" name="j_yaw:"/>
    29    </Tab>
     29   <SpinBox name="motor timeout:" value="100"/></Tab>
    3030   <Tab name="us">
    3131    <GroupBox name="position">
     
    4040    </GroupBox>
    4141    <DoubleSpinBox value="6" name="range:"/>
    42    <Vector3DSpinBox name="position" value_x="0.00" value_y="0.00" value_z="0.0400000000000000"/><Vector3DSpinBox name="direction" value_x="0" value_y="0" value_z="1"/></Tab>
     42   <Vector3DSpinBox name="position" value_x="0" value_y="0" value_z="0.04"/><Vector3DSpinBox name="direction" value_x="0" value_y="0" value_z="1"/></Tab>
    4343   <Tab name="bottom camera">
    4444    <GroupBox name="position">
  • trunk/demos/CircleFollower/simulator/build_x86_64/bin/setup_x8.xml

    r21 r214  
    1616    <DoubleSpinBox value="-1.2" name="z:"/>
    1717    <SpinBox value="90" name="yaw (deg):"/>
    18    <Vector3DSpinBox name="position" value_x="-1.50" value_y="0.00" value_z="-1.00"/></Tab>
     18   <Vector3DSpinBox name="position" value_x="-1.5" value_y="0" value_z="-1"/></Tab>
    1919   <Tab name="model">
    2020    <DoubleSpinBox value="1.6" name="mass (kg):"/>
     
    3131    <DoubleSpinBox value="0.72" name="sigma:"/>
    3232    <DoubleSpinBox value="1" name="S:"/>
    33    </Tab>
     33   <SpinBox name="motor timeout:" value="100"/></Tab>
    3434   <Tab name="us">
    3535    <GroupBox name="position">
     
    4444    </GroupBox>
    4545    <DoubleSpinBox value="6" name="range:"/>
    46    <Vector3DSpinBox name="position" value_x="0.00" value_y="0.00" value_z="0.04"/><Vector3DSpinBox name="direction" value_x="0.00" value_y="0.00" value_z="1.00"/></Tab>
     46   <Vector3DSpinBox name="position" value_x="0" value_y="0" value_z="0.04"/><Vector3DSpinBox name="direction" value_x="0" value_y="0" value_z="1"/></Tab>
    4747   <Tab name="bottom camera">
    4848    <GroupBox name="position">
     
    9696    <DoubleSpinBox value="0" name="z:"/>
    9797    <SpinBox value="90" name="yaw (deg):"/>
    98    <Vector3DSpinBox name="position" value_x="-1.50" value_y="1.00" value_z="0.00"/></Tab>
     98   <Vector3DSpinBox name="position" value_x="-1.5" value_y="1" value_z="0"/></Tab>
    9999   <Tab name="model">
    100100    <DoubleSpinBox value="1.3" name="translational speed (m/s):"/>
  • trunk/demos/CircleFollower/uav/src/CircleFollower.cpp

    r171 r214  
    2424#include <MetaVrpnObject.h>
    2525#include <TrajectoryGenerator2DCircle.h>
     26#include <Matrix.h>
    2627#include <cvmatrix.h>
    2728#include <cmath>
     
    6162
    6263    circle=new TrajectoryGenerator2DCircle(vrpnclient->GetLayout()->NewRow(),"circle");
    63     uavVrpn->xPlot()->AddCurve(circle->Matrix()->Element(0,0),DataPlot::Blue);
    64     uavVrpn->yPlot()->AddCurve(circle->Matrix()->Element(0,1),DataPlot::Blue);
    65     uavVrpn->VxPlot()->AddCurve(circle->Matrix()->Element(1,0),DataPlot::Blue);
    66     uavVrpn->VyPlot()->AddCurve(circle->Matrix()->Element(1,1),DataPlot::Blue);
    67     uavVrpn->XyPlot()->AddCurve(circle->Matrix()->Element(0,1),circle->Matrix()->Element(0,0),DataPlot::Blue,"circle");
     64    uavVrpn->xPlot()->AddCurve(circle->GetMatrix()->Element(0,0),DataPlot::Blue);
     65    uavVrpn->yPlot()->AddCurve(circle->GetMatrix()->Element(0,1),DataPlot::Blue);
     66    uavVrpn->VxPlot()->AddCurve(circle->GetMatrix()->Element(1,0),DataPlot::Blue);
     67    uavVrpn->VyPlot()->AddCurve(circle->GetMatrix()->Element(1,1),DataPlot::Blue);
     68    uavVrpn->XyPlot()->AddCurve(circle->GetMatrix()->Element(0,1),circle->GetMatrix()->Element(0,0),DataPlot::Blue,"circle");
    6869
    6970    uX=new Pid(setupLawTab->At(1,0),"u_x");
  • trunk/demos/OpticalFlow/uav/src/DemoOpticalFlow.cpp

    r167 r214  
    2222#include <LowPassFilter.h>
    2323#include <EulerDerivative.h>
    24 #include <cvmatrix.h>
     24#include <Matrix.h>
    2525#include <GridLayout.h>
    2626#include <DataPlot1D.h>
     
    6565  opticalFlowSpeedRaw=new OpticalFlowSpeed(opticalFlowCompensated,uav->GetAhrs(),uav->GetVerticalCamera()->GetLayout()->NewRow(),"vitesse du Flux Optique");
    6666  //opticalFlowSpeed=vitesse de déplacement en pixels par seconde (moyenne sur tous les points et division par le delta T)
    67   cvmatrix* twoByOneOFS=new cvmatrix((const Thread*)this,2,1,floatType);
    68   cvmatrix* twoByOneOFAR=new cvmatrix((const Thread*)this,2,1,floatType);
    69   cvmatrix* twoByOneOFA=new cvmatrix((const Thread*)this,2,1,floatType);
     67  Matrix* twoByOneOFS=new Matrix((const Thread*)this,2,1,floatType);
     68  Matrix* twoByOneOFAR=new Matrix((const Thread*)this,2,1,floatType);
     69  Matrix* twoByOneOFA=new Matrix((const Thread*)this,2,1,floatType);
    7070  opticalFlowSpeed=new LowPassFilter(opticalFlowSpeedRaw,uav->GetVerticalCamera()->GetLayout()->NewRow(),"Speed lowPass",twoByOneOFS);
    7171  opticalFlowAccelerationRaw=new EulerDerivative(opticalFlowSpeed,uav->GetVerticalCamera()->GetLayout()->NewRow(),"derivative",twoByOneOFAR);
     
    8383
    8484  xVelocityPlot->AddCurve(opticalFlowSpeedRaw->Output()->Element(0,0));
    85   xVelocityPlot->AddCurve(opticalFlowSpeed->Matrix()->Element(0,0),DataPlot::Blue);
     85  xVelocityPlot->AddCurve(opticalFlowSpeed->GetMatrix()->Element(0,0),DataPlot::Blue);
    8686  yVelocityPlot->AddCurve(opticalFlowSpeedRaw->Output()->Element(1,0));
    87   yVelocityPlot->AddCurve(opticalFlowSpeed->Matrix()->Element(1,0),DataPlot::Blue);
     87  yVelocityPlot->AddCurve(opticalFlowSpeed->GetMatrix()->Element(1,0),DataPlot::Blue);
    8888  xFirstPointPlot->AddCurve(opticalFlowCompensated->GetFirstPointDisplacement()->Element(0,0));
    8989  xFirstPointPlot->AddCurve(opticalFlowCompensated->GetFirstPointDisplacement()->Element(1,0),DataPlot::Blue);
     
    107107 
    108108  Tab* opticalFlowRealTab=new Tab(getFrameworkManager()->GetTabWidget(),"real speed");
    109   opticalFlowRealSpeed=new cvmatrix((const Thread*)this,2,1,floatType);
    110   opticalFlowReference=new cvmatrix((const Thread*)this,2,1,floatType);
    111   opticalFlowRealAcceleration=new cvmatrix((const Thread*)this,2,1,floatType);
     109  opticalFlowRealSpeed=new Matrix((const Thread*)this,2,1,floatType);
     110  opticalFlowReference=new Matrix((const Thread*)this,2,1,floatType);
     111  opticalFlowRealAcceleration=new Matrix((const Thread*)this,2,1,floatType);
    112112  DataPlot1D* xRealVelocityPlot=new DataPlot1D(opticalFlowRealTab->NewRow(),"x speed (m/s)",-2,2);
    113113  DataPlot1D* yRealVelocityPlot=new DataPlot1D(opticalFlowRealTab->LastRowLastCol(),"y speed (m/s)",-2,2);
  • trunk/demos/OpticalFlow/uav/src/DemoOpticalFlow.h

    r165 r214  
    2020namespace flair {
    2121    namespace core {
    22         class cvmatrix;
     22        class Matrix;
    2323    }
    2424    namespace gui {
     
    5555        flair::gui::GroupBox* opticalFlowGroupBox;
    5656        flair::gui::DoubleSpinBox *maxXSpeed,*maxYSpeed;
    57         flair::core::cvmatrix *opticalFlowReference;
     57        flair::core::Matrix *opticalFlowReference;
    5858        flair::filter::Pid *u_x, *u_y;
    5959        flair::filter::CvtColor* greyCameraImage;
    6060        flair::core::AhrsData *customReferenceOrientation;
    61         flair::core::cvmatrix *opticalFlowRealSpeed,*opticalFlowRealAcceleration;
     61        flair::core::Matrix *opticalFlowRealSpeed,*opticalFlowRealAcceleration;
    6262
    6363    private:
  • trunk/demos/SimpleFleet/uav/src/SimpleFleet.cpp

    r178 r214  
    2929#include <PidThrust.h>
    3030#include <Euler.h>
     31#include <Matrix.h>
    3132#include <cvmatrix.h>
    3233#include <AhrsData.h>
     
    6061
    6162    circle=new TrajectoryGenerator2DCircle(vrpnclient->GetLayout()->NewRow(),"circle");
    62     uavVrpn->xPlot()->AddCurve(circle->Matrix()->Element(0,0),0,0,255);
    63     uavVrpn->yPlot()->AddCurve(circle->Matrix()->Element(0,1),0,0,255);
    64     uavVrpn->VxPlot()->AddCurve(circle->Matrix()->Element(1,0),0,0,255);
    65     uavVrpn->VyPlot()->AddCurve(circle->Matrix()->Element(1,1),0,0,255);
     63    uavVrpn->xPlot()->AddCurve(circle->GetMatrix()->Element(0,0),0,0,255);
     64    uavVrpn->yPlot()->AddCurve(circle->GetMatrix()->Element(0,1),0,0,255);
     65    uavVrpn->VxPlot()->AddCurve(circle->GetMatrix()->Element(1,0),0,0,255);
     66    uavVrpn->VyPlot()->AddCurve(circle->GetMatrix()->Element(1,1),0,0,255);
    6667
    6768    xCircleCenter=new DoubleSpinBox(vrpnclient->GetLayout()->NewRow(),"x circle center"," m",-5,5,0.1,1,0);
  • trunk/demos/Sinus/src/Loop.cpp

    r16 r214  
    2424#include <PushButton.h>
    2525#include <DataPlot1D.h>
    26 #include <cvmatrix.h>
     26#include <Matrix.h>
    2727
    2828using namespace std;
     
    4747                                   "1st order lawpass filter");
    4848  sinus->GetPlot()->AddCurve(
    49       firstLowPass->Matrix()->Element(0),
     49      firstLowPass->GetMatrix()->Element(0),
    5050      DataPlot::Blue); // add output of the filter to signal's graph
    5151
     
    5454      sinus, sinus->GetSetupLayout()->NewRow(), "3rd order lawpass filter", 3);
    5555  sinus->GetPlot()->AddCurve(
    56       thirdLowPass->Matrix()->Element(0),
     56      thirdLowPass->GetMatrix()->Element(0),
    5757      DataPlot::Yellow); // add output of the filter to signal's graph
    5858
  • trunk/demos/Sinus/src/MeanFilter.cpp

    r157 r214  
    1313
    1414#include "MeanFilter.h"
    15 #include <cvmatrix.h>
     15#include <Matrix.h>
    1616#include <LayoutPosition.h>
    1717#include <GroupBox.h>
     
    4242  desc->SetElementName(0, 0,
    4343                       "mean filter"); // name will be used for graphs and logs
    44   output = new cvmatrix(this, desc, floatType, name);
     44  output = new Matrix(this, desc, floatType, name);
    4545  delete desc;
    4646
     
    5252MeanFilter::~MeanFilter() {}
    5353
    54 cvmatrix *MeanFilter::GetMatrix() const { return output; }
     54Matrix *MeanFilter::GetMatrix() const { return output; }
    5555
    5656float MeanFilter::GetValue(void) const { return output->Value(0, 0); }
     
    6464
    6565  float result = 0;
    66   // get input argument in a cvmatrix
    67   cvmatrix *input = (cvmatrix *)data;
     66  // get input argument in a matrix
     67  const Matrix* input = dynamic_cast<const Matrix*>(data);
     68 
     69  if (!input) {
     70      Warn("casting %s to Matrix failed\n",data->ObjectName().c_str());
     71      return;
     72  }
    6873
    6974  // simple (and not efficent!) implementation of the filter
  • trunk/demos/Sinus/src/MeanFilter.h

    r16 r214  
    2525namespace flair {
    2626namespace core {
    27 class cvmatrix;
     27class Matrix;
    2828}
    2929namespace gui {
     
    7070  * \return pointer to the output matrix
    7171  */
    72   core::cvmatrix *GetMatrix(void) const;
     72  core::Matrix *GetMatrix(void) const;
    7373
    7474  /*!
     
    8686  gui::GroupBox *groupBox;
    8787  gui::SpinBox *numberOfElements;
    88   core::cvmatrix *output;
     88  core::Matrix *output;
    8989  float previousValues[MAX_NUMBER_OF_ELEMENTS]; // previous values storage
    9090};
  • trunk/demos/Sinus/src/Sinus.cpp

    r157 r214  
    2121#include <SpinBox.h>
    2222#include <DataPlot1D.h>
    23 #include <cvmatrix.h>
     23#include <Matrix.h>
    2424#include <math.h>
    2525
     
    4141  cvmatrix_descriptor *desc = new cvmatrix_descriptor(1, 1);
    4242  desc->SetElementName(0, 0, "value"); // name will be used for graphs and logs
    43   output = new cvmatrix((IODevice *)this, desc, floatType, name);
     43  output = new Matrix((IODevice *)this, desc, floatType, name);
    4444  delete desc;
    4545
     
    9494}
    9595
    96 cvmatrix *Sinus::GetMatrix(void) const { return output; }
     96Matrix *Sinus::GetMatrix(void) const { return output; }
    9797
    9898float Sinus::GetValue(void) const { return output->Value(0, 0); }
  • trunk/demos/Sinus/src/Sinus.h

    r16 r214  
    2323namespace core {
    2424class FrameworkManager;
    25 class cvmatrix;
     25class Matrix;
    2626}
    2727namespace gui {
     
    6969  * \return un pointeur vers la matrice de sortie
    7070  */
    71   core::cvmatrix *GetMatrix(void) const;
     71  core::Matrix *GetMatrix(void) const;
    7272
    7373  /*!
     
    113113  void Run(void);
    114114
    115   core::cvmatrix *output;
     115  core::Matrix *output;
    116116  gui::Tab *mainTab;
    117117  gui::TabWidget *tabWidget;
Note: See TracChangeset for help on using the changeset viewer.