From 2e74897551a5d45feb5080691aff077aca5ad2fd Mon Sep 17 00:00:00 2001 From: Mark Jessop Date: Sat, 14 Sep 2019 23:07:51 +0930 Subject: [PATCH 1/7] Initial stab at per-payload onboard landing prediction markers. --- js/tracker.js | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/js/tracker.js b/js/tracker.js index f06a2aa..cda1e0b 100644 --- a/js/tracker.js +++ b/js/tracker.js @@ -919,6 +919,26 @@ function updateVehicleInfo(vcallsign, newPosition) { } else { vehicle.marker.setMode("parachute"); } + + // Update landing marker if data is available + if (newPosition.data.hasOwnProperty("pred_lat") && newPosition.data.hasOwnProperty("pred_lon")){ + // Landing prediction data exists.. + if (vehicle.landing_marker !== null){ + // We already have a marker initialized. + if(newPosition.gps_alt > 350){ + // Balloon is still in flight, so update the marker. + vehicle.landing_marker.setPosition(new google.maps.LatLng(newPosition.data.pred_lat, newPosition.data.pred_lon)); + // Re-add to map if it's been removed previously. + if (vehicle.landing_marker.getMap() == null){ + vehicle.landing_marker.setMap(map); + } + }else{ + // Balloon has landed, so hide the marker. + // Should we do this? Can we re-add it safely? + vehicle.landing_marker.setMap(null); + } + } + } } var image = vehicle.image_src; @@ -1657,6 +1677,30 @@ function addPosition(position) { this.setPosition(overlay.getProjection().fromDivPixelToLatLng(pos)); }; + // Add landing marker if the payload provides a predicted landing position. + if (position.data.hasOwnProperty('pred_lat') && position.data.hasOwnProperty('pred_lon')){ + landing_image_src = host_url + markers_url + "balloon-xmark.png"; + landing_image_src_size = new google.maps.Size(48,38); + landing_image_src_offset = new google.maps.Point(0,-38); + + landing_marker = new google.maps.Marker({ + icon: { + url: landing_image_src, + size: landing_image_src_size, + scaledSize: landing_image_src_size, + anchor: new google.maps.Point(24,18) + }, + zIndex: Z_CAR, + position: new google.maps.LatLng(position.data.pred_lat, position.data.pred_lon), + map: map, + optimized: false, + title: vcallsign + " Onboard Landing Prediction" + }); + gmaps_elements.push(landing_marker); + } else { + landing_marker = null; + } + horizon_circle = new google.maps.Circle({ map: map, zIndex: Z_RANGE, @@ -1790,6 +1834,7 @@ function addPosition(position) { vehicle_type: vehicle_type, marker: marker, marker_shadow: marker_shadow, + landing_marker: landing_marker, image_src: image_src, image_src_size: image_src_size, image_src_offset: image_src_offset, From 1ab637d652bf23ebe9dfacb7b1b44c49cbff8586 Mon Sep 17 00:00:00 2001 From: Mark Jessop Date: Sun, 15 Sep 2019 11:34:16 +0930 Subject: [PATCH 2/7] Handle pred_lat/lon being zero during ascent. --- js/tracker.js | 67 +++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 49 insertions(+), 18 deletions(-) diff --git a/js/tracker.js b/js/tracker.js index cda1e0b..483be12 100644 --- a/js/tracker.js +++ b/js/tracker.js @@ -937,6 +937,33 @@ function updateVehicleInfo(vcallsign, newPosition) { // Should we do this? Can we re-add it safely? vehicle.landing_marker.setMap(null); } + } else{ + // Landing marker has not been initialised yet. + if((newPosition.data.pred_lat !== 0.0) && (newPosition.data.pred_lon !== 0.0)){ + + landing_image_src = host_url + markers_url + "balloon-xmark.png"; + landing_image_src_size = new google.maps.Size(48,38); + landing_image_src_offset = new google.maps.Point(0,-38); + + landing_marker = new google.maps.Marker({ + icon: { + url: landing_image_src, + size: landing_image_src_size, + scaledSize: landing_image_src_size, + anchor: new google.maps.Point(24,18) + }, + zIndex: Z_CAR, + position: new google.maps.LatLng(position.data.pred_lat, position.data.pred_lon), + map: map, + optimized: false, + title: vcallsign + " Onboard Landing Prediction" + }); + + // Add the marker to the map, and to the vehicle object. + landing_marker.setMap(map); + vehicle.landing_marker = landing_marker; + } + } } } @@ -1678,25 +1705,29 @@ function addPosition(position) { }; // Add landing marker if the payload provides a predicted landing position. + // TODO: Only create this if the lat/lon are not zero. if (position.data.hasOwnProperty('pred_lat') && position.data.hasOwnProperty('pred_lon')){ - landing_image_src = host_url + markers_url + "balloon-xmark.png"; - landing_image_src_size = new google.maps.Size(48,38); - landing_image_src_offset = new google.maps.Point(0,-38); - - landing_marker = new google.maps.Marker({ - icon: { - url: landing_image_src, - size: landing_image_src_size, - scaledSize: landing_image_src_size, - anchor: new google.maps.Point(24,18) - }, - zIndex: Z_CAR, - position: new google.maps.LatLng(position.data.pred_lat, position.data.pred_lon), - map: map, - optimized: false, - title: vcallsign + " Onboard Landing Prediction" - }); - gmaps_elements.push(landing_marker); + // Only create the marker if the pred lat/lon are not zero (as will be the case during ascent). + if ((position.data.pred_lat !== 0.0) && (position.data.pred_lon !== 0.0)){ + landing_image_src = host_url + markers_url + "balloon-xmark.png"; + landing_image_src_size = new google.maps.Size(48,38); + landing_image_src_offset = new google.maps.Point(0,-38); + + landing_marker = new google.maps.Marker({ + icon: { + url: landing_image_src, + size: landing_image_src_size, + scaledSize: landing_image_src_size, + anchor: new google.maps.Point(24,18) + }, + zIndex: Z_CAR, + position: new google.maps.LatLng(position.data.pred_lat, position.data.pred_lon), + map: map, + optimized: false, + title: vcallsign + " Onboard Landing Prediction" + }); + gmaps_elements.push(landing_marker); + } } else { landing_marker = null; } From 9c70704dbc9133d96cd38720d28b4747694f3cd6 Mon Sep 17 00:00:00 2001 From: Mark Jessop Date: Sun, 15 Sep 2019 19:55:05 +0930 Subject: [PATCH 3/7] Add pred_lat/lon to known keys list. --- js/tracker.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/tracker.js b/js/tracker.js index 483be12..ddef11e 100644 --- a/js/tracker.js +++ b/js/tracker.js @@ -572,7 +572,9 @@ function habitat_data(jsondata, alternative) { "radiation": "Radiation (CPM)", "temperature_radio": "Temperature, Radio", "uplink_rssi": "Uplink RSSI", - "light_intensity": "Light Intensity" + "light_intensity": "Light Intensity", + "pred_lat": "Onboard Prediction (Lat)", + "pred_lon": "Onboard Prediction (Lon)" }; var hide_keys = { From f4e4bfbd225962f9e875e5c45d350ac840762108 Mon Sep 17 00:00:00 2001 From: Mark Jessop Date: Wed, 18 Sep 2019 07:53:15 +0930 Subject: [PATCH 4/7] Fix error with chase cars and landing_marker. --- js/tracker.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/tracker.js b/js/tracker.js index ddef11e..55ed19b 100644 --- a/js/tracker.js +++ b/js/tracker.js @@ -1549,6 +1549,7 @@ function addPosition(position) { if(!vehicles.hasOwnProperty(vcallsign)) { var marker = null; var marker_shadow = null; + var landing_marker = null; var vehicle_type = ""; var horizon_circle = null; var subhorizon_circle = null; @@ -1729,6 +1730,8 @@ function addPosition(position) { title: vcallsign + " Onboard Landing Prediction" }); gmaps_elements.push(landing_marker); + } else { + landing_marker = null; } } else { landing_marker = null; From 250159d24c79d929da2949423b67b18de8a7c6b7 Mon Sep 17 00:00:00 2001 From: Rossen Georgiev Date: Sun, 1 Dec 2019 23:37:31 +0000 Subject: [PATCH 5/7] make track.kml not load all the data --- track.kml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/track.kml b/track.kml index e5f4c4e..04f699d 100644 --- a/track.kml +++ b/track.kml @@ -4,7 +4,7 @@ habhub tracker (GE) Live tracking of high altitude balloons via Google Earth - http://spacenear.us/tracker/datanew.php?format=kml + http://spacenear.us/tracker/datanew.php?format=kml&mode=2days&vehicles=!RS_*; onInterval 20 From c0344b09d239199bbd20c24d1fb9454dfdba4058 Mon Sep 17 00:00:00 2001 From: Rossen Georgiev Date: Sun, 1 Dec 2019 23:43:24 +0000 Subject: [PATCH 6/7] kml needs & arghhhh --- track.kml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/track.kml b/track.kml index 04f699d..f177049 100644 --- a/track.kml +++ b/track.kml @@ -4,7 +4,7 @@ habhub tracker (GE) Live tracking of high altitude balloons via Google Earth - http://spacenear.us/tracker/datanew.php?format=kml&mode=2days&vehicles=!RS_*; + http://spacenear.us/tracker/datanew.php?format=kml&mode=2days&vehicles=!RS_*; onInterval 20 From 516acaf48e536bf6ce852c87a83d49dc2a093853 Mon Sep 17 00:00:00 2001 From: Mark Jessop Date: Sun, 8 Dec 2019 12:04:51 +1030 Subject: [PATCH 7/7] Add 1 hour filter for TTN receivers. --- js/tracker.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/tracker.js b/js/tracker.js index 55ed19b..c655488 100644 --- a/js/tracker.js +++ b/js/tracker.js @@ -2714,6 +2714,12 @@ function updateReceivers(r) { if(lat < -90 || lat > 90 || lon < -180 || lon > 180) continue; + // Filter out any receivers that are from the TTN Bridge code, and that are older than 1 hour. + // This helps de-clutter the map during launches utilising TTN, and that result in *many* new + // receivers showing up on the map. + var age = parseFloat(r[i].tdiff_hours); // Grab age of the receiver. + if(r[i].description.includes('TTN_LORAWAN_GW') && age > 1.0) continue; + var r_index = $.inArray(r[i].name, receiver_names); if(r_index == -1) {