Changeset 338 in flair-src for trunk/demos/OpticalFlow/uav


Ignore:
Timestamp:
Oct 17, 2019, 2:49:35 PM (5 years ago)
Author:
Sanahuja Guillaume
Message:

remove opencv dep

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/demos/OpticalFlow/uav/src/DemoOpticalFlow.cpp

    r314 r338  
    4747
    4848DemoOpticalFlow::DemoOpticalFlow(TargetController *controller): UavStateMachine(controller) {
    49   Uav* uav=GetUav();
     49    Uav* uav=GetUav();
    5050        if (uav->GetVerticalCamera() == NULL) {
    5151                                Err("no vertical camera found\n");
     
    5757        greyCameraImage=new CvtColor(uav->GetVerticalCamera(),"gray",CvtColor::Conversion_t::ToGray);
    5858
    59         uav->GetVerticalCamera()->UseDefaultPlot(greyCameraImage->Output()); // Le defaultPlot de la caméra peut afficher n'importe quoi?
     59        uav->GetVerticalCamera()->UseDefaultPlot(greyCameraImage->Output());
    6060
    6161        //optical flow stack
     
    7777  DataPlot1D* xVelocityPlot=new DataPlot1D(opticalFlowTab->NewRow(),"x speed (px/s)",-250,250);
    7878  DataPlot1D* yVelocityPlot=new DataPlot1D(opticalFlowTab->LastRowLastCol(),"y speed (px/s)",-250,250);
    79   DataPlot1D* xFirstPointPlot=new DataPlot1D(opticalFlowTab->NewRow(),"x movement first point",-25,25);
    80   DataPlot1D* yFirstPointPlot=new DataPlot1D(opticalFlowTab->LastRowLastCol(),"y movement first point",-25,25);
    81 //  DataPlot1D* xAccelerationPlot=new DataPlot1D(opticalFlowTab->NewRow(),"x_acceleration",-250,250);
    82 //  DataPlot1D* yAccelerationPlot=new DataPlot1D(opticalFlowTab->LastRowLastCol(),"y_acceleration",-250,250);
    83 
     79 
    8480  xVelocityPlot->AddCurve(opticalFlowSpeedRaw->Output()->Element(0,0));
    8581  xVelocityPlot->AddCurve(opticalFlowSpeed->GetMatrix()->Element(0,0),DataPlot::Blue);
    8682  yVelocityPlot->AddCurve(opticalFlowSpeedRaw->Output()->Element(1,0));
    8783  yVelocityPlot->AddCurve(opticalFlowSpeed->GetMatrix()->Element(1,0),DataPlot::Blue);
    88   xFirstPointPlot->AddCurve(opticalFlowCompensated->GetFirstPointDisplacement()->Element(0,0));
    89   xFirstPointPlot->AddCurve(opticalFlowCompensated->GetFirstPointDisplacement()->Element(1,0),DataPlot::Blue);
    90   xFirstPointPlot->AddCurve(opticalFlowCompensated->GetFirstPointDisplacement()->Element(2,0),DataPlot::Green);
    91   yFirstPointPlot->AddCurve(opticalFlowCompensated->GetFirstPointDisplacement()->Element(0,1));
    92   yFirstPointPlot->AddCurve(opticalFlowCompensated->GetFirstPointDisplacement()->Element(1,1),DataPlot::Blue);
    93   yFirstPointPlot->AddCurve(opticalFlowCompensated->GetFirstPointDisplacement()->Element(2,1),DataPlot::Green);
    94 //  xAccelerationPlot->AddCurve(opticalFlowAccelerationRaw->Matrix()->Element(0,0));
    95 //  xAccelerationPlot->AddCurve(opticalFlowAcceleration->Matrix()->Element(0,0),DataPlot::Blue);
    96 //  yAccelerationPlot->AddCurve(opticalFlowAccelerationRaw->Matrix()->Element(1,0));
    97 //  yAccelerationPlot->AddCurve(opticalFlowAcceleration->Matrix()->Element(1,0),DataPlot::Blue);
    98 
     84 
    9985  u_x=new Pid(setupLawTab->At(1,0),"u_x");
    10086  u_x->UseDefaultPlot(graphLawTab->NewRow());
     
    129115
    130116void DemoOpticalFlow::SignalEvent(Event_t event) {
     117    UavStateMachine::SignalEvent(event);
    131118    switch(event) {
    132119    case Event_t::EnteringControlLoop:
  • trunk/demos/OpticalFlow/uav/src/DemoOpticalFlow.h

    r214 r338  
    6666        flair::filter::OpticalFlowSpeed *opticalFlowSpeedRaw;
    6767        flair::filter::EulerDerivative *opticalFlowAccelerationRaw;
    68     flair::gui::PushButton *startOpticalflow,*stopOpticalflow;
    69     void StartOpticalFlow(void);
     68        flair::gui::PushButton *startOpticalflow,*stopOpticalflow;
     69        void StartOpticalFlow(void);
    7070        flair::filter::LowPassFilter* opticalFlowSpeed;
    7171        flair::filter::LowPassFilter* opticalFlowAcceleration;
Note: See TracChangeset for help on using the changeset viewer.