Aruna
Actuator.h
Go to the documentation of this file.
1 //
2 // Created by noeel on 27-3-19.
3 //
4 
5 #ifndef ARUNA_MOVEMENTACTUATOR_H
6 #define ARUNA_MOVEMENTACTUATOR_H
7 
8 #include "aruna/arunaTypes.h"
10 
11 namespace aruna {
12  namespace movement {
13 
14  class Actuator {
15  protected:
16 
17 
25  static double convert_range(uint16_t input, float range_max = 100.f, float range_min = 0.f);
26 
27  private:
29  int16_t speed = 0;
30 
38  virtual err_t _set(axis_mask_t axisMask, int16_t speed) = 0;
39 
40 
41  public:
46 
52 // TODO explicit?
54 
55  virtual ~Actuator();
56 
57 
58 
64  err_t set_axis(axis_mask_t new_axis);
65 
71 
78  err_t set(axis_mask_t axisMask, int16_t speed);
79 
84  uint16_t get_speed();
85 
86 
87 
88 
89 
90  };
91  }
92 }
93 
94 #endif //ARUNA_MOVEMENTACTUATOR_H
Definition: comm.cpp:14
static double convert_range(uint16_t input, float range_max=100.f, float range_min=0.f)
Convert uint16 to a new range.
Definition: Actuator.cpp:46
uint16_t get_speed()
Get the current speed of Actuator.
Definition: Actuator.cpp:34
err_t set_axis(axis_mask_t new_axis)
Set the axis that this Actuator is capable in moving in.
Definition: Actuator.cpp:40
Actuator(axis_mask_t axis=axis_mask_t::NONE)
Actuator object, used by the movement module for vehicle movement.
Definition: Actuator.cpp:12
axis_mask_t get_axis()
get the movement modes that this driver supports.
Definition: Actuator.cpp:16
err_t startup_error
error when constructing gets put here, read before usage.
Definition: Actuator.h:45
virtual err_t _set(axis_mask_t axisMask, int16_t speed)=0
Implementation of axis movement, this function is called from set(...).