1.5 KiB
Exercise to Engage the Code
These are questions that ask you to explore the code in a specific way. They highlight important functionality and flow-of-control. You might want to jot down the answers for your own use as you spend time learning the code. It will probably take you a minimum of 2 hours just to understand how all the pieces fit together. We highly recommend you spend time understanding the framework before adding a single line of code.
Answer the Following Questions Based on Iteration1 Code
-
What does GraphicsArenaViewer::DrawUsingNanoVG() do?
-
When does this get called?
-
How is it that the Recharge Station is being drawn - there is no command to draw it?
-
What entities exist in the Arena?
- For each entity, what is it's base (parent) class?
-
Where does the system check for collisions (look in Arena.cc)?
-
When does this happen (i.e. where is it in flow-of-control)?
-
What is the logic for checking for colliding with walls?
-
What is the logic for checking for colliding with other entities?
-
Trace the EventCollision from the point at which it is created in Arena to the robot sensor. What does the sensor record when a collision happens?
-
The RobotMotionHandler reads the touch sensor. What does it do with this information?
-
Identify the method (function) that updates the robot position. Trace flow-of-control from the call UpdateSimulation in GraphicsArenaViewer.
-
What is the equation used to calculate the deltaX and deltaY for the robot and update the position?