1.5.2 ROS Filesystem Related Commands
The ROS filesystem is fundamentally still part of the operating system's files. While standard Linux commands can be used to manipulate these files, ROS provides specialized commands similar to Linux commands for an improved user experience. These ROS-specific commands are more concise and efficient compared to native Linux commands. File operations primarily involve creating, deleting, modifying, querying, and executing. Next, we will introduce some commonly used ROS filesystem commands from these five perspectives.
1. Create
catkin_create_pkg custom_package_name dependencies=== Create a new ROS packagesudo apt install xxx=== Install a ROS package
2. Delete
sudo apt purge xxx=== Delete a specific package
3. Query
rospack list=== List all packagesrospack find package_name=== Check if a specific package exists; if it does, return its installation pathroscd package_name=== Navigate into a specific package directoryrosls package_name=== List files within a specific packageapt search xxx=== Search for a specific package
4. Modify
rosed package_name file_name=== Modify files within a package- Requires vim to be installed
- Example:
rosed turtlesim Color.msg
5. Execute
5.1 roscore
roscore === A collection of ROS system prerequisite nodes and programs. roscore must be running for ROS nodes to communicate.
roscore will start:
- ROS Master
- ROS Parameter Server
- rosout logging node
Usage:
roscoreOr (with specified port):
roscore -p xxxx5.2 rosrun
rosrun package_name executable_name === Run specified ROS node
Example: rosrun turtlesim turtlesim_node
5.3 roslaunch
roslaunch package_name launch_file_name === Execute launch file from a specific package