0
$\begingroup$

Gazebo Answers logo

I write a model plugin for my soccer-playing robot. I can successful spawn it into my simulation world. However, when I delete this model, the model is removed from the world, but then Gazebo does not respond anymore. I click everywhere and nothing happens. So I have to Ctrl-C in the terminal and it throws out a message like this:

[gazebo-2] killing on exit
gzclient: /usr/include/boost/smart_ptr/shared_ptr.hpp:653: typename boost::detail::sp_member_access<T>::type boost::shared_ptr<T>::operator->() const [with T = gazebo::msgs::Response; typename boost::detail::sp_member_access<T>::type = gazebo::msgs::Response*]: Assertion `px != 0' failed.
[gazebo_gui-3] escalating to SIGTERM
[gazebo-2] escalating to SIGTERM
[rosout-1] killing on exit
[master] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
done

I am using Gazebo 7 with gazebo_ros_pkgs. Indeed I use ROS in my model plugin. But does it matter?

Any suggestions would be greatly appreciated!

EDIT: I need the answer to this question eagerly. So please anyone give me some advice.


Originally posted by winston on Gazebo Answers with karma: 449 on 2016-08-05

Post score: 1


Original comments

Comment by chapulina on 2016-08-07:
I would try to isolate the problem a bit more, at this point the description is too general. Try launching Gazebo with and without ROS, try deleting the model with and without the plugin, remove parts of the model...

Comment by winston on 2016-08-14:
Without the plugin, the deletion of the models is successful. I think the problem is in ROS but I don't know which part.

$\endgroup$

1 Answer 1

0
$\begingroup$

Gazebo Answers logo

I found out the answer now. The problem is in the destrctor. I should shutdown the ROS node before the thread terminates. Otherwise, the message and service threads would never terminate since its termination signal is when ros::ok() fails. Therefore, the solution is quite simple, put rosnode_->shutdown() before threads join() function are called.


Originally posted by winston with karma: 449 on 2016-08-16

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by wicked88 on 2016-08-16:
winston, seems you are from nubot ! Im from MinhoTeam (Portugal). It seems that we are making the same thing, a simulator for our teams ! We can share stuff, please contact me @ [email protected] !

Comment by winston on 2016-08-17:
Nice to meet you. I will contact you.

$\endgroup$

Your Answer

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