Ensure the following are installed on your system:
- ROS 2 Humble
Refer to the installation guide. - ROSDEP
- COLCON
- CMAKE
- MAKE
- GIT
It only runs once, to ensure the repository compiles correctly, run prebuild.sh
first.
Make sure to execute the script in the workspace (ws
) directory where you plan to run colcon build
afterward.
If you don’t already have a target workspace, create one:
# Skip this step if you already have a target workspace
$ cd ~
$ mkdir -p home_ws/src
#Remember to source ros2 environment settings first
$ cd ~/home_ws/
#DO NOT omit "--recursive",or the source code of dependent submodule will not be downloaded.
$ git clone https://github.com/RoBorregos/home2.git --recursive src/
#Pay attention where are you executing prebuild, it has to be on the home_ws directory.
$ ./src/prebuild.sh
#AFTER RUNNING PREBUILD IMPORTANT TO SOURCE .BASHRC
$ source ~/.bashrc
#AFTER RUNNING PREBUILD IMPORTANT TO SOURCE .BASHRC
$ source ~/.bashrc
#Remember to source ros2 environment settings first
$ cd ~/home_ws/
#You can add the --executor sequential for only one compiling thread
$ colcon build --symlink-install
$ source install/setup.bash