|
Re: Team 599 Robodox - 2011 Logomotion Code
If I recall correctly, pointers are constructed when the code is first called then destructed when they are no longer needed. The code is called upon three times, once when the robot first turns on, when autonomous begins, and finally when the tele-op period begins. With pointers, the values of the variables are reset to their original position because a new copy is constructed for autonomous and a new copy is constructed for teleop. Otherwise, as with an object, when tele-op begins, the state that the sensor was last left in will now be its zero state. This could cause problems with an automatic lift system using an encoder or with gyroscopes on the robot.
__________________

2011: Head Scout
2012: (figure)Head Programmer
2013: Head Programmer, Chief Strategist, Outreach Executive, and Driver
|