00001 /** 00002 * @author <a href="mailto:Thorsten.Kerkhof@gmx.de">Thorsten Kerkhof</a> 00003 */ 00004 00005 #include "MultipleBallPerceptList.h" 00006 00007 MultipleBallPerceptList::MultipleBallPerceptList() 00008 : numberOfElements(0), 00009 panningVelocityError(0) 00010 { 00011 } 00012 00013 void MultipleBallPerceptList::add(const MultipleBallPerceptElement& elem) 00014 { 00015 if(numberOfElements < (int)(sizeof(multiplePercepts) / sizeof(multiplePercepts[0])) && elem.reliability > 0) 00016 multiplePercepts[numberOfElements++] = elem; 00017 } 00018 00019 void MultipleBallPerceptList::calculatePanningVelocityValue(double panningVelocity) 00020 { 00021 /* "panningVelocity"-value: 00022 * a is equal to 1 if the panning velocity is equal to 0 (minimum of the function) 00023 * the lowest value is 0.52 for a panning velocity of approximately 5.5 00024 */ 00025 double value = 0; 00026 00027 //Function is result of BallLocatorEvolutionBehavior: 00028 if(panningVelocity > 5.5) 00029 value = 57.198511908222125; 00030 else value = -0.9 * panningVelocity * panningVelocity 00031 + 9.90092024377335 * panningVelocity 00032 + 29.9684505674687; 00033 00034 //return the normalized value (30 is minimum of the function) 00035 //the bigger the panning velocity value is the lower the trust in the percept should be 00036 value = 30 / value; 00037 panningVelocityError = value > 1 ? 1 : value; 00038 }
1.3.6