-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix multiple bugs, including object detection
Object detection remained broken because getDestination() was accessing the j'th index in the object array, which was one ahead of where it should have been accessing. Rooms larger than 30 cm square could not be properly created and used because hasInterception() was using a hard-coded boundary check which assumed that the room was 30 cm square. The function has been overhauled, and now uses the start and end points of the line in question in its boundary checks. The room has also been adjusted to test this - it is now 60 cm square, and the single object in the room has been moved accordingly. The room class does not automatically have access to a max() function - it must be referenced from the Arduino header. Finally, I noticed that there was some code duplication in regards to float comparison, so I created two new functions to consolidate the code. References #162.
- Loading branch information
Showing
4 changed files
with
146 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#include "room.h" | ||
#include "calc.h"; | ||
#include "Arduino.h"; | ||
|
||
Point::Point() { | ||
this->x = 0.0; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters