API Documentation
Loading...
Searching...
No Matches
PositionSensor.h
Go to the documentation of this file.
1/**--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Hardware
28File: PositionSensor
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include <NDEVR/Device.h>
34#include <NDEVR/StationModel.h>
35#include <NDEVR/Deployment.h>
36#include <NDEVR/GPSPoint.h>
37#include <NDEVR/Matrix.h>
38#include <NDEVR/UUID.h>
39#include <QObject>
40namespace NDEVR
41{
42 class Deployment;
43 class StationModel;
44 class Effect;
45 class OrientationSensor;
46 class DistanceEncoder;
47
48
50 {
51 Q_OBJECT
52 public:
53 PositionSensor(const Model& name, ProgressInfo* log, QObject* parent = nullptr);
54 [[nodiscard]] virtual Vertex<3, fltp08> lastPosition() const;
55 void setPosition(const Vertex<3, fltp08>& location);
56 //Sensor Location
57 [[nodiscard]] virtual Vertex<3, fltp08> sensorLocation() const { return m_sensor_location; }
58 void setSensorLocation(const Vertex<3, fltp08>& location);
59 void update();
60 //GPS Options
61 [[nodiscard]] virtual GNSSQuality gpsQuality() const { return GNSSQuality::e_invalid; };
62 virtual bool requestUsingGPS(bool using_gps);
63 virtual bool stationUsedForOffset() const { return true; }
64 [[nodiscard]] virtual bool usingGPS() const { return m_using_gps; }
65 //Station Options
66
67 virtual bool requestDistanceEncoder(DistanceEncoder*) { return false; }
68 //Deployment Options
69 virtual void addDeploymentSegment(fltp08 distance) { UNUSED(distance); }
71 virtual void setVelocity(const Vector<3, fltp08>& velocity);
72 virtual void setAcceleration(const Vector<3, fltp08>& acceleration);
73#if NDEVR_STATION_MODEL
74 virtual bool requestStation(const StationModel& model);
75 [[nodiscard]] virtual const StationModel& station() const { return m_station_model; }
76 [[nodiscard]] virtual StationModel& station() { return m_station_model; }
77#endif
78#if NDEVR_DEPLOYMENT
79 virtual bool requestDeployment(const Deployment& deployment);
80 [[nodiscard]] virtual const Deployment& deployment() const { return m_deployment; }
81 [[nodiscard]] virtual Deployment& deployment() { return m_deployment; }
82#endif
83 [[nodiscard]] virtual DistanceEncoder* distanceEncoder() const { return nullptr; }
84 [[nodiscard]] virtual Vector<3, fltp08> stdDev() const { return Constant<Vector<3, fltp08>>::NaN; };
85 [[nodiscard]] virtual OrientationSensor* orientationSensor() const { return nullptr; }
86 signals:
89 void deploymentChangedSignal(UUID deployment);
91 protected:
92#if NDEVR_STATION_MODEL
93 StationModel m_station_model;
94#endif
95#if NDEVR_DEPLOYMENT
96 Deployment m_deployment;
97#endif
104 };
106}
#define UNUSED(expr)
Definition BaseValues.hpp:433
#define HARDWARE_API
Definition DLLInfo.h:74
Definition Device.h:48
Definition DistanceEncoder.h:20
Definition Model.h:54
Used to report the orientation of a Hardware object within 3D space.
Definition OrientationSensor.h:88
Definition PositionSensor.h:50
virtual bool usingGPS() const
Definition PositionSensor.h:64
void deploymentSegmentAddedSignal()
virtual bool stationUsedForOffset() const
Definition PositionSensor.h:63
Time m_last_position_time
Definition PositionSensor.h:99
virtual bool requestDistanceEncoder(DistanceEncoder *)
Definition PositionSensor.h:67
Vertex< 3, fltp08 > m_position
Definition PositionSensor.h:100
Vector< 3, fltp08 > m_acceleration
Definition PositionSensor.h:103
void deploymentSegmentRemovedSignal()
void stationChangedSignal(UUID station)
void deploymentChangedSignal(UUID deployment)
Vector< 3, fltp08 > m_velocity
Definition PositionSensor.h:102
virtual void removeDeploymentSegment(uint04 index=Constant< uint04 >::NaN)
Definition PositionSensor.h:70
virtual GNSSQuality gpsQuality() const
Definition PositionSensor.h:61
virtual OrientationSensor * orientationSensor() const
Definition PositionSensor.h:85
virtual void addDeploymentSegment(fltp08 distance)
Definition PositionSensor.h:69
bool m_using_gps
Definition PositionSensor.h:98
virtual DistanceEncoder * distanceEncoder() const
Definition PositionSensor.h:83
virtual Vector< 3, fltp08 > stdDev() const
Definition PositionSensor.h:84
virtual Vertex< 3, fltp08 > sensorLocation() const
Definition PositionSensor.h:57
Vertex< 3, fltp08 > m_sensor_location
Definition PositionSensor.h:101
Definition ProgressInfo.hpp:43
Definition StringStream.h:62
Represents a timestamp with utilities for manipulation and conversion.
Definition Time.h:54
Definition UUID.h:66
An element of a vector space. An element of the real coordinate space Rn Basis vector,...
Definition Vector.hpp:62
A vertex.
Definition Vertex.hpp:54
Definition ACIColor.h:37
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:120
constexpr t_type distance(const t_vertex &vertex, const LineSegment< t_dims, t_type, t_vertex > &line)
Definition Distance.hpp:250
GNSSQuality
Definition GPSPoint.h:7
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:181
Definition BaseValues.hpp:272