Skip to content

Add motion replay controller component to the INFINYTOOLKIT#41

Open
rmolazem wants to merge 11 commits intoInfinyTech3D:mainfrom
rmolazem:add_motion_replay
Open

Add motion replay controller component to the INFINYTOOLKIT#41
rmolazem wants to merge 11 commits intoInfinyTech3D:mainfrom
rmolazem:add_motion_replay

Conversation

@rmolazem
Copy link

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.

infinyToolkit_linking_Error

P.S. I have updated SOFA from the master branch.


****************************************************************************/
#pragma once

#include <InfinyToolkit/MotionReplayController/MotionReplayController.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#include <InfinyToolkit/MotionReplayController/MotionReplayController.h>
#include <InfinyToolkit/MotionReplayController/MotionReplayController.h>
#include <sofa/component/controller/MechanicalStateController.inl>

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@rmolazem rmolazem closed this Feb 11, 2026
@epernod
Copy link
Contributor

epernod commented Feb 11, 2026

I guess the closing is a wrong manipulation?

@rmolazem
Copy link
Author

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.
I am going to test the component today with an example scene, then push the final version. I can either re-open this or make a new PR, as you wish.

@epernod
Copy link
Contributor

epernod commented Feb 12, 2026

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
And at the end we squash and merge the PR, so after the merge only 1 commit will be visible in the history even if the PR was done with 10 commits

@rmolazem rmolazem reopened this Feb 12, 2026
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

Successfully merging this pull request may close these issues.

2 participants