https://github.com/apocalypsecalculator/sumobot
TER4UP Sumobot project, April 2023
https://github.com/apocalypsecalculator/sumobot
Last synced: 19 days ago
JSON representation
TER4UP Sumobot project, April 2023
- Host: GitHub
- URL: https://github.com/apocalypsecalculator/sumobot
- Owner: ApocalypseCalculator
- Created: 2023-02-13T15:40:55.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-04-19T07:58:12.000Z (about 3 years ago)
- Last Synced: 2025-07-05T12:48:23.641Z (about 1 year ago)
- Language: C++
- Homepage:
- Size: 51.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sumo Bot
1. scan for enemies
2. charge towards enemy
3. ???
4. profit
#### Optimizations
The final optimized code is in [sumobot_clean.ino](https://github.com/ApocalypseCalculator/SumoBot/blob/master/sumobot_clean.ino).
Several optimizations were made to reduce the latency of the loop:
1. When compiling the program the GCC compiler option `-Ofast` was set instead of the stock `-Os` (level 2 with file size optimization), which enables level 3 optimizations as well as some non-standard math optimizations. The compiler options were edited in `platform.txt` at `%LocalAppData%\Arduino15\packages\arduino\hardware\avr\1.8.6`.
2. The denoising/outlier removal of sensor values was removed as a tradeoff for performance
3. Accelerometer was removed entirely
4. The gradual acceleration/deceleration was removed
5. Any non-essential code like Serial and debug LEDs or redundant `digitalWrite()` were removed
Overall the latency of the loop was reduced from 250ms/iteration to roughly 25ms/iteration, **a 10x decrease!**