mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-22 07:44:03 -04:00
AP_GPS: added comments in GPS_AUTO_test example sketch
Added comments in libraries/AP_GPS/examples/GPS_AUTO_text/GPS_AUTO_test.cpp file AP_GPS: added comments to GPS_AUTO_test example sketch Added comments in libraries/AP_GPS/examples/GPS_AUTO_text/GPS_AUTO_test.cpp file AP_GPS: added comments to GPS_AUTO_test example sketch AP_GPS: add comments to GPS_AUTO_text example sketch AP_GPS: added comments in GPS_AUTO_test example sketch
This commit is contained in:
parent
f1c072bcd2
commit
8fa6432e3a
@ -16,7 +16,7 @@
|
||||
Test for AP_GPS_AUTO
|
||||
*/
|
||||
|
||||
#include <AP_HAL/AP_HAL.h>
|
||||
#include <AP_HAL/AP_HAL.h> //This is a common Hardware Abstraction Layer.
|
||||
#include <AP_GPS/AP_GPS.h>
|
||||
#include <GCS_MAVLink/GCS_Dummy.h>
|
||||
#include <AP_Notify/AP_Notify.h>
|
||||
@ -24,10 +24,10 @@
|
||||
#include <AP_SerialManager/AP_SerialManager.h>
|
||||
#include <AP_BoardConfig/AP_BoardConfig.h>
|
||||
|
||||
void setup();
|
||||
void loop();
|
||||
void setup(); //This function is defined in most of the libraries. This function is called only once at boot up time. This function is called by main() function in HAL.
|
||||
void loop(); //This function is defined in most of the libraries. This function is called by main function in HAL. The main work of the sketch is typically in this function only.
|
||||
|
||||
const AP_HAL::HAL& hal = AP_HAL::get_HAL();
|
||||
const AP_HAL::HAL& hal = AP_HAL::get_HAL(); //Declare "hal" reference variable. This variable is pointing to Ap_HAL::HAL class's object. Here, AP_HAL is library and HAL is a class in that library. This reference variable can be used to get access to hardware specific functions.
|
||||
|
||||
static AP_BoardConfig board_config;
|
||||
|
||||
@ -35,7 +35,7 @@ static AP_BoardConfig board_config;
|
||||
AP_BoardLED board_led;
|
||||
|
||||
// create fake gcs object
|
||||
GCS_Dummy _gcs;
|
||||
GCS_Dummy _gcs; //gcs stands for Ground Control Station
|
||||
|
||||
const AP_Param::GroupInfo GCS_MAVLINK_Parameters::var_info[] = {
|
||||
AP_GROUPEND
|
||||
@ -69,7 +69,7 @@ void print_latlon(AP_HAL::BetterStream *s, int32_t lat_or_lon);
|
||||
void print_latlon(AP_HAL::BetterStream *s, int32_t lat_or_lon)
|
||||
{
|
||||
int32_t dec_portion, frac_portion;
|
||||
int32_t abs_lat_or_lon = labs(lat_or_lon);
|
||||
int32_t abs_lat_or_lon = labs(lat_or_lon); //The labs() function in C++ returns the absolute value of a long or long int data.
|
||||
|
||||
// extract decimal portion (special handling of negative numbers to ensure we round towards zero)
|
||||
dec_portion = abs_lat_or_lon / 10000000UL;
|
||||
@ -92,7 +92,7 @@ void loop()
|
||||
// Update GPS state based on possible bytes received from the module.
|
||||
gps.update();
|
||||
|
||||
// If new GPS data is received, output it's contents to the console
|
||||
// If new GPS data is received, output its contents to the console
|
||||
// Here we rely on the time of the message in GPS class and the time of last message
|
||||
// saved in static variable last_msg_ms. When new message is received, the time
|
||||
// in GPS class will be updated.
|
||||
|
Loading…
Reference in New Issue
Block a user