Go to Post I'm sure there aren't a bunch of rule makers sitting in a board room discussing "What rule can we change now to mess with the teams' heads?" Lets all just sit back and enjoy the regionals! - Rick [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

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 12-03-2014, 14:50
Goldenchest Goldenchest is offline
Goldenchest
AKA: Gary Chien
FRC #1758 (Technomancers)
Team Role: Programmer
 
Join Date: Dec 2012
Rookie Year: 2010
Location: United States
Posts: 17
Goldenchest is an unknown quantity at this point
What is the simplest way to access files from the cRIO during Auto/Teleop mode?

More specifically, I need to be able to send camera images in .jpg format from the cRIO to the driver station to do vision processing.

I'm pretty sure that the solution to this is extremely simple, but I've never done anything like this before. How would I send files from the cRIO to the driver station using C++?
Reply With Quote
  #2   Spotlight this post!  
Unread 12-03-2014, 15:23
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: What is the simplest way to access files from the cRIO during Auto/Teleop mode?

Is there a requirement that the camera images go through the cRIO on the way to the operator console? Vision processing on the driver station typically communicates directly with the camera.
Reply With Quote
  #3   Spotlight this post!  
Unread 12-03-2014, 15:55
Goldenchest Goldenchest is offline
Goldenchest
AKA: Gary Chien
FRC #1758 (Technomancers)
Team Role: Programmer
 
Join Date: Dec 2012
Rookie Year: 2010
Location: United States
Posts: 17
Goldenchest is an unknown quantity at this point
Re: What is the simplest way to access files from the cRIO during Auto/Teleop mode?

Quote:
Originally Posted by Alan Anderson View Post
Is there a requirement that the camera images go through the cRIO on the way to the operator console? Vision processing on the driver station typically communicates directly with the camera.
How do I get the driver station to communicate directly with the camera in the code? I would like to be able to write .jpg files to the driver station. Any code samples would be greatly appreciated!

Last edited by Goldenchest : 12-03-2014 at 15:58.
Reply With Quote
  #4   Spotlight this post!  
Unread 12-03-2014, 16:33
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: What is the simplest way to access files from the cRIO during Auto/Teleop mode?

The default Dashboard program already connects to the camera and writes .jpg files to the computer. It's written in LabVIEW. Create a new Dashboard project and use it as your code sample.
Reply With Quote
  #5   Spotlight this post!  
Unread 12-03-2014, 17:14
Goldenchest Goldenchest is offline
Goldenchest
AKA: Gary Chien
FRC #1758 (Technomancers)
Team Role: Programmer
 
Join Date: Dec 2012
Rookie Year: 2010
Location: United States
Posts: 17
Goldenchest is an unknown quantity at this point
Re: What is the simplest way to access files from the cRIO during Auto/Teleop mode?

Is there any way to do it completely in C++, though? My team has zero experience with LabView.

I've been browsing other threads, and some of them mention using FTP to get files off of the cRIO (using software like FileZilla). Is this a viable way to do it, or is there a much simpler way to write the file to the driver station? Haha sorry, I'm still sort of an amateur at this stuff.

If any examples of relevant C++ code could be posted, I would very much appreciate it. Thanks!
Reply With Quote
  #6   Spotlight this post!  
Unread 12-03-2014, 17:37
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: What is the simplest way to access files from the cRIO during Auto/Teleop mode?

The default Dashboard already connects to the camera and writes .jpg files to the computer. Look in the dashboard directory to find them.
Reply With Quote
  #7   Spotlight this post!  
Unread 12-03-2014, 17:43
Goldenchest Goldenchest is offline
Goldenchest
AKA: Gary Chien
FRC #1758 (Technomancers)
Team Role: Programmer
 
Join Date: Dec 2012
Rookie Year: 2010
Location: United States
Posts: 17
Goldenchest is an unknown quantity at this point
Re: What is the simplest way to access files from the cRIO during Auto/Teleop mode?

I've attached two screenshots. Is this the directory you are referring to? I don't see any images automatically saved in there :/

If it's possible, could you show me some screenshots of your own of the dashboard directory?

Sorry about the trouble! This has been befuddling me for a while.
Attached Thumbnails
Click image for larger version

Name:	DashboardDirectory.PNG
Views:	21
Size:	23.3 KB
ID:	16548  Click image for larger version

Name:	DashboardDirectory_data.PNG
Views:	16
Size:	18.1 KB
ID:	16549  
Reply With Quote
  #8   Spotlight this post!  
Unread 13-03-2014, 08:26
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: What is the simplest way to access files from the cRIO during Auto/Teleop mode?

To answer your direct question, I'd say ftp. To answer your bigger question, I'd say ... don't do it that way.

To get images directly from the camera, you use an HTTP session where you request an mjpeg stream and decode it. This is how the cRIO does it, and it is how the dashboard does it. The camera can handle about five sessions at once.

If you want to process images on the cRIO using C++, that seems pretty straightforward. If you want to process images on the dashboard using LV, that is pretty straightforward. If you install LV and follow Tutorial 8 on the Getting Started window, you will have the basic goal detection working.

If you want to use C++ on the dashboard computer, you have much more work that you will need to do yourself. WPILib may be helpful, but I suspect there will be lots of issues you will need to fix.

Don't forget that you will also need to get the results of the image processing back to the robot.

I'd be happy to help, but you will need to broaden your approach.

Greg McKaskle
Reply With Quote
  #9   Spotlight this post!  
Unread 14-03-2014, 23:23
lucas.alvarez96's Avatar
lucas.alvarez96 lucas.alvarez96 is offline
Registered User
AKA: Lucas Alvarez
FRC #2576 (Chilean Heart)
Team Role: Mentor
 
Join Date: Dec 2013
Rookie Year: 2013
Location: Chile
Posts: 116
lucas.alvarez96 is a name known to alllucas.alvarez96 is a name known to alllucas.alvarez96 is a name known to alllucas.alvarez96 is a name known to alllucas.alvarez96 is a name known to alllucas.alvarez96 is a name known to all
Re: What is the simplest way to access files from the cRIO during Auto/Teleop mode?

Or you could just leave all of that aside, and do the vision processing with direct access to your AXIS cam, with the following IP address: "http://10.TE.AM.11/mjpg/video.mjpg". You'd just have to send the results from the vision analysis via Network Tables or UDP/TCP. I've got my vision code with python and Network Tables ready, so if you need it, just send me a P.M.
Good luck!
__________________
FRC 2576 2015-???: Mentor
FRC 2576 2013-2015: Programmer & Chairman's Presenter

Los Angeles Regional 2013: Gracious Professionalism Award | Los Angeles Regional 2014: Regional Chairman's Award

Reply With Quote
Reply


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 02:44.

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