Example #1
0
 /// <summary>
 /// returns true if the given feature is visible
 /// </summary>
 /// <param name="feat"></param>
 /// <returns></returns>
 public bool featureVisible(Feature feat)
 {
     if (!((feat.get_successful_measurement_flag()) && (feat.get_feature_measurement_model().fully_initialised_flag)))
     {
         if (feat.get_feature_measurement_model().fully_initialised_flag)
         {
             reconstructFeaturePosition(feat);
             int screen_x = 0;
             int screen_y = 0;
             projectFeature(feat, ref screen_x, ref screen_y);
             if ((screen_x > 0) && (screen_y > 0) && (screen_x < image_width) && (screen_y < image_height))
             {
                 Vector v = new Vector(2);
                 v[0] = screen_x;
                 v[1] = screen_y;
                 feat.set_h(v);
                 return(true);
             }
             else
             {
                 return(false);
             }
         }
         else
         {
             return(false);
         }
     }
     else
     {
         return(true);
     }
 }
Example #2
0
        /// <summary>
        /// Function to unite the bookeeping stuff for both
        /// add_new_partially_initialised_feature() and add_new_known_feature()
        /// </summary>
        /// <param name="nf"></param>
        public void add_new_feature_bookeeping(Feature nf)
        {  
            feature_list.Add(nf);

            next_free_label++; // Potential millenium-style bug when this overloads
                               // (hello if you're reading this in the year 3000)

            nf.set_position_in_total_state_vector(total_state_size);
            total_state_size += nf.get_feature_measurement_model().FEATURE_STATE_SIZE;
        }