added serial up, down, left and right control
Fork of Robot_a_cables_v3_5 by
rac.h@11:0fa23c2dab76, 2018-06-05 (annotated)
- Committer:
- unslaad
- Date:
- Tue Jun 05 07:24:15 2018 +0000
- Revision:
- 11:0fa23c2dab76
- Parent:
- 10:fb3542f3c5e6
added serial up, down, left and right control
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
protongamer | 10:fb3542f3c5e6 | 1 | #ifndef RAC_H |
protongamer | 10:fb3542f3c5e6 | 2 | #define RAC_H |
protongamer | 10:fb3542f3c5e6 | 3 | |
protongamer | 10:fb3542f3c5e6 | 4 | class RAC{ |
protongamer | 10:fb3542f3c5e6 | 5 | |
protongamer | 10:fb3542f3c5e6 | 6 | public: |
protongamer | 10:fb3542f3c5e6 | 7 | |
protongamer | 10:fb3542f3c5e6 | 8 | void readButtons(uint8_t SWX, uint8_t SWY, uint8_t BPO); |
protongamer | 10:fb3542f3c5e6 | 9 | void setVelocity(double velXin, double velYin, double centerRef, bool t_mode); |
protongamer | 10:fb3542f3c5e6 | 10 | void readPosition(double *cX, double *cY, bool *t_mode); |
protongamer | 10:fb3542f3c5e6 | 11 | void readVelocity(double *rvx, double *rvy); |
protongamer | 10:fb3542f3c5e6 | 12 | void send(int id, char octet_emis[], char RouD, char longueur ); |
protongamer | 10:fb3542f3c5e6 | 13 | |
protongamer | 10:fb3542f3c5e6 | 14 | private: |
protongamer | 10:fb3542f3c5e6 | 15 | |
protongamer | 10:fb3542f3c5e6 | 16 | uint8_t _SWX, _SWY, _BPO; |
protongamer | 10:fb3542f3c5e6 | 17 | int _x, _y, _ctr_x, _ctr_y; |
protongamer | 10:fb3542f3c5e6 | 18 | float _VX, _VY; |
protongamer | 10:fb3542f3c5e6 | 19 | long int _VM_L, _VM_R; |
protongamer | 10:fb3542f3c5e6 | 20 | char _command[8]; |
protongamer | 10:fb3542f3c5e6 | 21 | double _dy, _dx;//coordinates values when origin is done |
protongamer | 10:fb3542f3c5e6 | 22 | //these positions are in counters |
protongamer | 10:fb3542f3c5e6 | 23 | int32_t _p1, _p2; //motors positions |
protongamer | 10:fb3542f3c5e6 | 24 | int32_t _p_actual, _p_actual2, _p_pom, _p_pom2; //p_actual position read by can, p_pom position done when origin is made |
protongamer | 10:fb3542f3c5e6 | 25 | int32_t _lx, _l1, _l2; |
protongamer | 10:fb3542f3c5e6 | 26 | double _rvx, _rvy; |
protongamer | 10:fb3542f3c5e6 | 27 | }; |
protongamer | 10:fb3542f3c5e6 | 28 | |
protongamer | 10:fb3542f3c5e6 | 29 | |
protongamer | 10:fb3542f3c5e6 | 30 | |
protongamer | 10:fb3542f3c5e6 | 31 | |
protongamer | 10:fb3542f3c5e6 | 32 | #endif RAC_H |