Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maps for parameters instead of explicit parsing by calibration_job_definition #40

Open
drchrislewis opened this issue Oct 8, 2014 · 0 comments

Comments

@drchrislewis
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant