Skip to content
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

Open
4 of 5 tasks
cgmc opened this issue Apr 4, 2016 · 0 comments
Open
4 of 5 tasks

Simulator #164

cgmc opened this issue Apr 4, 2016 · 0 comments
Assignees
Milestone

Comments

@cgmc
Copy link
Contributor

cgmc commented Apr 4, 2016

This is another master issue, tracking all simulator-related issues.

@cgmc cgmc self-assigned this Apr 4, 2016
@cgmc cgmc added the Conor McM label Apr 4, 2016
@cgmc cgmc added this to the Sprint #7 milestone Apr 4, 2016
cgmc added a commit that referenced this issue Apr 14, 2016
Added a square located in the centre of the room, and moved the robot
from the centre (otherwise the robot would appear inside the object).

Also, corrected errors in the object detection code.

References #164, #163.
@cgmc cgmc added in progress and removed ready labels Apr 16, 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
Projects
None yet
Development

No branches or pull requests

3 participants