View Single Post
  #10   Spotlight this post!  
Unread 27-01-2012, 16:06
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
Re: Rectangle (Target Info) Overlaying on the Dashboard?

Ran it, getting an image now. However the Unflatten from String VI is giving an error code - 116.

According to the manual:

Quote:
Unflatten or byte stream read operation failed due to corrupt, unexpected, or truncated data.
EDIT: Not quite sure how to debug this one, really down to trial and error/Google.
EDIT 2: I forgot to use pack an array:

Code:
void RectangleTracker::SendVisionData() {
    Dashboard &d = DriverStation::GetInstance()->GetHighPriorityDashboardPacker();
    int n = (numCurrentMatches <= 10) ? numCurrentMatches : 10;
    d.AddCluster(); {
        d.AddArray(); {
        for (int i = 0; i < n; i++) {
                d.AddCluster(); {
                    d.AddI16((INT16)matches[i].corner[0].y);
                    d.AddI16((INT16)matches[i].corner[0].x);
                    d.AddI16((INT16)matches[i].corner[2].y);
                    d.AddI16((INT16)matches[i].corner[2].x);
                }
                d.FinalizeCluster();
            }
        }
        d.FinalizeArray();
    }
    d.FinalizeCluster();
    d.Finalize();
}

Last edited by basicxman : 27-01-2012 at 16:22.
Reply With Quote