View Single Post
  #20   Spotlight this post!  
Unread 03-02-2009, 08:08
sircedric4's Avatar
sircedric4 sircedric4 is offline
Registered User
AKA: Darren
no team (The SS Prometheus)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Lousiana
Posts: 245
sircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond repute
Re: WPILib PID controller object

Quote:
You were declaring a pointer to all of these classes and then allocating local versions in TeleopInit. The local version were being deleted when TeleopInit returned and the pointers you had in TeleopPeriodic were NULL and causing your program to crash.
Thanks! I have run into similar problems before when I tried to translate what code supposedly works in the SimpleRobot class examples to work in the IterativeRobot class with header files. Can you point me to some website or something that explains what all these pointers and local versions and such are? I only learned enough C to make the old control system work and that was extremely straightforward but this object oriented stuff for the new system is just hard for an old school VB programmer. I spend all my time fighting nomenclature because I don't understand it instead of programming good stuff.

Anyway, the program compiled with the changes above but I'll have to wait till tonight to see if I'll get the good old crash of death. Thanks again, I owe you a drink of your choice somehow. :-)

Edited:
Wow, as I was typing one thank you, a class on what I was doing wrong showed up! Thanks to Abwehr as well in some instruction. I hope my ignorance helps some other teams out there that are just coding through the monkey-see monkey do steal from examples type of coding I am doing.

Last edited by sircedric4 : 03-02-2009 at 08:12.
Reply With Quote