Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
flight-scripts
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
flight-scripts
Commits
7a5dee4f
Commit
7a5dee4f
authored
Mar 16, 2023
by
Léo-Paul Géneau
👾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update points A and B
parent
29e7a5d7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
18 deletions
+27
-18
restricted_flight.js
restricted_flight.js
+27
-18
No files found.
restricted_flight.js
View file @
7a5dee4f
...
...
@@ -16,14 +16,14 @@
IS_LEADER
=
me
.
id
===
LEADER_ID
,
PARACHUTE_ALTITUDE
=
100
,
POINT_A
=
{
latitude
:
45.6
447727
,
longitude
:
14.2
635345
,
altitude
:
60
8
latitude
:
45.6
50833
,
longitude
:
14.2
59722
,
altitude
:
60
6
},
POINT_B
=
{
latitude
:
45.644
7678
,
longitude
:
14.263
5388
,
altitude
:
60
8
latitude
:
45.644
167
,
longitude
:
14.263
611
,
altitude
:
60
7
},
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
}));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment