Workspace and function package creation process in ROS
Hello there! Using the Markdown editor for the first time .
What directories does the workspace contain?
Workspace (workspace) is a folder for storing project development related files:
- src , source space , code space;
- build , build space , compilation space;
- devel , development space , development space;
- install , install space , installation space;
Create a workspace (4step)
step1- create a workspace
#在开发主机界面打开终端##
$mkdir -p ~/catkin_ws/src
$cd ~/catkin_ws/src
$catkin_init_workspace
step2- Compile workspace
$cd ~/catkin_ws/
$catkin_make
step3-Set environment variables (can be added to the .bashrc file in the home insert picture description here
)
$source devel/setup.bash
step4- check environment variables
$echo $ROS_PACKAGE_PATH
Remarks : After running the above code, there are three directories in the workspace of catkin_ws, build, source, and devel, and one install is short of
The install directory is missing.
Run the catkin_make install command in the workspace to generate the install directory.
At this point, the workspace is created
Create function package (2step)
step-1 Create a feature package
$cd ~/catkin_ws/src
$catkin_creat_pkg test_pkg std_msgs rospy roscpp
step-2 Compile the function package
$cd ~/catkin_ws
$catkin_make
$source ~/catkin_ws/devel/setup.bash
% There cannot be a function package with the same name in the same workspace! ! !
% In different workspaces, there can be a function package with the same name. So
far, the function package is created