1Dev
Projects
Global Views
Pull Requests
Issues
Builds
Packages
drone_simulation
Code
Files
Commits
Branches
Tags
Code Comments
Code Compare
Pull Requests
Issues
List
Boards
Iterations
Builds
Packages
Statistics
Code
Child Projects
Projects
drone_simulation
Commits
77586f92
ctrl
k
Sign In
Fix totalPathDistance in PathStrategy
Browse Code
main
backend-fix
Integration-v2
Alex Nagel
committed
1 year ago
77586f92
1 parent
924d4b6b
service/include/simulationmodel/entity/Drone.h
■
■
■ ■ ■ ■
skipped 67 lines
68
68
}
69
69
70
70
bool hasToPackage() { return toPackage != nullptr; }
71
-
bool hasToFinalDestination() { return
toPackage
!= nullptr; }
71
+
bool hasToFinalDestination() { return
toFinalDestination
!= nullptr; }
72
72
73
73
74
74
skipped 10 lines
All occurrences
service/src/simulationmodel/entity/decorator/DroneBatteryDecorator.cc
■ ■ ■ ■ ■ ■
skipped 122 lines
123
123
distanceToDestination =
124
124
strategy->totalPathDistance(currentPosition);
125
125
126
+
127
+
// std::cout << "Distance for toPackage: " << distanceToDestination << ", type: " << typeid(strategy).name() << std::endl;
128
+
126
129
} else if (sub->getToFinalDestinationStrategy()) {
127
130
droneIdleTime = 0;
128
131
IStrategy* strategy = sub->getToFinalDestinationStrategy();
129
132
130
133
distanceToDestination =
131
134
strategy->totalPathDistance(currentPosition);
135
+
136
+
// std::cout << "Distance for finalDest: " << distanceToDestination << ", type: " << typeid(strategy).name() << std::endl;
137
+
132
138
} else {
133
139
droneIdleTime += dt;
134
140
if (droneIdleTime >= 1) {
skipped 72 lines
All occurrences
service/src/simulationmodel/strategy/celebrationdecorator/ICelebrationDecorator.cc
■
■
■ ■ ■ ■
skipped 24 lines
25
25
if (strategy) {
26
26
return strategy->totalPathDistance(startPosition);
27
27
} else {
28
-
return
8
;
28
+
return
0
;
29
29
}
30
30
}
31
31
All occurrences
service/src/simulationmodel/strategy/pathstrategy/PathStrategy.cc
■
■ ■ ■ ■ ■
skipped 23 lines
24
24
Vector3 nextPosition = path[i];
25
25
float distance = lastPosition.dist(nextPosition);
26
26
totalDistance += distance;
27
+
lastPosition = nextPosition;
27
28
}
28
29
29
30
return totalDistance;
skipped 4 lines
All occurrences
service
include/simulationmodel/entity/Drone.h
src/simulationmodel
entity/decorator/DroneBatteryDecorator.cc
strategy
celebrationdecorator/ICelebrationDecorator.cc
pathstrategy/PathStrategy.cc
Please wait...
Page is in error, reload to recover