1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-12 19:10:27 +03:00

SITL - RealFlight

This commit is contained in:
Scavanger 2024-02-13 11:34:39 -03:00
parent 107f5706c6
commit 9848c6dddc
3 changed files with 17 additions and 8 deletions

1
.gitignore vendored
View file

@ -22,6 +22,7 @@ cov-int*
/downloads/
/debug/
/release/
/*_SITL/
# script-generated files
docs/Manual.pdf

View file

@ -3,8 +3,15 @@
Supported are RealFlight 9.5S and RealFlight Evolution, NOT RealFlight-X.
RealFlight is very well suited to simulate the model flight specific aspects. Autolaunch and the mixers can be used.
However, since the sceneries do not correspond to a real environment, the GPS data must be "faked". The position is always shown somewhere in southern Nevada ;).
GPS data and flight modes work fine though, only for missions with waypoints it is of course not ideal.
The RealFlight 3D sceneries are based on real topographic data of the Sierra Nevada in Southern Spain.
INAV uses as reference the scenery "RealFlight Ranch" which is located at the coordinates Lat: 37.118949°, Lon: -2.772960.
Use these scenery to use the mission planner and other GPS features.
> [!CAUTION]:
> The immediate surroundings of the airfield have been levelled in the scenery. If, for example, Autoland is to be tested here, do not use "Sea level ref" and the automatically determined heights of the Configurator.
> Either use relarive elevations or correct the elevation manually.
> The altitude of the airfield is exactly 1300 metres.
## Joystick
In the settings, calibrate the joystick, set it up and assign the axes in the same order as in INAV.

View file

@ -58,9 +58,10 @@
#define RF_PORT 18083
#define RF_MAX_CHANNEL_COUNT 12
// RealFlight scenerys doesn't represent real landscapes, so fake some nice coords: Area 51 ;)
#define FAKE_LAT 37.277127f
#define FAKE_LON -115.799669f
// "RealFlight Ranch" is located in Sierra Nevada, southern Spain
// This is not the Position of the Ranch, it's the Point of 0,0 in the Map (bottom left corner)
#define FAKE_LAT 36.910610
#define FAKE_LON -2.876605
static uint8_t pwmMapping[RF_MAX_PWM_OUTS];
static uint8_t mappingCount;
@ -399,9 +400,9 @@ static void exchangeData(void)
computeQuaternionFromRPY(&quat, roll_inav, pitch_inav, yaw_inav);
transformVectorEarthToBody(&north, &quat);
fakeMagSet(
constrainToInt16(north.x * 1024.0f),
constrainToInt16(north.y * 1024.0f),
constrainToInt16(north.z * 1024.0f)
constrainToInt16(north.x * 16000.0f),
constrainToInt16(north.y * 16000.0f),
constrainToInt16(north.z * 16000.0f)
);
free(rfValues.m_currentAircraftStatus);