Rosanswers logo

Hello! i am using ros electric and i would like to use the navigation and visualization toolbox to implement the autonomous navigation for the turtlebot. In particular i want to reach some preset goals without the click of the mouse on the map in rviz. is it possible to modify directly the visualization stack of ROS? which are the files that rviz uses when i click on the "2d nav goal" and "2d pose estimate" buttons?

Originally posted by Yuri on ROS Answers with karma: 42 on 2012-10-08

Post score: 0


1 Answer 1


Rosanswers logo

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:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.