Skip to content
Snippets Groups Projects
PlatoonController.h 1 KiB
Newer Older
Hoop77's avatar
-
Hoop77 committed
//
// Created by philipp on 12.02.18.
//

#ifndef CAR_PLATOONCONTROLLER_H
#define CAR_PLATOONCONTROLLER_H

Franz Bethke's avatar
Franz Bethke committed
#include <functional>

Franz Bethke's avatar
Franz Bethke committed
// #include "PlatoonProtocolLib/Vehicle.h"
#include "C2CBase.h"
Franz Bethke's avatar
Franz Bethke committed
#include "PlatoonProtocolLib/Protocol.h"
#include "PC2CarLib/CommandReceiver.h"
#include "EgoMotion.h"
Franz Bethke's avatar
Franz Bethke committed
#include "PlatoonState.h"
Hoop77's avatar
-
Hoop77 committed
namespace car
{

class PlatoonController
{
public:
Franz Bethke's avatar
Franz Bethke committed
    using Callback = std::function<void()>;
    
Franz Bethke's avatar
Franz Bethke committed
    PlatoonController(C2CBase& c2c,
                      pc2car::CommandReceiver::Ptr pc,
                      EgoMotion& egoMotion);
Franz Bethke's avatar
Franz Bethke committed
      
Hoop77's avatar
-  
Hoop77 committed
    void run();
    Callback cruiseControllerNotify;
Hoop77's avatar
-
Hoop77 committed

private:
Franz Bethke's avatar
Franz Bethke committed
    C2CBase& c2c;
    pc2car::CommandReceiver::Ptr pc;
    EgoMotion& egoMotion;
Franz Bethke's avatar
Franz Bethke committed
    // TODO check these values!
    PlatoonState curState = PlatoonState::CACC_FV;
Franz Bethke's avatar
Franz Bethke committed

    bool wantsPlatoon = false;
Franz Bethke's avatar
Franz Bethke committed
    // TODO check these values!
    float desSpeed = 0.0;

    // METHODS

    void run_ACC();
    void run_CACC_FV();
    void run_CACC_LV();
    
Hoop77's avatar
-
Hoop77 committed
};

}

#endif //CAR_PLATOONCONTROLLER_H