1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-13 03:20:00 +03:00
betaflight/src/main/io/gps_virtual.h
Vladimir Demidov bdd2a2863d
The imitation of GPS is added for SITL (#14131)
* virtual gps module is added

* USE_VIRTUAL_GPS definition is added to sitl/target.h

* Virtual GPS using are added into sitl and gps modules

* Added settings values for lat, lon, alt, speed, speed3D, course in SITL

* setVirtualGPS function parameters are changed to double

* Code style improvement

Co-authored-by: Petr Ledvina <ledvinap@gmail.com>

* code style improvement: undue space symbol deleted

Co-authored-by: Petr Ledvina <ledvinap@gmail.com>

* Code style improvement

Co-authored-by: Petr Ledvina <ledvinap@gmail.com>

* Code style improvement

* The getVirtualGPS() function declarations is edited

* getVirtualGPS() functions declaration improvement

* Code style improvement

Co-authored-by: Petr Ledvina <ledvinap@gmail.com>

* define USE_VIRTUAL_GPS is removed from sitl/target.h

* Revert "define USE_VIRTUAL_GPS is removed from sitl/target.h"

This reverts commit 2e610339c4.

* virtual gps for SITL is made as special GPS_VIRTUAL provider

* Code style improvement. The LF code symbol is added

Co-authored-by: Mark Haslinghuis <mark@numloq.nl>

* the license is changed

* The license is edited in gps_virtual.c

Co-authored-by: Mark Haslinghuis <mark@numloq.nl>

* The license is edited in gps_virtual.h

Co-authored-by: Mark Haslinghuis <mark@numloq.nl>

* Code style improvement

* Virtual gps provider work improvement

* Code style improvement

Co-authored-by: Petr Ledvina <ledvinap@gmail.com>

* Code style improvement

Co-authored-by: Petr Ledvina <ledvinap@gmail.com>

* Code refactoring in io/gps.c

* SITL define issue is resolved

Co-authored-by: Mark Haslinghuis <mark@numloq.nl>

* Extra line is removed

Co-authored-by: Mark Haslinghuis <mark@numloq.nl>

* The VIRTUAL option is added into cli looktable

* switch case tab alignment refactoring in io\gps.c

* wrong indent resolved

* bugfix NMEA and UBLOX GPS mode for SITL (SIMULATOR_BUILD) builds target

---------

Co-authored-by: Petr Ledvina <ledvinap@gmail.com>
Co-authored-by: Mark Haslinghuis <mark@numloq.nl>
2025-01-14 22:42:58 +01:00

26 lines
931 B
C

/*
* This file is part of Betaflight.
*
* Betaflight is free software. You can redistribute this software
* and/or modify this software under the terms of the GNU General
* Public License as published by the Free Software Foundation,
* either version 3 of the License, or (at your option) any later
* version.
*
* Betaflight is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this software.
*
* If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "io/gps.h"
void setVirtualGPS(double latitude, double longitude, double altiutude, double velocity, double velocity3D, double course);
void getVirtualGPS(gpsSolutionData_t *gpsSolData);