VS Code Setup - ArcturusNavigation/all_seaing_vehicle GitHub Wiki
| Top: Installation |
|---|
It is recommended that you use VS Code for your IDE.
Recommended extensions
IntelliSense (code completion)
By default, code completion doesn't work well for C++ with ROS, especially with custom messages, and you will likely see many red squiggles. To fix this, first run colcon build again with an extra flag:
colcon build --symlink-install --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
The extra flag generates a compile_commands.json inside your build folder which can be used to configure IntelliSense.
Then, add the following line to configurations of c_cpp_properties.json, which should be located inside your .vscode folder.
"compileCommands": "~/arcturus/dev_ws/build/compile_commands.json"
Here is an example c_cpp_properties.json:
{
"configurations": [
{
"browse": {
"databaseFilename": "${default}",
"limitSymbolsToIncludedHeaders": false
},
"name": "all_seaing_vehicle",
"intelliSenseMode": "gcc-x64",
"cStandard": "gnu11",
"cppStandard": "c++14",
"compileCommands": "~/arcturus/dev_ws/build/compile_commands.json"
}
],
"version": 4
}
Docker Installation: Python Missing Imports
By default, when you open VSCode outside the docker container in your host machine, the Pylance VSCode extension will be unable to find the ROS packages since ROS is not installed in your host machine. To fix this, install the Dev Containers VSCode extension from Microsoft. To edit files using VSCode in a Docker container, click the right arrow next to arcturus_docker under Remote Explorer->Dev Containers.
After attaching to the Docker container, install the Python VSCode extension. You should now be able to fully use Python code completion features.
| Back: Native Installation or Docker Installation | Top: Installation |
|---|