When you click on the buttons 2D Nav Goal and 2D Pose Estimate all the rviz does is the publishing a simple message on the specified topic. By default those topics and messages are:
- geometry_msgs/PoseStamped on the topic /move_base_simple/goal in case of 2D Nav Goal
- geometry_msgs/PoseWithCovarianceStamped on the topic initialpose in case of 2D Pose Estimate
You are free to use any other publisher to send messages to those topics and therefore control the navigation stack either from your own program or from the command line using rostopic pub like:
rostopic pub -1 /move_base_simple/goal geometry_msgs/PoseStamped '{pose: {position: {x: 1.0}}}'
You can see which topics are called with specified button press in the Tools Properties panel window, which is usually localted in the upper right corner of the rviz. You can use this panel as well to change the default values for topics to be called.
Originally posted by Jakub with karma: 1821 on 2012-10-08
This answer was ACCEPTED on the original site
Post score: 3
Original comments
Comment by Lorenz on 2012-10-10:
Just an additional note: in your own programs, you should not publish just simple pose goals on a single topic because you cannot monitor the execution of navigation action that way. Instead, use actionlib. See http://ros.org/wiki/navigation/Tutorials/SendingSimpleGoals
Comment by Yuri on 2012-10-31:
thanks!!