Go to Post I fear not the drive team who has practiced 10,000 defenses once, but I fear the drive team who has practiced one defense 10,000 times. -Bruce Lee - bEdhEd [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rating: Thread Rating: 75 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #20   Spotlight this post!  
Unread 02-03-2009, 08:08 AM
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 : 02-03-2009 at 08:12 AM.
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
void* pointer to object in C++ byteit101 C/C++ 6 01-14-2009 05:15 PM
UI Board Object Specs 3DWolf Control System 2 12-10-2008 04:13 PM
Demo: Simple robot arm with a PID controller mtomczak Programming 1 01-17-2008 02:17 AM
rangefinding/object detection sciguy125 Electrical 14 01-13-2008 08:36 PM
Object Enablers SherryG Inventor 1 04-07-2006 10:01 AM


All times are GMT -5. The time now is 09:39 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi