Back to Blog
Roombo game5/25/2023 ![]() ![]() I considered a visual representation of where Roomba is in the room to be an upgrade of that. I am aware that the brief stated "A text based representation of the robot's position within the room" and That I would learn a lot more by just creating it myself. I was looking at libraries to create a grid for me at the beginning however I quickly realised I haven't created a grid of components before, but it worked out It made sense to me and felt natural.Ĭreating the grid was interesting. It would mount and check to see whether its dirty or whether This way it wouldīe easier to pass certain properties to it. To me the easiest way was to make every single tile a component which knows its own ID. It came apparent to me that there are different ways to bring this Roomba application to life, but By doing this I couldĭetermine what components I would need and where I would keep state. Instructions set for what would minimally achieve what was being looked for. The first thing I did was draw out what I thought the application would look like. Visit 'localhost:3000' in your browser to see the app.The goal of the application is to take the room dimensions, the locations of the dirt patches, and the hoover location as input and to allow the user to navigate the robot around the room.Īs a minimum you should build an interface with: The hoover is always on - there is no need to enable it.ĭriving into a wall has no effect (the robot skids in place). Placing the hoover on a patch of dirt ("hoovering") removes the patch of dirt so that patch is then clean for the remainder of the program run. The room will be rectangular, has no obstacles (except the room walls), no doors and all locations in the room will be clean (hoovering has no effect) except for the locations of the patches of dirt presented in the program input. ![]() Locations of patches of dirt, also defined by X and Y coordinates identifying the bottom left corner of those grid positions. ![]() The bottom left corner is the point of origin for our coordinate system, so as the room contains all coordinates its bottom left corner is defined by X: 0 and Y: 0.Īn initial hoover position (X and Y coordinates like patches of dirt) This room is divided up in a grid based on these dimensions a room that has dimensions X: 5 and Y: 5 has 5 columns and 5 rows, so 25 possible hoover positions. Room dimensions as X and Y coordinates, identifying the top right corner of the room rectangle. ![]()
0 Comments
Read More
Leave a Reply. |