|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Dashboard Robot SDRead Communication Problems
We are having some difficulties reading variables from the smart dashboard. The SD Write vi's are working fine, and from the "Variables" tab of the dashboard we can verify that the variables' values are updating, but when we run the SD Read vi's in the robot code, we get either old or default values. This does not happen consistently, and when it does it only happens with some variables. Our robot can drive with no problems, and closing and reopening the dashboard fixes the issue. Any ideas?
|
|
#2
|
||||
|
||||
|
Re: Dashboard Robot SDRead Communication Problems
You might want to post a screenshot of your code so we can see if it is correct. You need a while loop to continually update your sensor value. It should be placed in periodic task with a delay of either 10 or 100 ms.
|
|
#3
|
|||
|
|||
|
Re: Dashboard Robot SDRead Communication Problems
We only write our sensor value once, because it is an image from our camera and we are concerned with bandwidth issues.
We have read that we are not supposed to write to the dashboard from the dashboard, and instead update a control. We will try this, and post our result. |
|
#4
|
|||||
|
|||||
|
Re: Dashboard Robot SDRead Communication Problems
I can't think of any reason for wanting to write a camera image as a Smart Dashboard variable. Why are you trying to do that? What do you use the image for?
|
|
#5
|
|||
|
|||
|
Re: Dashboard Robot SDRead Communication Problems
Our robot writes the value it gets from the camera to the dashboard, so we can do vision processing on a laptop. The robot then reads the value from the dashboard and uses that data to tell if the goal is hot.
|
|
#6
|
|||||
|
|||||
|
Re: Dashboard Robot SDRead Communication Problems
Quote:
Your dashboard program should be getting the image directly from the camera, without forcing the robot program and Smart Dashboard communication to be an intermediary. The default Dashboard already connects to the camera and reads the image. You just need to feed that image to your vision processing. |
|
#7
|
|||
|
|||
|
Re: Dashboard Robot SDRead Communication Problems
Quote:
This is, however, not the problem being discussed in the thread, and as an update on that issue (not getting correct values with SD Read Boolean and Read Numeric), we seem to have been able to fix the problem by switching from SD Read and Write vi's to NT Read and Write vi's. ~another programmer from OP's team |
|
#8
|
|||
|
|||
|
Re: Dashboard Robot SDRead Communication Problems
Just to clarify a few things. The SD and NT functions work almost identically except that the SD functions automatically add "SmartDashboart/" to the variable name in order to keep it separate from the other types of Network Table variables. The storage, transmission approach and other aspects are the same.
I believe the size limit of strings is actually pretty small. It is implementation dependent, but cannot be larger than 65k characters. So in some implementations you may be able to store an image, but that may not work consistently. I'm not sure I have enough info to give a suggestion on how to setup your camera, but the camera supports both JPG read of a single image and an MJPG session which sends images without asking for each. If using MJPG, you need to read them as fast as they are sent or they will lag behind. You can ask the camera for a very low framerate. Because it was not often needed and caused confusion, I believe the JPG option is in vi.lib, but not in the palettes. If you want to use it, it is in the same folder as the other camera VIs. Greg McKaskle |
|
#9
|
|||
|
|||
|
Re: Dashboard Robot SDRead Communication Problems
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|