View Single Post
  #10   Spotlight this post!  
Unread 05-03-2010, 23:25
Lucie365 Lucie365 is offline
Registered User
FRC #0365
 
Join Date: Feb 2010
Location: Wilmington, DE
Posts: 13
Lucie365 has a spectacular aura aboutLucie365 has a spectacular aura about
Re: Camera code does not recognize target

I tried changing the compareTargets function to boolean as follows:

bool compareTargets(Target t1, Target t2) {
return (t1.m_score > t2.m_score)
}

This solved the problem. Apparently the sort function is looking for a true/false rather than -1/0/1. Both -1 and 1 were considered true (only 0 is considered false) so no sorting was actually being done.
Reply With Quote