Moving ground body in runtime

Hello,
i make game about locomotive. I created ground box and small polygones, they are coals, i need move up and down my ground box with some frequency which a calculate with cos. But when i change Y axe value some coals falls some stay in their places so it seems to that physics goes crazy.
this is my code:
// locomotive shaking
teVector3df locomotivePosition = locomotive->GetPosition();
teVector3df stockerPosition = stoker->GetPosition();
b2Vec2 groundBoxPosition = groundBody->GetPosition();
float angSpeedShaking = (V_current-1) / 2 * tePi * 15.f;
angShaking = angShaking + angSpeedShaking * dt;
float amplitude = V_current * 2.f * teCos(angShaking * teDegToRad) * dt;
locomotivePosition.Y = LOCOMOTIVE_Y_POSITION + amplitude;
stockerPosition.Y = STOCKER_Y_POSITION + amplitude;
groundBoxPosition.y = groundBody_y_position + amplitude;

groundBody->SetTransform(groundBoxPosition, 0.f);

stoker->SetPosition(stockerPosition);
locomotive->SetPosition(locomotivePosition);
printf ("amplituda = %0.3f\n", groundBody_y_position);

I use some engine developed in my company so there is a mix of code.
Try making the ground body a kinetic body (not dynamic or static), which will make it unmovable by collisions and gravity but be able to move by using the SetLinearVelocity and SetAngularVelocity functions.
Thanks for advise but result still the same 😢
It works! I'm sorry i forgot to apply linear velocity... i'm stoping a bit ))
I think jayther is right. Could you show us the new code?
If the floor is made from an edge fixture, maybe it would be better as a polygon.
Yes it consists of edges but i to be halls inside this ground body so i cant use polygone and it already works fine but still thanks for the help may be i'll use your advices in next tasks, and i have one more question for guru of box2d how i can avoid of tunel affect? My coals go threw the edges of ground body they don't have big speed but sizes are less then 0.3m is there some decision?

Original thread: https://box2d.org/forum/viewtopic.php?t=8349