[vc_row][vc_column][vc_column_text]
This tutorial shows how to use rosed to make editing easier.[/vc_column_text][vc_tour][vc_tab title=”Using rosed” tab_id=”1394687617-1-49″][vc_column_text]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 Logger.msg
This example demonstrates how you would edit the Logger.msg file within the roscpp package.
If this example doesn’t work is probably because you don’t have the vim editor installed. Please refer to Editor section. If you don’t know how to get out of vim, click here.
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.[/vc_column_text][/vc_tab][vc_tab title=”Using rosed with tab completion” tab_id=”1394687617-2-86″][vc_column_text]This way you can easily see and optionally edit all files from a package without knowing its exact name.
Usage:
$ rosed [package_name] <tab><tab> Example:
$ rosed roscpp <tab><tab>
Empty.srv package.xml GetLoggers.srv roscpp-msg-extras.cmake Logger.msg roscpp-msg-paths.cmake SetLoggerLevel.srv roscpp.cmake genmsg_cpp.py roscppConfig-version.cmake gensrv_cpp.py roscppConfig.cmake msg_gen.py
[/vc_column_text][/vc_tab][vc_tab title=”Editor” tab_id=”1394687746121-2-6″][vc_column_text]The default editor for rosed is vim. The more beginner-friendly editor nano is included with the default Ubuntu install. You can use it by editing your ~/.bashrc file to include:
export EDITOR='nano -w' To set the default editor to <tt>emacs</tt> you can edit your ~/.bashrc file to include:
export EDITOR='emacs -nw'
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 nano -w or emacs -nw
Now that you have successfully configured and used rosed, let’s create a Msg and Srv.
Wiki: ROS/Tutorials/UsingRosEd (2014-03-10 00:53:37由CoryCross编辑)
[/vc_column_text][/vc_tab][/vc_tour][/vc_column][/vc_row]
Leave a Reply
You must be logged in to post a comment.