ANYbotics / rqt_multiplot_plugin

An rqt plugin for visualizing numeric values in multiple 2D plots.
GNU Lesser General Public License v3.0
125 stars 41 forks source link

CurveDataSequence::processMessage: Catch variant_topic_tools exception #43

Closed wxmerkt closed 3 years ago

wxmerkt commented 4 years ago

This commit catches an exception of type 'variant_topic_tools::NoSuchMemberException' which previously caused a program crash. These exceptions can get thrown for instance if a message does not contain the selected field. Instead, a single warning will be printed to the console.

Background: I am using a config file for multiple setups - in some cases certain messages are not published. Thus, while other messages could be plotted one might not be. This currently terminates by throwing with:

terminate called after throwing an instance of 'variant_topic_tools::NoSuchMemberException'
  what():  Member with index [0] does not exist

Would it be okay to catch and either warn or catch and ignore? Would you prefer an alternate approach?

samuelba commented 3 years ago

Thank you for this PR. I will test it and then we can merge it.

samuelba commented 3 years ago

Hi @wxmerkt thank you very much for your contribution. Your changes are merged here 479a4973840ad5a596ac3ea78eb04995dc65c4de. But unfortunately, something went wrong importing/merging it in our internal repository and exporting it again to Github. Therefore, you are not mentioned as the author. I apologize for this.

wxmerkt commented 3 years ago

Thanks @samuelba for reviewing and merging :)