Gazebo | Ignition | Community
Ask Your Question
0

Is there any sleep function in gazebo ?

asked 2020-09-14 10:51:04 -0500

dragobette gravatar image

I want to set an angular velocity for a model and then sleep for X seconds. Is this possible only using gazebo? Could you please give me a solution ? (for a sleep / delay function in gazebo, not for the example given earlier).

edit retag flag offensive close merge delete

Comments

When you say sleep, do you mean that simulation should pause for a while, or your plugin should stop sending commands for a while?

chapulina gravatar imagechapulina ( 2020-09-14 15:29:50 -0500 )edit

I would like my plugin to stop sending commands for a while. Thanks for the question.

dragobette gravatar imagedragobette ( 2020-09-15 08:49:31 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-02-20 06:55:41 -0500

Gavriel-CTO gravatar image

This is late but for anyone searching:

gazebo::common::Time::MSleep(unsigned int miliseconds);

However, this seems to have a limit (anyone with an insight??) so if you need anything > 1 second, do a for loop like:

for(int i = 0; i < 1000; ++i) gazebo::common::Time::MSleep(unsigned int seconds);

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-09-14 10:51:04 -0500

Seen: 204 times

Last updated: Feb 20 '23