ros_parser.cpp
Go to the documentation of this file.
1 #include "ros_parser.h"
4 
5 using namespace PJ;
6 using namespace RosMsgParser;
7 
9 constexpr double RAD_TO_DEG = 180.0 / M_PI;
10 
11 static std::unordered_map<uint64_t, DataTamerParser::Schema> _global_data_tamer_schemas;
12 
13 ParserROS::ParserROS(const std::string& topic_name, const std::string& type_name,
14  const std::string& schema, RosMsgParser::Deserializer* deserializer,
16  : MessageParser(topic_name, data)
17  , _parser(topic_name, type_name, schema)
18  , _deserializer(deserializer)
19  , _topic(topic_name)
20 {
21  auto policy =
22  clampLargeArray() ? Parser::KEEP_LARGE_ARRAYS : Parser::DISCARD_LARGE_ARRAYS;
23 
25 
26  const auto& root_fields = _parser.getSchema()->root_msg->fields();
27  _has_header = !root_fields.empty() && root_fields.front().type().baseName() == "std_"
28  "msgs/"
29  "Header";
30 
31  using std::placeholders::_1;
32  using std::placeholders::_2;
33  if (Msg::Empty::id() == type_name)
34  {
35  _customized_parser = std::bind(&ParserROS::parseEmpty, this, _1, _2);
36  }
37  else if (Msg::DiagnosticArray::id() == type_name)
38  {
39  _customized_parser = std::bind(&ParserROS::parseDiagnosticMsg, this, _1, _2);
40  }
41  else if (Msg::JointState::id() == type_name)
42  {
43  _customized_parser = std::bind(&ParserROS::parseJointStateMsg, this, _1, _2);
44  }
45  else if (Msg::TFMessage::id() == type_name)
46  {
47  _customized_parser = std::bind(&ParserROS::parseTF2Msg, this, _1, _2);
48  }
49  else if (Msg::DataTamerSchemas::id() == type_name)
50  {
51  _customized_parser = std::bind(&ParserROS::parseDataTamerSchemas, this, _1, _2);
52  }
53  else if (Msg::DataTamerSnapshot::id() == type_name)
54  {
55  _customized_parser = std::bind(&ParserROS::parseDataTamerSnapshot, this, _1, _2);
56  }
57  else if (Msg::Imu::id() == type_name)
58  {
59  _customized_parser = std::bind(&ParserROS::parseImu, this, _1, _2);
60  }
61  else if (Msg::Pose::id() == type_name)
62  {
63  _customized_parser = std::bind(&ParserROS::parsePose, this, _1, _2);
64  }
65  else if (Msg::PoseStamped::id() == type_name)
66  {
67  _customized_parser = std::bind(&ParserROS::parsePoseStamped, this, _1, _2);
68  }
69  else if (Msg::Odometry::id() == type_name)
70  {
71  _customized_parser = std::bind(&ParserROS::parseOdometry, this, _1, _2);
72  }
73  else if (Msg::Transform::id() == type_name)
74  {
75  _customized_parser = std::bind(&ParserROS::parseTransform, this, _1, _2);
76  }
77  else if (Msg::TransformStamped::id() == type_name)
78  {
79  _customized_parser = std::bind(&ParserROS::parseTransformStamped, this, _1, _2);
80  }
81  else if (Msg::PalStatisticsNames::id() == type_name || type_name == "plotjuggler_msgs/"
82  "StatisticsNames")
83  {
84  _customized_parser = std::bind(&ParserROS::parsePalStatisticsNames, this, _1, _2);
85  }
86  else if (Msg::PalStatisticsValues::id() == type_name || type_name == "plotjuggler_msgs/"
87  "StatisticsValues")
88  {
89  _customized_parser = std::bind(&ParserROS::parsePalStatisticsValues, this, _1, _2);
90  }
91 }
92 
93 bool ParserROS::parseMessage(const PJ::MessageRef serialized_msg, double& timestamp)
94 {
96  {
97  _deserializer->init(
98  Span<const uint8_t>(serialized_msg.data(), serialized_msg.size()));
99  _customized_parser(_topic_name, timestamp);
100  return true;
101  }
102 
103  _parser.deserialize(serialized_msg, &_flat_msg, _deserializer.get());
104 
105  if (_has_header && this->useEmbeddedTimestamp())
106  {
107  double ts = 0;
108  if (_deserializer->isROS2())
109  {
110  auto sec = _flat_msg.value[0].second.convert<double>();
111  auto nsec = _flat_msg.value[1].second.convert<double>();
112  ts = sec + 1e-9 * nsec;
113  }
114  else
115  {
116  ts = _flat_msg.value[1].second.convert<RosMsgParser::Time>().toSec();
117  }
118  timestamp = (ts > 0) ? ts : timestamp;
119  }
120 
121  std::string series_name;
122 
123  for (const auto& [key, str] : _flat_msg.name)
124  {
125  key.toStr(series_name);
126  StringSeries& data = getStringSeries(series_name);
127  data.pushBack({ timestamp, str });
128  }
129 
130  for (const auto& [key, value] : _flat_msg.value)
131  {
132  key.toStr(series_name);
133  PlotData& data = getSeries(series_name);
134 
136  {
137  // bypass the truncation check
138  if (value.getTypeID() == BuiltinType::INT64)
139  {
140  data.pushBack({ timestamp, double(value.convert<int64_t>()) });
141  continue;
142  }
143  if (value.getTypeID() == BuiltinType::UINT64)
144  {
145  data.pushBack({ timestamp, double(value.convert<uint64_t>()) });
146  continue;
147  }
148  }
149  try
150  {
151  data.pushBack({ timestamp, value.convert<double>() });
152  }
153  catch (RangeException& ex)
154  {
155  std::string msg = std::string(ex.what());
156  if (msg == "Floating point truncated")
157  {
158  msg += ".\n\nYou can disable this check in:\n"
159  "App -> Preferences... -> Behavior -> Parsing";
160  }
161  throw std::runtime_error(msg);
162  }
163  }
164  return true;
165 }
166 
167 void ParserROS::setLargeArraysPolicy(bool clamp, unsigned max_size)
168 {
169  auto policy = clamp ? RosMsgParser::Parser::KEEP_LARGE_ARRAYS :
171 
172  _parser.setMaxArrayPolicy(policy, max_size);
173  MessageParser::setLargeArraysPolicy(clamp, max_size);
174 }
175 
176 //------------------------------------------------------------------------
177 
179 {
181  // only ROS1 as the files header.seq
182  if (dynamic_cast<ROS_Deserializer*>(_deserializer.get()) != nullptr)
183  {
184  header.seq = _deserializer->deserializeUInt32();
185  }
186 
187  header.stamp.sec = _deserializer->deserializeUInt32();
188  header.stamp.nanosec = _deserializer->deserializeUInt32();
189 
190  const double ts = header.stamp.toSec();
191  if (useEmbeddedTimestamp() && ts > 0)
192  {
193  timestamp = ts;
194  }
195  _deserializer->deserializeString(header.frame_id);
196 
197  return header;
198 }
199 
200 void ParserROS::parseHeader(const std::string& prefix, double& timestamp)
201 {
202  const auto header = readHeader(timestamp);
203 
204  getSeries(prefix + "/header/stamp").pushBack({ timestamp, header.stamp.toSec() });
205  getStringSeries(prefix + "/header/frame_id").pushBack({ timestamp, header.frame_id });
206  if (dynamic_cast<ROS_Deserializer*>(_deserializer.get()) != nullptr)
207  {
208  getSeries(prefix + "/header/seq").pushBack({ timestamp, double(header.seq) });
209  }
210 }
211 
212 void ParserROS::parseEmpty(const std::string& prefix, double& timestamp)
213 {
214  getSeries(prefix).pushBack({ timestamp, 0 });
215 }
216 
217 void ParserROS::parseVector3(const std::string& prefix, double& timestamp)
218 {
219  auto x = _deserializer->deserialize(FLOAT64).convert<double>();
220  auto y = _deserializer->deserialize(FLOAT64).convert<double>();
221  auto z = _deserializer->deserialize(FLOAT64).convert<double>();
222  getSeries(prefix + "/x").pushBack({ timestamp, x });
223  getSeries(prefix + "/y").pushBack({ timestamp, y });
224  getSeries(prefix + "/z").pushBack({ timestamp, z });
225 }
226 
227 void ParserROS::parsePoint(const std::string& prefix, double& timestamp)
228 {
229  auto x = _deserializer->deserialize(FLOAT64).convert<double>();
230  auto y = _deserializer->deserialize(FLOAT64).convert<double>();
231  auto z = _deserializer->deserialize(FLOAT64).convert<double>();
232  getSeries(prefix + "/x").pushBack({ timestamp, x });
233  getSeries(prefix + "/y").pushBack({ timestamp, y });
234  getSeries(prefix + "/z").pushBack({ timestamp, z });
235 }
236 
237 void ParserROS::parseQuaternion(const std::string& prefix, double& timestamp)
238 {
239  PJ::Msg::Quaternion quat;
240  quat.x = _deserializer->deserialize(FLOAT64).convert<double>();
241  quat.y = _deserializer->deserialize(FLOAT64).convert<double>();
242  quat.z = _deserializer->deserialize(FLOAT64).convert<double>();
243  quat.w = _deserializer->deserialize(FLOAT64).convert<double>();
244  getSeries(prefix + "/x").pushBack({ timestamp, quat.x });
245  getSeries(prefix + "/y").pushBack({ timestamp, quat.y });
246  getSeries(prefix + "/z").pushBack({ timestamp, quat.z });
247  getSeries(prefix + "/w").pushBack({ timestamp, quat.w });
248 
249  auto rpy = Msg::QuaternionToRPY(quat);
250  getSeries(prefix + "/roll").pushBack({ timestamp, rpy.roll });
251  getSeries(prefix + "/pitch").pushBack({ timestamp, rpy.pitch });
252  getSeries(prefix + "/yaw").pushBack({ timestamp, rpy.yaw });
253 }
254 
255 void ParserROS::parseTwist(const std::string& prefix, double& timestamp)
256 {
257  parseVector3(prefix + "/linear", timestamp);
258  parseVector3(prefix + "/angular", timestamp);
259 }
260 
261 void ParserROS::parseTwistWithCovariance(const std::string& prefix, double& timestamp)
262 {
263  parseTwist(prefix + "/twist", timestamp);
264  parseCovariance<6>(prefix + "/covariance", timestamp);
265 }
266 
267 void ParserROS::parseTransform(const std::string& prefix, double& timestamp)
268 {
269  parsePoint(prefix + "/translation", timestamp);
270  parseQuaternion(prefix + "/rotation", timestamp);
271 }
272 
273 void ParserROS::parseTransformStamped(const std::string& prefix, double& timestamp)
274 {
275  parseHeader(prefix + "/header", timestamp);
276 
277  std::string child_frame_id;
278  _deserializer->deserializeString(child_frame_id);
279  getStringSeries(prefix + "/child_frame_id").pushBack({ timestamp, child_frame_id });
280 
281  parseTransform(prefix + "/transform", timestamp);
282 }
283 
284 void ParserROS::parsePose(const std::string& prefix, double& timestamp)
285 {
286  parseVector3(prefix + "/position", timestamp);
287  parseQuaternion(prefix + "/orientation", timestamp);
288 }
289 
290 void ParserROS::parsePoseStamped(const std::string& prefix, double& timestamp)
291 {
292  parseHeader(prefix + "/header", timestamp);
293  parsePose(prefix + "/pose", timestamp);
294 }
295 
296 void ParserROS::parsePoseWithCovariance(const std::string& prefix, double& timestamp)
297 {
298  parsePose(prefix + "/pose", timestamp);
299  parseCovariance<6>(prefix + "/covariance", timestamp);
300 }
301 
302 void ParserROS::parseImu(const std::string& prefix, double& timestamp)
303 {
304  parseHeader(prefix + "/header", timestamp);
305 
306  parseQuaternion(prefix + "/orientation", timestamp);
307  parseCovariance<3>(prefix + "/orientation_covariance", timestamp);
308 
309  parseVector3(prefix + "/angular_velocity", timestamp);
310  parseCovariance<3>(prefix + "/angular_velocity_covariance", timestamp);
311 
312  parseVector3(prefix + "/linear_acceleration", timestamp);
313  parseCovariance<3>(prefix + "/linear_acceleration_covariance", timestamp);
314 }
315 
316 void ParserROS::parseOdometry(const std::string& prefix, double& timestamp)
317 {
318  parseHeader(prefix + "/header", timestamp);
319  std::string child_frame_id;
320  _deserializer->deserializeString(child_frame_id);
321  getStringSeries(prefix + "/child_frame_id").pushBack({ timestamp, child_frame_id });
322  parsePoseWithCovariance(prefix + "/pose", timestamp);
323  parseTwistWithCovariance(prefix + "/twist", timestamp);
324 }
325 
326 void ParserROS::parseDiagnosticMsg(const std::string& prefix, double& timestamp)
327 {
328  thread_local Msg::DiagnosticArray msg;
329 
330  parseHeader(prefix + "/header", timestamp);
331 
332  size_t status_count = _deserializer->deserializeUInt32();
333  msg.status.resize(status_count);
334 
335  for (size_t st = 0; st < status_count; st++)
336  {
337  auto& status = msg.status[st];
338  status.level = _deserializer->deserialize(BYTE).convert<uint8_t>();
339  _deserializer->deserializeString(status.name);
340  _deserializer->deserializeString(status.message);
341  _deserializer->deserializeString(status.hardware_id);
342 
343  status.key_value.clear();
344 
345  size_t key_value_count = _deserializer->deserializeUInt32();
346  std::string key;
347  std::string value_str;
348  for (size_t kv = 0; kv < key_value_count; kv++)
349  {
350  _deserializer->deserializeString(key);
351  _deserializer->deserializeString(value_str);
352  status.key_value.push_back({ key, value_str });
353  }
354  }
355 
356  //------ Now create the series --------
357 
358  std::string series_name;
359 
360  for (const auto& status : msg.status)
361  {
362  for (const auto& kv : status.key_value)
363  {
364  if (status.hardware_id.empty())
365  {
366  series_name = fmt::format("{}/{}/{}", prefix, status.name, kv.first);
367  }
368  else
369  {
370  series_name =
371  fmt::format("{}/{}/{}/{}", prefix, status.hardware_id, status.name, kv.first);
372  }
373 
374  bool ok;
375  double value = QString::fromStdString(kv.second).toDouble(&ok);
376 
377  if (ok)
378  {
379  getSeries(series_name).pushBack({ timestamp, value });
380  }
381  else
382  {
383  getStringSeries(series_name).pushBack({ timestamp, kv.second });
384  }
385  }
386  }
387 }
388 
389 void ParserROS::parseJointStateMsg(const std::string& prefix, double& timestamp)
390 {
391  thread_local Msg::JointState msg;
392 
393  msg.name.clear();
394  msg.position.clear();
395  msg.velocity.clear();
396  msg.effort.clear();
397 
398  parseHeader(prefix, timestamp);
399 
400  size_t name_size = _deserializer->deserializeUInt32();
401  if (name_size > 0)
402  {
403  msg.name.resize(name_size);
404  for (auto& name : msg.name)
405  {
406  _deserializer->deserializeString(name);
407  }
408  }
409 
410  //-----------
411  size_t pos_size = _deserializer->deserializeUInt32();
412  if (pos_size > 0)
413  {
414  msg.position.resize(pos_size);
415  for (auto& pos : msg.position)
416  {
417  pos = _deserializer->deserialize(FLOAT64).convert<double>();
418  }
419  }
420  //-----------
421  size_t vel_size = _deserializer->deserializeUInt32();
422  if (vel_size > 0)
423  {
424  msg.velocity.resize(vel_size);
425  for (auto& vel : msg.velocity)
426  {
427  vel = _deserializer->deserialize(FLOAT64).convert<double>();
428  }
429  }
430  //-----------
431  size_t eff_size = _deserializer->deserializeUInt32();
432  if (eff_size > 0)
433  {
434  msg.effort.resize(eff_size);
435  for (auto& eff : msg.effort)
436  {
437  eff = _deserializer->deserialize(FLOAT64).convert<double>();
438  }
439  }
440  //---------------------------
441  std::string series_name;
442  for (size_t i = 0; i < std::min(name_size, pos_size); i++)
443  {
444  series_name = fmt::format("{}/{}/position", _topic, msg.name[i]);
445  getSeries(series_name).pushBack({ timestamp, msg.position[i] });
446  }
447  for (size_t i = 0; i < std::min(name_size, vel_size); i++)
448  {
449  series_name = fmt::format("{}/{}/velocity", _topic, msg.name[i]);
450  getSeries(series_name).pushBack({ timestamp, msg.velocity[i] });
451  }
452  for (size_t i = 0; i < std::min(name_size, eff_size); i++)
453  {
454  series_name = fmt::format("{}/{}/effort", _topic, msg.name[i]);
455  getSeries(series_name).pushBack({ timestamp, msg.effort[i] });
456  }
457 }
458 
459 void ParserROS::parseTF2Msg(const std::string& prefix, double& timestamp)
460 {
461  const size_t transform_size = _deserializer->deserializeUInt32();
462 
463  if (transform_size == 0)
464  {
465  return;
466  }
467 
468  for (size_t i = 0; i < transform_size; i++)
469  {
470  const auto header = readHeader(timestamp);
471  std::string child_frame_id;
472  _deserializer->deserializeString(child_frame_id);
473 
474  std::string new_prefix;
475  if (header.frame_id.empty())
476  {
477  new_prefix = fmt::format("{}/{}", prefix, child_frame_id);
478  }
479  else
480  {
481  new_prefix = fmt::format("{}/{}/{}", prefix, header.frame_id, child_frame_id);
482  }
483  parseTransform(new_prefix, timestamp);
484  }
485 }
486 
487 void ParserROS::parseDataTamerSchemas(const std::string& prefix, double& timestamp)
488 {
489  const size_t vector_size = _deserializer->deserializeUInt32();
490 
491  for (size_t i = 0; i < vector_size; i++)
492  {
494  schema.hash = _deserializer->deserialize(BuiltinType::UINT64).convert<uint64_t>();
495  std::string channel_name;
496  _deserializer->deserializeString(channel_name);
497  std::string schema_text;
498  _deserializer->deserializeString(schema_text);
499 
500  auto dt_schema = DataTamerParser::BuilSchemaFromText(schema_text);
501  dt_schema.channel_name = channel_name;
502  _global_data_tamer_schemas.insert({ dt_schema.hash, dt_schema });
503  }
504 }
505 
506 void ParserROS::parseDataTamerSnapshot(const std::string& prefix, double& timestamp)
507 {
509 
510  snapshot.timestamp =
511  _deserializer->deserialize(BuiltinType::UINT64).convert<uint64_t>();
512  snapshot.schema_hash =
513  _deserializer->deserialize(BuiltinType::UINT64).convert<uint64_t>();
514 
515  auto active_mask = _deserializer->deserializeByteSequence();
516  snapshot.active_mask = { active_mask.data(), active_mask.size() };
517 
518  auto payload = _deserializer->deserializeByteSequence();
519  snapshot.payload = { payload.data(), payload.size() };
520 
521  auto it = _global_data_tamer_schemas.find(snapshot.schema_hash);
522  if (it == _global_data_tamer_schemas.end())
523  {
524  return;
525  }
526  const auto& dt_schema = it->second;
527 
528  const auto toDouble = [](const auto& value) { return static_cast<double>(value); };
529 
530  auto callback = [&](const std::string& name_field,
531  const DataTamerParser::VarNumber& value) {
532  double timestamp = double(snapshot.timestamp) * 1e-9;
533  auto name = fmt::format("{}/{}/{}", _topic_name, dt_schema.channel_name, name_field);
534  getSeries(name).pushBack({ timestamp, std::visit(toDouble, value) });
535  };
536 
537  DataTamerParser::ParseSnapshot(dt_schema, snapshot, callback);
538 }
539 
540 static std::unordered_map<uint32_t, std::vector<std::string>> _pal_statistics_names;
541 
542 void ParserROS::parsePalStatisticsNames(const std::string& prefix, double& timestamp)
543 {
544  const auto header = readHeader(timestamp);
545  std::vector<std::string> names;
546  const size_t vector_size = _deserializer->deserializeUInt32();
547  names.resize(vector_size);
548  for (auto& name : names)
549  {
550  _deserializer->deserializeString(name);
551  }
552  uint32_t names_version = _deserializer->deserializeUInt32();
553  _pal_statistics_names[names_version] = std::move(names);
554 }
555 
556 void ParserROS::parsePalStatisticsValues(const std::string& prefix, double& timestamp)
557 {
558  const auto header = readHeader(timestamp);
559  std::vector<double> values;
560  const size_t vector_size = _deserializer->deserializeUInt32();
561  values.resize(vector_size);
562 
563  for (auto& value : values)
564  {
565  value = _deserializer->deserialize(BuiltinType::FLOAT64).convert<double>();
566  }
567  uint32_t names_version = _deserializer->deserializeUInt32();
568  auto it = _pal_statistics_names.find(names_version);
569  if (it != _pal_statistics_names.end())
570  {
571  const auto& names = it->second;
572  const size_t N = std::min(names.size(), values.size());
573  for (size_t i = 0; i < N; i++)
574  {
575  auto& series = getSeries(fmt::format("{}/{}", prefix, names[i]));
576  series.pushBack({ timestamp, values[i] });
577  }
578  }
579 }
ParserROS::_strict_truncation_check
bool _strict_truncation_check
Definition: ros_parser.h:68
ParserROS::parseTwistWithCovariance
void parseTwistWithCovariance(const std::string &prefix, double &timestamp)
Definition: ros_parser.cpp:261
DataTamerParser::Schema
DataTamer uses a simple "flat" schema of key/value pairs (each pair is a "field").
Definition: data_tamer_parser.hpp:77
PJ::TimeseriesBase
Definition: timeseries.h:16
quaternion_type
static ROSType quaternion_type(Msg::Quaternion::id())
RosMsgParser::ROSType
ROSType.
Definition: ros_type.hpp:39
ParserROS::parseEmpty
void parseEmpty(const std::string &prefix, double &timestamp)
Definition: ros_parser.cpp:212
PJ::StringSeries::pushBack
void pushBack(const Point &p) override
Definition: stringseries.h:39
PJ::MessageParser::_topic_name
std::string _topic_name
Definition: messageparser_base.h:118
ParserROS::parsePalStatisticsNames
void parsePalStatisticsNames(const std::string &prefix, double &timestamp)
Definition: ros_parser.cpp:542
PJ::TimeseriesBase::pushBack
void pushBack(const Point &p) override
Definition: timeseries.h:61
DataTamerParser::Schema::hash
uint64_t hash
Definition: data_tamer_parser.hpp:79
RosMsgParser::Parser::setMaxArrayPolicy
void setMaxArrayPolicy(MaxArrayPolicy discard_entire_array, size_t max_array_size)
Definition: ros_parser.hpp:74
DataTamerParser::SnapshotView::payload
BufferSpan payload
serialized data containing all the values, ordered as in the schema
Definition: data_tamer_parser.hpp:102
PJ::MessageRef::data
const uint8_t * data() const
Definition: messageparser_base.h:51
PJ::Msg::Quaternion::w
double w
Definition: special_messages.h:96
sol::type_name
std::string type_name(lua_State *L, type t)
Definition: sol.hpp:8079
PJ::MessageParser::useEmbeddedTimestamp
virtual bool useEmbeddedTimestamp() const
Definition: messageparser_base.h:106
mqtt_test_proto.x
x
Definition: mqtt_test_proto.py:34
ParserROS::_deserializer
std::unique_ptr< RosMsgParser::Deserializer > _deserializer
Definition: ros_parser.h:27
mqtt_test_proto.msg
msg
Definition: mqtt_test_proto.py:43
PJ::MessageParser::maxArraySize
unsigned maxArraySize() const
Definition: messageparser_base.h:96
ParserROS::parseTransformStamped
void parseTransformStamped(const std::string &prefix, double &timestamp)
Definition: ros_parser.cpp:273
DataTamerParser::SnapshotView::timestamp
uint64_t timestamp
snapshot timestamp
Definition: data_tamer_parser.hpp:94
ok
ROSCPP_DECL bool ok()
mqtt_test_proto.y
y
Definition: mqtt_test_proto.py:35
ParserROS::_customized_parser
std::function< void(const std::string &prefix, double &)> _customized_parser
Definition: ros_parser.h:65
ParserROS::readHeader
PJ::Msg::Header readHeader(double &timestamp)
Definition: ros_parser.cpp:178
mqtt_test_proto.z
z
Definition: mqtt_test_proto.py:36
ParserROS::parseJointStateMsg
void parseJointStateMsg(const std::string &prefix, double &timestamp)
Definition: ros_parser.cpp:389
M_PI
#define M_PI
Definition: qwt_math.h:56
RAD_TO_DEG
constexpr double RAD_TO_DEG
Definition: ros_parser.cpp:9
DataTamerParser::VarNumber
std::variant< bool, char, int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t, float, double > VarNumber
Definition: data_tamer_parser.hpp:43
PJ::Msg::Quaternion::id
static const char * id()
Definition: special_messages.h:98
RosMsgParser::FLOAT64
@ FLOAT64
Definition: builtin_types.hpp:57
RosMsgParser
Definition: builtin_types.hpp:34
data_tamer_parser.hpp
BYTE
unsigned char BYTE
Definition: lz4.c:312
RosMsgParser::Parser::KEEP_LARGE_ARRAYS
@ KEEP_LARGE_ARRAYS
Definition: ros_parser.hpp:69
RosMsgParser::UINT64
@ UINT64
Definition: builtin_types.hpp:51
DataTamerParser::BuilSchemaFromText
Schema BuilSchemaFromText(const std::string &txt)
Definition: data_tamer_parser.hpp:216
ParserROS::setLargeArraysPolicy
void setLargeArraysPolicy(bool clamp, unsigned max_size) override
Definition: ros_parser.cpp:167
ParserROS::parseDiagnosticMsg
void parseDiagnosticMsg(const std::string &prefix, double &timestamp)
Definition: ros_parser.cpp:326
RosMsgParser::RangeException
Definition: exceptions.hpp:76
backward::details::move
const T & move(const T &v)
Definition: backward.hpp:394
ParserROS::parseMessage
bool parseMessage(const PJ::MessageRef serialized_msg, double &timestamp) override
Definition: ros_parser.cpp:93
PJ::MessageParser
The MessageParser is the base class used to parse a message with a specific encoding+schema.
Definition: messageparser_base.h:75
ParserROS::parseImu
void parseImu(const std::string &prefix, double &timestamp)
Definition: ros_parser.cpp:302
PJ::MessageParser::getSeries
PlotData & getSeries(const std::string &key)
Definition: messageparser_base.h:120
PJ::Msg::Quaternion::x
double x
Definition: special_messages.h:93
PJ::MessageParser::getStringSeries
StringSeries & getStringSeries(const std::string &key)
Definition: messageparser_base.h:125
ParserROS::_topic
std::string _topic
Definition: ros_parser.h:29
ParserROS::parsePose
void parsePose(const std::string &prefix, double &timestamp)
Definition: ros_parser.cpp:284
ParserROS::parseHeader
void parseHeader(const std::string &prefix, double &timestamp)
Definition: ros_parser.cpp:200
ParserROS::parseTransform
void parseTransform(const std::string &prefix, double &timestamp)
Definition: ros_parser.cpp:267
format
auto format(const text_style &ts, const S &format_str, const Args &... args) -> std::basic_string< Char >
Definition: color.h:543
ParserROS::parseDataTamerSnapshot
void parseDataTamerSnapshot(const std::string &prefix, double &timestamp)
Definition: ros_parser.cpp:506
DataTamerParser::SnapshotView::active_mask
BufferSpan active_mask
Definition: data_tamer_parser.hpp:99
RosMsgParser::Deserializer
Definition: deserializer.hpp:20
RosMsgParser::Parser::deserialize
bool deserialize(Span< const uint8_t > buffer, FlatMessage *flat_output, Deserializer *deserializer) const
deserializeIntoFlatContainer takes a raw buffer of memory and extract information from it....
Definition: rosx_introspection/src/ros_parser.cpp:76
RosMsgParser::FlatMessage::name
std::vector< std::pair< FieldsVector, std::string > > name
List of all those parsed fields that can be represented by a "string".
Definition: ros_parser.hpp:42
RosMsgParser::FlatMessage::value
std::vector< std::pair< FieldsVector, Variant > > value
Definition: ros_parser.hpp:39
toDouble
double toDouble(const void *data)
Definition: dataload_zcm.cpp:196
ParserROS::_parser
RosMsgParser::Parser _parser
Definition: ros_parser.h:26
PJ::Msg::DiagnosticArray
Definition: special_messages.h:55
ParserROS::parseTF2Msg
void parseTF2Msg(const std::string &prefix, double &timestamp)
Definition: ros_parser.cpp:459
nonstd::span_lite::span
Definition: span.hpp:581
ParserROS::parsePoseStamped
void parsePoseStamped(const std::string &prefix, double &timestamp)
Definition: ros_parser.cpp:290
RosMsgParser::RangeException::what
const char * what() const
Definition: exceptions.hpp:120
RosMsgParser::ROS_Deserializer
Definition: deserializer.hpp:63
PJ::Msg::QuaternionToRPY
RPY QuaternionToRPY(Quaternion q)
Definition: special_messages.cpp:4
DataTamerParser::BufferSpan::data
const uint8_t * data
Definition: data_tamer_parser.hpp:47
PJ::Msg::JointState
Definition: special_messages.h:232
PJ::MessageRef
Definition: messageparser_base.h:28
core.h
ParserROS::parseOdometry
void parseOdometry(const std::string &prefix, double &timestamp)
Definition: ros_parser.cpp:316
PJ
Definition: dataloader_base.h:16
RosMsgParser::Parser::DISCARD_LARGE_ARRAYS
@ DISCARD_LARGE_ARRAYS
Definition: ros_parser.hpp:68
ParserROS::parseQuaternion
void parseQuaternion(const std::string &prefix, double &timestamp)
Definition: ros_parser.cpp:237
mqtt_test.data
dictionary data
Definition: mqtt_test.py:22
PJ::MessageRef::size
size_t size() const
Definition: messageparser_base.h:61
DataTamerParser::ParseSnapshot
bool ParseSnapshot(const Schema &schema, SnapshotView snapshot, const NumberCallback &callback_number, const CustomCallback &callback_custom=NullCustomCallback)
Definition: data_tamer_parser.hpp:411
_global_data_tamer_schemas
static std::unordered_map< uint64_t, DataTamerParser::Schema > _global_data_tamer_schemas
Definition: ros_parser.cpp:11
ParserROS::parseVector3
void parseVector3(const std::string &prefix, double &timestamp)
Definition: ros_parser.cpp:217
PJ::PlotDataMapRef
Definition: plotdata.h:34
PJ::MessageParser::clampLargeArray
bool clampLargeArray() const
Definition: messageparser_base.h:101
ParserROS::parsePoint
void parsePoint(const std::string &prefix, double &timestamp)
Definition: ros_parser.cpp:227
ParserROS::parseTwist
void parseTwist(const std::string &prefix, double &timestamp)
Definition: ros_parser.cpp:255
ros_parser.h
PJ::Msg::Quaternion::z
double z
Definition: special_messages.h:95
header
const std::string header
DataTamerParser::SnapshotView
Definition: data_tamer_parser.hpp:88
PJ::Msg::Header
Definition: special_messages.h:25
ParserROS::ParserROS
ParserROS(const std::string &topic_name, const std::string &type_name, const std::string &schema, RosMsgParser::Deserializer *deserializer, PJ::PlotDataMapRef &data)
Definition: ros_parser.cpp:13
ParserROS::parsePalStatisticsValues
void parsePalStatisticsValues(const std::string &prefix, double &timestamp)
Definition: ros_parser.cpp:556
ParserROS::_flat_msg
RosMsgParser::FlatMessage _flat_msg
Definition: ros_parser.h:28
RosMsgParser::Time
Definition: builtin_types.hpp:150
PJ::Msg::Quaternion::y
double y
Definition: special_messages.h:94
DataTamerParser::SnapshotView::schema_hash
size_t schema_hash
Unique identifier of the schema.
Definition: data_tamer_parser.hpp:91
ParserROS::_has_header
bool _has_header
Definition: ros_parser.h:67
RosMsgParser::Parser::getSchema
const std::shared_ptr< MessageSchema > & getSchema() const
getSchema provides some metadata amout a registered ROSMessage.
Definition: rosx_introspection/src/ros_parser.cpp:49
PJ::Msg::Quaternion
Definition: special_messages.h:91
_pal_statistics_names
static std::unordered_map< uint32_t, std::vector< std::string > > _pal_statistics_names
Definition: ros_parser.cpp:540
PJ::StringSeries
Definition: stringseries.h:17
RosMsgParser::INT64
@ INT64
Definition: builtin_types.hpp:55
ParserROS::parsePoseWithCovariance
void parsePoseWithCovariance(const std::string &prefix, double &timestamp)
Definition: ros_parser.cpp:296
ParserROS::parseDataTamerSchemas
void parseDataTamerSchemas(const std::string &prefix, double &timestamp)
Definition: ros_parser.cpp:487


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:46