Lift Controller Plugin
I created a model of a Fork-Lifter. The Chassis and the forks are separated links, connected with a prismatic joint. This joint is controlled by a plug-in that handles the fork height.
When I'm spawning the model, sometimes I have the issue that the fork is spawned a few meters away from the chassis. When I'm excluding the fork lift plug-in it seems stable.
Another issue is that sometimes when I'm spawning the model, it seems that it gets a force kick and than it flies away. I already adjusted the inertia, but it doesn't helped. The reproductivity of both errors are quite strange, sometimes it works, sometimes the forks are displaced and sometime the whole model flies away.
Can someone have a look on my model.sdf and the lift/fork control plug-in? I'm really running out of ideas where the error could be.
The solution for me was to use SetForce() instead of using the model SetJointPosition() method. I followed the ElevatorPlugin example and implemented it like that:
this->liftPID.Init(1600, 0, 1600); double error = this->liftJoint->GetAngle(2).Radian() - (setpoint_height); double force = this->liftPID.Update(error, _info.simTime - this->prevSimTime); this->prevSimTime = _info.simTime; this->liftJoint->SetForce(0, force);
Also an approach over a JointController and setting up a pid over SetPositionPID() was avoiding my problem. But now I'm encountering another one, when I'm trying to lift something with the fork, a pallet or a box, its either flying away or the vehicle starts to shake.... I updated already my model added the same parameters like in the elevator example for the lift joint, but no success.
Thanks a lot, Rob