colcon buildInvokes the build tool colcon, which calls the CMake build system files in each package (a.k.a. directory). CMake does build magic™ that automatically finds and installs necessary packages so your code is ready to run. ONLY RUN THIS COMMAND IN /colcon-urc!
If you get errors from CMake or XML —> build errors Solution: Make sure all dependencies are installed
If you get errors from #include statements —> linker errors Solution: Make sure to include and bind any necessary packages in CMake/XML
If you get errors from .cpp/.hpp/.py files —> compile-time errors Solution: Check for typos and incorrect method usage
colcon build --packages-select <name of package>Builds a specific package
colcon testRuns tests on all built packages
colcon test-result --verboseOutputs a detailed log of everything that happened during testing to your terminal
colcon build && colcon test && colcon test-result --verboseBuilds, tests, and shows you the results of all tests. Use this for day to day ROS2 development!
. install/setup.bashAdds all required elements to your path, always run before launching anything
ros2 launch <directory with launch file> <python launch file>Activates a launch file, boots up gazebo and the simulation
ros2 topic listReturns all active topics
ros2 topic echo <topic name>Shows what is being published to a given topic
rosdep update && rosdep install --from-paths src --ignore-src -r -yInitializes all rosdep packages, enabling CMake to integrate and use them
sudo apt-get install ros-humble-<package name>Use this to install a specific rosdep package missing from the CMake
git pushPushes your changes to your branch.
I’d highly recommend using built-in Git integrations in your text editor of choice instead, but this is always an option for the Vim/Emacs chads out there.
git pullGet the newest version of your branch.
You can use the flag --recursive-submodules if you’d like to update submodule content as well, since by default github ignores submodules with any commands you enter.
git commit -m “<Message describing your commit>”Creates a snapshot of the changes you’ve made to the repo before you push. The -m flag allows you to include a message describing what the commit does. Do this before you push.
git add <filename>Adds a file you changed to the staging area. You can also do git add . to stage all of the files from the current directory that you changed. This needs to be done before you do git commit.
git fetchDowloads commits, files, and references from a remote repository into your local repository.
If you’re unable to checkout to a new branch or having issues with the remote repository in general, try using this command.
git stashUse to save your progress on a given branch before swapping
git stash popUse to restore previously stashed progress
git branchSee all local branches
git branch -rSee all remote branches
git checkout <name of branch>Swap to a specific branch
git submodule syncUpdates submodule metadata (the URL you linked in .gitmodules)
git submodule update --initInitializes and pulls any changes for every submodule. Use this if you are missing a specific submodule package during build!
ament_uncrustify --reformatAutomatically reformats all .cpp and .hpp files to ensure they match the rules laid out by ament_code_style.cfg
ament_<use tab complete to see all the options>All the various linters called when colcon test runs