Removed printfs
This commit is contained in:
		
							parent
							
								
									b2914e437b
								
							
						
					
					
						commit
						d348070092
					
				@ -1,6 +1,6 @@
 | 
				
			|||||||
#include "Perception.h"
 | 
					#include "Perception.h"
 | 
				
			||||||
#include "Angle.h"
 | 
					 | 
				
			||||||
#include <Arduino.h>
 | 
					#include <Arduino.h>
 | 
				
			||||||
 | 
					#include "Angle.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
DistanceSensor* Perception::GetSensor(float angle) {
 | 
					DistanceSensor* Perception::GetSensor(float angle) {
 | 
				
			||||||
  angle = Angle::Normalize(angle);
 | 
					  angle = Angle::Normalize(angle);
 | 
				
			||||||
@ -12,7 +12,6 @@ DistanceSensor *Perception::GetSensor(float angle) {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  DistanceSensor* distanceSensor = new DistanceSensor();
 | 
					  DistanceSensor* distanceSensor = new DistanceSensor();
 | 
				
			||||||
  Serial.printf("New sensor ADDED %f \n", angle);
 | 
					 | 
				
			||||||
  Placement* newPlacement = new Placement(distanceSensor, angle);
 | 
					  Placement* newPlacement = new Placement(distanceSensor, angle);
 | 
				
			||||||
  AddSensors(newPlacement, 1);
 | 
					  AddSensors(newPlacement, 1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										10
									
								
								Sensing.cpp
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								Sensing.cpp
									
									
									
									
									
								
							@ -37,7 +37,9 @@ void Sensing::AddSensors(Placement *things, unsigned int thingCount) {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
unsigned int Sensing::GetSensorCount() { return this->sensorCount; }
 | 
					unsigned int Sensing::GetSensorCount() {
 | 
				
			||||||
 | 
					  return this->sensorCount;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Sensor* Sensing::GetSensor(unsigned int sensorId) {
 | 
					Sensor* Sensing::GetSensor(unsigned int sensorId) {
 | 
				
			||||||
  if (sensorId >= this->sensorCount)
 | 
					  if (sensorId >= this->sensorCount)
 | 
				
			||||||
@ -87,7 +89,6 @@ float Sensing::DistanceLeft(float angle) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
float Sensing::DistanceRight(float angle) {
 | 
					float Sensing::DistanceRight(float angle) {
 | 
				
			||||||
  float minDistance = INFINITY;
 | 
					  float minDistance = INFINITY;
 | 
				
			||||||
  Serial.printf("  distance sensor count: %d\n", sensorCount);
 | 
					 | 
				
			||||||
  for (unsigned int sensorIx = 0; sensorIx < this->sensorCount; sensorIx++) {
 | 
					  for (unsigned int sensorIx = 0; sensorIx < this->sensorCount; sensorIx++) {
 | 
				
			||||||
    Placement placement = sensorPlacements[sensorIx];
 | 
					    Placement placement = sensorPlacements[sensorIx];
 | 
				
			||||||
    Sensor* sensor = (Sensor*)placement.thing;
 | 
					    Sensor* sensor = (Sensor*)placement.thing;
 | 
				
			||||||
@ -96,7 +97,6 @@ float Sensing::DistanceRight(float angle) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    DistanceSensor* distanceSensor = (DistanceSensor*)placement.thing;
 | 
					    DistanceSensor* distanceSensor = (DistanceSensor*)placement.thing;
 | 
				
			||||||
    float sensorAngle = placement.direction.y;
 | 
					    float sensorAngle = placement.direction.y;
 | 
				
			||||||
    Serial.printf("  distance sensor: 0 %f %f\n", sensorAngle, angle);
 | 
					 | 
				
			||||||
    if (sensorAngle > 0 && sensorAngle < angle) {
 | 
					    if (sensorAngle > 0 && sensorAngle < angle) {
 | 
				
			||||||
      minDistance = fmin(minDistance, distanceSensor->GetDistance());
 | 
					      minDistance = fmin(minDistance, distanceSensor->GetDistance());
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@ -200,7 +200,9 @@ void Sensing::SetRange(float min, float max) {
 | 
				
			|||||||
  this->rangeMaximum = max;
 | 
					  this->rangeMaximum = max;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
float *Sensing::GetDepthMap() { return this->depthMap; }
 | 
					float* Sensing::GetDepthMap() {
 | 
				
			||||||
 | 
					  return this->depthMap;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void Sensing::SetDepthMap(float angle, float distance) {
 | 
					void Sensing::SetDepthMap(float angle, float distance) {
 | 
				
			||||||
  if (angle < rangeMinimum || angle > rangeMaximum)
 | 
					  if (angle < rangeMinimum || angle > rangeMaximum)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user