AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
OdometerOutput.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16#pragma once
19
20#include <agx/Referenced.h>
21
22namespace agxSensor
23{
25
46 {
47 public:
48 enum Field : int32_t
49 {
53 NUM_FIELDS
54 };
55
56 using FieldVector = std::vector<Field>;
57
58 public:
63 static size_t sizeOf( Field field );
64
69 static const char* getFieldName( Field field );
70
71 public:
75 OdometerOutput() = default;
76
80 template<Field... field>
81 void build();
82
89
94 virtual size_t getElementSize() const override;
95
99 virtual const BinaryOutputBuffer& getData() override;
100
108 virtual bool hasUnreadData( bool markAsRead = true ) override;
109
113 bool contains(Field field) const;
114
121 size_t getOffset(Field field) const;
122
126 const FieldVector& getFields() const;
127
133
135
136 public:
137 virtual ~OdometerOutput() = default;
138
139 virtual void result( const CallbackData& data ) override;
140 virtual void cleanup() override;
141
143
145
146 private:
147 FieldVector m_fields{};
148 size_t m_elementSize{ 0u };
149 bool m_hasUnreadData{ false };
150 BinaryOutputBuffer m_output{};
151 };
152
153 template<OdometerOutput::Field... field>
155 {
156 m_fields.clear();
157 m_elementSize = 0u;
158 ( this->add( field ), ... );
159 }
160
162
163 class AGXSENSOR_EXPORT OdometerOutputDistance : public OdometerOutput
164 {
165 public:
166 OdometerOutputDistance();
167 };
168
170}
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
Definition: Serializable.h:207
#define AGXSENSOR_EXPORT
Buffer used for sensor output of a wide range of output element types.
Common interface for sensor output data.
Definition: SensorOutput.h:27
Odometer sensor output data where OdometerOutput::Field is used to define the data available.
static const char * getFieldName(Field field)
virtual const BinaryOutputBuffer & getData() override
virtual bool hasUnreadData(bool markAsRead=true) override
const FieldVector & getFields() const
void build()
Add one or more fields, build a matching data structure.
std::vector< Field > FieldVector
static size_t sizeOf(Field field)
bool contains(Field field) const
virtual size_t getElementSize() const override
"Element size" is the summed data size of the currently added fields.
size_t getOffset(Field field) const
Offset in bytes of the first entry of field in the pack of fields.
agx::Real computeCovariance() const
Compute the covariance of the odometer signal values at this output.
OdometerOutput()=default
Default constructor.
@ DISTANCE_F64
1x 64-bit floating point odometer output distance.
OdometerOutput & add(Field field)
Add new field.
System node is a separate step/operation in an execution tree representing a sensor (or such) in a se...
Definition: SystemNode.h:44
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: macros.h:89
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: macros.h:88
The agxSensor namespace contains components to model real-time sensors connected to the physics of AG...
double Real
Definition: Real.h:41