Bugfix: Fix crashes in DatasetFetcher
This commit is contained in:
parent
8917f746ec
commit
7d709c0fa5
1 changed files with 8 additions and 6 deletions
|
@ -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…
Reference in a new issue