Skip to content

Commit b0b9426

Browse files
Addressed comments
1 parent a143de7 commit b0b9426

File tree

5 files changed

+364
-46
lines changed

5 files changed

+364
-46
lines changed

.clang-format

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
BasedOnStyle: LLVM
2+
IndentWidth: 4
3+
TabWidth: 4
4+
ColumnLimit: 120
5+
UseTab: Never
6+
PointerAlignment: Left
7+
AlwaysBreakTemplateDeclarations: Yes

.devcontainer/Dockerfile

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Use an official ROS1 environment as a parent image
2+
FROM ros:noetic-robot
3+
4+
# Set the default shell to bash
5+
SHELL ["/bin/bash", "-c"]
6+
7+
# Set a non-interactive shell to avoid stuck prompts during build
8+
ARG DEBIAN_FRONTEND=noninteractive
9+
10+
# Update package lists and install only necessary packages
11+
RUN apt-get update && apt-get install -y \
12+
build-essential \
13+
cmake \
14+
git \
15+
sudo \
16+
lsb-release \
17+
gnupg2 \
18+
net-tools \
19+
clang-format \
20+
clangd \
21+
gdb \
22+
libpcl-dev \
23+
libopencv-dev \
24+
python3-pip \
25+
python3-catkin-tools \
26+
python3-rospkg \
27+
python3-rospy \
28+
ros-noetic-tf2-ros \
29+
ros-noetic-sensor-msgs \
30+
ros-noetic-catkin \
31+
ros-noetic-pcl-ros \
32+
ros-noetic-grid-map \
33+
&& apt-get clean \
34+
&& rm -rf /var/lib/apt/lists/*
35+
36+
# Set Python 3 as the default Python version
37+
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1
38+
39+
# Install Python packages using pip
40+
RUN pip3 install cmake-format
41+
42+
# Add a user for the development environment
43+
ARG USERNAME=devuser
44+
ARG USER_UID=1000
45+
ARG USER_GID=$USER_UID
46+
47+
# Create user with specified home directory
48+
RUN groupadd --gid $USER_GID $USERNAME || echo "Group $USERNAME already exists"
49+
RUN useradd --uid $USER_UID --gid $USER_GID --create-home --home-dir /home/$USERNAME $USERNAME || echo "User $USERNAME already exists"
50+
RUN echo "$USERNAME ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/$USERNAME
51+
RUN chmod 0440 /etc/sudoers.d/$USERNAME
52+
53+
# Set the working directory
54+
WORKDIR /home/$USERNAME/workspace
55+
56+
# Setup ROS1 environment in the bashrc for interactive bash shells
57+
RUN echo "source /opt/ros/noetic/setup.bash" >> /home/$USERNAME/.bashrc
58+
59+
# Setup GUI forwarding with the correct DISPLAY setting
60+
RUN echo "export DISPLAY=:1" >> /home/$USERNAME/.bashrc
61+
62+
# Switch to the non-root user
63+
USER $USERNAME
64+
65+
# Command to run on container start
66+
CMD ["/bin/bash"]

.devcontainer/devcontainer.json

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
{
2+
"name": "GroundGrid",
3+
"privileged": true,
4+
"build": {
5+
"dockerfile": "Dockerfile",
6+
"args": {
7+
"USER_UID": "1000",
8+
"USER_GID": "1000"
9+
}
10+
},
11+
"containerEnv": {
12+
"DISPLAY": "unix:1",
13+
"ROS_AUTOMATIC_DISCOVERY_RANGE": "LOCALHOST",
14+
"ROS_DOMAIN_ID": "0"
15+
},
16+
"runArgs": [
17+
"--net",
18+
"host",
19+
"--privileged",
20+
"--env=DISPLAY=:1",
21+
"--volume=/tmp/.X11-unix:/tmp/.X11-unix:rw"
22+
],
23+
"hostRequirements": {
24+
"gpu": "optional"
25+
},
26+
"remoteUser": "devuser",
27+
"workspaceFolder": "/home/devuser/workspace/groundgrid",
28+
"mounts": [
29+
{
30+
"source": "${env:HOME}/workspace",
31+
"target": "/home/devuser/workspace",
32+
"type": "bind"
33+
}
34+
],
35+
"postCreateCommand": "bash -c 'source /opt/ros/noetic/setup.bash'",
36+
"customizations": {
37+
"vscode": {
38+
"extensions": [
39+
"ms-iot.vscode-ros",
40+
"ms-python.black-formatter",
41+
"ms-python.vscode-pylance",
42+
"ms-python.python",
43+
"ms-python.debugpy",
44+
"xaver.clang-format",
45+
"eamodio.gitlens",
46+
"twxs.cmake",
47+
"ClemensPeters.format-json",
48+
"DavidAnson.vscode-markdownlint",
49+
"redhat.vscode-xml",
50+
"redhat.vscode-yaml",
51+
"mechatroner.rainbow-csv",
52+
"llvm-vs-code-extensions.vscode-clangd"
53+
],
54+
"settings": {
55+
"terminal.integrated.defaultProfile.linux": "bash",
56+
"terminal.integrated.env.linux": {
57+
"CMAKE_PREFIX_PATH": "/opt/ros/noetic:$CMAKE_PREFIX_PATH",
58+
"LD_LIBRARY_PATH": "/opt/ros/noetic/lib:$LD_LIBRARY_PATH"
59+
},
60+
"search.exclude": {
61+
"**/build": true,
62+
"**/install": true,
63+
"**/log": true
64+
},
65+
"ros.rosSetupScript": "/opt/ros/noetic/setup.bash",
66+
"python.autoComplete.extraPaths": [
67+
"/opt/ros/noetic/lib/python3/dist-packages/"
68+
],
69+
"python.analysis.extraPaths": [
70+
"/opt/ros/noetic/lib/python3/dist-packages/"
71+
],
72+
"clangd.path": "/usr/bin/clangd",
73+
"clangd.checkUpdates": false,
74+
"C_Cpp.clang_format_style": "file",
75+
"C_Cpp.default.cppStandard": "c++17",
76+
"C_Cpp.default.cStandard": "c11",
77+
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
78+
"C_Cpp.default.browse.path": [
79+
"${workspaceFolder}"
80+
],
81+
"C_Cpp.autocomplete": "disabled",
82+
"C_Cpp.intelliSenseEngine": "disabled",
83+
"C_Cpp.errorSquiggles": "disabled",
84+
"C_Cpp.formatting": "disabled",
85+
"C_Cpp.intelliSenseEngineFallback": "disabled",
86+
"C_Cpp.configurationWarnings": "disabled",
87+
"C_Cpp.vcpkg.enabled": false,
88+
"C_Cpp.inlayHints.parameterNames.enabled": false,
89+
"C_Cpp.autoAddFileAssociations": false,
90+
"C_Cpp.codeAnalysis.runAutomatically": false,
91+
"C_Cpp.default.enableConfigurationSquiggles": false,
92+
"[c]": {
93+
"editor.formatOnSave": true,
94+
"editor.defaultFormatter": "xaver.clang-format"
95+
},
96+
"[cpp]": {
97+
"editor.formatOnSave": true,
98+
"editor.defaultFormatter": "xaver.clang-format"
99+
},
100+
"[python]": {
101+
"editor.formatOnSave": true,
102+
"editor.defaultFormatter": "ms-python.black-formatter"
103+
},
104+
"[yaml]": {
105+
"editor.formatOnSave": true,
106+
"editor.defaultFormatter": "redhat.vscode-yaml"
107+
},
108+
"[json]": {
109+
"editor.formatOnSave": true,
110+
"editor.defaultFormatter": "ClemensPeters.format-json"
111+
},
112+
"[xml]": {
113+
"editor.formatOnSave": true,
114+
"editor.defaultFormatter": "redhat.vscode-xml"
115+
},
116+
"files.trimTrailingWhitespace": true,
117+
"files.insertFinalNewline": true,
118+
"terminal.integrated.scrollback": 10000
119+
}
120+
}
121+
}
122+
}

.gitignore

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# Core dumps
2+
core
3+
core.*
4+
5+
# Prerequisites
6+
*.d
7+
8+
# Compiled Object files
9+
*.slo
10+
*.lo
11+
*.o
12+
*.obj
13+
14+
# Precompiled Headers
15+
*.gch
16+
*.pch
17+
18+
# Compiled Dynamic libraries
19+
*.so
20+
*.dylib
21+
*.dll
22+
23+
# Fortran module files
24+
*.mod
25+
*.smod
26+
27+
# Compiled Static libraries
28+
*.lai
29+
*.la
30+
*.a
31+
*.lib
32+
33+
# Executables
34+
*.exe
35+
*.out
36+
*.app
37+
38+
# Build directories
39+
build/
40+
Build/
41+
bin/
42+
Bin/
43+
lib/
44+
Lib/
45+
lib64/
46+
Lib64/
47+
CMakeFiles/
48+
CMakeCache.txt
49+
cmake_install.cmake
50+
Makefile
51+
*.cmake
52+
*.ninja
53+
.ninja_deps
54+
.ninja_log
55+
*.vcxproj
56+
*.vcxproj.filters
57+
*.vcxproj.user
58+
*.DS_Store
59+
*.ipynb_checkpoints
60+
61+
# Python build artifacts
62+
*.pyc
63+
*.pyo
64+
*.pyd
65+
__pycache__/
66+
*.egg-info/
67+
dist/
68+
build/
69+
*.log
70+
71+
# Clang-format index
72+
.cache
73+
74+
# ROS
75+
.catkin_tools/
76+
devel/
77+
logs/
78+
install/
79+
*.launch~
80+
*.pyc
81+
82+
# Ignore files generated by IDEs and editors
83+
.vscode/
84+
.idea/
85+
*.swp
86+
*.bak
87+
*~
88+
*.tmp
89+
*.temp
90+
*.log
91+
*.log.*
92+
93+
# Ignore test results
94+
test-output/
95+
test-results/
96+
97+
# Ignore dependency directories
98+
node_modules/
99+
vendor/

0 commit comments

Comments
 (0)