Skip to content

Commit

Permalink
Added support for empty messages (#960)
Browse files Browse the repository at this point in the history
* Added support for empty messages

* Format
  • Loading branch information
jbendes authored Apr 22, 2024
1 parent e4f678b commit e659ad0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions plotjuggler_plugins/PluginsZcm/dataload_zcm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e659ad0

Please sign in to comment.