Skip to content

Commit 4939696

Browse files
updated CMakeLists for onnxruntime ros package and also .vscode configs
1 parent 013ba3b commit 4939696

File tree

6 files changed

+340
-38
lines changed

6 files changed

+340
-38
lines changed

.vscode/c_cpp_properties_json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"configurations": [
3+
{
4+
"name": "Linux",
5+
"includePath": [
6+
"${workspaceFolder}/include/**",
7+
"${workspaceFolder}/../hero_sam/onnxruntime-linux-x64-gpu-1.21.1/include",
8+
"/usr/local/cuda/include",
9+
"/usr/include/opencv4/**",
10+
"/opt/ros/noetic/include/**"
11+
],
12+
"defines": [
13+
14+
],
15+
"compilerPath": "/usr/bin/gcc",
16+
"cStandard": "c17",
17+
"cppStandard": "c++17",
18+
"intelliSenseMode": "linux-gcc-x64",
19+
"configurationProvider": "ms-vscode.cmake-tools"
20+
}
21+
],
22+
"version": 4
23+
}

.vscode/launch.json

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Debug SAM Model",
6+
"type": "cppdbg",
7+
"request": "launch",
8+
"program": "${workspaceFolder}/build/devel/lib/sam_onnx_ros/test_sam_onnx_ros", // Path to the executable
9+
"args": [], // Add any command-line arguments for your program here
10+
"stopAtEntry": false,
11+
"cwd": "${workspaceFolder}/build", // Set the working directory
12+
"environment": [],
13+
"externalConsole": false,
14+
"MIMode": "gdb",
15+
"setupCommands": [
16+
{
17+
"description": "Enable pretty-printing for gdb",
18+
"text": "-enable-pretty-printing",
19+
"ignoreFailures": true
20+
}
21+
],
22+
"preLaunchTask": "build-sam-project" // Ensure the project is built before debugging
23+
},
24+
{
25+
"name": "Debug GTest (pick binary)",
26+
"type": "cppdbg",
27+
"request": "launch",
28+
"program": "${input:testBinary}", // pick utils_tests or sam_tests
29+
"args": [
30+
//"--gtest_filter=${input:gtestFilter}" // uncomment to filter tests
31+
],
32+
"cwd": "${workspaceFolder}", // cwd doesn’t matter if SAM_MODELS_DIR is set
33+
"environment": [
34+
{
35+
"name": "SAM_MODELS_DIR",
36+
"value": "${env:SAM_MODELS_DIR}"
37+
} // or hardcode a path here
38+
],
39+
"stopAtEntry": false,
40+
"externalConsole": false,
41+
"MIMode": "gdb",
42+
"setupCommands": [
43+
{
44+
"description": "Enable pretty-printing for gdb",
45+
"text": "-enable-pretty-printing",
46+
"ignoreFailures": true
47+
}
48+
]
49+
},
50+
{
51+
"name": "Run all tests (ctest)",
52+
"type": "cppdbg",
53+
"request": "launch",
54+
"program": "/usr/bin/ctest",
55+
"args": [
56+
"--test-dir",
57+
"/home/amigo/ros/noetic/system/build/sam_onnx_ros",
58+
"-R",
59+
"(sam_tests|utils_tests)",
60+
"--output-on-failure",
61+
"-j",
62+
"4"
63+
],
64+
"cwd": "/home/amigo/ros/noetic/system/build/sam_onnx_ros",
65+
"environment": [
66+
{
67+
"name": "SAM_MODELS_DIR",
68+
"value": "${env:SAM_MODELS_DIR}"
69+
}
70+
],
71+
"stopAtEntry": false,
72+
"externalConsole": false,
73+
"MIMode": "gdb"
74+
// Note: ctest launching isn't great for step-debugging individual tests.
75+
}
76+
],
77+
"inputs": [
78+
{
79+
"id": "testBinary",
80+
"type": "pickString",
81+
"description": "Select gtest executable",
82+
"options": [
83+
"/home/amigo/ros/noetic/system/devel/.private/sam_onnx_ros/lib/sam_onnx_ros/utils_tests",
84+
"/home/amigo/ros/noetic/system/devel/.private/sam_onnx_ros/lib/sam_onnx_ros/sam_tests"
85+
]
86+
},
87+
{
88+
"id": "gtestFilter",
89+
"type": "promptString",
90+
"description": "gtest filter (e.g. Utils* or SamInferenceTest.PreProcess*)",
91+
"default": "*"
92+
}
93+
],
94+
}

.vscode/settings.json

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
{
2+
"files.associations": {
3+
"iostream": "cpp",
4+
"cctype": "cpp",
5+
"clocale": "cpp",
6+
"cmath": "cpp",
7+
"cstdarg": "cpp",
8+
"cstddef": "cpp",
9+
"cstdio": "cpp",
10+
"cstdlib": "cpp",
11+
"cstring": "cpp",
12+
"ctime": "cpp",
13+
"cwchar": "cpp",
14+
"cwctype": "cpp",
15+
"array": "cpp",
16+
"atomic": "cpp",
17+
"strstream": "cpp",
18+
"bit": "cpp",
19+
"*.tcc": "cpp",
20+
"bitset": "cpp",
21+
"chrono": "cpp",
22+
"codecvt": "cpp",
23+
"complex": "cpp",
24+
"condition_variable": "cpp",
25+
"cstdint": "cpp",
26+
"deque": "cpp",
27+
"list": "cpp",
28+
"map": "cpp",
29+
"set": "cpp",
30+
"unordered_map": "cpp",
31+
"unordered_set": "cpp",
32+
"vector": "cpp",
33+
"exception": "cpp",
34+
"algorithm": "cpp",
35+
"functional": "cpp",
36+
"iterator": "cpp",
37+
"memory": "cpp",
38+
"memory_resource": "cpp",
39+
"numeric": "cpp",
40+
"optional": "cpp",
41+
"random": "cpp",
42+
"ratio": "cpp",
43+
"regex": "cpp",
44+
"string": "cpp",
45+
"string_view": "cpp",
46+
"system_error": "cpp",
47+
"tuple": "cpp",
48+
"type_traits": "cpp",
49+
"utility": "cpp",
50+
"fstream": "cpp",
51+
"initializer_list": "cpp",
52+
"iomanip": "cpp",
53+
"iosfwd": "cpp",
54+
"istream": "cpp",
55+
"limits": "cpp",
56+
"mutex": "cpp",
57+
"new": "cpp",
58+
"ostream": "cpp",
59+
"shared_mutex": "cpp",
60+
"sstream": "cpp",
61+
"stdexcept": "cpp",
62+
"streambuf": "cpp",
63+
"thread": "cpp",
64+
"cfenv": "cpp",
65+
"cinttypes": "cpp",
66+
"typeindex": "cpp",
67+
"typeinfo": "cpp",
68+
"variant": "cpp",
69+
"compare": "cpp",
70+
"concepts": "cpp",
71+
"numbers": "cpp",
72+
"semaphore": "cpp",
73+
"stop_token": "cpp",
74+
"*.txx": "cpp",
75+
"filesystem": "cpp"
76+
}
77+
}

.vscode/tasks.json

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "build-sam-project",
6+
"dependsOrder": "sequence",
7+
"dependsOn": ["configure-sam", "build-sam-binary"],
8+
"problemMatcher": ["$gcc"],
9+
"group": "build"
10+
},
11+
{
12+
"label": "build-pipeline-project",
13+
"dependsOrder": "sequence",
14+
"dependsOn": ["configure-pipeline", "build-pipeline-binary"],
15+
"problemMatcher": ["$gcc"],
16+
"group": "build"
17+
},
18+
{
19+
"label": "build-yolo-project",
20+
"dependsOrder": "sequence",
21+
"dependsOn": ["configure-yolo", "build-yolo-binary"],
22+
"problemMatcher": ["$gcc"],
23+
"group": "build"
24+
},
25+
{
26+
"label": "configure-sam",
27+
"type": "shell",
28+
"command": "cmake",
29+
"args": [
30+
"-DCMAKE_BUILD_TYPE=Debug",
31+
"-DCMAKE_POLICY_VERSION_MINIMUM=3.5",
32+
"-S", "${workspaceFolder}/",
33+
"-B", "${workspaceFolder}/build"
34+
],
35+
"problemMatcher": ["$gcc"]
36+
},
37+
{
38+
"label": "configure-pipeline",
39+
"type": "shell",
40+
"command": "cmake",
41+
"args": [
42+
"-DCMAKE_BUILD_TYPE=Debug",
43+
"-S", "${workspaceFolder}/pipeline",
44+
"-B", "${workspaceFolder}/pipeline/build"
45+
],
46+
"problemMatcher": ["$gcc"]
47+
},
48+
{
49+
"label": "configure-yolo",
50+
"type": "shell",
51+
"command": "cmake",
52+
"args": [
53+
"-DCMAKE_BUILD_TYPE=Debug",
54+
"-S", "${workspaceFolder}/yolo_inference",
55+
"-B", "${workspaceFolder}/yolo_inference/build"
56+
],
57+
"problemMatcher": ["$gcc"]
58+
},
59+
{
60+
"label": "build-sam-binary",
61+
"type": "shell",
62+
"command": "cmake",
63+
"args": [
64+
"--build",
65+
"${workspaceFolder}/build",
66+
"--config", "Debug"
67+
],
68+
"problemMatcher": ["$gcc"]
69+
},
70+
{
71+
"label": "build-pipeline-binary",
72+
"type": "shell",
73+
"command": "cmake",
74+
"args": [
75+
"--build",
76+
"${workspaceFolder}/pipeline/build",
77+
"--config", "Debug"
78+
],
79+
"problemMatcher": ["$gcc"]
80+
},
81+
{
82+
"label": "build-yolo-binary",
83+
"type": "shell",
84+
"command": "cmake",
85+
"args": [
86+
"--build",
87+
"${workspaceFolder}/yolo_inference/build",
88+
"--config", "Debug"
89+
],
90+
"problemMatcher": ["$gcc"]
91+
}
92+
93+
]
94+
}

0 commit comments

Comments
 (0)