Skip to content

Commit 878dfe1

Browse files
committed
adds overloads to aggregator::determineTimestamp
For the stream aligner and transformer to work, access to a timestamp in the message is needed. By default a member variable called "time" is assumed to exist, which is not the case in the objectDetectionMessages. Therefore, overloads to determineTimestamp are provided which correctly access the timestamp in the header of the messages.
1 parent 6e18b71 commit 878dfe1

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

objectDetectionTypes.hpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <base/Time.hpp>
88
// TODO 1 #include <mars/interfaces/snmesh.h>
99

10+
1011
namespace mars
1112
{
1213

@@ -68,4 +69,30 @@ namespace mars
6869
};
6970

7071
}
72+
73+
// need to tell the stream_aligner/transformer that the timestamp of these types
74+
// is hidden in "header.stamp", instead of the default "time" member variable
75+
namespace aggregator {
76+
inline base::Time determineTimestamp(const mars::Detection3DArray& sample)
77+
{
78+
return sample.header.stamp;
79+
}
80+
81+
inline base::Time determineTimestamp(const mars::Detection3D& sample)
82+
{
83+
return sample.header.stamp;
84+
}
85+
86+
inline base::Time determineTimestamp(const mars::PointCloud& sample)
87+
{
88+
return sample.header.stamp;
89+
}
90+
91+
inline base::Time determineTimestamp(const mars::Header& sample)
92+
{
93+
return sample.stamp;
94+
}
95+
}
96+
97+
7198
#endif

0 commit comments

Comments
 (0)