only save images when commanded over network?
Doug Wegscheid from United States  [4 posts]
7 year
We have a good pipeline for our FRC robot, but we don't know how it will hold up in competition.

One of the things we would like to do is to get the pipeline to save an image (or images) at certain critical moments for post-match troubleshooting in case of unexpected results...

We're using UDP to communicate between RoboRealm and the roboRIO.

Is there an example of receiving data via UDP, then saving it so we can use the received data in an "IF"?

Is there an example of only saving images some of the time?
Steven Gentner from United States  [1446 posts] 7 year

This is possible to do. You can surround the Write_Images with an If Statement module and set the Write_Images to number image filenames to avoid overwriting the previous image.

The trick is to figure out what should trigger the save. If coming from UDP are you assuming that you intend to press a button on the joystick to save the image? If you intend to send back a single char to indicate this you can add a \[save_image] (with the \ to indicate a single char) to the SocketClient/Server module which will then set the variable save_image to 1 when you send back a 1 to the module. This can then be used in the If_Statement to trigger a write.

Inside the write image conditional, be sure to then set save_image to 0 to ensure only one image gets written per loop.

Otherwise, you can also create another condition in RR to trigger image writes ... for example, if no target is detected one can save an image too.

Doug Wegscheid from United States  [4 posts] 7 year
Thank you for the clear explanation; I can probably also use that to start an AVI capture.

I will have a followon question....

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index