Goodmorning Dario,
I'm answering this with so much delay because of job. Anyway: I've given a look at the example you've pointed me out and it seems to me that I've done all things correctly, so I'll paste some code:
// Creating the system
ChSystemNSC phSys;
phSys.SetCollisionSystemType(ChCollisionSystem::Type::BULLET);
phSys.Set_G_acc(ChVector<>(0.0, 0.0, 0.0));
auto mat = chrono_types::make_shared<ChMaterialSurfaceNSC>();
auto ground = chrono_types::make_shared<ChBodyEasyBox>(10.0, 3.0, 10.0, 100.0, mat);
ground->SetBodyFixed(true);
ground->SetPos(Vector(0.0, -1.50, 0.0));
if (auto vs = ground->GetVisualShape(0u); vs.get() != nullptr)
ground->GetVisualShape(0)->SetColor(ChColor(0.2f, 0.3f, 0.6f));
phSys.AddBody(ground); auto pareteCls = std::make_shared<chrono::ChBodyEasyBox>(4, 2.7, 0.5, 1000, true, false, mat);
phSys.AddBody(pareteCls);
pareteCls->SetName("PareteCls");
pareteCls->SetPos(Vector(2, 2.7 / 2.0, 0.25));
auto rotation = chrono_types::make_shared<ChLinkMotorRotationSpeed>();
rotation->Initialize(ground, pareteCls, ChFrame<>(Vector(0.0, 0.0, 0.0), Q_from_Euler123(chrono::Vector(0.0, CH_C_PI_2, 0.0))));
rotation->SetSpeedFunction(chrono_types::make_shared<ChFunction_Const>(CH_C_PI));
phSys.AddLink(rotazione);
// Irrlicht stuff...
while (vis->Run()) {
// Irrlicht stuff...
phSys.DoStepDynamics(time_step);
realtime_timer.Spin(time_step); }
Again: the rotation axis seems right, but after some simulation time this is the situation:
![rotating.png]()
Any hint?