VR-Engage  2.2
Loading...
Searching...
No Matches
rfxEntityLocationMessage.h
Go to the documentation of this file.
1// ******************************************************************************
2// ** Copyright (c) 2025 MAK Technologies
3// ** All rights reserved.
4// ******************************************************************************
5
6//! \file rfxEntityLocationMessage.h
7//! \brief Defines the request and response messages for entity location queries
8//! \ingroup vreRadarFxShared
9//!
10//! This file contains message classes for requesting the position, orientation,
11//! and velocity of specific entities in the simulation
12
13#pragma once
14
15#include "export.h"
16#include "rfxMessage.h"
17
18#include <vlutil/vlString.h>
19#include <matrix/vlVector.h>
20
21#include <vector>
22#include <string>
23
24
25namespace makRadarFx
26{
27
28//! \brief Request message for entity location information
29//!
30//! This message requests the current location, orientation, and velocity
31//! for a specific entity identified by its entity ID. The server will
32//! respond with the requested information or an error if the entity
33//! cannot be found.
35{
36public:
37 //! \brief Default constructor
38 //!
39 //! Initializes a new entity location request message with an empty entity ID
41
42 //! \brief Virtual destructor
44
45 //! \brief Sets the entity ID to query
46 //! \param name String identifier of the entity to look up
47 //!
48 //! Sets the identifier of the entity that this request is querying
49 //! the location, orientation, and velocity of.
50 virtual void setEntityId(const std::string& name);
51
52 //! \brief Gets the entity ID being queried
53 //! \return String identifier of the entity
54 //!
55 //! Returns the identifier of the entity that this request is querying.
56 virtual std::string entityId();
57
58 //! \brief size of the message
59 virtual int messageSize();
60 //! \brief decode a message. Used by the factory
61 static DtBaseMessage* decode(unsigned char* buffer, int length);
62 //! \brief clone a message. Caller of function is responsible managing this memory
63 virtual DtBaseMessage* clone();
64
65protected:
66 //! \brief Serializes the message data to a stream writer
67 //! \param writer Reference to the stream writer to write the data to
68 virtual void serialize(DtStreamWriter& writer);
69
70 //! \brief Deserializes message data from a stream reader
71 //! \param reader Reference to the stream reader to read the data from
72 virtual void deserialize(DtStreamReader& reader);
73
74 //! \brief Entity identifier to query
75 std::string myEntityId;
76};
77
78
79//! \brief Response message containing entity location information
80//!
81//! This message contains the response to an entity location request, providing
82//! the current position, orientation, and velocity of the requested entity.
83//! If the entity cannot be found, an error code will be set.
85{
86public:
87 //! \brief Error codes for entity location responses
89 {
90 ENTITY_LOC_NO_ERROR, //!< No error, location information is valid
91 ENTITY_LOC_NO_ENTITY, //!< Entity not found in the simulation
92 ENTITY_LOC_ERROR_OTHER //!< Other unspecified error
93 };
94
95 //! \brief Default constructor
96 //!
97 //! Initializes a new entity location response message with default values
99
100 //! \brief Virtual destructor
102
103 //! \brief Sets the entity's position
104 //! \param location Vector containing the entity's position (latitude, longitude, altitude)
105 //!
106 //! Sets the location of the entity at the time the request was fulfilled.
107 //! Position is in geodetic coordinates (latitude, longitude, altitude).
108 virtual void setEntityLocation(DtVector location);
109
110 //! \brief Gets the entity's position
111 //! \return Vector containing the entity's position (latitude, longitude, altitude)
112 //!
113 //! Returns the location of the entity at the time the request was fulfilled.
114 virtual DtVector entityLocation();
115
116 //! \brief Sets the entity's orientation
117 //! \param topoOrientation Tait-Bryan angles representing the entity's orientation
118 //!
119 //! Sets the topographic orientation of the entity at the time the request was fulfilled.
120 //! Orientation is expressed as Tait-Bryan angles (heading, pitch, roll).
121 virtual void setEntityTopoOrientation(DtTaitBryan topoOrientation);
122
123 //! \brief Gets the entity's orientation
124 //! \return Tait-Bryan angles representing the entity's orientation
125 //!
126 //! Returns the topographic orientation of the entity at the time the request was fulfilled.
127 virtual DtTaitBryan entityOrientation();
128
129 //! \brief Sets the entity's velocity
130 //! \param velocity Vector containing the entity's velocity components in m/s
131 //!
132 //! Sets the velocity vector of the entity at the time the request was fulfilled.
133 //! Velocity is in meters per second along each axis.
134 virtual void setEntityVelocity(DtVector32 velocity);
135
136 //! \brief Gets the entity's velocity
137 //! \return Vector containing the entity's velocity components in m/s
138 //!
139 //! Returns the velocity vector of the entity at the time the request was fulfilled.
140 virtual DtVector32 entityVelocity();
141
142 //! \brief Sets the error code
143 //! \param error The error code to set
144 //!
145 //! Sets the error status for this entity location response. Use
146 //! ENTITY_LOC_NO_ERROR if the location information is valid.
148
149 //! \brief Gets the error code
150 //! \return The current error code
151 //!
152 //! Returns the error status for this entity location response.
154
155 //! \brief size of the message
156 virtual int messageSize();
157 //! \brief decode a message. Used by the factory
158 static DtBaseMessage* decode(unsigned char* buffer, int length);
159 //! \brief clone a message. Caller of function is responsible managing this memory
161
162protected:
163 //! \brief Serializes the message data to a stream writer
164 //! \param writer Reference to the stream writer to write the data to
165 virtual void serialize(DtStreamWriter& writer);
166
167 //! \brief Deserializes message data from a stream reader
168 //! \param reader Reference to the stream reader to read the data from
169 virtual void deserialize(DtStreamReader& reader);
170
171 //! \brief Entity's position in geodetic coordinates
173
174 //! \brief Entity's orientation as Tait-Bryan angles
176
177 //! \brief Entity's velocity vector in m/s
179
180 //! \brief Error code for this response
182};
183} // namespace makRadarFx
DtBaseMessage()
Default constructor.
virtual std::string entityId()
Gets the entity ID being queried.
virtual ~DtEntityLocationRequest()
Virtual destructor.
virtual void deserialize(DtStreamReader &reader)
Deserializes message data from a stream reader.
std::string myEntityId
Entity identifier to query.
Definition rfxEntityLocationMessage.h:75
DtEntityLocationRequest()
Default constructor.
static DtBaseMessage * decode(unsigned char *buffer, int length)
decode a message. Used by the factory
virtual void setEntityId(const std::string &name)
Sets the entity ID to query.
virtual void serialize(DtStreamWriter &writer)
Serializes the message data to a stream writer.
virtual DtBaseMessage * clone()
clone a message. Caller of function is responsible managing this memory
virtual int messageSize()
size of the message
DtVector32 myEntityVelocity
Entity's velocity vector in m/s.
Definition rfxEntityLocationMessage.h:178
virtual void setEntityTopoOrientation(DtTaitBryan topoOrientation)
Sets the entity's orientation.
DtEntityLocationError myError
Error code for this response.
Definition rfxEntityLocationMessage.h:181
virtual DtEntityLocationError error()
Gets the error code.
virtual void setError(DtEntityLocationError error)
Sets the error code.
virtual DtBaseMessage * clone()
clone a message. Caller of function is responsible managing this memory
DtTaitBryan myEntityTopoOrientation
Entity's orientation as Tait-Bryan angles.
Definition rfxEntityLocationMessage.h:175
static DtBaseMessage * decode(unsigned char *buffer, int length)
decode a message. Used by the factory
virtual int messageSize()
size of the message
virtual void setEntityVelocity(DtVector32 velocity)
Sets the entity's velocity.
virtual DtTaitBryan entityOrientation()
Gets the entity's orientation.
virtual void deserialize(DtStreamReader &reader)
Deserializes message data from a stream reader.
virtual void serialize(DtStreamWriter &writer)
Serializes the message data to a stream writer.
DtVector myEntityLocation
Entity's position in geodetic coordinates.
Definition rfxEntityLocationMessage.h:172
virtual DtVector32 entityVelocity()
Gets the entity's velocity.
DtEntityLocationResponse()
Default constructor.
DtEntityLocationError
Error codes for entity location responses.
Definition rfxEntityLocationMessage.h:89
@ ENTITY_LOC_NO_ERROR
No error, location information is valid.
Definition rfxEntityLocationMessage.h:90
@ ENTITY_LOC_ERROR_OTHER
Other unspecified error.
Definition rfxEntityLocationMessage.h:92
@ ENTITY_LOC_NO_ENTITY
Entity not found in the simulation.
Definition rfxEntityLocationMessage.h:91
virtual void setEntityLocation(DtVector location)
Sets the entity's position.
virtual DtVector entityLocation()
Gets the entity's position.
virtual ~DtEntityLocationResponse()
Virtual destructor.
Stream reader for decoding values from a byte array in little endian format.
Definition byteStream.h:32
Stream writer for encoding values into a byte array in little endian format.
Definition byteStream.h:159
Defines export macros for the RadarFx Shared library.
#define RFX_DLL_SHARED
Export/import macro for non-Windows platforms (empty)
Definition export.h:25
Definition radarFxConnectorDriver.h:21
Defines the base message class for RadarFX client-server communication.