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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
32aad29a
Commit
32aad29a
authored
Mar 18, 2024
by
Léo-Paul Géneau
👾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officejs_drone_simulator: implement proper parachute landing
parent
ce80c289
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
43 additions
and
24 deletions
+43
-24
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
+17
-7
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
+3
-1
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_simulator/PathTemplateItem/web_page_module/drone_simulator_fixedwingdrone_js.js
...Item/web_page_module/drone_simulator_fixedwingdrone_js.js
+8
-4
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
+3
-1
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
No files found.
bt5/erp5_officejs_drone_capture_flag/PathTemplateItem/web_page_module/drone_capture_flag_fixedwingdrone_js.js
View file @
32aad29a
...
...
@@ -6,6 +6,7 @@ var FixedWingDroneAPI = /** @class */ (function () {
"
use strict
"
;
var
DEFAULT_SPEED
=
16
,
PARACHUTE_SPEED
=
8
,
EARTH_GRAVITY
=
9.81
,
LOITER_LIMIT
=
30
,
MAX_ACCELERATION
=
6
,
...
...
@@ -98,8 +99,12 @@ var FixedWingDroneAPI = /** @class */ (function () {
** Function called on every drone update, right before onUpdate AI script
*/
FixedWingDroneAPI
.
prototype
.
internal_update
=
function
(
context
,
delta_time
)
{
this
.
_updateSpeed
(
context
,
delta_time
);
this
.
_updatePosition
(
context
,
delta_time
);
if
(
context
.
position
.
z
>
0
)
{
this
.
_updateSpeed
(
context
,
delta_time
);
this
.
_updatePosition
(
context
,
delta_time
);
}
else
{
context
.
setDirection
(
0
,
0
,
0
);
}
context
.
_controlMesh
.
computeWorldMatrix
(
true
);
context
.
_mesh
.
computeWorldMatrix
(
true
);
...
...
@@ -486,8 +491,8 @@ var FixedWingDroneAPI = /** @class */ (function () {
function
(
altitude_diff
,
max_climb_rate
,
speed
,
max_pitch
)
{
var
maxVerticalSpeed
=
Math
.
min
(
altitude_diff
,
Math
.
min
(
max_climb_rate
,
speed
));
return
(
this
.
_toDeg
(
Math
.
asin
(
maxVerticalSpeed
/
speed
))
>
max_pitch
)
?
speed
*
Math
.
sin
(
this
.
_toRad
(
max_pitch
))
return
(
this
.
_toDeg
(
Math
.
asin
(
maxVerticalSpeed
/
speed
))
>
max_pitch
)
?
speed
*
Math
.
sin
(
this
.
_toRad
(
max_pitch
))
:
maxVerticalSpeed
;
};
FixedWingDroneAPI
.
prototype
.
_toRad
=
function
(
angle
)
{
...
...
@@ -511,11 +516,16 @@ var FixedWingDroneAPI = /** @class */ (function () {
};
FixedWingDroneAPI
.
prototype
.
land
=
function
(
drone
)
{
var
drone_pos
=
drone
.
getCurrentPosition
();
drone
.
setTargetCoordinates
(
this
.
_flight_parameters
.
drone
.
minSpeed
=
0
;
drone
.
_speed
=
0
;
drone
.
_acceleration
=
EARTH_GRAVITY
;
this
.
_flight_parameters
.
drone
.
maxSinkRate
=
PARACHUTE_SPEED
;
this
.
_flight_parameters
.
drone
.
minPitchAngle
=
-
90
;
drone
.
_internal_setTargetCoordinates
(
drone_pos
.
latitude
,
drone_pos
.
longitude
,
0
,
drone
.
get3DSpeed
()
-
PARACHUTE_SPEED
,
PARACHUTE_SPEED
);
this
.
_is_ready_to_fly
=
false
;
this
.
_is_landing
=
true
;
...
...
bt5/erp5_officejs_drone_capture_flag/PathTemplateItem/web_page_module/drone_capture_flag_fixedwingdrone_js.xml
View file @
32aad29a
...
...
@@ -246,7 +246,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
101
4.60733.7318.44953
</string>
</value>
<value>
<string>
101
5.19974.55909.31829
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -266,7 +266,7 @@
</tuple>
<state>
<tuple>
<float>
17
09564488.61
</float>
<float>
17
10776360.59
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs_drone_capture_flag/PathTemplateItem/web_page_module/drone_capture_flag_logic_js.js
View file @
32aad29a
...
...
@@ -360,7 +360,9 @@ var DroneManager = /** @class */ (function () {
return
this
.
_API
.
takeOff
();
};
DroneManager
.
prototype
.
land
=
function
()
{
return
this
.
_API
.
land
(
this
);
if
(
!
this
.
isLanding
())
{
return
this
.
_API
.
land
(
this
);
}
};
DroneManager
.
prototype
.
exit
=
function
()
{
return
this
.
_internal_crash
();
...
...
bt5/erp5_officejs_drone_capture_flag/PathTemplateItem/web_page_module/drone_capture_flag_logic_js.xml
View file @
32aad29a
...
...
@@ -246,7 +246,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
1015.
15587.24859.64699
</string>
</value>
<value>
<string>
1015.
21423.13957.6792
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -266,7 +266,7 @@
</tuple>
<state>
<tuple>
<float>
1710
512866.57
</float>
<float>
1710
863670.4
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs_drone_simulator/PathTemplateItem/web_page_module/drone_simulator_fixedwingdrone_js.js
View file @
32aad29a
...
...
@@ -7,6 +7,7 @@ var FixedWingDroneAPI = /** @class */ (function () {
// var TAKEOFF_RADIUS = 60,
var
DEFAULT_SPEED
=
16
,
PARACHUTE_SPEED
=
8
,
EARTH_GRAVITY
=
9.81
,
LOITER_LIMIT
=
30
,
MAX_ACCELERATION
=
6
,
...
...
@@ -373,8 +374,6 @@ var FixedWingDroneAPI = /** @class */ (function () {
var
processed_coordinates
=
this
.
_mapManager
.
convertToLocalCoordinates
(
lat
,
lon
,
z
);
processed_coordinates
.
z
-=
this
.
_map_dict
.
start_AMSL
;
//this._last_altitude_point_reached = -1;
//this.takeoff_path = [];
return
processed_coordinates
;
};
FixedWingDroneAPI
.
prototype
.
getCurrentPosition
=
function
(
x
,
y
,
z
)
{
...
...
@@ -470,11 +469,16 @@ var FixedWingDroneAPI = /** @class */ (function () {
};
FixedWingDroneAPI
.
prototype
.
land
=
function
(
drone
)
{
var
drone_pos
=
drone
.
getCurrentPosition
();
drone
.
setTargetCoordinates
(
this
.
_flight_parameters
.
drone
.
minSpeed
=
0
;
drone
.
_speed
=
0
;
drone
.
_acceleration
=
EARTH_GRAVITY
;
this
.
_flight_parameters
.
drone
.
maxSinkRate
=
PARACHUTE_SPEED
;
this
.
_flight_parameters
.
drone
.
minPitchAngle
=
-
90
;
drone
.
_internal_setTargetCoordinates
(
drone_pos
.
latitude
,
drone_pos
.
longitude
,
0
,
drone
.
get3DSpeed
()
PARACHUTE_SPEED
);
this
.
_is_ready_to_fly
=
false
;
this
.
_is_landing
=
true
;
...
...
bt5/erp5_officejs_drone_simulator/PathTemplateItem/web_page_module/drone_simulator_fixedwingdrone_js.xml
View file @
32aad29a
...
...
@@ -240,7 +240,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
101
4.60733.7318.4495
3
</string>
</value>
<value>
<string>
101
5.19909.43325.5746
3
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>
17
09562449.93
</float>
<float>
17
10776370.92
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs_drone_simulator/PathTemplateItem/web_page_module/drone_simulator_logic_js.js
View file @
32aad29a
...
...
@@ -316,7 +316,9 @@ var DroneManager = /** @class */ (function () {
return
this
.
_API
.
takeOff
();
};
DroneManager
.
prototype
.
land
=
function
()
{
return
this
.
_API
.
land
(
this
);
if
(
!
this
.
isLanding
())
{
return
this
.
_API
.
land
(
this
);
}
};
DroneManager
.
prototype
.
exit
=
function
()
{
return
this
.
_internal_crash
();
...
...
bt5/erp5_officejs_drone_simulator/PathTemplateItem/web_page_module/drone_simulator_logic_js.xml
View file @
32aad29a
...
...
@@ -240,7 +240,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
1015.
15585.15092.32085
</string>
</value>
<value>
<string>
1015.
21142.6327.53794
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>
1710
512741.55
</float>
<float>
1710
863206.6
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs_drone_simulator/PathTemplateItem/web_page_module/ojs_drone_simulator_script_page_js.js
View file @
32aad29a
...
...
@@ -122,7 +122,8 @@
'
}
\n
'
+
'
return;
\n
'
+
'
}
\n
'
+
'
me.exit(0);
\n
'
+
'
if (!me.isLanding()) { me.land() };
\n
'
+
'
if (me.getCurrentPosition().altitude <= 0) { me.exit(0) };
\n
'
+
'
};
'
,
DRAW
=
true
,
LOG
=
true
,
...
...
bt5/erp5_officejs_drone_simulator/PathTemplateItem/web_page_module/ojs_drone_simulator_script_page_js.xml
View file @
32aad29a
...
...
@@ -246,7 +246,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
101
4.60725.60577.24917
</string>
</value>
<value>
<string>
101
5.15836.20157.60791
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -266,7 +266,7 @@
</tuple>
<state>
<tuple>
<float>
17
09289017.41
</float>
<float>
17
10527785.95
</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