-
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.
Instead of allowing the robot to move into a wall or side of object, and waiting until a subsequent move to see if that move is going through the wall or side of object, the code now checks after the destination has been determined, to see if that destination lies on a wall or side of object, and if so, adjusts the destination to a point at a shorter distance. Because scanning relies on the destination being a point on a wall or side of object, a bool was added to the getDestination function to differentiate between the two states. A new Point constructor was created that takes two floats directly, and the existing constructor was re-written to call this new constructor. If there was any error in the simulator, the move response would always return a status of false, which was undesired behaviour. The code has been adjusted so that it only returns false if the robot would have hit a wall or side of object. The addObject function was altered so that index could be a private variable, since there would never be a situation where an object would be replaced mid-runtime - a different room would be created instead. The stop response code was corrected to use the global distTravelled variable instead of its own variable. Finally, some preliminary edits in relation to indentation were made, to comply with the repository style guide. References #164.
- Loading branch information
Showing
6 changed files
with
71 additions
and
73 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
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