Go to Post Okay guys I am enabling the robot. Honestly I have know idea what it is going to do. SO MOVE!! - JulieB [more]
Home
Go Back   Chief Delphi > Technical > Technical Discussion
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #3   Spotlight this post!  
Unread 03-02-2015, 22:35
taichichuan's Avatar
taichichuan taichichuan is offline
Software Mentor
AKA: Mike Anderson
FRC #0116 (Epsilon Delta)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Herndon, VA
Posts: 328
taichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud oftaichichuan has much to be proud of
Send a message via AIM to taichichuan
Re: Dual Cameras?

Quote:
Originally Posted by Adamz_ View Post
I'm going off of memory here because i don't have a roboRio to test with, but I'm fairly certain that within the Rio's web interface you can change the names of cameras to satisfy having the name cam0 or cam1.

Another way around this is with the cameraServer class, wich allows you to specify what camera you want to get the feed one.

For the example below, you would be receiving data from cam3 on the rio dashboard.
Code:
void CameraServer::StartAutomaticCapture (cam3)
If the above code doesn't make much sense i apologize, but I'm a java programmer.
Thanks for the suggestion, but we already tried this. The camera server code does not have a stop method and trying to use a camera other than 0 results in lots of errors being displayed in the messages windows. In particular, failures in line 33 of the USBCamera class related to setting the jpeg compression ratio.

It would be nice if you could:

If (button1) {
CameraServer::GetInstance()->StartAutomaticCapture("cam0");
}
if (button2) {
CameraServer::GetInstance()->StartAutomaticCapture("cam1");
}

But, that fails miserably. This is due to several reasons. First, the StartAutomaticCapture ends up creating threads, opening sockets etc. for which there is no clean shutdown method in the class. Second, even if there were a clean shutdown method, there is an m_camera member in the class that is hard coded to camera 0.

So, there is no way to clean up if you shut could shut the class down. And, if you tried to force it in Linux by killing the thread manually, this will undoubtedly come back to haunt you toward the end of the match because the thread probably has resources tied up.

So, does anyone have any other ideas?

TIA,

Mike
 


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 08:40.

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