ROS learning record (a)
ROS set of commands:
- rospack = ros + pack(age)
- roscd = rose + CD
- Rosli = ros + ls
1. rospack
usage:
# rospack find [包名称]
Example:
$ rospack find roscpp
2. Use roscd
usage:
# roscd [本地包名称[/子目录]]
Example:
$ roscd roscpp/cmake
In order to verify that we have to switch to the next roscpp package directory, we can now use the Unix pwd command output to the current working directory:
$ pwd
3.roscd log
Use roscd log ROS can switch to the directory to save the log file. Note that, if you do not have any ROS procedures performed, the system will get an error saying it does not exist.
If you have already run ROS program, you can try:
$ roscd log
4. Use rosls
rosls is part rosbash command set, which allows you to perform the ls command directly on the name of the package rather than an absolute path (directory list).
usage:
# rosls [本地包名称[/子目录]]
Example:
$ rosls roscpp_tutorials
Output should be:
cmake launch package.xml srv
5.Tab autocompletion
Input:
# roscd roscpp_tut<<< 现在请按TAB键 >>>
When press the TAB key, the command line will be automatically added the remainder of:
$ roscd roscpp_tutorials/
This should be useful because roscpp tutorials are currently only one name roscpp tut as the beginning of the ROS package.
Now try to enter:
# roscd tur<<< 现在请按TAB键 >>>
Press the TAB key, the command should automatically replenish complete as possible:
$ roscd turtle
However, in this case there is more than one package begins with turtle, when you press the TAB key again should list all packages beginning with turtle of ROS:
turtle_actionlib/ turtlesim/ turtle_tf/
At this point in the command line you should still see only:
$ roscd turtle
Now enter behind s turtle press TAB:
# roscd turtles<<< 请按TAB键 >>>
Because the name is only one software package begins with turtles, so you should see:
$ roscd turtlesim/