Commit 7a5dee4f authored by Léo-Paul Géneau's avatar Léo-Paul Géneau 👾

Update points A and B

parent 29e7a5d7
......@@ -16,14 +16,14 @@
IS_LEADER = me.id === LEADER_ID,
PARACHUTE_ALTITUDE = 100,
POINT_A = {
latitude: 45.6447727,
longitude: 14.2635345,
altitude: 608
latitude: 45.650833,
longitude: 14.259722,
altitude: 606
},
POINT_B = {
latitude: 45.6447678,
longitude: 14.2635388,
altitude: 608
latitude: 45.644167,
longitude: 14.263611,
altitude: 607
},
ROUND_NB = 1;
......@@ -90,10 +90,13 @@
me.start_altitude
);
if (me.init_alt_reached && IS_LEADER) {
exitOnFail(
me.setTargetCoordinates(
POINT_A.latitude,
POINT_A.longitude,
POINT_A.altitude + FLIGH_ALTITUDE
POINT_B.latitude,
POINT_B.longitude,
POINT_B.altitude + FLIGH_ALTITUDE
),
"Failed to set point B coordinates"
);
me.going_to_point_a = true;
me.sendMsg(JSON.stringify({going_to_point_a: me.going_to_point_a}));
......@@ -145,20 +148,26 @@
);
} else {
if (me.going_to_point_a) {
exitOnFail(
me.setTargetCoordinates(
POINT_B.latitude,
POINT_B.longitude,
POINT_B.altitude + FLIGH_ALTITUDE
),
"Failed to set point B coordinates"
);
me.going_to_point_a = false;
me.sendMsg(JSON.stringify({going_to_point_a: me.going_to_point_a}));
} else {
me.round_count += 1;
if (me.round_count < ROUND_NB) {
exitOnFail(
me.setTargetCoordinates(
POINT_A.latitude,
POINT_A.longitude,
POINT_A.altitude + FLIGH_ALTITUDE
),
"Failed to set point A coordinates"
);
me.going_to_point_a = true;
me.sendMsg(JSON.stringify({going_to_point_a: me.going_to_point_a}));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment