SmartWheels self-driving race car. Designed for NXP Cup. Uses FRDM-KL25Z, area-scan camera, and simple image processing to detect and navigate any NXP spec track.
Dependencies: TSI USBDevice mbed-dev
Fork of SmartWheels by
RemovedSources/WheelEncoder.h.txt@100:ffbeefc9e218, 2017-04-20 (annotated)
- Committer:
- hazheng
- Date:
- Thu Apr 20 21:04:10 2017 +0000
- Revision:
- 100:ffbeefc9e218
- Parent:
- 87:15fcf7891bf9
Better version of Intersection detection.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hazheng | 65:295c222fdf88 | 1 | #if 0 |
hazheng | 65:295c222fdf88 | 2 | |
Bobymicjohn | 15:eb6a274b3dfb | 3 | #pragma once |
Bobymicjohn | 15:eb6a274b3dfb | 4 | |
Bobymicjohn | 15:eb6a274b3dfb | 5 | #include <mbed.h> |
Bobymicjohn | 15:eb6a274b3dfb | 6 | |
Bobymicjohn | 15:eb6a274b3dfb | 7 | namespace SW |
Bobymicjohn | 15:eb6a274b3dfb | 8 | { |
Bobymicjohn | 15:eb6a274b3dfb | 9 | class Core; |
Bobymicjohn | 15:eb6a274b3dfb | 10 | } |
Bobymicjohn | 15:eb6a274b3dfb | 11 | |
Bobymicjohn | 15:eb6a274b3dfb | 12 | class WheelEncoder |
Bobymicjohn | 15:eb6a274b3dfb | 13 | { |
Bobymicjohn | 15:eb6a274b3dfb | 14 | public: |
Bobymicjohn | 15:eb6a274b3dfb | 15 | WheelEncoder(SW::Core &core); |
Bobymicjohn | 15:eb6a274b3dfb | 16 | |
Bobymicjohn | 15:eb6a274b3dfb | 17 | ~WheelEncoder(); |
Bobymicjohn | 15:eb6a274b3dfb | 18 | |
Bobymicjohn | 15:eb6a274b3dfb | 19 | void Update(float deltaTime); |
Bobymicjohn | 15:eb6a274b3dfb | 20 | |
Bobymicjohn | 15:eb6a274b3dfb | 21 | private: |
Bobymicjohn | 15:eb6a274b3dfb | 22 | |
Bobymicjohn | 15:eb6a274b3dfb | 23 | void pulseInRRight(); |
Bobymicjohn | 15:eb6a274b3dfb | 24 | |
Bobymicjohn | 15:eb6a274b3dfb | 25 | void pulseInRLeft(); |
Bobymicjohn | 15:eb6a274b3dfb | 26 | |
Bobymicjohn | 15:eb6a274b3dfb | 27 | SW::Core& m_core; |
Bobymicjohn | 15:eb6a274b3dfb | 28 | |
Bobymicjohn | 15:eb6a274b3dfb | 29 | InterruptIn m_intRL; |
Bobymicjohn | 15:eb6a274b3dfb | 30 | |
Bobymicjohn | 15:eb6a274b3dfb | 31 | InterruptIn m_intRR; |
Bobymicjohn | 15:eb6a274b3dfb | 32 | |
Bobymicjohn | 15:eb6a274b3dfb | 33 | Timer m_rrightTimer, m_rleftTimer; |
Bobymicjohn | 15:eb6a274b3dfb | 34 | |
Bobymicjohn | 15:eb6a274b3dfb | 35 | float m_rrDuration, m_rlDuration; |
hazheng | 65:295c222fdf88 | 36 | }; |
hazheng | 65:295c222fdf88 | 37 | #endif //if 0 |