Factories
Created by: joansola
Hello. Factories for the following objects are ready and working in branch 'master':
SensorXxx
ProcessorXxx
IntrinsicsXxx
ProcessorParamsXxx
It is now interesting that you take your objects and make them factory-enabled. Basically, using these factories serves to create these objects easily from information provided either from text, or from configuration files. This is useful in the main()
functions of our applications, or in the ROS nodes.
It is therefore convenient that you upgrade your main() and ROS nodes to make use of this functionality.
Please look at test_yaml.cpp
, test_wolf_factories.cpp
, and test_image.cpp
for examples of use. In particular, look at the way to add sensors and processors to Problem
:
Problem::installSensor()
Problem::installProcessor()
Please read the documentation in sensor_factory.h
for a thorough explanation of the use of the factories. In particular, you need to ensure that:
- You create methods
SensorXxx::create(...)
andProcessorXxx::create(...)
to create sensors and processors from the factory. Look atSensorCamera
andProcessorImage
for complete examples. - Register these methods to the factory. Look at
sensor_camera.cpp
for an example of a registration instruction. - You create methods
createIntrinsicsXxx(...)
andcreateProcessorParamsXxxx(...)
to create parameters for your objects from YAML or XML files. Look atyaml/sensor_camera_yaml.cpp
for en example. Look also atyaml/processor_image_yaml.cpp
. - You register these methods into the factories. See
.cpp
files in the directoryyaml/