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
1eb708b0
Commit
1eb708b0
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
9947e081
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
9 deletions
+20
-9
mavsdk_wrapper.cpp
mavsdk_wrapper.cpp
+20
-9
No files found.
mavsdk_wrapper.cpp
View file @
1eb708b0
...
@@ -55,6 +55,7 @@ static const float DEFAULT_SPEED = 16;
...
@@ -55,6 +55,7 @@ static const float DEFAULT_SPEED = 16;
static
float
last_override_altitude
;
static
float
last_override_altitude
;
static
float
last_override_speed
;
static
float
last_override_speed
;
static
bool
first_coordinate_entered
=
false
;
static
bool
do_projection
=
false
;
static
bool
do_projection
=
false
;
// Logs functions
// Logs functions
...
@@ -228,15 +229,17 @@ void updateLogAndProjection(void) {
...
@@ -228,15 +229,17 @@ void updateLogAndProjection(void) {
<<
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
(
do_projection
)
{
if
(
first_coordinate_entered
)
{
updateProjection
(
current_position
[
0
],
current_position
[
1
]);
if
(
do_projection
)
{
}
else
{
updateProjection
(
current_position
[
0
],
current_position
[
1
]);
doReposition_async
(
}
else
{
(
float
)
targeted_destination
.
latitude
,
doReposition_async
(
(
float
)
targeted_destination
.
longitude
,
(
float
)
targeted_destination
.
latitude
,
targeted_radius
,
(
float
)
targeted_destination
.
longitude
,
0
targeted_radius
,
);
0
);
}
}
}
}
}
}
}
...
@@ -384,6 +387,10 @@ int triggerParachute(void) {
...
@@ -384,6 +387,10 @@ int triggerParachute(void) {
// Flight management functions
// Flight management functions
void
loiter
(
double
la
,
double
lo
,
float
a
,
float
radius
)
{
void
loiter
(
double
la
,
double
lo
,
float
a
,
float
radius
)
{
if
(
!
first_coordinate_entered
)
{
first_coordinate_entered
=
true
;
}
targeted_destination
.
latitude
=
la
;
targeted_destination
.
latitude
=
la
;
targeted_destination
.
longitude
=
lo
;
targeted_destination
.
longitude
=
lo
;
targeted_radius
=
radius
;
targeted_radius
=
radius
;
...
@@ -409,6 +416,10 @@ void setTargetCoordinates(double la, double lo, float a) {
...
@@ -409,6 +416,10 @@ void setTargetCoordinates(double la, double lo, float a) {
return
;
return
;
}
}
if
(
!
first_coordinate_entered
)
{
first_coordinate_entered
=
true
;
}
targeted_destination
.
latitude
=
la
;
targeted_destination
.
latitude
=
la
;
targeted_destination
.
longitude
=
lo
;
targeted_destination
.
longitude
=
lo
;
do_projection
=
true
;
do_projection
=
true
;
...
...
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