add delay after sending route to car
This commit is contained in:
@@ -93,7 +93,7 @@ abstract class AbstractAlgorithm(val thisCar: Car) {
|
||||
this.prevState = state
|
||||
|
||||
command.distances.forEachIndexed { idx, distance ->
|
||||
thisCar.moveCar(distance, command.directions[idx])
|
||||
thisCar.moveCar(distance, command.directions[idx]).get()
|
||||
}
|
||||
|
||||
Logger.outDent()
|
||||
@@ -150,7 +150,7 @@ abstract class AbstractAlgorithm(val thisCar: Car) {
|
||||
Logger.log("Inverted cmd: ${invertedCommand.toString()}")
|
||||
Logger.outDent()
|
||||
invertedCommand.distances.forEachIndexed { idx, distance ->
|
||||
thisCar.moveCar(distance, invertedCommand.directions[idx])
|
||||
thisCar.moveCar(distance, invertedCommand.directions[idx]).get()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,6 +46,10 @@ class GetRoomModel : Handler {
|
||||
vector.length().toInt()
|
||||
}.toIntArray()
|
||||
|
||||
if (Environment.map.size == 0) {
|
||||
return DebugResponse.BuilderDebugResponse(begin_x, begin_y, end_x, end_y, 0, 0,
|
||||
0, pointsX, pointsY, wallDistances).build()
|
||||
}
|
||||
val car = Environment.map.values.last()
|
||||
return DebugResponse.BuilderDebugResponse(begin_x, begin_y, end_x, end_y, car.x.toInt(), car.y.toInt(),
|
||||
car.angle.toInt(), pointsX, pointsY, wallDistances).build()
|
||||
|
||||
Reference in New Issue
Block a user