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/2012/code/file/8139457abeed/Dashboard/Dashboard%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/2012/code/file/8139457abeed/ReboundRumble/DashboardDataFormat.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.

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”

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

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!

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.

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

Screen Shot 2012-04-03 at 6.48.24 AM.png


Screen Shot 2012-04-03 at 6.48.24 AM.png

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.

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