Go to Post overly agressive play, sudden torque gains, and signs of robot acne will cause immediate suspicion, and may be used as justification for a complete tear-down inspection - dlavery [more]
Home
Go Back   Chief Delphi > Technical > Programming > Python
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 11-02-2015, 17:49
razar51 razar51 is offline
Registered User
AKA: John Faulkner
FRC #1288 (Raven Robotics)
Team Role: Mentor
 
Join Date: Jan 2015
Rookie Year: 2007
Location: St. Charles, MO
Posts: 10
razar51 is an unknown quantity at this point
Prevent code crash when Camera unplugged.

I am currently using the automatic capture function to display a USB camera feed on the driver station, and I ran into a potential problem.

Since the roborio assigns a name to the USB camera, and the code must call out that name in order to define the correct camera object, when the camera is unplugged the code will crash on Init. This means that if someone accidentally unplugs the camera before a match the robot code will crash and the robot will do nothing for the whole match.

The same thing happens if the camera is replaced by a different camera (since the roborio assigns a different name).

Is there a way to wrap some protective code around the camera initialization so that it will not cause the code to crash in the absence of a camera? Or is there a way to query the names of the devices currently plugged into the roborio?
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 03:47.

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