Skip to content

Commit

Permalink
New Features
Browse files Browse the repository at this point in the history
Litchi Endpoints and all waypoints
Set overlap defaults to 60 and 70 after a few flights of testing
Speed input to calulate timed interval images.
  • Loading branch information
pepperlk committed Apr 7, 2017
1 parent e619b1e commit 7d81efa
Showing 1 changed file with 69 additions and 27 deletions.
96 changes: 69 additions & 27 deletions mission-planner.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
bottom: 0;
}
:host label{
display: block;
/*//display: block;*/
}
</style>
<div style="position: relative;">
Expand All @@ -51,45 +51,64 @@
<h2>Plan Flight</h2>
<label> Altitude (ft)</label>
<input type="number" min="20" max="1600" value={{altitude::change}} />
<br/>
<label> Grid Direction (Course)</label>
<input type="number" min="0" max="360" value={{angle::change}} />
<br/>
<label> Sidelap (%)</label>
<input type="number" min="30" max="75" value={{sidelap::change}} />
<br/>
<label> Overlap (%)</label>
<input type="number" min="30" max="75" value={{frontlap::change}} />
<h4>Advanced</h4>
<br/>
<label> Speed (mph)</label>
<input type="number" min="30" max="75" value={{speed::change}} />
<br/>
<p>Camera</p>
<label> Focal Length (mm)</label>
<input type="text" value={{focallength::change}} />
<br/>
<label> Sensor Width (mm)</label>
<input type="text" value={{sensorwidth::change}} />
<br/>
<label> Sensor Height (mm)</label>
<input type="text" value={{sensorheight::change}} />
<br/>

<label> Image Width (px)</label>
<input type="text" value={{imagewidth::change}} />
<br/>
<label> Image Height (px)</label>
<input type="text" value={{imageheight::change}} />
<br/>





<div>
<button on-tap="_exportLitchi">Litchi Export (CSV)</button>
<button on-tap="_exportLitchi">Litchi Export All(CSV)</button>
<br/>
<button on-tap="_exportLitchiEndpoints">Litchi Export Endpoints(CSV)</button>
</div>
<div hidden$="{{!hasFlight}}">
<h3>Flight Info</h3>
<label>Image Count</label>
<span>{{imagecount}}</span> Images
<label>Resolution</label>
<span>{{inpx}}</span> in/px

<label>Distance</label>
<span>{{totalDistanceString}}</span>
<label>Flight time @ 22mph</label>
<span>{{flighttime}}</span>
<label>Area (acres)</label>
<span>{{area}}</span> ac
<label>Image Count</label> <br/>
<span>{{imagecount}}</span> Images <br/>
<label>Resolution</label> <br/>
<span>{{inpx}}</span> in/px <br/>

<label>Distance</label> <br/>
<span>{{totalDistanceString}}</span> <br/>
<label>Flight time @ {{speed}}mph</label> <br/>
<span>{{flighttime}}</span> <br/>
<label>Area (acres)</label> <br/>
<span>{{area}}</span> ac <br/>

<label>Photo Timing (seconds)</label> <br/>
<span>{{photoEvery}}</span> <br/>


</div>


Expand Down Expand Up @@ -123,12 +142,12 @@ <h3>Flight Info</h3>

sidelap: {
type: Number,
value: 30,
value: 70,
observer: '_angleUpdated'
},
frontlap: {
type: Number,
value: 30,
value: 60,
observer: '_angleUpdated'
},
focallength: {
Expand Down Expand Up @@ -156,14 +175,19 @@ <h3>Flight Info</h3>
value: 3000,
observer: '_angleUpdated'
},
speed: {
type: Number,
value: 33,
observer: '_angleUpdated'
},
},
attached: function() {
var model = this;
this.async(function() {
model.map = L.map(this.$.map, {
zoomControl: false
}).setView([38.14, -98.82], 4);
// model.map.setView([41.185, -104.82], 16);
model.map.setView([41.185, -104.82], 16);



Expand Down Expand Up @@ -360,8 +384,8 @@ <h3>Flight Info</h3>
// calculate from mavic pro dems
var imagewidth = model.imagewidth;
var imageheight = model.imageheight;
var overlap = model.frontlap;
var sidelap = model.sidelap;
var overlap = model.sidelap;
var sidelap = model.frontlap;
var fov = model.getFOV(model.altitude * 0.3048, model.focallength, model.sensorwidth, model.sensorheight);
var viewheight = fov.viewheight;
var viewwidth = fov.viewwidth;
Expand Down Expand Up @@ -396,11 +420,16 @@ <h3>Flight Info</h3>
}


var mph = 22;
var mph = model.speed;
// seconds
model.flighttime = model.hhmmss((((totalFeet / 5280) / mph) * 60) * 60);


var metersPerSec = model.speed * .44704;


model.photoEvery = (distance / metersPerSec).toFixed(2);




Expand All @@ -425,17 +454,20 @@ <h3>Flight Info</h3>
if (llp.tag && llp.tag !== "M") {
pointList.push(new L.LatLng(llp.lat, llp.lng));
// draw footprints

var marker = L.marker([llp.lat, llp.lng]);
marker.bindPopup("Point " + i + " Tag: " + llp.tag)
model.flightLayer.addLayer(marker);




} else {
var marker = L.marker([llp.lat, llp.lng]);
marker.bindPopup("Point " + i + " Tag: " + llp.tag)
model.flightLayer.addLayer(marker);
count++;
}
var marker = L.marker([llp.lat, llp.lng]);
marker.bindPopup("Point " + i)
model.flightLayer.addLayer(marker);



var startangle = lastBearing;
Expand Down Expand Up @@ -474,7 +506,11 @@ <h3>Flight Info</h3>
this.updateFlightPlan();
},

_exportLitchi: function() {
_exportLitchiEndpoints: function(e) {
this._exportLitchi(e, true)
},

_exportLitchi: function(e, endpointsonly) {
var model = this;
var header = [
'latitude',
Expand Down Expand Up @@ -571,8 +607,14 @@ <h3>Flight Info</h3>
-1, //'actiontype15',
0, //'actionparam15'
];
if (llp.tag === "M") {
csvContent += row.join(',') + "\n";
if (endpointsonly) {
if (llp.tag !== "M") {
csvContent += row.join(',') + "\n";
}
} else {
if (llp.tag === "M") {
csvContent += row.join(',') + "\n";
}
}
}

Expand Down

0 comments on commit 7d81efa

Please sign in to comment.