Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
Carlos Ramos Carreño
erp5
Commits
c7943a9a
Commit
c7943a9a
authored
Nov 27, 2023
by
Léo-Paul Géneau
👾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officejs_drone_simulator_test: refactor x-y-z / lat-lon-alt properties to be consistent
See !1850
parent
505f14c9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
17 deletions
+17
-17
bt5/erp5_officejs_drone_simulator_test/PathTemplateItem/web_page_module/test_drone_simulator_flight_js.js
...ateItem/web_page_module/test_drone_simulator_flight_js.js
+15
-15
bt5/erp5_officejs_drone_simulator_test/PathTemplateItem/web_page_module/test_drone_simulator_flight_js.xml
...teItem/web_page_module/test_drone_simulator_flight_js.xml
+2
-2
No files found.
bt5/erp5_officejs_drone_simulator_test/PathTemplateItem/web_page_module/test_drone_simulator_flight_js.js
View file @
c7943a9a
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
start_AMSL
=
595
,
start_AMSL
=
595
,
INIT_LON
=
14.2658
,
INIT_LON
=
14.2658
,
INIT_LAT
=
45.6412
,
INIT_LAT
=
45.6412
,
INIT_
Z
=
15
,
INIT_
ALT
=
15
,
// Non-inputs parameters
// Non-inputs parameters
DEFAULT_SCRIPT_CONTENT
=
DEFAULT_SCRIPT_CONTENT
=
'
function assert(a, b, msg) {
\n
'
+
'
function assert(a, b, msg) {
\n
'
+
...
@@ -51,9 +51,9 @@
...
@@ -51,9 +51,9 @@
'
}
\n
'
+
'
}
\n
'
+
'
\n
'
+
'
\n
'
+
'
function compare(coord1, coord2) {
\n
'
+
'
function compare(coord1, coord2) {
\n
'
+
'
assert(coord1.
x, coord2.x
, "Latitude")
\n
'
+
'
assert(coord1.
latitude, coord2.latitude
, "Latitude")
\n
'
+
'
assert(coord1.
y, coord2.y
, "Longitude")
\n
'
+
'
assert(coord1.
longitude, coord2.longitude
, "Longitude")
\n
'
+
'
assert(coord1.
z, coord2.z
, "Altitude")
\n
'
+
'
assert(coord1.
altitude, coord2.altitude
, "Altitude")
\n
'
+
'
}
\n
'
+
'
}
\n
'
+
'
\n
'
+
'
\n
'
+
'
me.onStart = function () {
\n
'
+
'
me.onStart = function () {
\n
'
+
...
@@ -61,8 +61,8 @@
...
@@ -61,8 +61,8 @@
'
assert(me.getYaw(), 0, "Yaw angle")
\n
'
+
'
assert(me.getYaw(), 0, "Yaw angle")
\n
'
+
'
me.initialPosition = me.getCurrentPosition();
\n
'
+
'
me.initialPosition = me.getCurrentPosition();
\n
'
+
'
me.setTargetCoordinates(
\n
'
+
'
me.setTargetCoordinates(
\n
'
+
'
me.initialPosition.
x
+ 0.01,
\n
'
+
'
me.initialPosition.
latitude
+ 0.01,
\n
'
+
'
me.initialPosition.
y
,
\n
'
+
'
me.initialPosition.
longitude
,
\n
'
+
'
me.getAltitudeAbs()
\n
'
+
'
me.getAltitudeAbs()
\n
'
+
'
);
\n
'
+
'
);
\n
'
+
'
};
\n
'
+
'
};
\n
'
+
...
@@ -70,19 +70,19 @@
...
@@ -70,19 +70,19 @@
'
me.onUpdate = function (timestamp) {
\n
'
+
'
me.onUpdate = function (timestamp) {
\n
'
+
'
var current_position = me.getCurrentPosition(),
\n
'
+
'
var current_position = me.getCurrentPosition(),
\n
'
+
'
realDistance = distance(
\n
'
+
'
realDistance = distance(
\n
'
+
'
me.initialPosition.
x
,
\n
'
+
'
me.initialPosition.
latitude
,
\n
'
+
'
me.initialPosition.
y
,
\n
'
+
'
me.initialPosition.
longitude
,
\n
'
+
'
me.getCurrentPosition().
x
,
\n
'
+
'
me.getCurrentPosition().
latitude
,
\n
'
+
'
me.getCurrentPosition().
y
\n
'
+
'
me.getCurrentPosition().
longitude
\n
'
+
'
).toFixed(8),
\n
'
+
'
).toFixed(8),
\n
'
+
'
expectedDistance = (me.getAirSpeed() * timestamp / 1000).toFixed(8);
\n
'
+
'
expectedDistance = (me.getAirSpeed() * timestamp / 1000).toFixed(8);
\n
'
+
'
assert(timestamp, 1000 / 60, "Timestamp");
\n
'
+
'
assert(timestamp, 1000 / 60, "Timestamp");
\n
'
+
'
assert(realDistance, expectedDistance, "Distance");
\n
'
+
'
assert(realDistance, expectedDistance, "Distance");
\n
'
+
'
current_position.
x = current_position.x
.toFixed(7);
\n
'
+
'
current_position.
latitude = current_position.latitude
.toFixed(7);
\n
'
+
'
compare(current_position, {
\n
'
+
'
compare(current_position, {
\n
'
+
'
x: (me.initialPosition.x
+ 2.3992831666911723e-06).toFixed(7),
\n
'
+
'
latitude: (me.initialPosition.latitude
+ 2.3992831666911723e-06).toFixed(7),
\n
'
+
'
y: me.initialPosition.y
,
\n
'
+
'
longitude: me.initialPosition.longitude
,
\n
'
+
'
z: me.initialPosition.z
\n
'
+
'
altitude: me.initialPosition.altitude
\n
'
+
'
});
\n
'
+
'
});
\n
'
+
'
me.exit(me.triggerParachute());
\n
'
+
'
me.exit(me.triggerParachute());
\n
'
+
'
};
'
,
'
};
'
,
...
@@ -199,7 +199,7 @@
...
@@ -199,7 +199,7 @@
"
initialPosition
"
:
{
"
initialPosition
"
:
{
"
longitude
"
:
parseFloat
(
INIT_LON
),
"
longitude
"
:
parseFloat
(
INIT_LON
),
"
latitude
"
:
parseFloat
(
INIT_LAT
),
"
latitude
"
:
parseFloat
(
INIT_LAT
),
"
z
"
:
parseFloat
(
INIT_Z
)
"
altitude
"
:
parseFloat
(
INIT_ALT
)
},
},
"
draw_flight_path
"
:
DRAW
,
"
draw_flight_path
"
:
DRAW
,
"
temp_flight_path
"
:
true
,
"
temp_flight_path
"
:
true
,
...
...
bt5/erp5_officejs_drone_simulator_test/PathTemplateItem/web_page_module/test_drone_simulator_flight_js.xml
View file @
c7943a9a
...
@@ -246,7 +246,7 @@
...
@@ -246,7 +246,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
101
0.12196.1891.61832
</string>
</value>
<value>
<string>
101
2.50925.12802.42871
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -266,7 +266,7 @@
...
@@ -266,7 +266,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
1
691485888.5
</float>
<float>
1
701095838.64
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
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