Go to Post Also, I did not know that Autodesk had changed our name from WildStang to "Digital Cheetanators"? - Raul [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
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 09-04-2014, 19:35
nstephenh nstephenh is offline
Registered User
FRC #0900
 
Join Date: Oct 2013
Location: North Carolina
Posts: 20
nstephenh is on a distinguished road
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?
Reply With Quote
  #2   Spotlight this post!  
Unread 09-04-2014, 21:50
Kevin Phan's Avatar
Kevin Phan Kevin Phan is offline
College Student
FRC #0357 (Royal Assault)
Team Role: Alumni
 
Join Date: Apr 2013
Rookie Year: 2010
Location: PA, United States
Posts: 95
Kevin Phan will become famous soon enoughKevin Phan will become famous soon enough
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.
__________________
VEX & FRC Student Team Member #357 Royal Assault 2010-2014 "Dare Mighty Things"
2014-2019 Attending Drexel University Major:Electrical Enginnering
Reply With Quote
  #3   Spotlight this post!  
Unread 10-04-2014, 07:34
nstephenh nstephenh is offline
Registered User
FRC #0900
 
Join Date: Oct 2013
Location: North Carolina
Posts: 20
nstephenh is on a distinguished road
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.
Reply With Quote
  #4   Spotlight this post!  
Unread 10-04-2014, 08:56
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,113
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: 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?
Reply With Quote
  #5   Spotlight this post!  
Unread 10-04-2014, 15:16
nstephenh nstephenh is offline
Registered User
FRC #0900
 
Join Date: Oct 2013
Location: North Carolina
Posts: 20
nstephenh is on a distinguished road
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.
Reply With Quote
  #6   Spotlight this post!  
Unread 10-04-2014, 16: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,113
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: Dashboard Robot SDRead Communication Problems

Quote:
Originally Posted by nstephenh View Post
Our robot writes the value it gets from the camera to the dashboard, so we can do vision processing on a laptop.
That is not a very good way to do it. Given the network architecture we use, I would go so far as to call it a spectacularly poor way to do it.

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.
Reply With Quote
  #7   Spotlight this post!  
Unread 10-04-2014, 18:01
prometheusLKR prometheusLKR is offline
Registered User
FRC #0900
 
Join Date: Jan 2014
Location: Raleigh
Posts: 3
prometheusLKR is an unknown quantity at this point
Re: Dashboard Robot SDRead Communication Problems

Quote:
Originally Posted by Alan Anderson View Post
That is not a very good way to do it. Given the network architecture we use, I would go so far as to call it a spectacularly poor way to do it.

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.
We tried doing that, and because of the internal buffering of the camera, if we use the dashboard Read MJPG just when we want to get a new image, the image is not current, and if we read from the camera continuously, we have bandwidth issues (even at low resolution and frame rate, it resulted in our robot losing communication with the field at the NC Regional). We seem to have been able to solve this issue by running the "MJPG Loop" vi in Periodic Tasks, and when we need an image, we get the image string and communicate it using a network tables variable. This has resulted in being able to consistently get a current image, something we were never able to accomplish getting the image directly from the camera in dashboard code.

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
Reply With Quote
  #8   Spotlight this post!  
Unread 12-04-2014, 06:40
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,752
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: 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
Reply With Quote
  #9   Spotlight this post!  
Unread 12-04-2014, 22:05
prometheusLKR prometheusLKR is offline
Registered User
FRC #0900
 
Join Date: Jan 2014
Location: Raleigh
Posts: 3
prometheusLKR is an unknown quantity at this point
Re: Dashboard Robot SDRead Communication Problems

Quote:
Originally Posted by Greg McKaskle View Post
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
OK, thanks. I'll try and see if I can get the JPG option working sometime, although I think we're going to stick with network tables for championships since it's been working consistently and we wouldn't have much time to test out a new approach before championships.
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 20:16.

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