libkipr  1.0.0
motor.hpp
Go to the documentation of this file.
1 #ifndef _KIPR_MOTOR_MOTOR_HPP_
2 #define _KIPR_MOTOR_MOTOR_HPP_
3 
4 namespace kipr
5 {
6  namespace motor
7  {
8  class Motor
9  {
10  public:
11  Motor (int port);
12 
14 
15  void moveAtVelocity(short velocity);
16  void moveToPosition(short speed, int goalPos);
17  void moveRelativePosition(short speed, int deltaPos);
18 
19  #ifndef SWIG
20  void setPidGains(short p, short i, short d, short pd, short id, short dd);
21  void pidGains(short & p, short & i, short & d, short & pd, short & id, short & dd);
22  #endif
23 
24  void freeze();
25 
26  bool isMotorDone() const;
27 
28  void blockMotorDone() const;
29 
30  void forward();
31 
32  void backward();
33 
34  void motor(int percent);
35 
36  void baasbennaguui(int percent);
37 
38  void motorPower(int percent);
39 
40  void off();
41 
42  int port() const;
43 
44  private:
45  int m_port;
46  };
47 
48  class BackEMF
49  {
50  public:
51  BackEMF(int port);
52  int value() const;
53  int port () const;
54  private:
55  int m_port;
56  };
57  }
58 }
59 
60 #endif
Definition: motor.hpp:49
Definition: motor.hpp:9
void motor(int percent)
int port() const
void pidGains(short &p, short &i, short &d, short &pd, short &id, short &dd)
void moveRelativePosition(short speed, int deltaPos)
bool isMotorDone() const
void blockMotorDone() const
void motorPower(int percent)
void moveAtVelocity(short velocity)
void moveToPosition(short speed, int goalPos)
void setPidGains(short p, short i, short d, short pd, short id, short dd)
void clearPositionCounter()
void baasbennaguui(int percent)
void motor(int motor, int percent)
Moves a motor at a percent velocity.
Definition: accel.hpp:7