NHK2017Ateamかにろぼ
Dependencies: 2017NHKpin_config mbed FEP HMC6352 MotorDriverController PID QEI omni
\ ̄\ / ̄/ /l \ \ / / lヽ | ヽ ヽ | | / / | \ ` ‐ヽ ヽ ● ● / / ‐ / \ __ l | ||___|| / l __ / \ \ / \/ /\| 人__人 |/\ //\| |/\\ //\| |/\\ / . \_____/ \ ┏┓ ┏━┓┏┓ ┏┓ ┏┓┏┓ ┏┓ ┏┓┗┛ ┏┓ ┗┓┃┗┛ ┏┛┗━┓ ┃┃┃┃ ┃┃┏━┛┗┓┏┓┏┛┗━┓┃┃┏┓┏┓┏━━━┓ ┗┓┏━┛ ┃┃┗┛ ┃┃┗━┓┏┛┗┛┗┓┏┓┃┗┛┗┛┃┃┗━━━┛ ┏┛┃┏━┓┃┗━━┓┃┃┏━┛┗┓ ┏┛┃┃┃ ┃┃ ┃┏┛┗━┛┗━━┓┃┃┃┃┏┓┏┛ ┗━┛┃┃ ┃┃┏┓ ┃┃┏━━┓┏━━┛┃┃┃┃┗┛┃ ┏┛┃ ┃┃┃┗━━┓ ┗┛┗━━┛┗━━━┛┗┛┗━━┛ ┗━┛ ┗┛┗━━━┛
bot/motor_driver/motor_driver.cpp@6:590c9622ecf1, 2017-08-24 (annotated)
- Committer:
- UCHITAKE
- Date:
- Thu Aug 24 08:16:21 2017 +0000
- Revision:
- 6:590c9622ecf1
- Child:
- 8:3987aa3d016b
Just worked !!!!!!!!
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
UCHITAKE | 6:590c9622ecf1 | 1 | #include "motor_driver.h" |
UCHITAKE | 6:590c9622ecf1 | 2 | |
UCHITAKE | 6:590c9622ecf1 | 3 | MotorDriver::MotorDriver() : MDC(MDSDA, MDSCL) |
UCHITAKE | 6:590c9622ecf1 | 4 | { |
UCHITAKE | 6:590c9622ecf1 | 5 | MotorSTOP(); |
UCHITAKE | 6:590c9622ecf1 | 6 | } |
UCHITAKE | 6:590c9622ecf1 | 7 | |
UCHITAKE | 6:590c9622ecf1 | 8 | void MotorDriver::moveSlider(float speed) |
UCHITAKE | 6:590c9622ecf1 | 9 | { |
UCHITAKE | 6:590c9622ecf1 | 10 | write(ARM_MDC_ADDR, SLIDER_NUMBER, speed); |
UCHITAKE | 6:590c9622ecf1 | 11 | } |
UCHITAKE | 6:590c9622ecf1 | 12 | |
UCHITAKE | 6:590c9622ecf1 | 13 | void MotorDriver::destroy(float speed) |
UCHITAKE | 6:590c9622ecf1 | 14 | { |
UCHITAKE | 6:590c9622ecf1 | 15 | write(ARM_MDC_ADDR, ARM_NUMBER, speed); |
UCHITAKE | 6:590c9622ecf1 | 16 | } |
UCHITAKE | 6:590c9622ecf1 | 17 | |
UCHITAKE | 6:590c9622ecf1 | 18 | void MotorDriver::goXY(float X, float Y, float moment) |
UCHITAKE | 6:590c9622ecf1 | 19 | { |
UCHITAKE | 6:590c9622ecf1 | 20 | quadOmni.computeXY(X, Y, moment); |
UCHITAKE | 6:590c9622ecf1 | 21 | for(int i = 0; i < 4; i++) { |
UCHITAKE | 6:590c9622ecf1 | 22 | write(WHEEL_MDC_ADDR, i, quadOmni.getOutput(i)); |
UCHITAKE | 6:590c9622ecf1 | 23 | } |
UCHITAKE | 6:590c9622ecf1 | 24 | } |
UCHITAKE | 6:590c9622ecf1 | 25 | |
UCHITAKE | 6:590c9622ecf1 | 26 | void MotorDriver::goCircular(float r, float rad, float moment) |
UCHITAKE | 6:590c9622ecf1 | 27 | { |
UCHITAKE | 6:590c9622ecf1 | 28 | quadOmni.computeCircular(r, rad, moment); |
UCHITAKE | 6:590c9622ecf1 | 29 | for(int i = 0; i < 4; i++) { |
UCHITAKE | 6:590c9622ecf1 | 30 | write(WHEEL_MDC_ADDR, i, quadOmni.getOutput(i)); |
UCHITAKE | 6:590c9622ecf1 | 31 | } |
UCHITAKE | 6:590c9622ecf1 | 32 | } |