Changeset 314 in flair-src for trunk


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

maj joystick

Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/ReleaseNotes

    r302 r314  
    33- new build system, now out of source; binaries are no longer provided in repositories
    44- corrected a bug with vrpn delta time calculation
     5- const TargetController *UavStateMachine::GetJoystick as been replaced by const TargetController *UavStateMachine::GetTargetController
     6- new method MetaDualShock3 *UavStateMachine::GetJoystick
    57
    68
  • trunk/demos/CircleFollower/uav/src/CircleFollower.cpp

    r311 r314  
    1919#include <DataPlot1D.h>
    2020#include <DataPlot2D.h>
    21 #include <MetaDualShock3.h>
    2221#include <FrameworkManager.h>
    2322#include <VrpnClient.h>
     
    230229void CircleFollower::ExtraCheckJoystick(void) {
    231230    //R1 and Circle
    232     if(GetJoystick()->IsButtonPressed(9) && GetJoystick()->IsButtonPressed(4) && (behaviourMode!=BehaviourMode_t::Circle)) {
     231    if(GetTargetController()->IsButtonPressed(9) && GetTargetController()->IsButtonPressed(4) && (behaviourMode!=BehaviourMode_t::Circle)) {
    233232        StartCircle();
    234233    }
    235234
    236235    //R1 and Cross
    237     if(GetJoystick()->IsButtonPressed(9) && GetJoystick()->IsButtonPressed(5) && (behaviourMode==BehaviourMode_t::Circle)) {
     236    if(GetTargetController()->IsButtonPressed(9) && GetTargetController()->IsButtonPressed(5) && (behaviourMode==BehaviourMode_t::Circle)) {
    238237        StopCircle();
    239238    }
    240239   
    241240    //R1 and Square
    242     if(GetJoystick()->IsButtonPressed(9) && GetJoystick()->IsButtonPressed(2) && (behaviourMode==BehaviourMode_t::Default)) {
     241    if(GetTargetController()->IsButtonPressed(9) && GetTargetController()->IsButtonPressed(2) && (behaviourMode==BehaviourMode_t::Default)) {
    243242        VrpnPositionHold();
    244243    }
  • trunk/demos/CircleFollower/uav/src/main.cpp

    r291 r314  
    1818#include <tclap/CmdLine.h>
    1919#include <TargetEthController.h>
    20 //#include <VisionFilter.h>
    2120
    2221using namespace TCLAP;
  • trunk/demos/Gps/uav/src/DemoGps.cpp

    r186 r314  
    163163void DemoGps::ExtraCheckJoystick(void) {
    164164  // R1 and Circle
    165   if(GetJoystick()->IsButtonPressed(9) && GetJoystick()->IsButtonPressed(4) &&
     165  if(GetTargetController()->IsButtonPressed(9) && GetTargetController()->IsButtonPressed(4) &&
    166166     (behaviourMode != BehaviourMode_t::Circle)) {
    167167    StartCircle();
     
    169169
    170170  // R1 and Cross
    171   if(GetJoystick()->IsButtonPressed(9) && GetJoystick()->IsButtonPressed(5) &&
     171  if(GetTargetController()->IsButtonPressed(9) && GetTargetController()->IsButtonPressed(5) &&
    172172     (behaviourMode == BehaviourMode_t::Circle)) {
    173173    StopCircle();
  • trunk/demos/MixedReality/real/uav/src/CircleFollower.cpp

    r292 r314  
    222222void CircleFollower::ExtraCheckJoystick(void) {
    223223    //R1 and Circle
    224     if(GetJoystick()->IsButtonPressed(9) && GetJoystick()->IsButtonPressed(4) && (behaviourMode!=BehaviourMode_t::Circle)) {
     224    if(GetTargetController()->IsButtonPressed(9) && GetTargetController()->IsButtonPressed(4) && (behaviourMode!=BehaviourMode_t::Circle)) {
    225225        StartCircle();
    226226    }
    227227
    228228    //R1 and Cross
    229     if(GetJoystick()->IsButtonPressed(9) && GetJoystick()->IsButtonPressed(5) && (behaviourMode==BehaviourMode_t::Circle)) {
     229    if(GetTargetController()->IsButtonPressed(9) && GetTargetController()->IsButtonPressed(5) && (behaviourMode==BehaviourMode_t::Circle)) {
    230230        StopCircle();
    231231    }
    232232   
    233233    //R1 and Square
    234     if(GetJoystick()->IsButtonPressed(9) && GetJoystick()->IsButtonPressed(2) && (behaviourMode==BehaviourMode_t::Default)) {
     234    if(GetTargetController()->IsButtonPressed(9) && GetTargetController()->IsButtonPressed(2) && (behaviourMode==BehaviourMode_t::Default)) {
    235235        VrpnPositionHold();
    236236    }
  • trunk/demos/MixedReality/virtual/uav/src/App.cpp

    r293 r314  
    169169void App::ExtraCheckJoystick(void) {
    170170    //R1 and Square
    171     if(GetJoystick()->IsButtonPressed(9) && GetJoystick()->IsButtonPressed(2) && (behaviourMode==BehaviourMode_t::Default)) {
     171    if(GetTargetController()->IsButtonPressed(9) && GetTargetController()->IsButtonPressed(2) && (behaviourMode==BehaviourMode_t::Default)) {
    172172        VrpnPositionHold();
    173173    }
  • 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;
  • trunk/demos/PidStandalone/uav/src/PidUav.cpp

    r236 r314  
    9191  static bool wasOscillatingModeButtonPressed = false;
    9292  // controller button R1 enters optical flow mode
    93   if (GetJoystick()->IsButtonPressed(9)) { // R1
     93  if (GetTargetController()->IsButtonPressed(9)) { // R1
    9494    if (!wasOscillatingModeButtonPressed) {
    9595      wasOscillatingModeButtonPressed = true;
  • trunk/demos/Skeletons/CustomReferenceAngles/src/MyApp.cpp

    r167 r314  
    8383void MyApp::ExtraCheckJoystick(void) {
    8484    //R1
    85     if(GetJoystick()->IsButtonPressed(9) && (behaviourMode!=BehaviourMode_t::CustomReferenceAngles)) {
     85    if(GetTargetController()->IsButtonPressed(9) && (behaviourMode!=BehaviourMode_t::CustomReferenceAngles)) {
    8686        StartCustomAngles();
    8787    }
  • trunk/demos/Skeletons/CustomTorques/src/MyApp.cpp

    r122 r314  
    7070void MyApp::ExtraCheckJoystick(void) {
    7171    //R1
    72     if(GetJoystick()->IsButtonPressed(9) && (behaviourMode!=BehaviourMode_t::CustomTorques)) {
     72    if(GetTargetController()->IsButtonPressed(9) && (behaviourMode!=BehaviourMode_t::CustomTorques)) {
    7373        StartCustomTorques();
    7474    }
Note: See TracChangeset for help on using the changeset viewer.