Bugfix: Fix crashes in DatasetFetcher

master
Starbeamrainbowlabs 3 years ago
parent 8917f746ec
commit 7d709c0fa5
  1. 14
      server/train-ai/DatasetFetcher.mjs

@ -40,9 +40,7 @@ class DatasetFetcher {
),
0, 1);
result.input.push(next_input);
console.log(`Distance from gateway: ${haversine(gateway_location, rssi)}m`);
// console.log(`Distance from gateway: ${haversine(gateway_location, rssi)}m`);
let next_output = clamp(normalise(rssi.rssi,
{ min: this.settings.ai.rssi_min, max: this.settings.ai.rssi_max },
@ -56,12 +54,16 @@ class DatasetFetcher {
}
for(let reading of this.repo_reading.iterate_unreceived()) {
result.input.push(this.normalise_latlng(
let next_input = this.normalise_latlng(
reading.latitude,
reading.longitude
));
);
next_input.distance = haversine(gateway_location, reading);
result.output.push([ 0 ]);
result.push({
input: next_input,
output: 0
});
}
return result;

Loading…
Cancel
Save