Add motion replay controller component to the INFINYTOOLKIT#41
Add motion replay controller component to the INFINYTOOLKIT#41rmolazem wants to merge 11 commits intoInfinyTech3D:mainfrom
Conversation
| ****************************************************************************/ | ||
| #pragma once | ||
|
|
||
| #include <InfinyToolkit/MotionReplayController/MotionReplayController.h> |
There was a problem hiding this comment.
| #include <InfinyToolkit/MotionReplayController/MotionReplayController.h> | |
| #include <InfinyToolkit/MotionReplayController/MotionReplayController.h> | |
| #include <sofa/component/controller/MechanicalStateController.inl> |
There was a problem hiding this comment.
Ay, I had forgotten it. In my mind, I had added to my header.
|
|
||
| template<class DataTypes> | ||
| class MotionReplayController | ||
| : public sofa::component::controller::MechanicalStateController<DataTypes> |
There was a problem hiding this comment.
I would recommend to inherit directly from sofa::component::controller::Controller or BaseController
MechanicalStateController is already a very complexe specialisation of a simple controller and add a lot of unuseful methods in this case
|
I guess the closing is a wrong manipulation? |
|
Since the PR was open, and I made some modifications, including changing the base class. I thought it might be cleaner to open a clean PR. Except if you want to follow the history of the changes. |
|
You can keep the same PR as in any case we only review the change in files which is the final diff between your branch and master: https://github.com/InfinyTech3D/InfinyToolkit/pull/41/changes |
This controller inherits from MechanicalStateController, allowing easy access to the mechanical object’s states after loading all frames at initialization from a CSV file.
The class introduces two new functions:
loadMotion() – Loads all frames from the CSV and stores them in a vector.
handleEvent() – Updates the mechanical object’s positions (grids) according to the loaded frames at each animation step.
However, while compiling SOFA (which includes the infiny toolkit), there is a linking issue: It seems it
cannot inherit from MechanicalStateController and the plugin does not compile. I might have missed some steps to properly register this component inside the InfinyToolkit.
P.S. I have updated SOFA from the master branch.