View Single Post
  #5   Spotlight this post!  
Unread 16-10-2014, 20:58
matan129 matan129 is offline
Registered User
FRC #4757 (Talos)
Team Role: Programmer
 
Join Date: Oct 2014
Rookie Year: 2015
Location: Israel
Posts: 19
matan129 is an unknown quantity at this point
Re: Vision Processing with Raspberry Pi

Quote:
Originally Posted by jman4747 View Post
Unfortunately I have only done this in LabView and I believe you mentioned using C++. I never did find an example of how to utilize the RS-232 port on the C-Rio and had to ask around here (CD) and experiment which I imagine you will have to do. I could post some LV examples so you can get an idea of the algorithm at least. Also I didn't do much of the work with the R-PI so I can't advise as much there though there are way more tutorials on using the UART on the PI.

Basically UART and RS-232 allow you to send ascii characters over the bus. This makes it very easy to come up with your own command set for your system. You can basically tell the PI to write "SHOOT" or "stop" to the UART and the RIO will see the characters "SHOOT" or "STOP" on the other end and vise versa. You can for instance use an equal to comparator to check if what is in the input buffer is "SHOOT" or not and if it is output a TRUE to be used by some other part of the code.
Alright, I start to get the idea of how this works. So, generally speaking, I should check for UART input (somehow) on the robot side. If I get a predefined command from the RPi (like "Shoot", or "move X degrees left") I should interrupt the currently running command / add a command in the scheduler and so on.
In addition, you have mentioned differences between the cRio (which I have now and I can test on before the kickoff) and the new RoboRio - are these changes going to affect dramatically the code? (I mean more then just changing the line that reads the UART input to the new one, for example)