Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

peek - Finding location of models after specified time

I want to find the estimated position of a model after a time X. So, I basically want gazebo to run the simulation for time X and give back the ModelState after it runs it for time X.

I am currently using the ROS Service /gazebo/get_model_state and /gazebo/pause_physics with /gazebo/unpause_physics to:

unpause -> wait for time X -> pause -> query model state

But this is giving inaccurate results. I guess because the "wait for time X" is bad. I need it to give the same positions repeatably.

How do I do something like what I want ?

click to hide/show revision 2
added a brief algo to describe the chain of command

peek - Finding location of models after specified time

I want to find the estimated position of a model after a time X. So, I basically want gazebo to run the simulation for time X and give back the ModelState after it runs it for time X.

I am currently using the ROS Service /gazebo/get_model_state and /gazebo/pause_physics with /gazebo/unpause_physics to:

unpause -> wait for time X -> pause -> query model state

But this is giving inaccurate results. I guess because the "wait for time X" is bad. I need it to give the same positions repeatably.

How do I do something like what I want ?

EDIT: This is the algorithm I wish to run:

  1. Launch file is run, Node1 and gazebo started. Gazebo is paused initially.
  2. Node1 sets some motor velocities
  3. Gazebo is unpaused. As soon as 1 sec passes in simulation time, gazebo pauses and give back the state of the model
  4. Node1 finds the new motor velocities to set, and it publishes that.
  5. Goto step 3