Files
paparazzi/sw/airborne/modules/decawave/trilateration.h
T
Gautier Hattenberger 2aabe921b3 [module] add support for Decawave DW1000 modules (#2084)
Implement trilateration algorithm for positionning using the
UltraWideBand modules DW1000 from Decawave.
The interface with the modules is done with an arduino using the low
level library https://github.com/thotro/arduino-dw1000 with some
modifications.
The data extraction and trilateration are working, calibration and real
flight have not been done at the moment.
2017-06-28 18:08:42 +02:00

58 lines
1.7 KiB
C

/*
* Copyright (C) 2017 Gautier Hattenberger <gautier.hattenberger@enac.fr>
*
* This file is part of paparazzi
*
* paparazzi is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* paparazzi 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 paparazzi; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*/
/**
* @file "modules/decawave/trilateration.h"
* @author Gautier Hattenberger
* Trilateration algorithm
* https://en.wikipedia.org/wiki/Trilateration
*/
#ifndef TRILATERATION_H
#define TRILATERATION_H
#include "std.h"
#include "math/pprz_geodetic_float.h"
/** Anchor structure */
struct Anchor {
float distance; ///< last measured distance
float time; ///< time of the last received data
struct EnuCoor_f pos; ///< position of the anchor
uint16_t id; ///< anchor ID
};
/** Init internal trilateration structures
*
* @param[in] anchors array of anchors with their location
*/
extern int trilateration_init(struct Anchor *anchors);
/** Compute trilateration based on the latest measurments
*
* @param[in] anchors array of anchors with updated distance measurements
* @param[out] pos computed position
* @return error status (0 for valid position)
*/
extern int trilateration_compute(struct Anchor *anchors, struct EnuCoor_f *pos);
#endif