AP_Math: define postype_t and vectors

This commit is contained in:
Andrew Tridgell 2021-06-22 15:32:47 +10:00
parent 3fc88b19b8
commit 3a3a30ab22
1 changed files with 19 additions and 0 deletions

View File

@ -1,5 +1,24 @@
#pragma once
#include <AP_HAL/AP_HAL.h>
#include <AP_HAL/AP_HAL_Boards.h>
#ifndef HAL_WITH_POSTYPE_DOUBLE
#define HAL_WITH_POSTYPE_DOUBLE BOARD_FLASH_SIZE > 1024
#endif
#if HAL_WITH_POSTYPE_DOUBLE
typedef double postype_t;
typedef Vector2d Vector2p;
typedef Vector3d Vector3p;
#define topostype todouble
#else
typedef float postype_t;
typedef Vector2f Vector2p;
typedef Vector3f Vector3p;
#define topostype tofloat
#endif
/*
common controller helper functions
*/