z ysaito
/
APro_B2DTst_0_Can_Class
2018.07.26
mtrAccess.h@0:b3376afd10d8, 2018-07-26 (annotated)
- Committer:
- sayzyas
- Date:
- Thu Jul 26 00:20:04 2018 +0000
- Revision:
- 0:b3376afd10d8
2018.07.26
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sayzyas | 0:b3376afd10d8 | 1 | class mtrAccess |
sayzyas | 0:b3376afd10d8 | 2 | { |
sayzyas | 0:b3376afd10d8 | 3 | private: |
sayzyas | 0:b3376afd10d8 | 4 | |
sayzyas | 0:b3376afd10d8 | 5 | float motor1_current_center_value; |
sayzyas | 0:b3376afd10d8 | 6 | float motor2_current_center_value; |
sayzyas | 0:b3376afd10d8 | 7 | float motor3_current_center_value; |
sayzyas | 0:b3376afd10d8 | 8 | float motor1_current_fwd_thd; |
sayzyas | 0:b3376afd10d8 | 9 | float motor1_current_rvs_thd; |
sayzyas | 0:b3376afd10d8 | 10 | float motor2_current_fwd_thd; |
sayzyas | 0:b3376afd10d8 | 11 | float motor2_current_rvs_thd; |
sayzyas | 0:b3376afd10d8 | 12 | uint32_t motor_pantiltwch_1_lock_count; |
sayzyas | 0:b3376afd10d8 | 13 | uint32_t motor_pantiltwch_2_lock_count; |
sayzyas | 0:b3376afd10d8 | 14 | // Motor lock |
sayzyas | 0:b3376afd10d8 | 15 | volatile bool flg_motor_pantiltwch_1_lockcup; |
sayzyas | 0:b3376afd10d8 | 16 | volatile bool flg_motor_pantiltwch_2_lockcup; |
sayzyas | 0:b3376afd10d8 | 17 | volatile uint32_t flg_motor_pantiltwch_1_lock; |
sayzyas | 0:b3376afd10d8 | 18 | volatile uint32_t flg_motor_pantiltwch_2_lock; |
sayzyas | 0:b3376afd10d8 | 19 | |
sayzyas | 0:b3376afd10d8 | 20 | |
sayzyas | 0:b3376afd10d8 | 21 | int MCTR_CANID_CRAWLER; // CRAWLER motor ID |
sayzyas | 0:b3376afd10d8 | 22 | int MCTR_CANID_PTORWCH; // PAN,TILT(B1) or Winch(B2) motor ID |
sayzyas | 0:b3376afd10d8 | 23 | int MCTR_CANID_TRANSFORM; // TRANSFORM motor ID |
sayzyas | 0:b3376afd10d8 | 24 | |
sayzyas | 0:b3376afd10d8 | 25 | bool sndCmd2MC( int rcan_id, int no, int speed ); |
sayzyas | 0:b3376afd10d8 | 26 | |
sayzyas | 0:b3376afd10d8 | 27 | |
sayzyas | 0:b3376afd10d8 | 28 | public: |
sayzyas | 0:b3376afd10d8 | 29 | |
sayzyas | 0:b3376afd10d8 | 30 | bool flg_timerint_motor; |
sayzyas | 0:b3376afd10d8 | 31 | bool flg_ival_motor_cw; |
sayzyas | 0:b3376afd10d8 | 32 | bool flg_ival_motor_ccw; |
sayzyas | 0:b3376afd10d8 | 33 | |
sayzyas | 0:b3376afd10d8 | 34 | int16_t move_interval_cw; // moving interval m1 to m2 cw rotation |
sayzyas | 0:b3376afd10d8 | 35 | int16_t move_interval_ccw; // moving interval m1 to m2 ccw rotation |
sayzyas | 0:b3376afd10d8 | 36 | |
sayzyas | 0:b3376afd10d8 | 37 | mtrAccess(); |
sayzyas | 0:b3376afd10d8 | 38 | bool setBaudRate( int baudrate ); |
sayzyas | 0:b3376afd10d8 | 39 | bool cmdControl( char* cmd, int sizeofcmd, int speed_m1, int speed_m2 ); |
sayzyas | 0:b3376afd10d8 | 40 | int readMotorCurrent( int motor_id, int motor_no, int motor_dir ); |
sayzyas | 0:b3376afd10d8 | 41 | }; |