Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin removal causes crash of Gazebo #58

Closed
traversaro opened this issue Feb 13, 2014 · 9 comments
Closed

Plugin removal causes crash of Gazebo #58

traversaro opened this issue Feb 13, 2014 · 9 comments

Comments

@traversaro
Copy link
Member

Removing a model using gazebo_yarp_controlboard, gazebo_yarp_imu or gazebo_yarp_forcetorque using the GUI frequently (always?) causes the crash of Gazebo.
I don't have a clear idea of where the bug is, but I presume this can be solved by appropriately handling the removal event in the plugins.

@MirkoFerrati
Copy link
Contributor

I completely agree. Our plugin segfaults when its destructor is called, this is the reason of gazebo crash.
We need to close yarp ports, delete allocated memory and stuff like that!

@traversaro
Copy link
Member Author

We discussed with @francesco-romano , the first things to fix (for all three plugins) are to properly close the yarp driver in the gazebo plugin destructor, and to properly remove the WorldUpdate callback in yarp driver close function.

@traversaro
Copy link
Member Author

Commit cda7722 solves this issue on the normal iCub, but in my case crashes are still constant when removing iCubLegs (just saying to aid the debugging, I don't know if it is reproducible).

@traversaro traversaro added this to the v0.2.0 milestone Feb 14, 2014
@francesco-romano
Copy link
Collaborator

I cleaned the code a bit, but the issue still remains.
Maybe we can try to debug this from within gazebo.

@traversaro
Copy link
Member Author

@francesco-romano the situation is definitely improved now. For a more definite debug in the future we can try to use Gazebo compile in debug mode.

@francesco-romano
Copy link
Collaborator

It seems some issues are caused by ForceTorque plugin...
I don't see its destructor called when the model is removed

EDIT: removing the torque plugin from the sdf file did not solve completely the problem, but it improved the behaviour... @traversaro I will need your help here (and of your gazebo-sources)

@traversaro
Copy link
Member Author

Apparently (one) problem was with gazebo_yarp_forcetorque plugin removal. It is probably a gazebo bug, already reported to upstream :
https://bitbucket.org/osrf/gazebo/issue/1112/joint-destructor-are-never-called-after

@traversaro
Copy link
Member Author

By the way it would be nice for gazebo_yarp_plugins if this bug could be fixed before the release of Gazebo 3.0, so it would be good if we could vote the issue [1] to gain upstream attention. For voting we need a bitbucket account, but if you already have a github account you can log through it.

cc @EnricoMingo @emingo @barbalberto @arocchi @MirkoFerrati @iron76 @alessandrosettimi @DanielePucci @jeljaik

https://bitbucket.org/osrf/gazebo/issue/1112/joint-destructor-are-never-called-after

@traversaro
Copy link
Member Author

Using last version of development branch (after commits fa39668 and eaf14a7) and Gazebo 3.0 (that should be released soon) the bug seems finally to be solved.
If someone is still experiencing similar problems please reopen the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants