Skip to content

Instantly share code, notes, and snippets.

@diogon01
Last active July 2, 2021 22:12
Show Gist options
  • Save diogon01/6e5097607a2b0a33730981f8bfadde91 to your computer and use it in GitHub Desktop.
Save diogon01/6e5097607a2b0a33730981f8bfadde91 to your computer and use it in GitHub Desktop.
ROS Vscode configurarion
{
"configurations": [
{
"browse": {
"databaseFilename": "",
"limitSymbolsToIncludedHeaders": true
},
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"/opt/ros/noetic/include/**",
"~/catkin_ws/devel/include/**"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "gnu17",
"cppStandard": "gnu++14",
"intelliSenseMode": "gcc-x64"
}
],
"version": 4
}
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) launch",
"type": "cppdbg",
"request": "launch",
"program": "${env:HOME}/catkin_ws/devel/lib/${workspaceFolderBasename}/${fileBasenameNoExtension}",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"preLaunchTask": "prerun",
"MIMode": "gdb",
"targetArchitecture": "x64",
"avoidWindowsConsoleRedirection": true,
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "prerun",
"type": "shell",
"dependsOn": [
"build package only"
],
"command": "source ../../devel/setup.bash && export ROS_MASTER_URI=http://localhost:11311/ "
},
{
"label": "build all packages",
"type": "shell",
"command": "cd ~/catkin_ws/ && catkin config --extend /opt/ros/noetic && catkin build -DCMAKE_BUILD_TYPE=Debug -j8",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": []
},
{
"label": "build package only",
"type": "shell",
"command": "cd ~/catkin_ws/ && catkin config --extend /opt/ros/noetic && catkin build ${workspaceFolderBasename} -DCMAKE_BUILD_TYPE=Debug -j8",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": []
},
{
"label": "clean",
"type": "shell",
"command": "cd ~/catkin_ws/ && catkin clean --yes"
},
{
"label": "release",
"type": "shell",
"command": "sudo checkinstall --install=no catkin build -j4 --cmake--args -DCMAKE_BUILD_TYPE=Release"
}
]
}
@diogon01
Copy link
Author

All files for Build, Run and debug any ROS files. Without and no external plugin, if use kinetic ou melodic, replace in the source files "noetic" for your ROS version.

My Build tasks use catkin build, but if your use catkin_make, change the task files for catkin_make commands

For intelliSenseEngine autocomplete correct, set "C_Cpp.intelliSenseEngine": "Tag Parser"

tag_parser

For debug click in the ROS Nodo file and press F5:

ros_debu_example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment