Changeset 314 in flair-src for trunk/demos/OpticalFlow


Ignore:
Timestamp:
Mar 21, 2019, 2:04:45 PM (6 years ago)
Author:
Sanahuja Guillaume
Message:

maj joystick

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/demos/OpticalFlow/uav/src/DemoOpticalFlow.cpp

    r274 r314  
    102102  u_y->UseDefaultPlot(graphLawTab->LastRowLastCol());
    103103
    104   opticalFlowGroupBox=new GroupBox(GetJoystick()->GetTab()->NewRow(),"consignes fo");
     104  opticalFlowGroupBox=new GroupBox(GetTargetController()->GetTab()->NewRow(),"consignes fo");
    105105  maxXSpeed=new DoubleSpinBox(opticalFlowGroupBox->NewRow(),"debattement x"," m/s",-5,5,0.1,1);
    106106  maxYSpeed=new DoubleSpinBox(opticalFlowGroupBox->LastRowLastCol(),"debattement y"," m/s",-5,5,0.1,1);
     
    131131    switch(event) {
    132132    case Event_t::EnteringControlLoop:
    133         opticalFlowReference->SetValue(0,0,GetJoystick()->GetAxisValue(1)*maxXSpeed->Value());//joy axis 0 maps to x displacement
    134         opticalFlowReference->SetValue(1,0,GetJoystick()->GetAxisValue(0)*maxYSpeed->Value());//joy axis 1 maps to y displacement
     133        opticalFlowReference->SetValue(0,0,GetTargetController()->GetAxisValue(1)*maxXSpeed->Value());//joy axis 0 maps to x displacement
     134        opticalFlowReference->SetValue(1,0,GetTargetController()->GetAxisValue(0)*maxYSpeed->Value());//joy axis 1 maps to y displacement
    135135        float focal=271.76;
    136136        float z,dz;
     
    164164    static bool wasOpticalFlowModeButtonPressed=false;
    165165    // controller button R1 enters optical flow mode
    166     if(GetJoystick()->IsButtonPressed(9)) { // R1
     166    if(GetTargetController()->IsButtonPressed(9)) { // R1
    167167        if (!wasOpticalFlowModeButtonPressed) {
    168168            wasOpticalFlowModeButtonPressed=true;
Note: See TracChangeset for help on using the changeset viewer.