Mostly, we want to add a initial covariance to the problem. To do this, there is the CaptureFix (we can change its name), adding it to the first frame and processing it, it creates a constraintFix.
But the ProcessorMotion::setOrigin(vectorXs state, ts) creates a key frame that should be the first, also. Maybe it should accept a frame instead of a ts...?
Designs
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related.
Learn more.
I added a ProcessorMotion::setOrigin(FrameBase*, ts) to be used in case the first keyframe is already created before the processor motion initialization.
However, it is still undefined the wolf problem initialization procedure, so I leave this issue opened...
I think we should only provide one function call for initialization, in Problem. the rest should be automatic. Can you come up with an API proposition that makes sense from the user point of view? Please consider #58 (closed)
I think that the first frame is more an input parameter in the problem constructor (with the option to provide an initial covariance too) and the processorMotion should take it as origin when it is added (or setted or installed... XD)
I think both should be done in the installation process...
Other alternative is doing A and B.1 in something like:
Problem::initialize(_init_pose,_init_covariance)
But it should be called after the installation of the motion sensor.
So to be sure, do you mean that you would discard the alternative of setting the origin in the problem constructor?
Then, in the installProcessor there should be a Problem::setProcessorMotion(_processor_motion_ptr) call. I see two problems:
Is there a way to use polymorphism to force that processor motion installers should call Problem::setProcessorMotion(this)?
Dealing with more than one processor motion: The processor motion installer should accept somehow specifying if the Problem::setProcessorMotion(this) should be called.
The one processor motion needs to be known by problem, and it's one of the parameters of the configurations. I think specifying the origin means:
set mean and cov
set which is the processor motion
and that this should be done only once, for example in problem:
problem.setOrigin(mean, cov)
problem.setProcessorMotion("Processor Name")
but, again I did not think about it enough...
Then, if later, you install sensors and processors, things should get configured automatically.
And also it you installed them previously. There must be a system to ensure that everything ends up OK no matter the order of the configuration.
My point is that if the origin is setted in the problem constructor, then we force the order (we can't install anything in a problem that is not created yet).
However, I'm not sure if always in the constructor call time, the final user will always know the origin..
Let's do it separately. I'll figure out if the order is really an issue.
I think we can avoid your 3rd point if when installing the processor motion, setProcessorMotion is automatically done. We can specify that, for instance, the first processor motion installed is the main one.
In my opinion, this issue is important since it defines how Wolf should be set up by the external users. I added in the milestone of the first private release.
I agree it is important. However, the discussion above is 3 years old. Is it still relevant? I mean, do we need to consider the discussion above to go for a better design, or do we have newer/different considerations or needs?
prior/state a vector (not required in mode nothing).
prior/time_tolerance (not required in mode nothing).
prior/covariance a covariance matrix (only required in mode factor).
Implementation
About the TimeStamp and the creation of this KF:
New struct in Problem containing all the previous information.
New function Problem::isPriorCreated() returning false if not created or nothing prior mode.
New function Problem::emplacePriorKeyFrame(TimeStamp) that emplaces the KF with the stored information and calls Problem::keyFrameCallback(KF,nullptr).
In ProcessorBase::captureCallback(capture), before anything else:
if (!getProblem()->isPriorCreated()) getProblem()->emplacePriorKeyFrame(capture->getTimeStamp())
Open issues:
setOrigin() functions, most of them to be removed or made private.
Check that processors work ok geting the origin via keyFrameCallback(), IMPORTANT: this implementation ensures that before any processCapture(), keyFrameCallback() will be called before (either calling storeKF() or processKF() or both).