-
Notifications
You must be signed in to change notification settings - Fork 769
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
gazebo_ros: Wait spawning Gazebo Model until ros::Time::now() is not 0. #1024
base: melodic-devel
Are you sure you want to change the base?
gazebo_ros: Wait spawning Gazebo Model until ros::Time::now() is not 0. #1024
Conversation
Why: * Plugin incorrectly sends failure status message. This change addresses the need by: * Looping over ros::Time::now() until non-zero is returned.
@@ -2660,6 +2660,8 @@ bool GazeboRosApiPlugin::spawnAndConform(TiXmlDocument &gazebo_model_xml, const | |||
|
|||
/// \brief poll and wait, verify that the model is spawned within Hardcoded 10 seconds | |||
ros::Duration model_spawn_timeout(10.0); | |||
/// Wait until time can be read. | |||
while (ros::Time::now().is_zero()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If simulation is started paused, this line will hang until simulation starts running. I'm not sure if this is desired.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might make more sense to switch this to be wall time not ROS time. I'm assuming this is resource contention based and not simulation time passing. Then we won't need to worry about whether ROS time is initialized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I understand the comment form @spark4160 it is related to simulation time passing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where would I find the file gazebo_ros_api_plugin?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hichamhendy did you find a solution for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I skipped it!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked the terminal that launched my gazebo world and found the errors that I needed to fix there. So if the URDF file has any issues, it doesn't load and times out.
I encountered this problem while spawning models as gazebo starts using worlds that had the It's not a solution to this issue as the spawn model service should handle this case, but if you're reading this, check the |
This worked for me |
Setting |
Changing |
can u just show where did you set the 'sim_time' .. image of part of the world file |
This was both helpful and inciteful. |
This was helpful. It worked like magic! |
Why:
This change addresses the need by: