geometry_twist_msg.h
Go to the documentation of this file.
1 #ifndef GEOMETRY_MSG_TWIST_H
2 #define GEOMETRY_MSG_TWIST_H
3 
4 #include <geometry_msgs/Twist.h>
5 #include <geometry_msgs/TwistStamped.h>
6 #include "ros_parser_base.h"
7 
9 {
10 public:
11 
13  {
14  _data.emplace_back( "/linear/x" );
15  _data.emplace_back( "/linear/y" );
16  _data.emplace_back( "/linear/z" );
17  _data.emplace_back( "/angular/x" );
18  _data.emplace_back( "/angular/y" );
19  _data.emplace_back( "/angular/z" );
20  }
21 
22  static const std::string& getCompatibleKey()
23  {
25  return str;
26  }
27 
28  const std::unordered_set<std::string>& getCompatibleKeys() const override
29  {
30  static std::unordered_set<std::string> temp = { getCompatibleKey() };
31  return temp;
32  }
33 
34  virtual void pushMessageRef(const std::string& ,
35  const MessageRef& msg,
36  double timestamp) override
37  {
38  geometry_msgs::Twist twist;
39  ros::serialization::IStream is( const_cast<uint8_t*>(msg.data()), msg.size() );
41 
42  _data[0].pushBack( {timestamp, twist.linear.x} );
43  _data[1].pushBack( {timestamp, twist.linear.y} );
44  _data[2].pushBack( {timestamp, twist.linear.z} );
45  _data[3].pushBack( {timestamp, twist.angular.x} );
46  _data[4].pushBack( {timestamp, twist.angular.y} );
47  _data[5].pushBack( {timestamp, twist.angular.z} );
48  }
49 
50  void extractData(PlotDataMapRef& plot_map, const std::string& prefix) override
51  {
52  for (auto& it: _data)
53  {
54  appendData(plot_map, prefix + it.name(), it);
55  }
56  }
57 
58 private:
59  std::vector<PlotData> _data;
60 };
61 
62 typedef
65 
66 
67 #endif // GEOMETRY_MSG_TWIST_H
std::vector< PlotData > _data
size_t size() const
const std::unordered_set< std::string > & getCompatibleKeys() const override
void extractData(PlotDataMapRef &plot_map, const std::string &prefix) override
const uint8_t * data() const
virtual void pushMessageRef(const std::string &, const MessageRef &msg, double timestamp) override
RosMessageStampedParser< geometry_msgs::TwistStamped, geometry_msgs::Twist, GeometryMsgTwist > GeometryMsgTwistStamped
static const char * value()
static const std::string & getCompatibleKey()
static void appendData(PlotDataMapRef &destination_plot_map, const std::string &field_name, PlotData &in_data)
void deserialize(Stream &stream, T &t)


plotjuggler
Author(s): Davide Faconti
autogenerated on Sat Jul 6 2019 03:44:17