Note: This tutorial assumes that you have completed the previous tutorials: Using rxconsole and roslaunch.

Using rosed to edit files in ROS

Description: This tutorial shows how to use rosed to make editing easier.

Tutorial Level: BEGINNER

Next Tutorial: Creating a Msg and Srv

Contents

  1. Using rosed

Using rosed

rosed is part of the rosbash suite. It allows you to directly edit a file within a package by using the package name rather than having to type the entire path to the package.

Usage:

$ rosed [package_name] [filename]

Example:

$ rosed roscpp ros.h

This example demonstrates how you would edit the ros.h file within the roscpp package.

If the filename is not uniquely defined within the package, a menu will prompt you to choose which of the possible files you want to edit.

The default editor for rosed is vim. To set the default editor to something else edit your ~/.bashrc file to include:

export EDITOR='emacs -nw'

This example makes emacs the default editor.

NOTE: changes in .bashrc will only take effect for new terminals. Terminals that are already open will not see the new environmental variable.

Open a new terminal and see if EDITOR is defined:

$ echo $EDITOR
  • emacs -nw

Now that you have successfully configured and used rosed, let's create a Msg and Srv.

Wiki: ROS/Tutorials/UsingRosEd (last edited 2011-06-02 21:38:06 by MeloneeWise)