we will learn about colcon now 2
colcon is a tool that ros2 uses in order to build the package from source 3
we work in a workspace where we store the packages and the colcon build will be use to build these packages So 4
here is the command in order to install 5
so it is installed and now we will be creating our first workspace remember that we pushed a 6
line in The Bashrc that was the source opt Ros and Foxy setup.bash so this is how we 7
Source a terminal that was our underlay workspace and now we will be creating 8
an overlay workspace open the files create a folder ros2_ws ros2 workspace 9
now we will clone a package inside our workspace so cd ros2_ws so 10
now we are in our workspace from the terminal and we will be cloning a package that is here 11
yeah so now it has a SRC folder and then example and then there are some code 12
inside this and we will just see the package structure the SRC folder in which we keep our 13
repositories try to build this how we can build it we there are actually two commands 14
one is the colcon build and the other is colcon build 15
-- symlink - install so what is the difference between these two commands Okay 16
colcon build will be building all the packages from The Source instead of just building if 17
we add the keyword symlink install it will also be linking the packages 18
with the installation directories build directly colcon build -- symlink 19
install is command that built the packages faster so we will be using this command 20
and now it is building our first package that we just cloned remember that we we had just 21
src folder before but after we enter the command it has created three extra folders so 22
in the build folder it builds and save the files in binaries into this build directory and in the 23
install directory it creates the file that will be used to install and in the log solder it saved 24
the log information from the different nodes now we have build the package after building 25
our workspace is still not sourced so we also have to Source this particular workspace in 26
order to run a node okay so how do we do that by source install and set up dot bash 27
using this command colcon test we can also monitor the package about their colcon status 28
do you remember how do we run a node, we use command ros2 run package name 29
and then the executable conde ros2 run package name is the example underscore 30
and node name subscriber member function node is running now we will open up another terminal and uh 31
we will type this command this is the publisher command 32
okay it is publishing and this is receiving 33
okay so this is how we can run a node from our workspace