Skip to content

Commit

Permalink
Added support for empty messages
Browse files Browse the repository at this point in the history
  • Loading branch information
jbendes committed Apr 4, 2024
1 parent 15dce41 commit 365bcab
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions plotjuggler_plugins/PluginsZcm/dataload_zcm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,14 @@ 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)
Expand Down

0 comments on commit 365bcab

Please sign in to comment.