View Single Post
  #9   Spotlight this post!  
Unread 17-12-2011, 13:41
xraymypanda's Avatar
xraymypanda xraymypanda is offline
Cowboy programmer
AKA: Chris M
FRC #0599 (RoboDox)
Team Role: Programmer
 
Join Date: Dec 2011
Rookie Year: 2011
Location: Granada Hills,CA
Posts: 82
xraymypanda has a spectacular aura aboutxraymypanda has a spectacular aura about
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
Reply With Quote