Skip to content

Commit

Permalink
adds overloads to aggregator::determineTimestamp
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
niniemann committed Sep 10, 2019
1 parent 6e18b71 commit 878dfe1
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions objectDetectionTypes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <base/Time.hpp>
// TODO 1 #include <mars/interfaces/snmesh.h>


namespace mars
{

Expand Down Expand Up @@ -68,4 +69,30 @@ namespace mars
};

}

// need to tell the stream_aligner/transformer that the timestamp of these types
// is hidden in "header.stamp", instead of the default "time" member variable
namespace aggregator {
inline base::Time determineTimestamp(const mars::Detection3DArray& sample)
{
return sample.header.stamp;
}

inline base::Time determineTimestamp(const mars::Detection3D& sample)
{
return sample.header.stamp;
}

inline base::Time determineTimestamp(const mars::PointCloud& sample)
{
return sample.header.stamp;
}

inline base::Time determineTimestamp(const mars::Header& sample)
{
return sample.stamp;
}
}


#endif

0 comments on commit 878dfe1

Please sign in to comment.