-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathODriveArduino.h
More file actions
35 lines (28 loc) · 1.02 KB
/
ODriveArduino.h
File metadata and controls
35 lines (28 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef ODriveArduino_h
#define ODriveArduino_h
#include "Arduino.h"
#include "ODriveEnums.h"
class ODriveArduino {
public:
ODriveArduino(Stream& serial);
// Commands
void SetPosition(int motor_number, float position);
void SetPosition(int motor_number, float position, float velocity_feedforward);
void SetPosition(int motor_number, float position, float velocity_feedforward, float current_feedforward);
void SetVelocity(int motor_number, float velocity);
void SetVelocity(int motor_number, float velocity, float current_feedforward);
void SetCurrent(int motor_number, float current);
void TrapezoidalMove(int motor_number, float position);
// Getters
float GetVelocity(int motor_number);
float GetPosition(int motor_number);
// General params
float readFloat();
int32_t readInt();
// State helper
bool run_state(int axis, int requested_state, bool wait_for_idle, float timeout = 10.0f);
private:
String readString();
Stream& serial_;
};
#endif //ODriveArduino_h