NHK2017Ateamかにろぼ
Dependencies: 2017NHKpin_config mbed FEP HMC6352 MotorDriverController PID QEI omni
\ ̄\ / ̄/ /l \ \ / / lヽ | ヽ ヽ | | / / | \ ` ‐ヽ ヽ ● ● / / ‐ / \ __ l | ||___|| / l __ / \ \ / \/ /\| 人__人 |/\ //\| |/\\ //\| |/\\ / . \_____/ \ ┏┓ ┏━┓┏┓ ┏┓ ┏┓┏┓ ┏┓ ┏┓┗┛ ┏┓ ┗┓┃┗┛ ┏┛┗━┓ ┃┃┃┃ ┃┃┏━┛┗┓┏┓┏┛┗━┓┃┃┏┓┏┓┏━━━┓ ┗┓┏━┛ ┃┃┗┛ ┃┃┗━┓┏┛┗┛┗┓┏┓┃┗┛┗┛┃┃┗━━━┛ ┏┛┃┏━┓┃┗━━┓┃┃┏━┛┗┓ ┏┛┃┃┃ ┃┃ ┃┏┛┗━┛┗━━┓┃┃┃┃┏┓┏┛ ┗━┛┃┃ ┃┃┏┓ ┃┃┏━━┓┏━━┛┃┃┃┃┗┛┃ ┏┛┃ ┃┃┃┗━━┓ ┗┛┗━━┛┗━━━┛┗┛┗━━┛ ┗━┛ ┗┛┗━━━┛
bot/motor_driver/motor_driver.cpp@2:ea151e05033a, 2017-08-22 (annotated)
- Committer:
- UCHITAKE
- Date:
- Tue Aug 22 11:56:47 2017 +0000
- Revision:
- 2:ea151e05033a
- Parent:
- 1:269914e0aa07
???????
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
UCHITAKE | 0:757e9800c103 | 1 | #include "motor_driver.h" |
UCHITAKE | 0:757e9800c103 | 2 | |
UCHITAKE | 2:ea151e05033a | 3 | MotorDriver::MotorDriver() : MDC(MDSDA, MDSCL) |
UCHITAKE | 1:269914e0aa07 | 4 | { |
UCHITAKE | 1:269914e0aa07 | 5 | MotorSTOP(); |
UCHITAKE | 1:269914e0aa07 | 6 | } |
UCHITAKE | 1:269914e0aa07 | 7 | |
UCHITAKE | 1:269914e0aa07 | 8 | void MotorDriver::moveSlider(float speed) |
UCHITAKE | 1:269914e0aa07 | 9 | { |
UCHITAKE | 1:269914e0aa07 | 10 | write(ARM_MDC_ADDR, SLIDER_NUMBER, speed); |
UCHITAKE | 1:269914e0aa07 | 11 | } |
UCHITAKE | 1:269914e0aa07 | 12 | |
UCHITAKE | 1:269914e0aa07 | 13 | void MotorDriver::destroy(float speed) |
UCHITAKE | 1:269914e0aa07 | 14 | { |
UCHITAKE | 1:269914e0aa07 | 15 | write(ARM_MDC_ADDR, ARM_NUMBER, speed); |
UCHITAKE | 1:269914e0aa07 | 16 | } |
UCHITAKE | 1:269914e0aa07 | 17 | |
UCHITAKE | 1:269914e0aa07 | 18 | void MotorDriver::goPolar(double parallelVector[], double moment) |
UCHITAKE | 1:269914e0aa07 | 19 | { |
UCHITAKE | 1:269914e0aa07 | 20 | quadOmni.computePolar(parallelVector, moment); |
UCHITAKE | 1:269914e0aa07 | 21 | for(int i = 0; i < 4; i++) { |
UCHITAKE | 1:269914e0aa07 | 22 | write(WHEEL_MDC_ADDR, i, quadOmni.getOutput(i)); |
UCHITAKE | 1:269914e0aa07 | 23 | } |
UCHITAKE | 0:757e9800c103 | 24 | } |