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
Nikola Balog
erp5
Commits
3c307e6a
Commit
3c307e6a
authored
Feb 28, 2024
by
Léo-Paul Géneau
👾
Browse files
Options
Browse Files
Download
Plain Diff
Define speed and coordinates simultaneously
See merge request
nexedi/erp5!1870
parents
b2f7be44
0c42f440
Changes
18
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
90 additions
and
92 deletions
+90
-92
bt5/erp5_officejs_drone_capture_flag/PathTemplateItem/web_page_module/drone_capture_flag_fixedwingdrone_js.js
...m/web_page_module/drone_capture_flag_fixedwingdrone_js.js
+8
-2
bt5/erp5_officejs_drone_capture_flag/PathTemplateItem/web_page_module/drone_capture_flag_fixedwingdrone_js.xml
.../web_page_module/drone_capture_flag_fixedwingdrone_js.xml
+2
-2
bt5/erp5_officejs_drone_capture_flag/PathTemplateItem/web_page_module/drone_capture_flag_logic_js.js
...mplateItem/web_page_module/drone_capture_flag_logic_js.js
+14
-16
bt5/erp5_officejs_drone_capture_flag/PathTemplateItem/web_page_module/drone_capture_flag_logic_js.xml
...plateItem/web_page_module/drone_capture_flag_logic_js.xml
+2
-2
bt5/erp5_officejs_drone_capture_flag/PathTemplateItem/web_page_module/ojs_drone_capture_flag_API_page_html.html
...web_page_module/ojs_drone_capture_flag_API_page_html.html
+5
-24
bt5/erp5_officejs_drone_capture_flag/PathTemplateItem/web_page_module/ojs_drone_capture_flag_API_page_html.xml
.../web_page_module/ojs_drone_capture_flag_API_page_html.xml
+2
-2
bt5/erp5_officejs_drone_capture_flag/PathTemplateItem/web_page_module/ojs_drone_capture_flag_script_page_js.js
.../web_page_module/ojs_drone_capture_flag_script_page_js.js
+20
-10
bt5/erp5_officejs_drone_capture_flag/PathTemplateItem/web_page_module/ojs_drone_capture_flag_script_page_js.xml
...web_page_module/ojs_drone_capture_flag_script_page_js.xml
+2
-2
bt5/erp5_officejs_drone_capture_flag_test/PathTemplateItem/web_page_module/test_capture_drone_flight_js.js
...plateItem/web_page_module/test_capture_drone_flight_js.js
+6
-4
bt5/erp5_officejs_drone_capture_flag_test/PathTemplateItem/web_page_module/test_capture_drone_flight_js.xml
...lateItem/web_page_module/test_capture_drone_flight_js.xml
+2
-2
bt5/erp5_officejs_drone_simulator/PathTemplateItem/web_page_module/drone_simulator_fixedwingdrone_js.js
...Item/web_page_module/drone_simulator_fixedwingdrone_js.js
+8
-2
bt5/erp5_officejs_drone_simulator/PathTemplateItem/web_page_module/drone_simulator_fixedwingdrone_js.xml
...tem/web_page_module/drone_simulator_fixedwingdrone_js.xml
+2
-2
bt5/erp5_officejs_drone_simulator/PathTemplateItem/web_page_module/drone_simulator_logic_js.js
...hTemplateItem/web_page_module/drone_simulator_logic_js.js
+6
-13
bt5/erp5_officejs_drone_simulator/PathTemplateItem/web_page_module/drone_simulator_logic_js.xml
...TemplateItem/web_page_module/drone_simulator_logic_js.xml
+2
-2
bt5/erp5_officejs_drone_simulator/PathTemplateItem/web_page_module/ojs_drone_simulator_script_page_js.js
...tem/web_page_module/ojs_drone_simulator_script_page_js.js
+2
-1
bt5/erp5_officejs_drone_simulator/PathTemplateItem/web_page_module/ojs_drone_simulator_script_page_js.xml
...em/web_page_module/ojs_drone_simulator_script_page_js.xml
+2
-2
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
+3
-2
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_capture_flag/PathTemplateItem/web_page_module/drone_capture_flag_fixedwingdrone_js.js
View file @
3c307e6a
...
...
@@ -345,7 +345,7 @@ var FixedWingDroneAPI = /** @class */ (function () {
};
FixedWingDroneAPI
.
prototype
.
internal_setTargetCoordinates
=
function
(
drone
,
coordinates
,
radius
)
{
function
(
drone
,
coordinates
,
speed
,
radius
)
{
if
(
radius
)
{
this
.
_loiter_mode
=
true
;
if
(
radius
>=
LOITER_LIMIT
)
{
...
...
@@ -354,6 +354,7 @@ var FixedWingDroneAPI = /** @class */ (function () {
}
else
{
this
.
_loiter_mode
=
false
;
}
this
.
setSpeed
(
drone
,
speed
);
};
FixedWingDroneAPI
.
prototype
.
sendMsg
=
function
(
msg
,
to
)
{
...
...
@@ -543,7 +544,12 @@ var FixedWingDroneAPI = /** @class */ (function () {
};
FixedWingDroneAPI
.
prototype
.
triggerParachute
=
function
(
drone
)
{
var
drone_pos
=
drone
.
getCurrentPosition
();
drone
.
setTargetCoordinates
(
drone_pos
.
latitude
,
drone_pos
.
longitude
,
5
);
drone
.
setTargetCoordinates
(
drone_pos
.
latitude
,
drone_pos
.
longitude
,
5
,
drone
.
getAirSpeed
()
);
};
FixedWingDroneAPI
.
prototype
.
landed
=
function
(
drone
)
{
var
drone_pos
=
drone
.
getCurrentPosition
();
...
...
bt5/erp5_officejs_drone_capture_flag/PathTemplateItem/web_page_module/drone_capture_flag_fixedwingdrone_js.xml
View file @
3c307e6a
...
...
@@ -246,7 +246,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
101
1.46032.14056.1553
</string>
</value>
<value>
<string>
101
4.48041.44620.29337
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -266,7 +266,7 @@
</tuple>
<state>
<tuple>
<float>
1
696870145.24
</float>
<float>
1
709113157.81
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs_drone_capture_flag/PathTemplateItem/web_page_module/drone_capture_flag_logic_js.js
View file @
3c307e6a
...
...
@@ -150,11 +150,11 @@ var DroneManager = /** @class */ (function () {
* Set a target point to move
*/
DroneManager
.
prototype
.
setTargetCoordinates
=
function
(
latitude
,
longitude
,
altitude
)
{
this
.
_internal_setTargetCoordinates
(
latitude
,
longitude
,
altitude
);
function
(
latitude
,
longitude
,
altitude
,
speed
)
{
this
.
_internal_setTargetCoordinates
(
latitude
,
longitude
,
altitude
,
speed
);
};
DroneManager
.
prototype
.
_internal_setTargetCoordinates
=
function
(
latitude
,
longitude
,
altitude
,
radius
)
{
function
(
latitude
,
longitude
,
altitude
,
speed
,
radius
)
{
if
(
!
this
.
_canPlay
)
{
return
;
}
...
...
@@ -165,6 +165,7 @@ var DroneManager = /** @class */ (function () {
return
this
.
_API
.
internal_setTargetCoordinates
(
this
,
this
.
_targetCoordinates
,
speed
,
radius
);
};
...
...
@@ -224,15 +225,6 @@ var DroneManager = /** @class */ (function () {
}
return
this
.
_API
.
setStartingPosition
(
this
,
x
,
y
,
z
);
};
DroneManager
.
prototype
.
setAirSpeed
=
function
(
speed
)
{
if
(
!
this
.
_canPlay
)
{
return
;
}
if
(
isNaN
(
speed
))
{
throw
new
Error
(
'
Speed must be a number
'
);
}
return
this
.
_API
.
setSpeed
(
this
,
speed
);
};
DroneManager
.
prototype
.
setDirection
=
function
(
x
,
y
,
z
)
{
if
(
!
this
.
_canPlay
)
{
return
;
...
...
@@ -334,8 +326,14 @@ var DroneManager = /** @class */ (function () {
* Make the drone loiter (circle with a set radius)
*/
DroneManager
.
prototype
.
loiter
=
function
(
latitude
,
longitude
,
altitude
,
radius
)
{
this
.
_internal_setTargetCoordinates
(
latitude
,
longitude
,
altitude
,
radius
);
function
(
latitude
,
longitude
,
altitude
,
radius
,
speed
)
{
this
.
_internal_setTargetCoordinates
(
latitude
,
longitude
,
altitude
,
speed
,
radius
);
};
DroneManager
.
prototype
.
getFlightParameters
=
function
()
{
if
(
this
.
_API
.
getFlightParameters
)
{
...
...
bt5/erp5_officejs_drone_capture_flag/PathTemplateItem/web_page_module/drone_capture_flag_logic_js.xml
View file @
3c307e6a
...
...
@@ -246,7 +246,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
101
1.57487.9176.36369
</string>
</value>
<value>
<string>
101
4.48183.45277.7697
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -266,7 +266,7 @@
</tuple>
<state>
<tuple>
<float>
1
697558075.3
8
</float>
<float>
1
709113192.2
8
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs_drone_capture_flag/PathTemplateItem/web_page_module/ojs_drone_capture_flag_API_page_html.html
View file @
3c307e6a
...
...
@@ -363,39 +363,20 @@
<p
class=
"item-param-1"
>
altitude: Float
</p>
<p
class=
"item-param-2"
>
altitude value (in meters).
</p>
</div>
<div>
<h5
class=
"item-param-1"
>
Example
</h5>
</div>
<div>
<p
class=
"item-example"
>
me.setTargetCoordinates(lat, lon, altitude);
<br>
</p>
</div>
<div
class=
"line"
></div>
<!-- setAirSpeed -->
<h4
class=
"item-name"
id=
"setAirSpeed"
><span>
setAirSpeed
</span><span>
: void
</span></h4>
<p
class=
"item-descr"
>
Set the drone speed in meters/second. The drone will move at the given value.
</p>
<div>
<h5
class=
"item-param-1"
>
Param
</h5>
<h5
class=
"item-param-2"
>
Description
</h5>
</div>
<div>
<p
class=
"item-param-1"
>
speed: Float
</p>
<p
class=
"item-param-2"
>
Speed value
</p>
<p
class=
"item-param-2"
>
speed value (in meters per second).
</p>
</div>
<div>
<h5
class=
"item-param-1"
>
Example
</h5>
</div>
<p
class=
"item-param-1"
>
me.setAirSpeed(16);
<br>
<div>
<p
class=
"item-example"
>
me.setTargetCoordinates(lat, lon, altitude, speed);
<br>
</p>
</div>
<div
class=
"line"
></div>
...
...
bt5/erp5_officejs_drone_capture_flag/PathTemplateItem/web_page_module/ojs_drone_capture_flag_API_page_html.xml
View file @
3c307e6a
...
...
@@ -244,7 +244,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
101
3.8667.7605.21589
</string>
</value>
<value>
<string>
101
4.45296.39536.30276
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -264,7 +264,7 @@
</tuple>
<state>
<tuple>
<float>
170
2410728.19
</float>
<float>
170
8536065.15
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs_drone_capture_flag/PathTemplateItem/web_page_module/ojs_drone_capture_flag_script_page_js.js
View file @
3c307e6a
...
...
@@ -77,6 +77,7 @@ var OperatorAPI = /** @class */ (function () {
MAX_PITCH
=
25
,
MAX_CLIMB_RATE
=
8
,
MAX_SINK_RATE
=
3
,
MAX_COMMAND_FREQUENCY
=
2
,
NUMBER_OF_DRONES
=
5
,
// Non-inputs parameters
EPSILON
=
"
15
"
,
...
...
@@ -104,7 +105,7 @@ var OperatorAPI = /** @class */ (function () {
'
);
\n
'
+
'
}
\n
'
+
'
\n
'
+
'
me.onStart = function () {
\n
'
+
'
me.onStart = function (
timestamp
) {
\n
'
+
'
me.direction_set = false;
\n
'
+
'
me.dodging = false;
\n
'
+
'
me.ongoing_detection = false;
\n
'
+
...
...
@@ -136,7 +137,8 @@ var OperatorAPI = /** @class */ (function () {
'
me.setTargetCoordinates(
\n
'
+
'
me.flag_positions[me.next_checkpoint].position.latitude,
\n
'
+
'
me.flag_positions[me.next_checkpoint].position.longitude,
\n
'
+
'
me.flag_positions[me.next_checkpoint].position.altitude + me.id
\n
'
+
'
me.flag_positions[me.next_checkpoint].position.altitude + me.id,
\n
'
+
'
'
+
DEFAULT_SPEED
+
'
\n
'
+
'
);
\n
'
+
//' console.log("[DEMO] Going to Checkpoint %d", me.next_checkpoint);\n' +
'
}
\n
'
+
...
...
@@ -162,12 +164,6 @@ var OperatorAPI = /** @class */ (function () {
'
}
\n
'
+
'
return;
\n
'
+
'
}
\n
'
+
'
if (me.next_checkpoint == me.flag_positions.length) {
\n
'
+
'
me.triggerParachute();
\n
'
+
'
}
\n
'
+
'
if (me.landed()) {
\n
'
+
'
me.exit();
\n
'
+
'
}
\n
'
+
'
};
\n
'
+
'
\n
'
+
'
me.onDroneViewInfo = function (drone_view) {
\n
'
+
...
...
@@ -182,7 +178,7 @@ var OperatorAPI = /** @class */ (function () {
'
} else {
\n
'
+
'
dodge_point.longitude = dodge_point.longitude * -1;
\n
'
+
'
}
\n
'
+
'
me.setTargetCoordinates(dodge_point.latitude, dodge_point.longitude, me.getCurrentPosition().altitude);
\n
'
+
'
me.setTargetCoordinates(dodge_point.latitude, dodge_point.longitude, me.getCurrentPosition().altitude
,
'
+
DEFAULT_SPEED
+
'
);
\n
'
+
'
return;
\n
'
+
'
}
\n
'
+
'
};
'
,
...
...
@@ -680,6 +676,17 @@ var OperatorAPI = /** @class */ (function () {
"
hidden
"
:
0
,
"
type
"
:
"
FloatField
"
},
"
my_drone_max_command_frequency
"
:
{
"
description
"
:
""
,
"
title
"
:
"
Drone max command frequency
"
,
"
default
"
:
gadget
.
state
.
drone_max_command_frequency
,
"
css_class
"
:
""
,
"
required
"
:
1
,
"
editable
"
:
1
,
"
key
"
:
"
drone_max_command_frequency
"
,
"
hidden
"
:
0
,
"
type
"
:
"
FloatField
"
},
"
my_number_of_drones
"
:
{
"
description
"
:
""
,
"
title
"
:
"
Number of drones
"
,
...
...
@@ -708,7 +715,8 @@ var OperatorAPI = /** @class */ (function () {
[[
"
my_drone_min_speed
"
],
[
"
my_drone_speed
"
],
[
"
my_drone_max_speed
"
],
[
"
my_drone_max_acceleration
"
],
[
"
my_drone_max_deceleration
"
],
[
"
my_drone_max_roll
"
],
[
"
my_drone_min_pitch
"
],
[
"
my_drone_max_pitch
"
],
[
"
my_drone_max_sink_rate
"
],
[
"
my_drone_max_climb_rate
"
]]
[
"
my_drone_max_sink_rate
"
],
[
"
my_drone_max_climb_rate
"
],
[
"
my_drone_max_command_frequency
"
]]
]]
}
});
...
...
@@ -836,6 +844,7 @@ var OperatorAPI = /** @class */ (function () {
"
maxPitchAngle
"
:
parseFloat
(
gadget
.
state
.
drone_max_pitch
),
"
maxSinkRate
"
:
parseFloat
(
gadget
.
state
.
drone_max_sink_rate
),
"
maxClimbRate
"
:
parseFloat
(
gadget
.
state
.
drone_max_climb_rate
),
"
maxCommandFrequency
"
:
parseFloat
(
gadget
.
state
.
drone_max_command_frequency
),
"
list
"
:
drone_list
},
"
gameTime
"
:
parseInt
(
gadget
.
state
.
simulation_time
,
10
),
...
...
@@ -950,6 +959,7 @@ var OperatorAPI = /** @class */ (function () {
operator_script
:
DEFAULT_OPERATOR_SCRIPT
,
drone_script
:
DEFAULT_SCRIPT_CONTENT
,
number_of_drones
:
NUMBER_OF_DRONES
,
drone_max_command_frequency
:
MAX_COMMAND_FREQUENCY
,
drone_max_climb_rate
:
MAX_CLIMB_RATE
,
drone_max_sink_rate
:
MAX_SINK_RATE
,
drone_max_pitch
:
MAX_PITCH
,
...
...
bt5/erp5_officejs_drone_capture_flag/PathTemplateItem/web_page_module/ojs_drone_capture_flag_script_page_js.xml
View file @
3c307e6a
...
...
@@ -246,7 +246,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
101
1.57494.145.60023
</string>
</value>
<value>
<string>
101
4.55204.2137.9676
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -266,7 +266,7 @@
</tuple>
<state>
<tuple>
<float>
1
697558059.95
</float>
<float>
1
709130500.2
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs_drone_capture_flag_test/PathTemplateItem/web_page_module/test_capture_drone_flight_js.js
View file @
3c307e6a
...
...
@@ -53,13 +53,14 @@
'
}
\n
'
+
'
\n
'
+
'
me.onStart = function () {
\n
'
+
'
assert(me.getAirSpeed(),
16
, "Initial speed");
\n
'
+
'
assert(me.getAirSpeed(),
'
+
DEFAULT_SPEED
+
'
, "Initial speed");
\n
'
+
'
assert(me.getYaw(), 0, "Yaw angle")
\n
'
+
'
me.initialPosition = me.getCurrentPosition();
\n
'
+
'
me.setTargetCoordinates(
\n
'
+
'
me.initialPosition.latitude + 0.01,
\n
'
+
'
me.initialPosition.longitude,
\n
'
+
'
me.getAltitudeAbs()
\n
'
+
'
me.getAltitudeAbs(),
\n
'
+
'
'
+
DEFAULT_SPEED
+
'
\n
'
+
'
);
\n
'
+
'
};
\n
'
+
'
\n
'
+
...
...
@@ -71,8 +72,9 @@
'
me.getCurrentPosition().latitude,
\n
'
+
'
me.getCurrentPosition().longitude
\n
'
+
'
).toFixed(8),
\n
'
+
'
expectedDistance = (me.getAirSpeed() * timestamp / 1000).toFixed(8);
\n
'
+
'
assert(timestamp, 1000 / 60, "Timestamp");
\n
'
+
'
time_interval = 1000 / 60,
\n
'
+
'
expectedDistance = (me.getAirSpeed() * time_interval / 1000).toFixed(8);
\n
'
+
'
assert(timestamp, Math.floor(time_interval), "Timestamp");
\n
'
+
'
assert(realDistance, expectedDistance, "Distance");
\n
'
+
'
current_position.latitude = current_position.latitude.toFixed(7);
\n
'
+
'
compare(current_position, {
\n
'
+
...
...
bt5/erp5_officejs_drone_capture_flag_test/PathTemplateItem/web_page_module/test_capture_drone_flight_js.xml
View file @
3c307e6a
...
...
@@ -246,7 +246,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
1014.5
3878.23823.32290
</string>
</value>
<value>
<string>
1014.5
5202.48917.18107
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -266,7 +266,7 @@
</tuple>
<state>
<tuple>
<float>
1709
057695.61
</float>
<float>
1709
130419.7
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs_drone_simulator/PathTemplateItem/web_page_module/drone_simulator_fixedwingdrone_js.js
View file @
3c307e6a
...
...
@@ -349,7 +349,7 @@ var FixedWingDroneAPI = /** @class */ (function () {
};
FixedWingDroneAPI
.
prototype
.
internal_setTargetCoordinates
=
function
(
drone
,
coordinates
,
radius
)
{
function
(
drone
,
coordinates
,
speed
,
radius
)
{
if
(
radius
)
{
this
.
_loiter_mode
=
true
;
if
(
radius
>=
LOITER_LIMIT
)
{
...
...
@@ -358,6 +358,7 @@ var FixedWingDroneAPI = /** @class */ (function () {
}
else
{
this
.
_loiter_mode
=
false
;
}
this
.
setSpeed
(
drone
,
speed
);
};
FixedWingDroneAPI
.
prototype
.
sendMsg
=
function
(
msg
,
to
)
{
...
...
@@ -502,7 +503,12 @@ var FixedWingDroneAPI = /** @class */ (function () {
};
FixedWingDroneAPI
.
prototype
.
triggerParachute
=
function
(
drone
)
{
var
drone_pos
=
drone
.
getCurrentPosition
();
drone
.
setTargetCoordinates
(
drone_pos
.
latitude
,
drone_pos
.
longitude
,
5
);
drone
.
setTargetCoordinates
(
drone_pos
.
latitude
,
drone_pos
.
longitude
,
5
,
drone
.
getAirSpeed
()
);
};
FixedWingDroneAPI
.
prototype
.
landed
=
function
(
drone
)
{
var
drone_pos
=
drone
.
getCurrentPosition
();
...
...
bt5/erp5_officejs_drone_simulator/PathTemplateItem/web_page_module/drone_simulator_fixedwingdrone_js.xml
View file @
3c307e6a
...
...
@@ -240,7 +240,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
101
1.48679.53693.47701
</string>
</value>
<value>
<string>
101
4.11751.44914.51968
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>
1
697030763.04
</float>
<float>
1
706523358.41
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs_drone_simulator/PathTemplateItem/web_page_module/drone_simulator_logic_js.js
View file @
3c307e6a
...
...
@@ -136,11 +136,11 @@ var DroneManager = /** @class */ (function () {
* Set a target point to move
*/
DroneManager
.
prototype
.
setTargetCoordinates
=
function
(
latitude
,
longitude
,
altitude
)
{
this
.
_internal_setTargetCoordinates
(
latitude
,
longitude
,
altitude
);
function
(
latitude
,
longitude
,
altitude
,
speed
)
{
this
.
_internal_setTargetCoordinates
(
latitude
,
longitude
,
altitude
,
speed
);
};
DroneManager
.
prototype
.
_internal_setTargetCoordinates
=
function
(
latitude
,
longitude
,
altitude
,
radius
)
{
function
(
latitude
,
longitude
,
altitude
,
speed
,
radius
)
{
if
(
!
this
.
_canPlay
)
{
return
;
}
...
...
@@ -150,6 +150,7 @@ var DroneManager = /** @class */ (function () {
return
this
.
_API
.
internal_setTargetCoordinates
(
this
,
this
.
_targetCoordinates
,
speed
,
radius
);
};
...
...
@@ -197,15 +198,6 @@ var DroneManager = /** @class */ (function () {
}
return
this
.
_API
.
setStartingPosition
(
this
,
x
,
y
,
z
);
};
DroneManager
.
prototype
.
setAirSpeed
=
function
(
speed
)
{
if
(
!
this
.
_canPlay
)
{
return
;
}
if
(
isNaN
(
speed
))
{
throw
new
Error
(
'
Speed must be a number
'
);
}
return
this
.
_API
.
setSpeed
(
this
,
speed
);
};
DroneManager
.
prototype
.
setDirection
=
function
(
x
,
y
,
z
)
{
if
(
!
this
.
_canPlay
)
{
return
;
...
...
@@ -299,11 +291,12 @@ var DroneManager = /** @class */ (function () {
* Make the drone loiter (circle with a set radius)
*/
DroneManager
.
prototype
.
loiter
=
function
(
latitude
,
longitude
,
altitude
,
radius
)
{
function
(
latitude
,
longitude
,
altitude
,
radius
,
speed
)
{
this
.
_internal_setTargetCoordinates
(
latitude
,
longitude
,
altitude
,
speed
,
radius
);
};
...
...
bt5/erp5_officejs_drone_simulator/PathTemplateItem/web_page_module/drone_simulator_logic_js.xml
View file @
3c307e6a
...
...
@@ -240,7 +240,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
101
1.48744.22696.33177
</string>
</value>
<value>
<string>
101
4.11746.34243.61149
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>
1
697032866.09
</float>
<float>
1
706523386.8
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs_drone_simulator/PathTemplateItem/web_page_module/ojs_drone_simulator_script_page_js.js
View file @
3c307e6a
...
...
@@ -98,7 +98,8 @@
'
me.setTargetCoordinates(
\n
'
+
'
CHECKPOINT_LIST[me.next_checkpoint].latitude,
\n
'
+
'
CHECKPOINT_LIST[me.next_checkpoint].longitude,
\n
'
+
'
CHECKPOINT_LIST[me.next_checkpoint].altitude + ALTITUDE + ALTITUDE * me.id
\n
'
+
'
CHECKPOINT_LIST[me.next_checkpoint].altitude + ALTITUDE + ALTITUDE * me.id,
\n
'
+
'
'
+
DEFAULT_SPEED
+
'
\n
'
+
'
);
\n
'
+
'
console.log("[DEMO] Going to Checkpoint %d", me.next_checkpoint);
\n
'
+
'
}
\n
'
+
...
...
bt5/erp5_officejs_drone_simulator/PathTemplateItem/web_page_module/ojs_drone_simulator_script_page_js.xml
View file @
3c307e6a
...
...
@@ -246,7 +246,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
101
1.48716.48246.13943
</string>
</value>
<value>
<string>
101
4.54902.15254.29337
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -266,7 +266,7 @@
</tuple>
<state>
<tuple>
<float>
1
697031250.03
</float>
<float>
1
709130323.68
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs_drone_simulator_test/PathTemplateItem/web_page_module/test_drone_simulator_flight_js.js
View file @
3c307e6a
...
...
@@ -57,13 +57,14 @@
'
}
\n
'
+
'
\n
'
+
'
me.onStart = function () {
\n
'
+
'
assert(me.getAirSpeed(),
16
, "Initial speed");
\n
'
+
'
assert(me.getAirSpeed(),
'
+
DEFAULT_SPEED
+
'
, "Initial speed");
\n
'
+
'
assert(me.getYaw(), 0, "Yaw angle")
\n
'
+
'
me.initialPosition = me.getCurrentPosition();
\n
'
+
'
me.setTargetCoordinates(
\n
'
+
'
me.initialPosition.latitude + 0.01,
\n
'
+
'
me.initialPosition.longitude,
\n
'
+
'
me.getAltitudeAbs()
\n
'
+
'
me.getAltitudeAbs(),
\n
'
+
'
'
+
DEFAULT_SPEED
+
'
\n
'
+
'
);
\n
'
+
'
};
\n
'
+
'
\n
'
+
...
...
bt5/erp5_officejs_drone_simulator_test/PathTemplateItem/web_page_module/test_drone_simulator_flight_js.xml
View file @
3c307e6a
...
...
@@ -246,7 +246,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
101
2.50925.12802.42871
</string>
</value>
<value>
<string>
101
4.55202.15664.53026
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -266,7 +266,7 @@
</tuple>
<state>
<tuple>
<float>
170
1095838.64
</float>
<float>
170
9130383.65
</float>
<string>
UTC
</string>
</tuple>
</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