Go to Post (This is why Non-Engineering Mentors make the dinner plans for the team...) - KathieK [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 Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 19-02-2011, 22:35
CodeMonkeyMatt CodeMonkeyMatt is offline
Registered User
FRC #2605
 
Join Date: Jan 2011
Rookie Year: 2008
Location: WA
Posts: 46
CodeMonkeyMatt is on a distinguished road
Enabling PIDController Crashes Windriver

I'm attempting to use a PIDController for positioning the robot. I created a PIDSource class based on the camera, and a PIDOutput that goes to all four drive motors. All this is created in the robot constructor without a hitch (that I can see at least). I'm using CANJaguars and the IterativeRobot template.

The problem comes when I attempt to enable the PIDController in the AutonomousInit function. At that line, the program crashes and when Windriver attaches the debugger, it goes into the assembly code. I've followed it to the "strafeController.Enable();" line though, so I'm sure it's that. It's our first year of PID, so I'm still a little lost.

Code:
45         ShsAlignCam *alignCam;  
46         ShsStrafePID *strafer;  
47         PIDController *strafeController;  
...
 BuiltinDefaultCode(void):  
96         camera(AxisCamera::GetInstance())  
97         {  
...
157                 alignCam = new ShsAlignCam();  
158                 strafer = new ShsStrafePID(leftFront, rightFront, leftBack, rightBack);  
159                 strafeController = new PIDController(1, 0.001, 0.0, alignCam, strafer);  
...
183         }  
...
 void AutonomousInit(void) {  
...
227                 strafeController->SetSetpoint(0);  
228                 strafeController->Enable();  
...    
237         }
Any ideas? Happy to answer questions if you have them.

Edit: Just realized what I typed in as the title. It crashes my program, not windriver. Windriver tells me that it crashed. I'm tired.

Another Edit: I'm going to call it a night due to the English paper due Monday hanging over my head. Here's hoping that someone sees this by tomorrow and can help.

Last edited by CodeMonkeyMatt : 19-02-2011 at 22:50.
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


All times are GMT -5. The time now is 13:36.

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