Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
c-astral-wrapper
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
c-astral-wrapper
Commits
96ed9f80
Commit
96ed9f80
authored
Apr 09, 2024
by
Léo-Paul Géneau
👾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Comply with qjs-wrapper 2.1
parent
b5a42f83
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
13 deletions
+17
-13
mavsdk_wrapper.cpp
mavsdk_wrapper.cpp
+17
-13
No files found.
mavsdk_wrapper.cpp
View file @
96ed9f80
...
@@ -11,7 +11,8 @@
...
@@ -11,7 +11,8 @@
#include <future>
#include <future>
#include <memory>
#include <memory>
#include <thread>
#include <thread>
#include "autopilot_wrapper.h"
#include "dronedge_protocol.h"
#include "autopilot_API.h"
using
namespace
mavsdk
;
using
namespace
mavsdk
;
using
std
::
chrono
::
seconds
;
using
std
::
chrono
::
seconds
;
...
@@ -226,16 +227,19 @@ void updateLogAndProjection(void) {
...
@@ -226,16 +227,19 @@ void updateLogAndProjection(void) {
if
(
mavsdk_started
)
{
if
(
mavsdk_started
)
{
metrics
=
telemetry
->
fixedwing_metrics
();
metrics
=
telemetry
->
fixedwing_metrics
();
oss
<<
current_position
[
4
]
<<
";"
oss
<<
current_position
[
TIMESTAMP
]
<<
";"
<<
current_position
[
0
]
<<
";"
<<
current_position
[
1
]
<<
";"
<<
current_position
[
LATITUDE
]
<<
";"
<<
current_position
[
2
]
<<
";"
<<
current_position
[
3
]
<<
";"
<<
current_position
[
LONGITUDE
]
<<
";"
<<
current_position
[
ABS_ALTITUDE
]
<<
";"
<<
current_position
[
REL_ALTITUDE
]
<<
";"
<<
telemetry
->
attitude_euler
().
yaw_deg
<<
";"
<<
telemetry
->
attitude_euler
().
yaw_deg
<<
";"
<<
metrics
.
airspeed_m_s
<<
";"
<<
metrics
.
climb_rate_m_s
;
<<
metrics
.
airspeed_m_s
<<
";"
<<
metrics
.
climb_rate_m_s
;
log
(
oss
.
str
());
log
(
oss
.
str
());
if
(
first_coordinate_entered
)
{
if
(
first_coordinate_entered
)
{
if
(
do_projection
)
{
if
(
do_projection
)
{
updateProjection
(
current_position
[
0
],
current_position
[
1
]);
updateProjection
(
current_position
[
LATITUDE
],
current_position
[
LONGITUDE
]);
}
else
{
}
else
{
doReposition_async
(
doReposition_async
(
(
float
)
targeted_destination
.
latitude
,
(
float
)
targeted_destination
.
latitude
,
...
@@ -294,11 +298,11 @@ int start(const char * ip, int port, const char * log_file, int timeout) {
...
@@ -294,11 +298,11 @@ int start(const char * ip, int port, const char * log_file, int timeout) {
if
(
timestamp_difference
==
0
)
if
(
timestamp_difference
==
0
)
timestamp_difference
=
getTimestamp
()
-
position
.
time_boot_ms
;
timestamp_difference
=
getTimestamp
()
-
position
.
time_boot_ms
;
current_position
[
0
]
=
position
.
lat
;
current_position
[
LATITUDE
]
=
position
.
lat
;
current_position
[
1
]
=
position
.
lon
;
current_position
[
LONGITUDE
]
=
position
.
lon
;
current_position
[
2
]
=
position
.
alt
;
current_position
[
ABS_ALTITUDE
]
=
position
.
alt
;
current_position
[
3
]
=
position
.
relative_alt
;
current_position
[
REL_ALTITUDE
]
=
position
.
relative_alt
;
current_position
[
4
]
=
position
.
time_boot_ms
+
timestamp_difference
;
current_position
[
TIMESTAMP
]
=
position
.
time_boot_ms
+
timestamp_difference
;
});
});
telemetry
->
subscribe_landed_state
([](
const
Telemetry
::
LandedState
landed_state
)
{
telemetry
->
subscribe_landed_state
([](
const
Telemetry
::
LandedState
landed_state
)
{
...
@@ -458,9 +462,9 @@ float *getSpeedArray(void) {
...
@@ -458,9 +462,9 @@ float *getSpeedArray(void) {
Telemetry
::
FixedwingMetrics
metrics
=
telemetry
->
fixedwing_metrics
();
Telemetry
::
FixedwingMetrics
metrics
=
telemetry
->
fixedwing_metrics
();
float
*
speedArray
=
float
*
speedArray
=
(
float
*
)
malloc
(
SPEED_ARRAY_SIZE
*
sizeof
(
float
));
(
float
*
)
malloc
(
SPEED_ARRAY_SIZE
*
sizeof
(
float
));
speedArray
[
0
]
=
getYaw
();
speedArray
[
YAW
]
=
getYaw
();
speedArray
[
1
]
=
metrics
.
airspeed_m_s
;
speedArray
[
SPEED
]
=
metrics
.
airspeed_m_s
;
speedArray
[
2
]
=
metrics
.
climb_rate_m_s
;
speedArray
[
CLIMB_RATE
]
=
metrics
.
climb_rate_m_s
;
return
speedArray
;
return
speedArray
;
}
}
...
...
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