Gazebo | Ignition | Community
Ask Your Question
0

Perform one simulation step

asked 2015-12-07 06:56:03 -0500

Georacer gravatar image

Hello everyone!

I'm want to interface ROS and Gazebo to perform a robot control task.

However, I want to have full control of the simulation evolution, by arbitrating the simulation steps. To be more specific, I publish a simulation clock in ROS and then: I want to tell Gazebo to execute the next simulation step, gather data, perform calculations over them and publish control outputs for the next simulation steps. Afterwards, run the next simulation step and start over.

I found this question, but it is outdated and with broken links.

Is there anything more recent on this topic?

Thanks, George

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2015-12-07 09:39:40 -0500

AndreiHaidu gravatar image

Hi there,

as @scpeters mentioned in the other question you could publish gazebo world_control messages on the ~/world_control topic. You start the simulation paused and you send a message with step = true to step once in the simulation.

Cheers, Andrei

edit flag offensive delete link more
0

answered 2015-12-07 10:33:54 -0500

Georacer gravatar image

@AdreiHaidu

(Posting a separate answer because of space restrictions)

I am using ROS Indigo. I have done sudo apt-get install ros-indigo-gazebo-ros-pkgs.

I can successfully launch Gazebo with roscore && rosrun gazebo_ros gazebo.

A rostopic list returns (as expected from here)

george@csl-laptop:~$ rostopic list
/clock
/gazebo/link_states
/gazebo/model_states
/gazebo/parameter_descriptions
/gazebo/parameter_updates
/gazebo/set_link_state
/gazebo/set_model_state
/rosout
/rosout_agg

Moreover, the available gazeoo ros msgs are only:

george@csl-laptop:~$ rosmsg show gazebo_msgs/
gazebo_msgs/ContactsState       gazebo_msgs/LinkState           gazebo_msgs/ModelState          gazebo_msgs/ODEJointProperties  gazebo_msgs/WorldState          
gazebo_msgs/ContactState        gazebo_msgs/LinkStates          gazebo_msgs/ModelStates         gazebo_msgs/ODEPhysics

It seems to me that the world_control message is no longer supported. Am I looking in the wrong place?

edit flag offensive delete link more

Comments

1

Hi, (you can edit your first answer when you need to add extra information), the topic you are looking for is a gazebo topic, they work pretty similarly to ros topics. So try the command ` gz topic -l ` to view the topics. To test the sent messages you can `echo` the topic and then pause/play/step into the simulation from the GUI to see the relevant messages.

AndreiHaidu gravatar imageAndreiHaidu ( 2015-12-07 13:29:57 -0500 )edit

I hadn't realized that Gazebo has its own set of topics, subscribers and publishers. Thanks!

Georacer gravatar imageGeoracer ( 2015-12-07 14:17:20 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2015-12-07 06:56:03 -0500

Seen: 2,291 times

Last updated: Dec 07 '15