Position Publishers and Subscribers

asked 2019-06-28 14:37:14 -0500

Queltron gravatar image


I'm currently using distribution Kinetic and I'm working on making a position publisher and subscriber for two turtlesim bots.

I've read the basic tutorials and found a few that are in the ballpark of what I am trying to do. One publisher than directs a turtle to move randomly and another tutorial that allows turtle2 to follow turtle1.

What I'm trying to do is have turtle1 move at random, then when it crosses a certain (x,y) position turtle2 will move to that position.

So I need a position publisher for turtle1 and a position subscriber for turtle2.

The tutorial on publishers and subscribers is "light" and doesn't go far enough.

Any help pointing me in the write direction would be appreciated.

edit retag flag offensive close merge delete


Just to clarify, what are you trying to publish. Are you trying to send goal actions to move the turtle bots to specific locations or are you trying to publish cmd_vel messages to control the velocity the turtles move at?

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2019-06-29 12:48:55 -0500 )edit

I have a publisher that publishes the x and y coordinates. I want turtle2 to go to those coord once turtle1 comes across that location. I'm trying to write a subscriber that will take the published x and y coordinates and make turtle2 move to that location.

Hope that helps, thanks for the reply!

Queltron gravatar image Queltron  ( 2019-06-29 15:30:31 -0500 )edit

Did you figure this out, and if yes, could you add what you feel is missing from the tutorial?

fvd gravatar image fvd  ( 2020-03-02 04:34:14 -0500 )edit