Bug fixes
This commit is contained in:
parent
48b80fb9ed
commit
1abe40815e
@ -3,6 +3,10 @@
|
||||
|
||||
#include "FloatSingle.h"
|
||||
|
||||
extern "C" {
|
||||
#include "debug.h"
|
||||
}
|
||||
|
||||
Propulsion::Propulsion() {
|
||||
this->placement = nullptr;
|
||||
this->motorCount = 0;
|
||||
@ -33,7 +37,7 @@ void Propulsion::AddMotors(Placement* things, unsigned int thingCount) {
|
||||
|
||||
}
|
||||
|
||||
void Propulsion::AddQuadcopter(Quadcopter* quadcoper) {
|
||||
void Propulsion::AddQuadcopter(Quadcopter* quadcopter) {
|
||||
this->quadcopter = quadcopter;
|
||||
}
|
||||
|
||||
|
10
Sensing.cpp
10
Sensing.cpp
@ -5,6 +5,10 @@
|
||||
#include <math.h>
|
||||
#include <algorithm>
|
||||
|
||||
extern "C" {
|
||||
#include "debug.h"
|
||||
}
|
||||
|
||||
SensorPlacement::SensorPlacement(DistanceSensor* distanceSensor, Vector2 direction) {
|
||||
this->distanceSensor = distanceSensor;
|
||||
this->switchSensor = nullptr;
|
||||
@ -65,8 +69,8 @@ float Sensing::DistanceForward(float angle) {
|
||||
continue;
|
||||
|
||||
DistanceSensor* distanceSensor = (DistanceSensor*)placement.thing;
|
||||
float sensorAngle = placement.direction.x;
|
||||
if (sensorAngle > -angle && sensorAngle < angle) {
|
||||
float sensorAngle = placement.direction.z;
|
||||
if (sensorAngle > 0 && sensorAngle < angle) {
|
||||
minDistance = fmin(minDistance, distanceSensor->GetDistance());
|
||||
}
|
||||
}
|
||||
@ -116,7 +120,7 @@ float Sensing::DistanceUp(float angle) {
|
||||
Sensor* sensor = (Sensor*)placement.thing;
|
||||
if (sensor->isDistanceSensor == false)
|
||||
continue;
|
||||
|
||||
|
||||
DistanceSensor* distanceSensor = (DistanceSensor*)placement.thing;
|
||||
float sensorAngle = placement.direction.y; // not correct!
|
||||
if (sensorAngle > 0 && sensorAngle < angle) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user