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
62fa10be
Commit
62fa10be
authored
Sep 06, 2023
by
Léo-Paul Géneau
👾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix projection
Do not do any projection before target coordinates have been set.
parent
d036ffe3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
+15
-9
mavsdk_wrapper.cpp
mavsdk_wrapper.cpp
+15
-9
No files found.
mavsdk_wrapper.cpp
View file @
62fa10be
...
...
@@ -56,6 +56,7 @@ static const float DEFAULT_SPEED = 16;
static
float
last_override_altitude
;
static
float
last_override_speed
;
static
bool
first_coordinate_entered
=
false
;
static
bool
do_projection
=
false
;
// Logs functions
...
...
@@ -164,6 +165,9 @@ static int doReposition(float la, float lo, float radius, float y) {
}
static
void
doReposition_async
(
float
la
,
float
lo
,
float
radius
,
float
y
)
{
if
(
!
first_coordinate_entered
)
{
first_coordinate_entered
=
true
;
}
std
::
thread
(
doReposition
,
la
,
lo
,
radius
,
y
).
detach
();
}
...
...
@@ -223,15 +227,17 @@ void updateLogAndProjection(void) {
<<
metrics
.
airspeed_m_s
<<
";"
<<
metrics
.
climb_rate_m_s
;
log
(
oss
.
str
());
if
(
do_projection
)
{
updateProjection
(
current_position
[
0
],
current_position
[
1
]);
}
else
{
doReposition_async
(
(
float
)
targeted_destination
.
latitude
,
(
float
)
targeted_destination
.
longitude
,
targeted_radius
,
0
);
if
(
first_coordinate_entered
)
{
if
(
do_projection
)
{
updateProjection
(
current_position
[
0
],
current_position
[
1
]);
}
else
{
doReposition_async
(
(
float
)
targeted_destination
.
latitude
,
(
float
)
targeted_destination
.
longitude
,
targeted_radius
,
0
);
}
}
}
}
...
...
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