-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simulator #164
Comments
This was referenced Apr 19, 2016
cgmc
added a commit
that referenced
this issue
Apr 20, 2016
Previously, changing the parameters of the room required carefully modifying a number of variables. This was awkward, so it was requested that it be made possible to load different pre-defined rooms based on one variable. Initially, the code was contained in the setup function in the main sketch, but it became immediately apparent that it would look messy and make the main code less maintainable if left there, so a new class was created to hold the new code. Switching between rooms is now accomplished by passing one variable to a function in the new class. To create a Room object without explicitly initializing it, a default constructor was required, so one was written. The currentPosition variable is no longer needed, since a Room object has the robot's current position as a member variable. References #163, #164.
cgmc
added a commit
that referenced
this issue
Apr 21, 2016
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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is another master issue, tracking all simulator-related issues.
The text was updated successfully, but these errors were encountered: