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
d3b087d2
Commit
d3b087d2
authored
10 years ago
by
Andrew Tridgell
Browse files
Options
Downloads
Patches
Plain Diff
AP_GPS: fixed build on non-PX4 platforms
parent
e69582aa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
libraries/AP_GPS/AP_GPS.cpp
+7
-3
7 additions, 3 deletions
libraries/AP_GPS/AP_GPS.cpp
libraries/AP_GPS/AP_GPS_PX4.cpp
+5
-1
5 additions, 1 deletion
libraries/AP_GPS/AP_GPS_PX4.cpp
libraries/AP_GPS/AP_GPS_PX4.h
+3
-1
3 additions, 1 deletion
libraries/AP_GPS/AP_GPS_PX4.h
with
15 additions
and
5 deletions
libraries/AP_GPS/AP_GPS.cpp
+
7
−
3
View file @
d3b087d2
...
@@ -145,20 +145,23 @@ AP_GPS::detect_instance(uint8_t instance)
...
@@ -145,20 +145,23 @@ AP_GPS::detect_instance(uint8_t instance)
AP_GPS_Backend
*
new_gps
=
NULL
;
AP_GPS_Backend
*
new_gps
=
NULL
;
AP_HAL
::
UARTDriver
*
port
=
instance
==
0
?
hal
.
uartB
:
hal
.
uartE
;
AP_HAL
::
UARTDriver
*
port
=
instance
==
0
?
hal
.
uartB
:
hal
.
uartE
;
struct
detect_state
*
dstate
=
&
detect_state
[
instance
];
struct
detect_state
*
dstate
=
&
detect_state
[
instance
];
uint32_t
now
=
hal
.
scheduler
->
millis
();
#if CONFIG_HAL_BOARD == HAL_BOARD_PX4
if
(
_type
[
instance
]
==
GPS_TYPE_PX4
)
{
if
(
_type
[
instance
]
==
GPS_TYPE_PX4
)
{
// check for explicitely chosen PX4 GPS beforehand
// check for explicitely chosen PX4 GPS beforehand
// it is not possible to autodetect it, nor does it require a real UART
// it is not possible to autodetect it, nor does it require a real UART
hal
.
console
->
print_P
(
PSTR
(
" PX4 "
));
hal
.
console
->
print_P
(
PSTR
(
" PX4 "
));
new_gps
=
new
AP_GPS_PX4
(
*
this
,
state
[
instance
],
port
);
new_gps
=
new
AP_GPS_PX4
(
*
this
,
state
[
instance
],
port
);
goto
found_gps
;
}
}
else
if
(
port
==
NULL
)
{
#endif
if
(
port
==
NULL
)
{
// UART not available
// UART not available
return
;
return
;
}
}
uint32_t
now
=
hal
.
scheduler
->
millis
();
state
[
instance
].
instance
=
instance
;
state
[
instance
].
instance
=
instance
;
state
[
instance
].
status
=
NO_GPS
;
state
[
instance
].
status
=
NO_GPS
;
...
@@ -233,6 +236,7 @@ AP_GPS::detect_instance(uint8_t instance)
...
@@ -233,6 +236,7 @@ AP_GPS::detect_instance(uint8_t instance)
#endif
#endif
}
}
found_gps
:
if
(
new_gps
!=
NULL
)
{
if
(
new_gps
!=
NULL
)
{
state
[
instance
].
status
=
NO_FIX
;
state
[
instance
].
status
=
NO_FIX
;
drivers
[
instance
]
=
new_gps
;
drivers
[
instance
]
=
new_gps
;
...
...
This diff is collapsed.
Click to expand it.
libraries/AP_GPS/AP_GPS_PX4.cpp
+
5
−
1
View file @
d3b087d2
...
@@ -22,7 +22,10 @@
...
@@ -22,7 +22,10 @@
//
//
// Code by Holger Steinhaus
// Code by Holger Steinhaus
#include
<AP_HAL.h>
#if CONFIG_HAL_BOARD == HAL_BOARD_PX4
#include
"AP_GPS_PX4.h"
#include
"AP_GPS_PX4.h"
#include
<uORB/uORB.h>
#include
<uORB/uORB.h>
#include
<math.h>
#include
<math.h>
...
@@ -75,4 +78,5 @@ AP_GPS_PX4::read(void)
...
@@ -75,4 +78,5 @@ AP_GPS_PX4::read(void)
}
}
return
updated
;
return
updated
;
}
}
\ No newline at end of file
#endif
This diff is collapsed.
Click to expand it.
libraries/AP_GPS/AP_GPS_PX4.h
+
3
−
1
View file @
d3b087d2
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
#include
<AP_HAL.h>
#include
<AP_HAL.h>
#include
<AP_GPS.h>
#include
<AP_GPS.h>
#if CONFIG_HAL_BOARD == HAL_BOARD_PX4
#include
<modules/uORB/topics/vehicle_gps_position.h>
#include
<modules/uORB/topics/vehicle_gps_position.h>
class
AP_GPS_PX4
:
public
AP_GPS_Backend
{
class
AP_GPS_PX4
:
public
AP_GPS_Backend
{
...
@@ -35,5 +36,6 @@ private:
...
@@ -35,5 +36,6 @@ private:
int
_gps_sub
;
int
_gps_sub
;
struct
vehicle_gps_position_s
_gps_pos
;
struct
vehicle_gps_position_s
_gps_pos
;
};
};
#endif // CONFIG_HAL_BOARD
#endif // AP_GPS_PX4_H
#endif // AP_GPS_SIRF_h
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