Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
16630dda
Unverified
Commit
16630dda
authored
Jan 23, 2020
by
Gus Grubba
Committed by
GitHub
Jan 23, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8254 from mavlink/pr-odometer
Update flight distance
parents
c4b864aa
bd93a3d7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
1 deletion
+11
-1
TrajectoryPoints.cc
src/Vehicle/TrajectoryPoints.cc
+4
-1
Vehicle.cc
src/Vehicle/Vehicle.cc
+5
-0
Vehicle.h
src/Vehicle/Vehicle.h
+2
-0
No files found.
src/Vehicle/TrajectoryPoints.cc
View file @
16630dda
...
...
@@ -23,7 +23,10 @@ void TrajectoryPoints::_vehicleCoordinateChanged(QGeoCoordinate coordinate)
// Fewer points means higher performance of map display.
if
(
_lastPoint
.
isValid
())
{
if
(
_lastPoint
.
distanceTo
(
coordinate
)
>
_distanceTolerance
)
{
double
distance
=
_lastPoint
.
distanceTo
(
coordinate
);
if
(
distance
>
_distanceTolerance
)
{
//-- Update flight distance
_vehicle
->
updateFlightDistance
(
distance
);
// Vehicle has moved far enough from previous point for an update
double
newAzimuth
=
_lastPoint
.
azimuthTo
(
coordinate
);
if
(
qIsNaN
(
_lastAzimuth
)
||
qAbs
(
newAzimuth
-
_lastAzimuth
)
>
_azimuthTolerance
)
{
...
...
src/Vehicle/Vehicle.cc
View file @
16630dda
...
...
@@ -4244,6 +4244,11 @@ void Vehicle::_handleObstacleDistance(const mavlink_message_t& message)
_objectAvoidance
->
update
(
&
o
);
}
void
Vehicle
::
updateFlightDistance
(
double
distance
)
{
_flightDistanceFact
.
setRawValue
(
_flightDistanceFact
.
rawValue
().
toDouble
()
+
distance
);
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
...
...
src/Vehicle/Vehicle.h
View file @
16630dda
...
...
@@ -805,6 +805,8 @@ public:
JoystickModeMax
}
JoystickMode_t
;
void
updateFlightDistance
(
double
distance
);
int
joystickMode
(
void
);
void
setJoystickMode
(
int
mode
);
...
...
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