MentorPi Setting Up a Custom ROS2 Workspace on the Robot
1. Introduction
In this ROS 2 basic tutorial, when attempting to create a custom ROS workspace on the robot, the steps in the tutorial may not work as expected. This is because the tutorial is performed in a virtual machine, and the system environment differs from the robot’s operating system.
2. Operation Step
This tutorial uses the creation of a simple ROS workspace as an example.
- Double-click the remote desktop icon
to open a new command-line terminal, then enter the command mkdir ros2_ws.
mkdir mydemo_ros
- Enter the command
cd ros2_ws/ && mkdir srcto create a new src folder.
cd ros2_ws/ && mkdir src
- Enter the command
colcon buildto build the workspace.
colcon build
- Enter the command
source ~/ros2_ws/install/setup.zshto load the workspace environment in ROS2. This step differs from the procedure used in the virtual machine.
source ~/ros2_ws/install/setup.zsh
3. Important Note
To download the package, a network connection is required.