Go to Post We'll get through this as a community, this we know. - JaneYoung [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 06-02-2015, 19:55
FleventyFive FleventyFive is offline
Registered User
FRC #4118
 
Join Date: Sep 2014
Location: Gainesville, FL
Posts: 23
FleventyFive is on a distinguished road
Program crashing when grabbing USB Camera frame + misc comm issues

I'm trying to work on vision code or at least displaying a camera feed on the dashboard, but the program crashes on the function where I set the camera server frame. I know about the StartAutomaticCapture function but I'm trying to actually have each frame in memory so I can threshold it or w/e. I have a command that executes this every update time (5 ms or whatever the default is).
Code:
	cam->GetImage(NIframe);

	CameraServer::GetInstance()->SetImage( NIframe );

	Wait(0.1);
This causes the program to crash. The DriverStation says there is no RobotCode until I redeploy it/restart the roborio. The debugger says it is on this line (66) of wpilib's CameraServer.cpp.
Code:
     
    while (start < dataSize - 1) {
      if (data[start] == 0xFF && data[start + 1] == 0xD8) break;
      else start++;
    }
The header file for this command declares these variables
Code:
	USBCamera *cam;
	Threshold *thresh;
	ColorImage *frame;
	Image *NIframe;
	BinaryImage *binaryFrame;
It's been pretty frustrating trying to figure this out. Any ideas? I'm not sure if I'm making an obvious mistake or this is actually an odd issue. Also, even without any vission stuff happening we seem to have communication drops for a second every once in a while, but this might just be low battery. Is my program perhaps too big? It is CommandBassed with like 10 command and 3 subsystems and a few PID loops. Thanks!
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 12:07.

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