From e659ad0deb264135fd2117aa39c8df227237bbf0 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Mon, 22 Apr 2024 13:46:19 -0400 Subject: [PATCH] Added support for empty messages (#960) * Added support for empty messages * Format --- plotjuggler_plugins/PluginsZcm/dataload_zcm.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plotjuggler_plugins/PluginsZcm/dataload_zcm.cpp b/plotjuggler_plugins/PluginsZcm/dataload_zcm.cpp index 8abaa9d63..9cfd44342 100644 --- a/plotjuggler_plugins/PluginsZcm/dataload_zcm.cpp +++ b/plotjuggler_plugins/PluginsZcm/dataload_zcm.cpp @@ -275,6 +275,15 @@ bool DataLoadZcm::readDataFromFile(FileLoadInfo* info, PlotDataMapRef& plot_data return; } + if (evt->datalen == 0) + { + auto itr = plot_data.numeric.find(evt->channel); + if (itr == plot_data.numeric.end()) + itr = plot_data.addNumeric(evt->channel); + itr->second.pushBack({ (double)evt->timestamp / 1e6, 0 }); + return; + } + zcm::Introspection::processEncodedType(evt->channel, evt->data, evt->datalen, "/", types, processData, &usr); for (auto& n : usr.numerics)