TechTheTime-HighLevel 0.0.1
The high level robot's code using ros2-foxy for the robotics competition(Erobot-2022)
Binder Class Reference

#include <controllerSetup.hpp>

Public Member Functions

void BindAxis (int axis, std::function< void(int, int)> func)
 Binds the axis index with the callback function. More...
 
void BindButton (int button, std::function< void(int, bool)> func)
 Binds the button index with the callback function. More...
 
 Binder ()
 
void CallAxisCallback (int axis, int value)
 Calls the callback assiociated with the axis index. More...
 
void CallButtonCallback (int button, bool state)
 Calls the callback assiociated with the button index. More...
 

Private Attributes

std::array< std::function< void(int, int)>, 8 > axisCallback
 
std::array< std::function< void(int, bool)>, 11 > buttonsCallback
 

Constructor & Destructor Documentation

◆ Binder()

Binder ( )

Member Function Documentation

◆ BindAxis()

void BindAxis ( int  axis,
std::function< void(int, int)>  func 
)

Binds the axis index with the callback function.

Parameters
axisThe axis that will be bound
funcThe function that will be bound

◆ BindButton()

void BindButton ( int  button,
std::function< void(int, bool)>  func 
)

Binds the button index with the callback function.

Parameters
buttonThe button that will be bound
funcThe function that will be bound

◆ CallAxisCallback()

void CallAxisCallback ( int  axis,
int  value 
)

Calls the callback assiociated with the axis index.

Parameters
axisThe axis index
valueThe value of the axis

◆ CallButtonCallback()

void CallButtonCallback ( int  button,
bool  state 
)

Calls the callback assiociated with the button index.

Parameters
buttonThe button
stateThe state of the button

Member Data Documentation

◆ axisCallback

std::array<std::function<void(int, int)>, 8> axisCallback
private

◆ buttonsCallback

std::array<std::function<void(int, bool)>, 11> buttonsCallback
private

The documentation for this class was generated from the following file: