diff --git a/ias_robot.cpp b/ias_robot.cpp index aae3552..3363507 100644 --- a/ias_robot.cpp +++ b/ias_robot.cpp @@ -28,7 +28,9 @@ #include #include #include +#ifndef NDEBUG #include +#endif #include "ias_robot.hpp" @@ -134,7 +136,9 @@ float IASSS_Robot::brss() { std::map U, V; unsigned int i_min, i_max; float min, sample, prob, max, sum_uv = 0.0f, steer; +#ifndef NDEBUG std::ostringstream oss; +#endif while(U.size() < (U_RATIO * NUM_PHERO_SAMPLES)) { min = std::numeric_limits::max(); @@ -221,12 +225,14 @@ float IASSS_Robot::brss() { steer = (NUM_PHERO_SAMPLES / 2.0f) - i_max; +#ifndef NDEBUG oss << "samples: " << std::endl; for(unsigned int i = 0; i < NUM_PHERO_SAMPLES; i++) oss << "\tSAMPLE[" << i << "]: " << _phero_sensor[i] << " - " << _phero_sensor.sample_amnt[i] << " - " << _phero_sensor.probs[i] << std::endl; oss << "\ti_max: " << i_max << " | Steer: " << steer; log(oss.str()); +#endif return steer; } diff --git a/pheromone.hpp b/pheromone.hpp index 27fa54f..78e528c 100644 --- a/pheromone.hpp +++ b/pheromone.hpp @@ -34,7 +34,7 @@ extern const unsigned char MAX_PHERO_INTENSITY; extern const unsigned char MIN_PHERO_INTENSITY; -const unsigned int NUM_PHERO_SAMPLES = 5; +const unsigned int NUM_PHERO_SAMPLES = 180; typedef struct PHERO_SENSOR { float samples[NUM_PHERO_SAMPLES];