industrial_calibration icon indicating copy to clipboard operation
industrial_calibration copied to clipboard

Maps for parameters instead of explicit parsing by calibration_job_definition

Open drchrislewis opened this issue 10 years ago • 0 comments

There are four different objects whose parameters are parsed explicitly by the calibration job definition. Because of this, should a developer decide to add a new object of any of these types, they must also add the parsing of any particular parameters to the calibraiton_job_definition's parser.

It makes more sense to have the parsing of object parameters be performed by each object. The three objects which should have this change are:

  1. Camera defined in camera.h
  2. Target defined in target.h
  3. TransformInterface defined in transform_interface.hpp
  4. Trigger defined in trigger.h

Ideally, these classes will have minimal constructors and a virtual member function called either init() or parse_parameters() which will initialize all necessary member values using the yaml node.

In this way calibration_job_definition.cpp could simply instantiate the correct object type, and then call its parser/init function. This still does not eliminate the need to add code to calibration_job_definition to instantiate a new object when one is created. I see no way around this except to create plugins for each of these object types. However it does clean up the higher level parser and pushes the responsibility of parsing particular parameters to the object that needs them.

drchrislewis avatar Oct 08 '14 13:10 drchrislewis