Delta Robot example
Dependencies: BufferedSerial Eigen
Fork of TCPSocket_Example by
Diff: Axis.h
- Revision:
- 4:778bc352c47f
- Parent:
- 3:10fa3102c2d7
- Child:
- 5:01e1e68309ae
diff -r 10fa3102c2d7 -r 778bc352c47f Axis.h --- a/Axis.h Fri Oct 05 15:57:55 2018 +0000 +++ b/Axis.h Sun Oct 07 19:40:12 2018 +0000 @@ -1,25 +1,44 @@ #ifndef AXIS_H #define AXIS_H +#include "odrive.h" +#include "mbed.h" +#include "calibration.h" +#include "comms.h" +#include <string> +#include <sstream> + +enum axisName { + AX_A, + AX_B, + AX_C, +}; + class Axis { public: - void Axis(&ODrive od, int ax, DigitalIn homeSwitch,float gearRatio); + Axis(ODrive* od, int ax, DigitalIn* homeSwitch, calVals calibration_,axisName indentity); void homeAxis(); void goAngle(float angle); void goAngleSpeed(float angle, float speed); - + void runState(int requestedState); + DigitalIn* homeSwitch_; + void setMaxVel(float stepsPerSec); + ODrive* odrive; private: - &Odrive odrive; - int axNum - int homeOffset = 0; - float currentSetPos = 0; - float currentSetVel = 0; - DigitalIn homeSwitch_; - float maxAngle = 2; //roughtly - float gearRatio_ = 3; + + int axNum; + int homeOffset; + float currentSetPos; + float currentSetVel; + + float maxAngle; //roughtly + float gearRatio_; + float pulse_per_rev; + float pulse_per_rad; + float rotation_offset; // defines the rotational ofset from flat, to be calibrated. };