0
$\begingroup$

Gazebo Answers logo

Hi,

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.

[UPDATE]:

model.sdf

lift_ctrl.cpp

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


Originally posted by TwoBid on Gazebo Answers with karma: 35 on 2016-09-20

Post score: 1


Original comments

Comment by chapulina on 2016-09-20:
What's the gazebo version you're using?

Comment by wicked88 on 2016-09-20:
That happens to me also, when using factory message to spawn a model, one part of the model goes to the correct place, the other goes to a completly different position ... Gazebo is very buggy sometimes, it doesnt handle model spawn/delete on the fly very well, at least for me tho

Comment by TwoBid on 2016-09-21:
I'm using 7.3.1

Comment by TwoBid on 2016-09-21:
So i narrowed it down to the lift control plugin. I changed the initial fork height from 0.163 to 0. I actually assumed that the method SetJointPosition is not influencing the physics engine, but it doesn't help anyway. I also changed the order of the subscriber init and the update events init and now its done at the end of the load method. But still 1 of 4 times the fork is displaced.

Comment by wicked88 on 2016-09-21:
May be, we (you and i) should use boost::mutex * GetSetWorldPoseMutex () const before making any changes to a model ... In my plugin i also dynamically change the sdf of the robot and odd behaviours occur.

Comment by TwoBid on 2016-09-27:
So i played around a little and in my case the following line is causing the problem: this->model->SetJointPosition(lift_joint->GetScopedName(), this->lift_height);

Comment by Peter Mitrano on 2016-09-29:
I don't think setJointPosition does a teleportation like you expect. The easy solution is to send a JointCmd message, which uses PID to control joint position

$\endgroup$

1 Answer 1

0
$\begingroup$

Gazebo Answers logo

As you discovered, SetJointPosition doesn't do the kind of pretty teleportation you wanted. I'll offer another way to do PID however, which is to publish a msgs::JointCmd to the right topic. This is often cleaner in your code than using a PID object and such. It's the same interface the joint panel in gazebo uses.


Originally posted by Peter Mitrano with karma: 768 on 2016-09-30

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.