todo: fill in details @kurt
I just give some example commands here. See https://www.digitalocean.com/community/tutorials/how-to-use-rsync-to-sync-local-and-remote-directories for more details
rsync
allows file/folder upload and download from a remote machine, and saves time by only sending modified files.
To send a folder called rl2024
to your home directory on the lab PC: rsync -azv rl2024 rtis-lab-internal:
And to update your copy with whatever is on the lab PC: rsync -azv rtis-lab-internal:rl2024 .
Always use the machine name (or IP address), and then a colon to specify the path of the file/folder of interest. For example: rsync -azv rtis-lab-internal:rl2024/checkpoint ./
unlike
cp
andscp
, trailing slashes in file paths are important! See https://www.digitalocean.com/community/tutorials/how-to-use-rsync-to-sync-local-and-remote-directories
If you’re ever unsure what an rsync
command does, add --dry-run
to the end of the command.
clangd
While I used to recommend the Microsoft VSCode C/C++ Extension, I no longer do since it 1) re-scans the entire system include folder for each workspace, and 2) creates enourmous cache files in ~/.cache/vscode-cpptools
.
Use the clangd
extension instead. To allow the extension to properly detect ROS include files, there is some setup required.
You can use
clangd
for completions and linting regardless of whatever compiler you use. CMake usesgcc
by default, but can output configuration files thatclangd
can use at the same time.
https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-clangd
Once the extension is installed, reload the vscode window. You may see a popup appear in the bottom left, requesting that you install clangd
. Depending on your system, the extension may install it for you, or you may need to install it yourself.
compile_commands.json
fileWhen using colcon build
, add --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=1
. The whole command might look like this:
colcon --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=1
You do not need to use this flag for every build - only whenever you add new files or a major dependency.
The
-DCMAKE_EXPORT_COMPILE_COMMANDS
argument instructs cmake to export acompile_commands.json
, which includes all the steps and files used to build the workspace.clangd
uses this to figure out which include files to index, which is much more efficient than VSCode’s C/C++ strategy of “just index everything”.
clandg
where to find compile_commands.json
If it doesn’t exist, make a .vscode/settings.json
file. Drop the following code block into it:
"clangd.arguments": [
"--compile-commands-dir=${workspaceFolder}/build",
],
"C_Cpp.intelliSenseEngine": "Disabled",
"clangd.arguments": [
"--compile-commands-dir=${workspaceFolder}/build",
"--completion-style=detailed",
"--clang-tidy",
"--clang-tidy-checks=-*,modernize*",
"--header-insertion=never"
],
"C_Cpp.intelliSenseEngine": "Disabled",
(Taken from https://github.com/lzptr/VS_Code_ROS?tab=readme-ov-file#clangd-extension)
Then, reload the window.
todo
Useful for progress bars for long-running operations.