Home | Tutorials | Wiki | Issues
Ask Your Question

Publishing to a Gazebo Topic by Terminal

asked 2017-08-11 22:08:46 -0500

ItzMeJP gravatar image

Can I pub a test message to a specific Gazebo topic using a terminal line command?

I am looking for something like the command rostopic pub for ROS, but for Gazebo.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2017-08-14 19:26:47 -0500

iche033 gravatar image

there is a command line tool but it's not exactly the same as rostopic pub. You can send commands like modifying model/camera/joint properties, etc but you can't publish commands to arbitrary gazebo topics.

type gz help for more info

edit flag offensive delete link more


I already did it and no options help me. Is there any code example (in C++) of a simple publish (to a exist random topic) for gazebo?

ItzMeJP gravatar imageItzMeJP ( 2017-08-15 16:53:12 -0500 )edit
iche033 gravatar imageiche033 ( 2017-08-16 11:48:44 -0500 )edit

This link is broken =/

ItzMeJP gravatar imageItzMeJP ( 2017-08-16 12:24:10 -0500 )edit

Now it works, thank you. It is what I am looking for.

ItzMeJP gravatar imageItzMeJP ( 2017-08-16 13:19:22 -0500 )edit

answered 2017-10-13 09:32:52 -0500

craig gravatar image

gz command can help here. I use it to send joint commands to the pioneer2dx, for example:

gz joint -m pioneer2dx -j left_wheel_hinge --vel-t 1.0 --vel-p 1.0

This will send a joint command to the joint left_wheel_hinge of the model named pioneer2dx. The message is sent as a one-shot so may not do what you want, but it can be useful for testing.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools



Asked: 2017-08-11 22:08:46 -0500

Seen: 171 times

Last updated: Oct 13