1 #ifndef ROS_MESSAGEPARSER_H 2 #define ROS_MESSAGEPARSER_H 9 #include <std_msgs/Header.h> 26 template <
typename MainType,
typename SubType,
class ChildParser>
31 _child_prefix(child_prefix)
33 _data.emplace_back(
"/header/seq" );
34 _data.emplace_back(
"/header/stamp" );
40 static std::unordered_set<std::string> compatible_key =
42 return compatible_key;
47 double timestamp)
override 53 size_t header_size =
sizeof(
ros::Time ) + 8 + header.frame_id.size();
55 _data[0].pushBack( {timestamp, header.seq} );
56 _data[1].pushBack( {timestamp, header.stamp.toSec()} );
60 _child_parser.pushMessageRef( key, sub_buffer, timestamp );
69 _child_parser.extractData(plot_map, prefix + _child_prefix);
80 #endif // ROS_MESSAGEPARSER_H
std::vector< PlotData > _data
const std::unordered_set< std::string > & getCompatibleKeys() const override
void extractData(PlotDataMapRef &plot_map, const std::string &prefix) override
const uint8_t * data() const
std::string _child_prefix
static const char * value()
RosMessageStampedParser(const char *child_prefix)
virtual void pushMessageRef(const std::string &key, const MessageRef &buffer, double timestamp) override
static void appendData(PlotDataMapRef &destination_plot_map, const std::string &field_name, PlotData &in_data)
ChildParser _child_parser
struct absl::base_internal::@37::AllocList::Header header
void deserialize(Stream &stream, T &t)
The MessageParser is the base class to create plugins that are able to parse one or multiple Message ...
void setUseHeaderStamp(bool use)