Go to Post It's like FIRST saying "Well it was too hard, so we give up. Lets give the kids something easier to do." How is that supposed to inspire kids? - Mike [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 02-04-2012, 00:40
yabberyabber yabberyabber is offline
Registered User
AKA: Andrew Nelson
FRC #0973
Team Role: College Student
 
Join Date: Jan 2010
Rookie Year: 2008
Location: SLO, Ca and/or Seattle, WA
Posts: 10
yabberyabber is an unknown quantity at this point
Overlaying rectangles over the targets in the camera feed

We've been trying for some time to draw the vision targets over the camera feed so we can check to see if the targeting code is working correctly, and have never been able to get it to work.

What we've done so far is add the dimensions of the rectangle into the HighPriorityDashboard data cluster and then have that data cluster shoved into a global variable in the Dashboard Then in the camera loop we draw four rectangles on the picture depending on the data in the data cluster.
The problem we're having is that when I run the dashboard, labview highlights the variable (Called secret dash data, because I can't figure out how to rename it) and says "corrupt memory".
Here is our dashboard file: http://proj.titanrobotics.net/hg/Frc...oard%20Main.vi - click raw (not sure if labview will allow sharing code like this... if not the entire project is available one directory up)
Here is the C++ code that generates the cluster http://proj.titanrobotics.net/hg/Frc...DataFormat.cpp (although we're fairly confident in it)

Thanks in advance for your help! No one on our team is a labview person, so the answer is probably something pretty silly. I'm sorry if it's something super obvious that I've just overlooked.

Last edited by yabberyabber : 02-04-2012 at 20:42.
Reply With Quote
  #2   Spotlight this post!  
Unread 02-04-2012, 20:43
yabberyabber yabberyabber is offline
Registered User
AKA: Andrew Nelson
FRC #0973
Team Role: College Student
 
Join Date: Jan 2010
Rookie Year: 2008
Location: SLO, Ca and/or Seattle, WA
Posts: 10
yabberyabber is an unknown quantity at this point
Re: Overlaying rectangles over the targets in the camera feed

Oops; I forgot to mention the problem. Sorry guys.

The problem is that whenever I try to run it, labview highlights the variable with the dash data (called secret dash data, because I can't figure out how to rename it) and says "corrupt memory"
Reply With Quote
  #3   Spotlight this post!  
Unread 02-04-2012, 21:06
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: Overlaying rectangles over the targets in the camera feed

The corrupt memory message just means that the type can't be created from the data. Have you added the rectangle to the type where it is unflattened?

Greg McKaskle
Reply With Quote
  #4   Spotlight this post!  
Unread 03-04-2012, 00:51
yabberyabber yabberyabber is offline
Registered User
AKA: Andrew Nelson
FRC #0973
Team Role: College Student
 
Join Date: Jan 2010
Rookie Year: 2008
Location: SLO, Ca and/or Seattle, WA
Posts: 10
yabberyabber is an unknown quantity at this point
Re: Overlaying rectangles over the targets in the camera feed

The entire programming team has double checked, and we can't find any descrepancies between the data type we flatten out and send on the robot and the data type we unflatten in the dashboard.

If it helps, here's a screenshot of the error http://i.imgur.com/BjkUZ.png (sorry, not very much relivant code is in view; we have to be with the robot to get the error and we have no internet where the robot is)

Thanks again for helping with this problem!
Reply With Quote
  #5   Spotlight this post!  
Unread 03-04-2012, 07:44
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: Overlaying rectangles over the targets in the camera feed

In your C++ code, you have a section that pads the data if there are fewer than four targets detected. The layout of the "null" clusters has the boolean last, while the actual data (which matches the Dashboard unbundle pattern) has the boolean first.
Reply With Quote
  #6   Spotlight this post!  
Unread 03-04-2012, 07:50
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: Overlaying rectangles over the targets in the camera feed

From what I can see, you have dropped a network variable on the dashboard. That is not the protocol used to send data from DS to Dashboard, but is an industrial and rather heavy-weight protocol for distributed measurements.

In the attachment, there is low and high priority user data. Whichever you are attaching to on the robot is the one to decode on the dashboard. You can also probe the string to see the packed data before you make a guess. Enable and unpack the data and then use that rectangle data to update your rectangles.

Greg McKaskle
Attached Thumbnails
Click image for larger version

Name:	Screen Shot 2012-04-03 at 6.48.24 AM.png
Views:	36
Size:	10.5 KB
ID:	12516  
Reply With Quote
  #7   Spotlight this post!  
Unread 09-04-2012, 19:51
yabberyabber yabberyabber is offline
Registered User
AKA: Andrew Nelson
FRC #0973
Team Role: College Student
 
Join Date: Jan 2010
Rookie Year: 2008
Location: SLO, Ca and/or Seattle, WA
Posts: 10
yabberyabber is an unknown quantity at this point
Re: Overlaying rectangles over the targets in the camera feed

Thanks for your responses guys, I made the changes to the data format, but I'm a little confused about what Greg McKaskle said. Greg, could you explain a little more? The thumbnail you attached looks the same as what I already have in the code. The High Priority User Data gets fed into a variable and then unflattened up in the camera loop.
Reply With Quote
  #8   Spotlight this post!  
Unread 09-04-2012, 22:54
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: Overlaying rectangles over the targets in the camera feed

My attachment showed the disabled code for unflattening the high priority data, and the wire with the low priority too. If you are using the high priority data, check to see what is in the string and check the type you are unflattening it with. You may even find it useful to go back to a simpler type in the C++ and LV dashboard, and get that working, then add elements a few at a time to learn which is failing.

Greg McKaskle
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 04:13.

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