UWBMarker.h 2.43 KB
Newer Older
1
//    Copyright (C) 2018, ETH Zurich, D-ITET
flashingx's avatar
flashingx committed
2
3
4
5
6
7
//			Yvan Bosshard			byvan		@ee.ethz.ch
//			Michael Rogenmoser		michaero	@ee.ethz.ch
//			Tiago Salzmann			tiagos		@ee.ethz.ch
//	  
//	  Adapted from centerMarker of Angel Romero.
//
8
9
10
//    This file is part of D-FaLL-System.
//    
//    D-FaLL-System is free software: you can redistribute it and/or modify
flashingx's avatar
flashingx committed
11
12
13
//    it 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.
14
15
//    
//    D-FaLL-System is distributed in the hope that it will be useful,
flashingx's avatar
flashingx committed
16
17
18
//    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.
19
//    
flashingx's avatar
flashingx committed
20
//    You should have received a copy of the GNU General Public License
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//    along with D-FaLL-System.  If not, see <http://www.gnu.org/licenses/>.
//    
//
//    ----------------------------------------------------------------------------------
//    DDDD        FFFFF        L     L           SSSS  Y   Y   SSSS  TTTTT  EEEEE  M   M
//    D   D       F      aaa   L     L          S       Y Y   S        T    E      MM MM
//    D   D  ---  FFFF  a   a  L     L     ---   SSS     Y     SSS     T    EEE    M M M
//    D   D       F     a  aa  L     L              S    Y        S    T    E      M   M
//    DDDD        F      aa a  LLLL  LLLL       SSSS     Y    SSSS     T    EEEEE  M   M
//
//
//    DESCRIPTION:
//    Marker for the Crazyflie flying with UWB
//
//    ----------------------------------------------------------------------------------

flashingx's avatar
flashingx committed
37

tiagos's avatar
tiagos committed
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef UWBMARKER_H
#define UWBMARKER_H

#include <QGraphicsSvgItem>
#include <QSvgRenderer>

#include "globalDefinitions.h"

#include "d_fall_pps/UWBAnchor.h"

#define ANCHOR_HEIGHT	200 * FROM_MILIMETERS_TO_UNITS * 1.2
#define	ANCHOR_WIDTH	200 * FROM_MILIMETERS_TO_UNITS * 1.2
#define ANCHOR_OPACITY	0.7

flashingx's avatar
flashingx committed
52
53
using namespace d_fall_pps;

tiagos's avatar
tiagos committed
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
class UWBMarker : public QGraphicsSvgItem
{
public:
	explicit UWBMarker(const UWBAnchor* const anchor, QString filename, QGraphicsItem* parent = 0);
	~UWBMarker();

	void updateMarker(const UWBAnchor* const anchor);

	QRectF boundingRect() const;
	void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget);

private:
	// info for plotting anchor
    qreal m_width;
    qreal m_height;

    qreal m_x;
    qreal m_y;
    qreal m_z;
	
};

#endif