Home | Tutorials | Wiki | Issues
Ask Your Question
1

Publishing to a Gazebo Topic by Terminal

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

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
2

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

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

Comments

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 -0600 )edit
iche033 gravatar imageiche033 ( 2017-08-16 11:48:44 -0600 )edit

This link is broken =/

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

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

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

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

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

2 followers

Stats

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

Seen: 248 times

Last updated: Oct 13