27 if (leaf2 && leaf2->
value() ==
"header" && leaf1->
value() ==
"stamp")
29 double header_stamp =
it.second.convert<
double>();
33 timestamp = header_stamp;
44 const auto&
key =
it.first;
49 uint64_t raw_value =
it.second.extract<uint64_t>();
53 value =
static_cast<double>(raw_value);
57 int64_t raw_value =
it.second.extract<int64_t>();
61 value =
static_cast<double>(raw_value);
63 else if(
it.second.getTypeID() == RosIntrospection::BuiltinType::STRING )
66 auto str =
it.second.extract<std::string>();
79 value =
it.second.convert<
double>();
84 if (!std::isnan(static_cast<double>(value)) && !std::isinf(value))
86 series.pushBack({ timestamp, value });
95 const std::string& topic_type,
96 const std::string& definition)
98 std::shared_ptr<RosMessageParser>
parser;
99 if (_parsers.count(topic_name) > 0)
104 const std::string&
type = topic_type;
106 if (type ==
"sensor_msgs/JointState")
110 else if (type ==
"diagnostic_msgs/DiagnosticArray")
114 else if (type ==
"tf/tfMessage")
118 else if (type ==
"tf2_msgs/TFMessage")
122 else if (type ==
"geometry_msgs/Quaternion")
126 else if (type ==
"sensor_msgs/Imu")
130 else if (type ==
"nav_msgs/Odometry")
134 else if (type ==
"geometry_msgs/Pose")
138 else if (type ==
"geometry_msgs/PoseStamped")
142 else if (type ==
"geometry_msgs/PoseWithCovariance")
146 else if (type ==
"geometry_msgs/PoseWithCovarianceStamped")
150 else if (type ==
"geometry_msgs/Twist")
154 else if (type ==
"geometry_msgs/TwistStamped")
158 else if (type ==
"geometry_msgs/TwistWithCovariance")
162 else if (type ==
"pal_statistics_msgs/StatisticsNames")
166 else if (type ==
"pal_statistics_msgs/StatisticsValues")
170 else if (type ==
"plotjuggler_msgs/Dictionary")
174 else if (type ==
"plotjuggler_msgs/DataPoints")
178 else if (type ==
"fiveai_node_msgs/NodeDiagnostics")
188 _parsers.insert({ topic_name, parser });
bool boolean_strings_to_number
RosIntrospection::Parser _parser
RosIntrospection::RenamedValues _renamed
PlotDataMapRef & _plot_data
Element of the tree. it has a single parent and N >= 0 children.
PJ::PlotData & getSeries(const std::string &key)
virtual bool parseMessage(MessageRef serialized_msg, double ×tamp) override
void registerMessageType(const std::string &topic_name, const std::string &topic_type, const std::string &definition)
IntrospectionParser(const std::string &topic_name, const std::string &topic_type, const std::string &definition, PJ::PlotDataMapRef &plot_data)
StringSeries & getOrCreateStringSeries(const std::string &name, PlotGroup::Ptr group={})
TfMsgParserImpl< tf::tfMessage > TfMsgParser
bool remove_suffix_from_strings
std::vector< std::pair< StringTreeLeaf, Variant > > value
void applyNameTransform(const std::string &msg_identifier, const FlatMessage &container, RenamedValues *renamed_value, bool dont_add_topicname=false)
applyNameTransform is used to create a vector of type RenamedValues from the vector FlatMessage::valu...
bool ParseDouble(const std::string &str, double &value, bool remover_suffix, bool parse_boolean)
RosIntrospection::FlatMessage _flat_msg
void pushBack(const Point &p) override
const TreeNode * parent() const
TfMsgParserImpl< tf2_msgs::TFMessage > Tf2MsgParser
const uint8_t * data() const
bool deserializeIntoFlatContainer(const std::string &msg_identifier, Span< uint8_t > buffer, FlatMessage *flat_container_output, const uint32_t max_array_size) const
deserializeIntoFlatContainer takes a raw buffer of memory and extract information from it...