Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Q
qjs-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
qjs-wrapper
Commits
760fed00
Commit
760fed00
authored
Feb 14, 2023
by
Léo-Paul Géneau
👾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use timestamp in milliseconds
parent
1a778c02
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
mavsdk_wrapper.cpp
mavsdk_wrapper.cpp
+6
-3
No files found.
mavsdk_wrapper.cpp
View file @
760fed00
...
@@ -48,6 +48,7 @@ static double xy_ratio;
...
@@ -48,6 +48,7 @@ static double xy_ratio;
static
double
target_latitude
;
static
double
target_latitude
;
static
double
target_longitude
;
static
double
target_longitude
;
static
int
mavsdk_started
=
0
;
static
int
mavsdk_started
=
0
;
static
uint64_t
init_timestamp
;
static
Telemetry
::
Position
origin
;
static
Telemetry
::
Position
origin
;
// Logs functions
// Logs functions
...
@@ -142,14 +143,13 @@ int mavsdk_start(const char * url, const char * log_file, int timeout) {
...
@@ -142,14 +143,13 @@ int mavsdk_start(const char * url, const char * log_file, int timeout) {
telemetry
->
subscribe_flight_mode
([](
Telemetry
::
FlightMode
flight_mode
)
{
telemetry
->
subscribe_flight_mode
([](
Telemetry
::
FlightMode
flight_mode
)
{
if
(
takingOff
&&
flight_mode
!=
Telemetry
::
FlightMode
::
Takeoff
)
{
if
(
takingOff
&&
flight_mode
!=
Telemetry
::
FlightMode
::
Takeoff
)
{
takingOff
=
false
;
log
(
"Subscribing to raw GPS..."
);
log
(
"Subscribing to raw GPS..."
);
telemetry
->
subscribe_raw_gps
([](
Telemetry
::
RawGps
gps
)
{
telemetry
->
subscribe_raw_gps
([](
Telemetry
::
RawGps
gps
)
{
std
::
ostringstream
oss
;
std
::
ostringstream
oss
;
Telemetry
::
FixedwingMetrics
metrics
=
telemetry
->
fixedwing_metrics
();
Telemetry
::
FixedwingMetrics
metrics
=
telemetry
->
fixedwing_metrics
();
Telemetry
::
Position
position
=
telemetry
->
position
();
Telemetry
::
Position
position
=
telemetry
->
position
();
oss
<<
gps
.
timestamp_us
<<
";"
oss
<<
(
gps
.
timestamp_us
-
init_timestamp
)
/
1000
<<
";"
<<
gps
.
latitude_deg
<<
";"
<<
gps
.
longitude_deg
<<
";"
<<
gps
.
latitude_deg
<<
";"
<<
gps
.
longitude_deg
<<
";"
<<
gps
.
absolute_altitude_m
<<
";"
<<
position
.
relative_altitude_m
<<
";"
<<
gps
.
absolute_altitude_m
<<
";"
<<
position
.
relative_altitude_m
<<
";"
<<
telemetry
->
attitude_euler
().
yaw_deg
<<
";"
<<
telemetry
->
attitude_euler
().
yaw_deg
<<
";"
...
@@ -165,7 +165,10 @@ int mavsdk_start(const char * url, const char * log_file, int timeout) {
...
@@ -165,7 +165,10 @@ int mavsdk_start(const char * url, const char * log_file, int timeout) {
break
;
break
;
default:
default:
return
;
if
(
takingOff
)
{
takingOff
=
false
;
init_timestamp
=
telemetry
->
raw_gps
().
timestamp_us
;
}
}
}
});
});
...
...
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