Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1 add support for realsense cameras #2

Open
wants to merge 4 commits into
base: humble
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

**/build
**/install
**/log
.vscode/settings.json
10 changes: 10 additions & 0 deletions .vscode/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -e
source /opt/ros/humble/setup.bash
# Set the default build type
BUILD_TYPE=RelWithDebInfo
colcon build \
--merge-install \
--symlink-install \
--cmake-args "-DCMAKE_BUILD_TYPE=$BUILD_TYPE" "-DCMAKE_EXPORT_COMPILE_COMMANDS=On" \
-Wall -Wextra -Wpedantic
18 changes: 18 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"/opt/ros/humble/include/**"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"cStandard": "c99",
"cppStandard": "c++17",
"intelliSenseMode": "linux-gcc-x64"
}
],
"version": 4
}
90 changes: 90 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
// 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": [
// Example launch of a python file
{
"name": "Python: Current File",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
},
// Example gdb launch of a ros executable
{
"name": "(gdb) Launch (merge-install)",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/install/lib/${input:package}/${input:program}",
"args": [],
"preLaunchTask": "build",
"stopAtEntry": true,
"cwd": "${workspaceFolder}",
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},
{
"name": "(gdb) Launch (isolated-install)",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/install/${input:package}/lib/${input:package}/${input:program}",
"args": [],
"preLaunchTask": "build",
"stopAtEntry": true,
"cwd": "${workspaceFolder}",
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},
//Example of a ROS Launch file
{
"name": "ROS: Launch File (merge-install)",
"type": "ros",
"request": "launch",
"preLaunchTask": "build",
"target": "${workspaceFolder}/install/share/${input:package}/launch/${input:ros_launch}",
},
{
"name": "ROS: Launch File (isolated-install)",
"type": "ros",
"request": "launch",
"preLaunchTask": "build",
"target": "${workspaceFolder}/install/${input:package}/share/${input:package}/launch/${input:ros_launch}",
},
],
"inputs": [
{
"id": "package",
"type": "promptString",
"description": "Package name",
"default": "examples_rclcpp_minimal_publisher"
},
{
"id": "program",
"type": "promptString",
"description": "Program name",
"default": "publisher_member_function"
},
{
"id": "ros_launch",
"type": "promptString",
"description": "ROS launch name",
"default": "file_name_launch.py"
}
]
}
254 changes: 254 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,254 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
// Build tasks
{
"label": "build",
"detail": "Build workspace (default)",
"type": "shell",
"command": ".vscode/build.sh",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": "$gcc"
},
{
"label": "debug",
"detail": "Build workspace (debug)",
"type": "shell",
"command": ".vscode/build.sh",
"options": {
"env": {
"BUILD_TYPE": "Debug"
}
},
"group": "build",
"problemMatcher": "$gcc"
},
// Test tasks
{
"label": "test",
"detail": "Run all unit tests and show results.",
"type": "shell",
"command": "./test.sh",
"group": {
"kind": "test",
"isDefault": true
}
},
// Clean
{
"label": "clean",
"detail": "Run the clean target",
"type": "shell",
"command": "colcon build --cmake-target clean",
"problemMatcher": "$gcc"
},
{
"label": "purge",
"detail": "Purge workspace by deleting all generated files.",
"type": "shell",
"command": "sudo rm -fr build install log; sudo py3clean .",
"problemMatcher": []
},
{
"label": "source",
"detail": "Source workspace",
"type": "shell",
"command": "source /opt/ros/humble/setup.bash",
"problemMatcher": []
},
// Linting and static code analysis tasks
{
"label": "fix",
"detail": "Reformat files with uncrustify.",
"type": "shell",
"command": "ament_uncrustify --reformat nk_ros_pkgs/",
"problemMatcher": []
},
{
"label": "uncrustify",
"detail": "Lint files with uncrustify.",
"type": "shell",
"command": "ament_uncrustify nk_ros_pkgs/",
"presentation": {
"panel": "dedicated",
"reveal": "silent",
"clear": true
},
"problemMatcher": [
{
"owner": "uncrustify",
"source": "uncrustify",
"fileLocation": "relative",
"pattern": [
// just the file name message
{
"regexp": "^(.*)'(.*)':",
"kind": "file",
"file": 2,
"message": 1
}
]
}
]
},
{
"label": "cpplint",
"detail": "Lint files with cpplint.",
"type": "ament",
"task": "cpplint",
"path": "nk_ros_pkgs/",
"problemMatcher": "$ament_cpplint",
"presentation": {
"panel": "dedicated",
"reveal": "silent",
"clear": true
},
},
{
"label": "cppcheck",
"detail": "Run static code checker cppcheck.",
"type": "ament",
"task": "cppcheck",
"path": "nk_ros_pkgs/",
"problemMatcher": "$ament_cppcheck",
"presentation": {
"panel": "dedicated",
"reveal": "silent",
"clear": true
},
"options": {
"env": {
"AMENT_CPPCHECK_ALLOW_SLOW_VERSIONS": "1"
}
}
},
{
"label": "lint_cmake",
"detail": "Run lint on cmake files.",
"type": "ament",
"task": "lint_cmake",
"path": "nk_ros_pkgs/",
"problemMatcher": "$ament_lint_cmake",
"presentation": {
"panel": "dedicated",
"reveal": "silent",
"clear": true
}
},
{
"label": "flake8",
"detail": "Run flake8 on python files.",
"type": "ament",
"task": "flake8",
"path": "nk_ros_pkgs/",
"problemMatcher": "$ament_flake8",
"presentation": {
"panel": "dedicated",
"reveal": "silent",
"clear": true
}
},
{
"label": "pep257",
"detail": "Run pep257 on python files.",
"type": "ament",
"task": "pep257",
"path": "nk_ros_pkgs/",
"problemMatcher": "$ament_pep257",
"presentation": {
"panel": "dedicated",
"reveal": "silent",
"clear": true
}
},
{
"label": "xmllint",
"detail": "Run xmllint on xml files.",
"type": "ament",
"task": "xmllint",
"path": "nk_ros_pkgs/",
"problemMatcher": "$ament_xmllint",
"presentation": {
"panel": "dedicated",
"reveal": "silent",
"clear": true
}
},
{
"label": "lint all",
"detail": "Run all linters.",
"dependsOn": [
"cppcheck",
"cpplint",
"flake8",
"lint_cmake",
"pep257",
"xmllint",
"uncrustify"
],
"problemMatcher": []
},
// Workspace editing tasks
{
"label": "new ament_cmake package",
"detail": "Create a new ROS cpp package from a template.",
"type": "shell",
"command": "ros2 pkg create --destination-directory nk_ros_pkgs --build-type ament_cmake ${input:package}",
"problemMatcher": []
},
{
"label": "new ament_python package",
"detail": "Create a new ROS python package from a template.",
"type": "shell",
"command": "ros2 pkg create --destination-directory nk_ros_pkgs --build-type ament_python ${input:package}",
"problemMatcher": []
},
{
"label": "import from workspace file",
"detail": "Use vcs to import modules specified by a workspace/rosinstall file.",
"type": "shell",
"command": "vcs import < nk_ros_pkgs/ros2.repos nk_ros_pkgs",
"problemMatcher": []
},
{
"label": "update workspace file",
"detail": "Use vcs to update repositories in nk_ros_pkgs to workspace file.",
"type": "shell",
"command": "vcs export nk_ros_pkgs > nk_ros_pkgs/ros2.repos",
"problemMatcher": []
},
{
"label": "install dependencies",
"detail": "Install all dependencies specified in the workspaces package.xml files.",
"type": "shell",
"command": "sudo apt-get update && rosdep update && rosdep install --from-paths nk_ros_pkgs --ignore-nk_ros_pkgs -y",
"problemMatcher": []
},
{
"label": "setup",
"detail": "Set up the workspace",
"type": "shell",
"command": "./setup.sh",
"problemMatcher": []
},
{
"label": "add submodules from .repos",
"detail": "Create a git submodule for all repositories in your .repos file",
"type": "shell",
"command": "python3 .devcontainer/repos_to_submodules.py",
"problemMatcher": []
}
],
"inputs": [
{
"id": "package",
"type": "promptString",
"description": "Package name"
}
]
}
Loading