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 /**--------------------------------------------------------------------------------------------------
49 \brief A position sensor is a Device that determines the position of Hardware. This device might be
50 a GPS or SLAM style logic device.
51 **/
53 {
54 Q_OBJECT
55 public:
56 PositionSensor(const Model& name, ProgressInfo* log, QObject* parent = nullptr);
57 [[nodiscard]] virtual Vertex<3, fltp08> lastPosition() const;
58 void setPosition(const Vertex<3, fltp08>& location);
59 //Sensor Location
60 [[nodiscard]] virtual Vertex<3, fltp08> sensorLocation() const { return m_sensor_location; }
61 void setSensorLocation(const Vertex<3, fltp08>& location);
62 void update();
63 //GPS Options
64 [[nodiscard]] virtual GNSSQuality gpsQuality() const { return GNSSQuality::e_invalid; };
65 virtual bool requestUsingGPS(bool using_gps);
66 virtual bool stationUsedForOffset() const { return true; }
67 [[nodiscard]] virtual bool usingGPS() const { return m_using_gps; }
68 //Station Options
69
70 virtual bool requestDistanceEncoder(DistanceEncoder*) { return false; }
71 //Deployment Options
72 virtual void addDeploymentSegment(fltp08 distance) { UNUSED(distance); }
74 virtual void setVelocity(const Vector<3, fltp08>& velocity);
75 virtual void setAcceleration(const Vector<3, fltp08>& acceleration);
76#if NDEVR_STATION_MODEL
77 virtual bool requestStation(const StationModel& model);
78 [[nodiscard]] virtual const StationModel& station() const { return m_station_model; }
79 [[nodiscard]] virtual StationModel& station() { return m_station_model; }
80#endif
81#if NDEVR_DEPLOYMENT
82 virtual bool requestDeployment(const Deployment& deployment);
83 [[nodiscard]] virtual const Deployment& deployment() const { return m_deployment; }
84 [[nodiscard]] virtual Deployment& deployment() { return m_deployment; }
85#endif
86 [[nodiscard]] virtual DistanceEncoder* distanceEncoder() const { return nullptr; }
87 [[nodiscard]] virtual Vector<3, fltp08> stdDev() const { return Constant<Vector<3, fltp08>>::Invalid; };
88 [[nodiscard]] virtual OrientationSensor* orientationSensor() const { return nullptr; }
89 signals:
92 void deploymentChangedSignal(UUID deployment);
94 protected:
95#if NDEVR_STATION_MODEL
96 StationModel m_station_model;
97#endif
98#if NDEVR_DEPLOYMENT
99 Deployment m_deployment;
100#endif
107 };
109}
#define UNUSED(expr)
Definition BaseValues.hpp:409
#define HARDWARE_API
Definition DLLInfo.h:56
A root class which describes some physical object, such as a Motor, Sensor, or Connection....
Definition Device.h:52
A distance encoder is a device that measures distance by generating pulses in response to an object's...
Definition DistanceEncoder.h:36
A core class that represents a node on model heirarchy. This node may contain a Geometry or one or mo...
Definition Model.h:58
Used to report the orientation of a Hardware object within 3D space.
Definition OrientationSensor.h:86
A position sensor is a Device that determines the position of Hardware. This device might be a GPS or...
Definition PositionSensor.h:53
virtual bool usingGPS() const
Definition PositionSensor.h:67
void setSensorLocation(const Vertex< 3, fltp08 > &location)
void deploymentSegmentAddedSignal()
virtual void removeDeploymentSegment(uint04 index=Constant< uint04 >::Invalid)
Definition PositionSensor.h:73
virtual bool stationUsedForOffset() const
Definition PositionSensor.h:66
virtual bool requestUsingGPS(bool using_gps)
Time m_last_position_time
Definition PositionSensor.h:102
virtual bool requestDistanceEncoder(DistanceEncoder *)
Definition PositionSensor.h:70
Vertex< 3, fltp08 > m_position
Definition PositionSensor.h:103
PositionSensor(const Model &name, ProgressInfo *log, QObject *parent=nullptr)
void setPosition(const Vertex< 3, fltp08 > &location)
virtual void setAcceleration(const Vector< 3, fltp08 > &acceleration)
Vector< 3, fltp08 > m_acceleration
Definition PositionSensor.h:106
void deploymentSegmentRemovedSignal()
virtual Vertex< 3, fltp08 > lastPosition() const
void stationChangedSignal(UUID station)
void deploymentChangedSignal(UUID deployment)
Vector< 3, fltp08 > m_velocity
Definition PositionSensor.h:105
virtual GNSSQuality gpsQuality() const
Definition PositionSensor.h:64
virtual OrientationSensor * orientationSensor() const
Definition PositionSensor.h:88
virtual void setVelocity(const Vector< 3, fltp08 > &velocity)
virtual void addDeploymentSegment(fltp08 distance)
Definition PositionSensor.h:72
bool m_using_gps
Definition PositionSensor.h:101
virtual DistanceEncoder * distanceEncoder() const
Definition PositionSensor.h:86
virtual Vector< 3, fltp08 > stdDev() const
Definition PositionSensor.h:87
virtual Vertex< 3, fltp08 > sensorLocation() const
Definition PositionSensor.h:60
Vertex< 3, fltp08 > m_sensor_location
Definition PositionSensor.h:104
A light-weight base class for Log that allows processes to update, without the need for additional in...
Definition ProgressInfo.hpp:48
Logic for reading or writing to a string or a user friendly, TranslatedString.
Definition StringStream.h:230
Represents a timestamp with utilities for manipulation and conversion.
Definition Time.h:54
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:60
A fixed-size array with better performance compared to dynamic containers.
Definition Vector.hpp:60
A vertex or point. A specific type of Vector used primarily for spacial location information.
Definition Vertex.hpp:48
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:96
constexpr t_type distance(const t_vertex &vertex, const LineSegment< t_dims, t_type, t_vertex > &line)
Definition Distance.hpp:171
GNSSQuality
A list of standard GNSS qualities for GNSS measured data.
Definition GPSPoint.h:10
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:149
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
Definition BaseValues.hpp:233