Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
Ardupilot
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenSource
Ardupilot
Commits
0bb7b8e9
Commit
0bb7b8e9
authored
11 years ago
by
Jonathan Challinger
Committed by
Andrew Tridgell
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
AP_GPS: Fix bug that causes permanent lag if we miss a message
parent
416e9457
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libraries/AP_GPS/AP_GPS_UBLOX.cpp
+3
-1
3 additions, 1 deletion
libraries/AP_GPS/AP_GPS_UBLOX.cpp
libraries/AP_GPS/AP_GPS_UBLOX.h
+3
-0
3 additions, 0 deletions
libraries/AP_GPS/AP_GPS_UBLOX.h
with
6 additions
and
1 deletion
libraries/AP_GPS/AP_GPS_UBLOX.cpp
+
3
−
1
View file @
0bb7b8e9
...
@@ -394,6 +394,7 @@ AP_GPS_UBLOX::_parse_gps(void)
...
@@ -394,6 +394,7 @@ AP_GPS_UBLOX::_parse_gps(void)
switch
(
_msg_id
)
{
switch
(
_msg_id
)
{
case
MSG_POSLLH
:
case
MSG_POSLLH
:
Debug
(
"MSG_POSLLH next_fix=%u"
,
next_fix
);
Debug
(
"MSG_POSLLH next_fix=%u"
,
next_fix
);
_last_pos_time
=
_buffer
.
posllh
.
time
;
state
.
location
.
lng
=
_buffer
.
posllh
.
longitude
;
state
.
location
.
lng
=
_buffer
.
posllh
.
longitude
;
state
.
location
.
lat
=
_buffer
.
posllh
.
latitude
;
state
.
location
.
lat
=
_buffer
.
posllh
.
latitude
;
state
.
location
.
alt
=
_buffer
.
posllh
.
altitude_msl
/
10
;
state
.
location
.
alt
=
_buffer
.
posllh
.
altitude_msl
/
10
;
...
@@ -469,6 +470,7 @@ AP_GPS_UBLOX::_parse_gps(void)
...
@@ -469,6 +470,7 @@ AP_GPS_UBLOX::_parse_gps(void)
break
;
break
;
case
MSG_VELNED
:
case
MSG_VELNED
:
Debug
(
"MSG_VELNED"
);
Debug
(
"MSG_VELNED"
);
_last_vel_time
=
_buffer
.
velned
.
time
;
state
.
ground_speed
=
_buffer
.
velned
.
speed_2d
*
0.01
f
;
// m/s
state
.
ground_speed
=
_buffer
.
velned
.
speed_2d
*
0.01
f
;
// m/s
state
.
ground_course_cd
=
_buffer
.
velned
.
heading_2d
/
1000
;
// Heading 2D deg * 100000 rescaled to deg * 100
state
.
ground_course_cd
=
_buffer
.
velned
.
heading_2d
/
1000
;
// Heading 2D deg * 100000 rescaled to deg * 100
state
.
have_vertical_velocity
=
true
;
state
.
have_vertical_velocity
=
true
;
...
@@ -488,7 +490,7 @@ AP_GPS_UBLOX::_parse_gps(void)
...
@@ -488,7 +490,7 @@ AP_GPS_UBLOX::_parse_gps(void)
// we only return true when we get new position and speed data
// we only return true when we get new position and speed data
// this ensures we don't use stale data
// this ensures we don't use stale data
if
(
_new_position
&&
_new_speed
)
{
if
(
_new_position
&&
_new_speed
&&
_last_vel_time
==
_last_pos_time
)
{
_new_speed
=
_new_position
=
false
;
_new_speed
=
_new_position
=
false
;
_fix_count
++
;
_fix_count
++
;
if
((
hal
.
scheduler
->
millis
()
-
_last_5hz_time
)
>
15000U
&&
!
need_rate_update
)
{
if
((
hal
.
scheduler
->
millis
()
-
_last_5hz_time
)
>
15000U
&&
!
need_rate_update
)
{
...
...
This diff is collapsed.
Click to expand it.
libraries/AP_GPS/AP_GPS_UBLOX.h
+
3
−
0
View file @
0bb7b8e9
...
@@ -247,6 +247,9 @@ private:
...
@@ -247,6 +247,9 @@ private:
uint8_t
_fix_count
;
uint8_t
_fix_count
;
uint8_t
_class
;
uint8_t
_class
;
uint32_t
_last_vel_time
;
uint32_t
_last_pos_time
;
// do we have new position information?
// do we have new position information?
bool
_new_position
:
1
;
bool
_new_position
:
1
;
// do we have new speed information?
// do we have new speed information?
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment