Go to Post I like what FIRST said about it best: They consider it part of the "Game Challenge" - Alavinus [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

 
 
 
Thread Tools Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 25-01-2012, 22:56
basicxman basicxman is offline
Emily Horsman
FRC #2200 (MMRambotics)
Team Role: Programmer
 
Join Date: Oct 2007
Rookie Year: 2007
Location: Burlington, Ontario
Posts: 971
basicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant future
Send a message via AIM to basicxman Send a message via MSN to basicxman Send a message via Yahoo to basicxman
Rectangle (Target Info) Overlaying on the Dashboard?

Disclaimer: I know little of LabVIEW, I use C++ with the rest of 2200.

So I've got rectangle identification working quite smoothly in C++ but I'd like to see some target info on the LabVIEW Dashboard. Right now I'm just using the smart dashboard to print coordinates of the target.

The 2010 Vision Demonstration project in WindRiver contains code to send an arbitrarily sized array of vision targets to the dashboard using the high priority dashboard packer. I want to duplicate this for rectangles.

I know the following:
  • Create a cRio Robot project in LabVIEW and make the Dashboard Datatype
  • Send data in C++ (code below)
  • Use the IMAQ Overlay Rectangle VI in a for loop (or a loop to iterate the results)

I've stripped down the dashboard to what I want and looked through some of the documentation in LabVIEW, but I'm missing a few concepts:
  • How can I make an arbitrarily sized array of clusters (matching the below C++ code)?
  • How can I loop through this in the Dashboard project to add multiple overlays?

Code:
void RectangleTracker::SendVisionData() {
    Dashboard &d = DriverStation::GetInstance()->GetHighPriorityDashboardPacker();
    int n = matches.size();
    n = (n <= 10) ? n : 10;
    d.AddCluster(); {
        for (int i = 0; i < n; i++) {
            d.AddCluster(); {
                d.AddI32((INT32)matches[i].corner[0].y);
                d.AddI32((INT32)matches[i].corner[0].x);
                d.AddI32((INT32)matches[i].corner[2].y);
                d.AddI32((INT32)matches[i].corner[2].x);
            }
            d.FinalizeCluster();
        }
    }
    d.FinalizeCluster();
    d.Finalize();
}
Thanks CD LabVIEWers. I'll continue to do my Google-ing.

Last edited by basicxman : 25-01-2012 at 22:58.
Reply With Quote
 


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 11:31.

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