mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-13 21:32:14 +08:00
c1bcb53d4e
* Revert "Revert "[commabody] Add new body teleop ui (#29119)" (#29249)" This reverts commit 5dcfddbbfbddf00d16cb1f28c51f3dffc75d7cf6. * add to release files --------- Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> old-commit-hash: e7d307ca1b064c3789902bc077e93453dd96794b
23 lines
806 B
JavaScript
23 lines
806 B
JavaScript
import { handleKeyX, executePlan } from "./controls.js";
|
|
import { start, stop, last_ping } from "./webrtc.js";
|
|
|
|
export var pc = null;
|
|
export var dc = null;
|
|
|
|
document.addEventListener('keydown', (e)=>(handleKeyX(e.key.toLowerCase(), 1)));
|
|
document.addEventListener('keyup', (e)=>(handleKeyX(e.key.toLowerCase(), 0)));
|
|
$(".keys").bind("mousedown touchstart", (e)=>handleKeyX($(e.target).attr('id').replace('key-', ''), 1));
|
|
$(".keys").bind("mouseup touchend", (e)=>handleKeyX($(e.target).attr('id').replace('key-', ''), 0));
|
|
$("#plan-button").click(executePlan);
|
|
|
|
setInterval( () => {
|
|
const dt = new Date().getTime();
|
|
if ((dt - last_ping) > 1000) {
|
|
$(".pre-blob").removeClass('blob');
|
|
$("#battery").text("-");
|
|
$("#ping-time").text('-');
|
|
$("video")[0].load();
|
|
}
|
|
}, 5000);
|
|
|
|
start(pc, dc); |