Changeset 38 in flair-src for trunk/demos


Ignore:
Timestamp:
Jun 23, 2016, 10:15:30 AM (5 years ago)
Author:
Bayard Gildas
Message:

Modif. pour ajour manette émulée (EmulatedController?)

Location:
trunk/demos
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/demos/CircleFollower/uav/src/CircleFollower.cpp

    r23 r38  
    1313
    1414#include "CircleFollower.h"
     15#include <TargetController.h>
    1516#include <Uav.h>
    1617#include <GridLayout.h>
     
    3334using namespace flair::core;
    3435using namespace flair::gui;
     36using namespace flair::sensor;
    3537using namespace flair::filter;
    3638using namespace flair::meta;
    3739
    38 CircleFollower::CircleFollower(Uav* uav): UavStateMachine(uav), behaviourMode(BehaviourMode_t::Default), vrpnLost(false) {
     40CircleFollower::CircleFollower(Uav* uav,TargetController *controller): UavStateMachine(uav,controller), behaviourMode(BehaviourMode_t::Default), vrpnLost(false) {
    3941    uav->SetupVRPNAutoIP(uav->ObjectName());
    4042
  • trunk/demos/CircleFollower/uav/src/CircleFollower.h

    r23 r38  
    2727        class MetaVrpnObject;
    2828    }
     29    namespace sensor {
     30        class TargetController;
     31    }
    2932}
    3033
    3134class CircleFollower : public flair::meta::UavStateMachine {
    3235    public:
    33         CircleFollower(flair::meta::Uav* uav);
     36        CircleFollower(flair::meta::Uav* uav,flair::sensor::TargetController *controller);
    3437        ~CircleFollower();
    3538
  • trunk/demos/CircleFollower/uav/src/main.cpp

    r23 r38  
    1717#include <stdio.h>
    1818#include <tclap/CmdLine.h>
     19#include <TargetEthController.h>
    1920
    2021using namespace TCLAP;
     
    2223using namespace flair::core;
    2324using namespace flair::meta;
     25using namespace flair::sensor;
    2426
    2527string uav_type;
    2628string log_path;
    2729int port;
     30int ds3port;
    2831string xml_file;
    2932string name;
     
    4346
    4447    Uav* drone=CreateUav(manager,name,uav_type);
    45     CircleFollower* demo=new CircleFollower(drone);
     48    TargetEthController *controller=new TargetEthController(manager,"Dualshock3",ds3port);
     49    CircleFollower* demo=new CircleFollower(drone,controller);
    4650
    4751    demo->Start();
     
    7478        cmd.add( addressArg );
    7579
     80        ValueArg<int> ds3portArg("d","ds3_port","port pour ds3",false,20000,"int");
     81        cmd.add( ds3portArg );
     82
    7683        cmd.parse( argc, argv );
    7784
     
    7986        log_path = logsArg.getValue();
    8087        port=portArg.getValue();
     88        ds3port=ds3portArg.getValue();
    8189        xml_file = xmlArg.getValue();
    8290        name=nameArg.getValue();
  • trunk/demos/SimpleFleet/uav/src/SimpleFleet.cpp

    r33 r38  
    1313
    1414#include "SimpleFleet.h"
     15#include <TargetController.h>
    1516#include <Uav.h>
    1617#include <GridLayout.h>
     
    4950
    5051
    51 SimpleFleet::SimpleFleet(flair::meta::Uav* uav,string broadcast,uint16_t ds3port): UavStateMachine(uav,ds3port), behaviourMode(BehaviourMode_t::Default), vrpnLost(false) {
     52SimpleFleet::SimpleFleet(flair::meta::Uav* uav,string broadcast,TargetController *controller): UavStateMachine(uav,controller), behaviourMode(BehaviourMode_t::Default), vrpnLost(false) {
    5253    uav->SetupVRPNAutoIP(uav->ObjectName());
    5354
  • trunk/demos/SimpleFleet/uav/src/SimpleFleet.h

    r33 r38  
    3434class SimpleFleet : public flair::meta::UavStateMachine {
    3535    public:
    36         SimpleFleet(flair::meta::Uav* uav,std::string broadcast,uint16_t ds3port);
     36        SimpleFleet(flair::meta::Uav* uav,std::string broadcast,flair::sensor::TargetController *controller);
    3737        ~SimpleFleet();
    3838
  • trunk/demos/SimpleFleet/uav/src/main.cpp

    r33 r38  
    1717#include <stdio.h>
    1818#include <tclap/CmdLine.h>
     19#include <TargetEthController.h>
    1920
    2021using namespace TCLAP;
     
    2223using namespace flair::core;
    2324using namespace flair::meta;
     25using namespace flair::sensor;
    2426
    2527string uav_type;
     
    4547
    4648    Uav* drone=CreateUav(manager,name,uav_type);
    47     SimpleFleet* demo=new SimpleFleet(drone,broadcast,ds3port);
     49    TargetEthController *controller=new TargetEthController(manager,"Dualshock3",ds3port);
     50    SimpleFleet* demo=new SimpleFleet(drone,broadcast,controller);
    4851
    4952    demo->Start();
Note: See TracChangeset for help on using the changeset viewer.