For what concerns the core plugin, here are the necessary changes. They concern ProcessorMotion, Problem, all nodes having state blocks, and StateBlock:
ProcessorMotion:
Add a member bool ProcessorMotion::bootstrapping to control the following:
factors added are declared inactive --> probably in Derived::emplaceFactors()
bootstrap() is called
Add virtual void ProcessorMotion::bootstrap() method (virtual or pure virtual, TBD)
wait for the conditions to apply the bootstrap
compute the necessary elements
transform all the nodes in Problem with the new bootsrapped solution
re-activate all factors that were declared inactive
clear the bootstrapping flag
Problem:
Add void Problem::transformAll(VectorComposite("PO")) to transform all wolf tree after bootstrapping
Nodes (maybe in HasStateBlocks):
Add void AllNodes::transform(VectorComposite("PO")) to transform all node's state blocks
StateBlock:
Add void StateBlock::transform(VectorComposite("PO")) = 0 to transform the state block
Add bool StateBlock::transformable to control if transformation should be applied
Derive all state blocks to specific types.
Implement transform in all derived state blocks
9 of 10 checklist items completed
· Edited
Designs
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related.
Learn more.
Joan Solà Ortegamarked the checklist item factors added are declared inactive --> probably in Derived::emplaceFactors() as completed
marked the checklist item factors added are declared inactive --> probably in Derived::emplaceFactors() as completed
Joan Solà Ortegamarked the checklist item Add void Problem::transformAll(VectorComposite("PO")) to transform all wolf tree after bootstrapping as completed
marked the checklist item Add void Problem::transformAll(VectorComposite("PO")) to transform all wolf tree after bootstrapping as completed
Joan Solà Ortegamarked the checklist item Add void AllNodes::transform(VectorComposite("PO")) to transform all node's state blocks as completed
marked the checklist item Add void AllNodes::transform(VectorComposite("PO")) to transform all node's state blocks as completed
Joan Solà Ortegamarked the checklist item Add bool StateBlock::transformable to control if transformation should be applied as completed
marked the checklist item Add bool StateBlock::transformable to control if transformation should be applied as completed
@joanvallve regarding the point: "Derive all state blocks to specific types", we can condensate these "specific types" to some family, e.g.
StateNonTransformable: states that are not transformed, no matter what
StateVector: vectors that transform with a pure rotation
StatePoint: vectors that transform with rotation and translation
StateQuaternion, Angle, Homogeneous: specific types, they exist already
StateBlaBla: any new state block that may appear in the future
Do you see any inconvenient in doing this?
Note: in any case, the property StateBlock::transformable and method StateBlock::isTransformable() exist to block the capacity of transforming the object. So types 1,2,3,4 can be declared non-transformable too.
Possibly, after defining the types above, we can typedef them to more specific types:
typedefStateVectorStateVelocity;typedefStateVectorStateAcceleration;typedefStateVectorStateAngularVelocity;typedefStateVectorStateAngularMomentum;typedefStatePointStatePosition;typedefStatePointStateCoM;// this one is really stupid, but just to illustratetypedefStateNonTransformableStateIntrinsic;typedefStateNonTransformableStateBias;typedefStateNonTransformableStateGains;typedefStateNonTransformableStateDiffDriveModel;// this one is really stupid, but just to illustrate
The thing is: can we pass with only the classes above, eventually separating 2d and 3d? So types Point2d, Vector2d, Point3d, Vector3d, NonTransformable?
Or do we need special types for velocity, acceleration, angular momentum, etc?
About 2d and 3d, I think that having fully defined states is a good idea (otherwise, the required size has to be passed along with the class in the changes I'm implementing in the sensors MR). But this does not mean that we can implement everything in some
About velocity and etc. we can define the transformations in base classes.. (actually, to register a class in the factory, we don't need a class, just register the class with the corresponding string, no?)
This was discussed yesterday: a position is transformable, but a position extrinsic is not. Then, you use a flag to differentiate this. And you put it in the StateBlock because Frames are not derived and therefore they do not know who is transformable and who is not.
NonTransformable inherits from StateBlock. Why do you need to inherit it again? It's just a plain vector with no geometric meaning, so non transformable. for example, biases, or camera intrinsic params
I'm messing up.. this is not related with this issue, but with the experience of the MR I'm working on, I would say that it is a good idea to have state block classes that completely define the state, so having also the size defined.
I mean, otherwise, every time a developer comes with a new meaning for a state, it has to code a new class for that state. We should avoid this by providing standard types that do the job