ROS Command Line
ROS Shell Command
a. roscore (Type: Launch Command): - Function: Starts the ROS master, which is the central coordination point for all ROS nodes in a system.
**Example**: Open a terminal and run the following command to start the ROS master.
```
roscore
```
b. rosrun (Type: Launch Command): - Function: Runs a specific node from a ROS package.
**Example**: Suppose you have a package named `my_robot_pkg` and you want to run a node named `controller_node` from it.
```
rosrun my_robot_pkg controller_node
```
c. roslaunch (Type: Launch Command): - Function: Launches complex ROS systems composed of multiple nodes and configuration files.
**Example**: If you have a launch file named `my_robot.launch` that launches several nodes for a robot simulation:
```
roslaunch my_robot_pkg my_robot.launch
```
d. rostopic (Type: Information Command): - Function: Provides information about ROS topics.
**Example**: To list all available topics:
```
rostopic list
```
e. rosservice (Type: Information Command): - Function: Gives information about ROS services.
**Example**: To list all available services:
```
rosservice list
```
f. rosparam (Type: Configuration Command): - Function: Manages parameters on the ROS parameter server.
**Example**: To set a parameter named `max_speed` to a value of `5.0`:
```
rosparam set max_speed 5.0
```
g. rosbag (Type: Data Recording and Playback Command): - Function: Records and plays back ROS topic data.
**Example**: To record data from specific topics into a bag file named `data.bag`:
```
rosbag record -O data.bag /topic1 /topic2
```
h. roscd (Type: File and Directory Navigation Command): - Function: Changes the current working directory to the package or stack directory of a specified ROS package or stack.
**Example**: Change the working directory to the 'my_robot_pkg' package
```
roscd my_robot_pkg
```
i. rosls (Type: File Listing Command): - Function: Lists the contents of a ROS package or stack.
**Example**: List the contents of the 'my_robot_pkg' package
```
rosls my_robot_pkg
```
j. rosed (Type: File Editing Command): - Function: Edits a file within a ROS package using the user’s default editor.
**Example**: Edit the 'config.yaml' file in the 'my_robot_pkg' package
```
rosed my_robot_pkg config.yaml
```
k. roscp (Type: File Copying Command): - Function: Copies files from a ROS package or stack to a specified destination.
**Example**: Copy 'config.yaml' from 'my_robot_pkg' to the '/path/to/destination' directory
```
roscp my_robot_pkg config.yaml /path/to/destination
```
l. rospd (Type: Stack and Package Directory Navigation Command): - Function: Changes the current working directory to the directory containing a specified ROS package or stack.
**Example**: Change the working directory to the directory containing 'my_robot_pkg'
```
rospd my_robot_pkg
```
m. rosd (Type: Directory Stack Navigation Command): - Function: Changes the current working directory to the top of the ROS directory stack.
**Example**: Change the working directory to the top of the ROS directory stack
```
rosd
```
n. rosclean (Type: Cleanup Command): - Function: Cleans up various ROS-related directories, logs, and temporary files.
**Example**: Clean up ROS-related directories and logs
```
rosclean
```
o. rosnode (Type: Node Information Command): - Function: Provides information about ROS nodes, including listing active nodes and getting information about a specific node.
**Example**: To list all active nodes in the ROS system
```
rosnode list
```
p. rosmsg (Type: Message Inspection Command): - Function: Provides information about ROS message types.
**Example**: To display the fields of a specific message type (e.g., std_msgs/String)
```
rosmsg show std_msgs/String
```
q. rossrv (Type: Service Inspection Command): - Function: Provides information about ROS service types.
**Example**: To display the request and response message types of a specific service type
```
rossrv show my_robot_pkg/MoveService
```
r. rosversion (Type: ROS Version Command): - Function: Prints the installed version of ROS.
**Example**: To display the installed ROS version
```
rosversion
```
s. roswtf (Type: ROS “What the F***” Command): - Function: Checks the ROS system for potential issues and provides diagnostic information.
**Example**: To check the ROS system for potential issues
```
roswtf
```
t. rospack (Type: Package Information Command): - Function: Provides information about ROS packages.
**Example**: To display the package path of a specific package (e.g., my_robot_pkg)
```
rospack find my_robot_pkg
```
u. rosinstall (Type: Installation Command): - Function: Installs ROS packages and their dependencies from a ROS installation source.
**Example**: To install a specific ROS package (e.g., navigation)
```
rosinstall ~/ros_workspace https://github.com/ros-planning/navigation.git
```
v. rosdep (Type: Dependency Management Command): - Function: Installs system dependencies required by ROS packages.
**Example**: To install system dependencies for a specific ROS package (e.g., my_robot_pkg)
```
rosdep install --from-paths src --ignore-src -r -y
```
w. roslocate (Type: Package Location Command): - Function: Locates ROS packages and provides information about their source repositories.
**Example**: To locate the source repository of a specific ROS package (e.g., geometry_msgs)
```
roslocate info geometry_msgs
```
x. roscreate-pkg (Type: Package Creation Command): - Function: Creates a new ROS package with the specified dependencies and directory structure.
**Example**: To create a new ROS package named my_new_pkg with dependencies on rospy and std_msgs
```
roscreate-pkg my_new_pkg rospy std_msgs
```
y. rosmake (Type: Package Building Command): - Function: Builds a ROS package.
**Example**: To build a specific ROS package (e.g., my_robot_pkg)
```
rosmake my_robot_pkg
```
z. catkin_create_pkg (Type: Catkin Package Creation Command): - Function: Creates a new catkin-based ROS package.
**Example**: To create a new catkin-based ROS package named my_catkin_pkg with dependencies on rospy and std_msgs
```
catkin_create_pkg my_catkin_pkg rospy std_msgs
```
aa. catkin_make (Type: Catkin Package Building Command): - Function: Builds catkin-based ROS packages.
**Example**: To build catkin-based ROS packages in the current workspace
```
catkin_make
```
bb. catkin_eclipse (Type: Catkin Eclipse Integration Command): - Function: Integrates a catkin workspace with the Eclipse IDE.
**Example**: To generate Eclipse project files for a catkin workspace
```
catkin_eclipse
```
cc. catkin_prepare_release (Type: Catkin Package Release Preparation Command): - Function: Prepares a catkin package for release by updating version numbers and generating changelogs.
**Example**: To prepare a catkin package named my_catkin_pkg for release
```
catkin_prepare_release my_catkin_pkg
```
dd. catkin_generate_changelog (Type: Catkin Changelog Generation Command): - Function: Generates a changelog for a catkin package based on commit history.
**Example**: To generate a changelog for a catkin package named my_catkin_pkg
```
catkin_generate_changelog my_catkin_pkg
```
ee. catkin_init_workspace (Type: Catkin Workspace Initialization Command): - Function: Initializes a directory as a catkin workspace.