-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
269 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--- | ||
BasedOnStyle: Google | ||
AccessModifierOffset: -2 | ||
ConstructorInitializerIndentWidth: 2 | ||
AlignEscapedNewlinesLeft: false | ||
AlignTrailingComments: true | ||
AllowAllParametersOfDeclarationOnNextLine: false | ||
AllowShortIfStatementsOnASingleLine: false | ||
AllowShortLoopsOnASingleLine: false | ||
AllowShortFunctionsOnASingleLine: None | ||
AlwaysBreakTemplateDeclarations: true | ||
AlwaysBreakBeforeMultilineStrings: false | ||
BreakBeforeBinaryOperators: false | ||
BreakBeforeTernaryOperators: false | ||
BreakConstructorInitializersBeforeComma: true | ||
BinPackParameters: true | ||
ColumnLimit: 120 | ||
ConstructorInitializerAllOnOneLineOrOnePerLine: true | ||
DerivePointerBinding: false | ||
PointerBindsToType: true | ||
ExperimentalAutoDetectBinPacking: false | ||
IndentCaseLabels: true | ||
MaxEmptyLinesToKeep: 1 | ||
NamespaceIndentation: None | ||
ObjCSpaceBeforeProtocolList: true | ||
PenaltyBreakBeforeFirstCallParameter: 19 | ||
PenaltyBreakComment: 60 | ||
PenaltyBreakString: 1 | ||
PenaltyBreakFirstLessLess: 1000 | ||
PenaltyExcessCharacter: 1000 | ||
PenaltyReturnTypeOnItsOwnLine: 90 | ||
SpacesBeforeTrailingComments: 2 | ||
Cpp11BracedListStyle: false | ||
Standard: Auto | ||
IndentWidth: 2 | ||
TabWidth: 2 | ||
UseTab: Never | ||
IndentFunctionDeclarationAfterType: false | ||
SpacesInParentheses: false | ||
SpacesInAngles: false | ||
SpaceInEmptyParentheses: false | ||
SpacesInCStyleCastParentheses: false | ||
SpaceAfterControlStatementKeyword: true | ||
SpaceBeforeAssignmentOperators: true | ||
ContinuationIndentWidth: 4 | ||
IncludeBlocksStyle: Preserve | ||
SortIncludes: CaseInsensitive | ||
SpaceAfterCStyleCast: false | ||
|
||
# Configure each individual brace in BraceWrapping | ||
BreakBeforeBraces: Custom | ||
|
||
# Control of individual brace wrapping cases | ||
BraceWrapping: | ||
{ | ||
AfterClass: "true", | ||
AfterControlStatement: "true", | ||
AfterEnum: "true", | ||
AfterFunction: "true", | ||
AfterNamespace: "true", | ||
AfterStruct: "true", | ||
AfterUnion: "true", | ||
BeforeCatch: "true", | ||
BeforeElse: "true", | ||
IndentBraces: "false", | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# @license BSD-3 https://opensource.org/licenses/BSD-3-Clause | ||
# Copyright (c) 2021, Institute of Automatic Control - RWTH Aachen University | ||
# All rights reserved. | ||
|
||
# Choose from melodic or noetic tags | ||
FROM ros:noetic-robot | ||
|
||
# Add your own additional packages | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y \ | ||
# Check if GUI and 3D acceleration works | ||
mesa-utils x11-apps \ | ||
# Nice plots for debugging | ||
ros-${ROS_DISTRO}-plotjuggler-ros \ | ||
&& apt-get upgrade -y \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# git-lfs | ||
RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \ | ||
apt-get update && \ | ||
apt-get install git-lfs -y --no-install-recommends && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
git lfs install | ||
# ROS additional essential packages | ||
RUN apt-get update && apt-get install -y --no-install-recommends\ | ||
python3-catkin-tools python3-catkin-lint python3-rosdep python3-rosinstall python3-rosinstall-generator python3-vcstool python3-wstool build-essential python3-osrf-pycommon \ | ||
ros-${ROS_DISTRO}-ros-control ros-${ROS_DISTRO}-ros-controllers ros-${ROS_DISTRO}-rqt-controller-manager && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
ENV DEBIAN_FRONTEND=dialog | ||
|
||
# Setup non-root user to solve file permission problems with rootfull docker | ||
ARG USERNAME=vscode | ||
ARG USER_UID=1000 | ||
ARG USER_GID=${USER_UID} | ||
|
||
RUN groupadd --gid ${USER_GID} $USERNAME \ | ||
&& useradd --uid ${USER_UID} --gid ${USER_GID} -m $USERNAME \ | ||
&& apt-get update \ | ||
&& apt-get install -y --no-install-recommends sudo \ | ||
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ | ||
&& chmod 0440 /etc/sudoers.d/$USERNAME | ||
|
||
# Autocompletion for root user | ||
RUN echo "if [ -f /etc/bash_completion ] && ! shopt -oq posix; then\n . /etc/bash_completion\nfi" >> /root/.bashrc | ||
|
||
# Create for vscode | ||
RUN sudo mkdir -p /workspace/src && chown -R vscode:vscode /workspace | ||
# Use non-root user to avoid permission problems | ||
USER vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// @license BSD-3 https://opensource.org/licenses/BSD-3-Clause | ||
// Copyright (c) 2021, Institute of Automatic Control - RWTH Aachen University | ||
// All rights reserved. | ||
{ | ||
"dockerComposeFile": "docker-compose.yml", | ||
"service": "ros-devcontainer", | ||
"workspaceFolder": "/workspace/src/lbrmed-ros", | ||
// Source the ROS workspace, the ${containerWorkspaceFolder} variable only gets replaced in this .json | ||
// Install dependencies for workspace except Gazebo packages as the OSRF version is installed | ||
"postCreateCommand": "echo 'source /opt/ros/${ROS_DISTRO}/setup.bash' >> ${HOME}/.bashrc && echo 'source ${containerWorkspaceFolder}/devel/setup.bash' >> ${HOME}/.bashrc && /bin/sh .devcontainer/postCreate.sh", | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"dotjoshjohnson.xml", | ||
"epivision.vscode-file-header", | ||
"gruntfuggly.todo-tree", | ||
"mhutchie.git-graph", | ||
"ms-azuretools.vscode-docker", | ||
"ms-iot.vscode-ros", | ||
"ms-python.black-formatter", | ||
"ms-python.flake8", | ||
"ms-python.python", | ||
"ms-vscode.cmake-tools", | ||
"ms-vscode.cpptools", | ||
"ms-vsliveshare.vsliveshare", | ||
"oderwat.indent-rainbow", | ||
"redhat.vscode-yaml", | ||
"streetsidesoftware.code-spell-checker", | ||
"twxs.cmake", | ||
"valentjn.vscode-ltex", | ||
"visualstudioexptteam.vscodeintellicode" | ||
], | ||
// Set *default* container specific settings.json values on container create. | ||
"settings": { | ||
// Use C/C++ extension for formatting, linting and debugging | ||
"C_Cpp.clang_format_style": "file", | ||
"C_Cpp.codeAnalysis.clangTidy.enabled": true, | ||
"C_Cpp.default.cppStandard": "c++14", | ||
"C_Cpp.default.cStandard": "c11", | ||
"C_Cpp.formatting": "clangFormat", | ||
"[cpp]": { | ||
"editor.defaultFormatter": "ms-vscode.cpptools" | ||
}, | ||
// Other settings | ||
"editor.formatOnSave": true, | ||
"editor.tabSize": 2, | ||
"git.repositoryScanMaxDepth": 3, | ||
"powerHeader.autoInsert.enable": true, | ||
"powerHeader.commentMode": "line", | ||
"powerHeader.template": "file://${containerWorkspaceFolder}/.vscode/copyright_template.txt", | ||
"python.formatting.provider": "autopep8", | ||
"python.autoComplete.extraPaths": [ | ||
"/opt/ros/${env:ROS_DISTRO}/lib/python3/dist-packages" | ||
], | ||
"python.analysis.extraPaths": [ | ||
"/opt/ros/${env:ROS_DISTRO}/lib/python3/dist-packages" | ||
], | ||
"terminal.integrated.defaultProfile.linux": "bash", | ||
"terminal.integrated.gpuAcceleration": "on" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Use this, if you run a full Linux installation | ||
services: | ||
ros-devcontainer: | ||
build: | ||
# context: .. | ||
dockerfile: Dockerfile | ||
# Optional: Access external devices, e.g., USB cameras | ||
privileged: true | ||
volumes: | ||
- ..:/workspace/src/lbrmed-ros:cached | ||
# GUI support | ||
- /tmp/.X11-unix:/tmp/.X11-unix | ||
# Avoid Qt glitches | ||
ipc: host | ||
network_mode: host | ||
environment: | ||
# GUI support | ||
DISPLAY: $DISPLAY | ||
WAYLAND_DISPLAY: WAYLAND_DISPLAY | ||
XDG_RUNTIME_DIR: XDG_RUNTIME_DIR | ||
PULSE_SERVER: PULSE_SERVER | ||
# Optional: Use NVIDIA GPU for rendering | ||
# __NV_PRIME_RENDER_OFFLOAD: 1 | ||
# __GLX_VENDOR_LIBRARY_NAME: nvidia | ||
devices: | ||
# Accelerated 3D graphics | ||
- /dev/dri | ||
# Optional: Enable CUDA | ||
# deploy: | ||
# resources: | ||
# reservations: | ||
# devices: | ||
# - driver: nvidia | ||
# capabilities: [gpu] | ||
# count: 1 # limit number of GPUs used by container | ||
# Required for ptrace-based debuggers like C++ | ||
cap_add: | ||
- SYS_PTRACE | ||
security_opt: | ||
- apparmor:unconfined | ||
- seccomp:unconfined | ||
# Avoid shutting down after process ends | ||
command: sleep infinity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# @license BSD-3 https://opensource.org/licenses/BSD-3-Clause | ||
# Copyright (c) 2021, Institute of Automatic Control - RWTH Aachen University | ||
# All rights reserved. | ||
|
||
# /workspace/src/lbrmed-ros | ||
cd /workspace | ||
|
||
# If it exists: extend workspace from source built MoveIt (which extends /opt/ros/...) | ||
if [ -d "/moveit_ws/devel" ]; then | ||
catkin config --init --extend /moveit_ws/devel --cmake-args -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=1 #-DCMAKE_CXX_STANDARD=17 | ||
else | ||
catkin config --init --extend /opt/ros/$ROS_DISTRO --cmake-args -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=1 #-DCMAKE_CXX_STANDARD=17 | ||
fi | ||
|
||
# install workspace dependencies, src is one level above the lbrmed-ros workspace | ||
wstool init src | ||
wstool merge -t src src/lbrmed-ros/.rosinstall | ||
wstool update -t src | ||
rosdep update && sudo apt-get update | ||
rosdep install --from-paths src --ignore-src -r -q -y --skip-keys 'gazebo gazebo_dev gazebo_plugins gazebo_ros gazebo_ros_control' | ||
# install other system dependencies, note that they are not cached for rebuilds of the devcontainer | ||
# frequently used dependencies should be install in my.Dockerfile | ||
|
||
# Check rendering support | ||
glxinfo -B |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
.catkin_tools | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters