Welcome to ROS Robot Expansion Board repository
4.ROS workspace
4.ROS workspace
The ros workspace is a folder used to store ros function packages. It usually ends with ws. Let's create a space named ros_ws as an example to explain how to create a ros workspace.
4.1 Create workspace folder
Take creating the ros_ws space in the ~ directory as an example, and enter in the terminal,
cdmkdir ros_ws4.2 Create src to store function packages
We create a src folder in the src directory of the workspace to store the function package created later, and enter it in the terminal.
xxxxxxxxxxcd ~/ros_wsmkdir src4.3 Initialize workspace
Terminal input,
xxxxxxxxxxcd ~/ros_ws/srccatkin_init_workspace

4.4 Compile workspace
Use the catkin_make command to compile the functions in the entire workspace. You need to compile in the workspace directory,
xxxxxxxxxxcd ~/ros_wscatkin_make
4.5 Add workspace to environment variables
Add the workspace to the environment variable so that you can find the function package when you open the terminal. Otherwise, you need to source the workspace every time to find the function package and related programs. Enter in the terminal.
xxxxxxxxxxecho "source ~/ros_ws/devel/setup.bash" >> ~/.bashrcEnter the following command to refresh the environment variables or reopen the terminal to take effect. Enter in the terminal,
xxxxxxxxxxsource ~/.bashrc