Useful Commands
Create Workspace
A ROS2 project workspace has a standard structure. First, we create the root directory of the workspace
mkdir MyRosWorkspaceThen, we go to the workspace directory and create a build directory
cd MyRosWorkspace
mkdir buildCreate C++ Package
Go to the workspace root directory and use the pkg create command. For instance
cd MyRosWorkspace
ros2 pkg create MyFirstProject --build-type ament_cmakeCreate Python Package
Go to the workspace root directory and use the pkg create command. For instance
cd MyRosWorkspace
ros2 pkg create MyPythonProject --build-type ament_pythonBuild Workspace
To build the workspace, we use the following command:
The first command checks missing dependencies and the second command build the whole workspace. To build a specific package, use the following command:
How to specify the namespace and node name in the command line?
In ROS2, the namespace and node name can be specified in the command line through the remap. For more information, please refer to the design doc Remapping Names. The command below shows the syntax:
How to check URDF file
To validate a URDF, you can use the following command:
How to turn on the debug info when launch the stack?
Use the -d option. For example:
Last updated