View Single Post
  #5   Spotlight this post!  
Unread 14-02-2016, 01:17
1452-Leo 1452-Leo is offline
Registered User
FRC #1452 (Omnicats)
Team Role: Alumni
 
Join Date: Dec 2014
Rookie Year: 2014
Location: Los Angeles
Posts: 44
1452-Leo is an unknown quantity at this point
Re: Diagnosing a crash

Quote:
Originally Posted by nighterfighter View Post
When you say it crashes with zero input:
Does it crash moments after you go into teleop?
Or a few minutes after enabling teleop and driving around?
If the first situation: You have something being initialized that the code doesn't like. If the second, it's possible you may have a memory leak? But more likely if you're doing stuff with IMAQ, it is related to that.
You aren't accidentally dividing by zero are you? I had that problem in 2012 when using the camera for tracking; Sometimes when it lost the target it would give something a value of 0 and try to divide with it.
It crashes 30 seconds to a minute after enabling teleop, regardless of movement/action. I was thinking it could be a memory leak earlier today, but the Roborio's free RAM as shown on the Driver Station stayed constant at around 115 mb throughout the testing.

Here is my IMAQ code in my TeleopPeriodic:
Code:
IMAQdxGrab(session, frame, true, NULL);
if(imaqError != IMAQdxErrorSuccess) {
	DriverStation::ReportError("IMAQdxGrab error: " + std::to_string((long)imaqError) + "\n");
} else {
	if (reversed){
		imaqFlip(frame,frame,FlipAxis_enum::IMAQ_VERTICAL_AXIS);
	} else {
		imaqFlip(frame,frame,FlipAxis_enum::IMAQ_CENTER_AXIS);
	}
	CameraServer::GetInstance()->SetImage(frame);
}
As you can see, I am only using IMAQ to mirror the image stream on command, not do any processing with it. Would this cause any issues? Thanks again!