Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Guideline to implement own sensor plugins: Usage of Message Passing or Inheritance?

Hi guys,

as far as i've understood there are two possibilities to implement an own sensor plugin: Using message passing or inheritance concepts, e.g. as described here for a ModelPlugin.

So, for example, for implementing an own Ray sensor plugin, i could follow one of the following approaches:

  • Message Passing: I could also instantiate a transport node in order to subscribe to the published message of the super class.
  • Inheritance: Create a method MySensorPlugin::OnNewLaserScan(), which implements the virtual function RayPlugin::OnNewLaserScan() and therefore is called every time a new laser scan is measured, since it has been registered as a callback somewhere in the RayPlugin.

So my question is now, what is the appropriate way of handling this issue? What is the expected way of implementing an own sensor plugin?

With best regards and thanks in advance!