Compare commits
1 commit
Author | SHA1 | Date | |
---|---|---|---|
5d07a73048 |
1 changed files with 35 additions and 8 deletions
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
const ZONE_DIRECTIONS_MAPPING = ["E", "NE", "N", "NW", "W", "SW", "S", "SE"];
|
const ZONE_DIRECTIONS_MAPPING = ["E", "NE", "N", "NW", "W", "SW", "S", "SE"];
|
||||||
|
|
||||||
|
let telescopeDeployed = false;
|
||||||
let joystickBankEnabled = false;
|
let joystickBankEnabled = false;
|
||||||
let navigationEnabled = true;
|
let navigationEnabled = true;
|
||||||
|
|
||||||
|
@ -126,15 +127,32 @@
|
||||||
console.log("stop robot action");
|
console.log("stop robot action");
|
||||||
currentWs.send("stop_robot", {});
|
currentWs.send("stop_robot", {});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hasGpChange(['axes.cross_x', 'axes.cross_y'])) {
|
||||||
|
console.log(newGpDictState.axes.cross_x, newGpDictState.axes.cross_y);
|
||||||
|
if (newGpDictState.axes.cross_y == -1) {
|
||||||
|
console.log("souffler");
|
||||||
|
currentWs.send("turbine_souffler")
|
||||||
|
}
|
||||||
|
if (newGpDictState.axes.cross_y == 1) {
|
||||||
|
console.log("aspirer");
|
||||||
|
currentWs.send("turbine_aspirer")
|
||||||
|
|
||||||
|
}
|
||||||
|
if (newGpDictState.axes.cross_x != 0) {
|
||||||
|
currentWs.send("turbine_stop")
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
if (hasGpChange(['buttons.triangle'])) {
|
if (hasGpChange(['buttons.triangle'])) {
|
||||||
if (newGpDictState.buttons.triangle.pressed) {
|
if (newGpDictState.buttons.triangle.pressed) {
|
||||||
// one time action
|
telescopeDeployed = !telescopeDeployed;
|
||||||
console.log("turbine action");
|
|
||||||
currentWs.send("set_turbine", {"speed":20});
|
|
||||||
}
|
}
|
||||||
else{
|
if (telescopeDeployed) {
|
||||||
console.log("stop_turbine")
|
currentWs.send("telescope_deploy")
|
||||||
currentWs.send("set_turbine",{"speed":0})
|
}
|
||||||
|
if (!telescopeDeployed) {
|
||||||
|
currentWs.send("telescope_zero")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -213,6 +231,15 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
|
window.setTurbine = (speed) => {
|
||||||
|
currentWs.send("set_turbine", {"speed":speed});
|
||||||
|
}
|
||||||
|
window.setRange = (name, min, max) => {
|
||||||
|
currentWs.send("set_range", {name, min, max})
|
||||||
|
}
|
||||||
|
console.log(window.setTurbine);
|
||||||
|
|
||||||
|
|
||||||
translationZones = generateTranslationZones();
|
translationZones = generateTranslationZones();
|
||||||
rotationZones = [
|
rotationZones = [
|
||||||
{ from: Math.PI/2+ -(6/8)*Math.PI, to: Math.PI/2+ -(2/8)*Math.PI },
|
{ from: Math.PI/2+ -(6/8)*Math.PI, to: Math.PI/2+ -(2/8)*Math.PI },
|
||||||
|
|
Loading…
Reference in a new issue