Skip to content
This repository was archived by the owner on Apr 10, 2025. It is now read-only.

Commit 32a1072

Browse files
authored
Implement driver and controller interfaces (#25)
* Started project configuration * Added missing dotfiles * Started implementation of alpha driver * continued implementation of alpha driver * Finished initial crc implementation and started devops error resolution * Working on resolving build errors for tests * Resolved linking errors with testing in cmakelists * cleaned up alpha driver cmakelists file * Resolved bugs in crc calculation * implemented cobs encoding and cleaned up crc methods * Revert back to clang formatting * added support for clang tidy and resolved clang tidy errors * resolved copyright errors * forgot to save * more files that i forgot to save * Started designing ros messages * Implemented support for packet decoding * Cleanup * implemented unit tests for packet * Resolve type warnings and discrepancies between cpplint and clang format * Made a packet ros msg for comms between driver and control interface * save point * started implementing terminal configurations and serial device initialization * added methods to send data and register read callbacks * Added support for configuring read to block * Added active public member * started implementing heartbeat monitor * Clean up linter errors * Cleaned up some guidelines violations and integrated logging support into client * Finished up initial implementation of serial client * started implementation of ros wrapper for driver * resolved some bugs in the serial client * Resolved bug in serial read * Cleaned up implemented and comments * added heartbeat monitor * sorry google but i hate your method naming convention * rip buildx * started refactoring to support ros2 control and started systeminterface implementation * Continued refactoring driver to better support ros2 control integration * Cleaned up comments and added new request method * Converted driver to library and separated control interface * get rid of gross src directory * forgot to actually remove src * started implementation of hardware interface * removed alpha msgs package and added bringup and description packages * started implementation of init method * finished initial version of hardware interface on_init * started implementing on_cleanup * added logs and try catch blocks for mode switching * Remove files from develop to start enforcing pr process * Starting down the rabbit hole of exception safe code.. cheers Jon Kalb * Integrate a Linux serial driver with ros2_control position, velocity, and joint trajectory control (#18) * updated exceptions according to feedback from code review * removed unnecessary consts * Integrate ros2_control for position, velocity, and joint trajectory control (#11) * moved ros2 control work to new branch * started adding support for position control * quick save * Implemented command and state interface exports * Resolve merge conflicts * Save point * added on_configure method * finished read and write methods * Implemented initial version of write method * ported meshes and URDFs from reach sdk * Added urdf specifications and rviz launch * fix logger naming in hardware description * added missing readme * added missing readme * starting integration of ros2_control xacro * fix readme link * Remove italics * added ros2_control descriptions nad config and gazebo macro * added moveit * started moveit2 integration * Starting to migrate moveit2 configs to description package * started working on adding launch files * removed joint state gui * squashed system hardware bugs and continued bringup * why does gazebo suck so much * Save point * finished first versions of launch files.. time to debug * Fixed moveit configs * curse you moveit * fixed controller execution * fixed rviz launch with gazebo * fixed moveit bugs * debugging gazebo * Removed gazebo stuff for time being * started system cleanup for PR * i guess its ros 2 not ros2 * cleaned up bringup package * cleaned up folder structure * starting cleanup of documentation * IMPORTANT GAZEBO SAVE POINT * added gazebo to dockerfile * Added documented inertial properties * fixed bugs in state callbacks * continued bug fixes * save point for ramen * resolved bugs in hardware configuration with moveit * first pass for PR * Resolved *most* of the comments from the pr review * fixed joint limit issues * Fixed initial positions file error * Added missing changelog document * Fixed camera angles for rviz and gazebo * Fixed moveit rviz camera angle * fixed order of moveit controllers * Created a CODE_OF_CONDUCT document (#19) * Integrate GH actions CI/CD pipelines (#21) * started docker then got distracted * split dev image from production images * take 1 * take 2 * moving ci integration here to make docker updates easier * testing precommit pipeline * take one on ci * ran with wrong branch * attempt to use clang style config files * another attempt at clang format * testing different version of clang tidy * testing to see if ici catches bug in test * attempt to disable clang format checks * remove clang format from build tests in favor of pre-commit * weird things happening with tidy * weird things happening with tidy * im tired and want to go to bed * im just guessing at this point * another random test * disable ici clang tidy in favor of other workflow * why * why * why * pain * sad * this is as good as it's going to get * put env variable in wrong spot * fixed readme. time for bed * fixed readme. time for bed * fixed readme. time for bed * removed test branch from ci pipeline. actually going to bed now * Resolved PR comments
1 parent 643f9b0 commit 32a1072

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+5555
-3
lines changed

.clang-format

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
Language: Cpp
3+
BasedOnStyle: Google
4+
ColumnLimit: 100
5+
MaxEmptyLinesToKeep: 1
6+
7+
IndentWidth: 2
8+
TabWidth: 2
9+
UseTab: Never
10+
AccessModifierOffset: -2
11+
AlignAfterOpenBracket: AlwaysBreak
12+
ConstructorInitializerIndentWidth: 0
13+
ContinuationIndentWidth: 2
14+
DerivePointerAlignment: false
15+
PointerAlignment: Middle
16+
PackConstructorInitializers: Never
17+
18+
# Configure brace wrapping cases
19+
BreakBeforeBraces: Custom
20+
BraceWrapping:
21+
AfterClass: true
22+
AfterEnum: true
23+
AfterFunction: true
24+
AfterNamespace: true
25+
AfterStruct: true
26+
AfterUnion: true
27+
BeforeCatch: true

.clang-tidy

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
---
2+
Checks: >
3+
-*,
4+
abseil-*,
5+
bugprone-*,
6+
google-*,
7+
misc-*,
8+
modernize-*,
9+
performance-*,
10+
portability-*,
11+
readability-*,
12+
-google-readability-braces-around-statements,
13+
-google-readability-namespace-comments,
14+
-google-runtime-references,
15+
-misc-non-private-member-variables-in-classes,
16+
-modernize-return-braced-init-list,
17+
-modernize-use-trailing-return-type,
18+
-performance-move-const-arg,
19+
-readability-braces-around-statements,
20+
-readability-identifier-length,
21+
-readability-magic-numbers,
22+
-readability-named-parameter,
23+
-readability-redundant-declaration,
24+
-readability-function-cognitive-complexity,
25+
-bugprone-narrowing-conversions,
26+
-bugprone-easily-swappable-parameters,
27+
-bugprone-implicit-widening-of-multiplication-result,
28+
-modernize-avoid-bind,
29+
-modernize-use-nodiscard
30+
WarningsAsErrors: "*"
31+
CheckOptions:
32+
- key: readability-braces-around-statements.ShortStatementLines
33+
value: "2"
34+
- key: readability-identifier-naming.NamespaceCase
35+
value: lower_case
36+
- key: readability-identifier-naming.ClassCase
37+
value: CamelCase
38+
- key: readability-identifier-naming.StructCase
39+
value: CamelCase
40+
- key: readability-identifier-naming.TemplateParameterCase,
41+
value: CamelCase,
42+
- key: readability-identifier-naming.FunctionCase
43+
value: camelBack
44+
- key: readability-identifier-naming.MethodCase
45+
value: camelBack
46+
- key: readability-identifier-naming.VariableCase
47+
value: lower_case
48+
- key: readability-identifier-naming.ClassMemberCase
49+
value: lower_case
50+
- key: readability-identifier-naming.ClassMemberSuffix
51+
value: _
52+
- key: readability-identifier-naming.PrivateMemberSuffix
53+
value: _
54+
- key: readability-identifier-naming.ProtectedMemberSuffix
55+
value: _
56+
- key: readability-identifier-naming.EnumConstantCase
57+
value: CamelCase
58+
- key: readability-identifier-naming.EnumConstantPrefix
59+
value: k
60+
- key: readability-identifier-naming.ConstexprVariableCase
61+
value: CamelCase
62+
- key: readability-identifier-naming.ConstexprVariablePrefix
63+
value: k
64+
- key: readability-identifier-naming.GlobalConstantCase
65+
value: CamelCase
66+
- key: readability-identifier-naming.GlobalConstantPrefix
67+
value: k
68+
- key: readability-identifier-naming.MemberConstantCase
69+
value: CamelCase
70+
- key: readability-identifier-naming.MemberConstantPrefix
71+
value: k
72+
- key: readability-identifier-naming.StaticConstantCase
73+
value: CamelCase
74+
- key: readability-identifier-naming.StaticConstantPrefix
75+
value: k
76+
- key: readability-implicit-bool-conversion.AllowIntegerConditions
77+
value: 1
78+
- key: readability-implicit-bool-conversion.AllowPointerConditions
79+
value: 1
80+
- key: readability-function-cognitive-complexity.IgnoreMacros
81+
value: 1

.devcontainer/Dockerfile

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
ARG ROS_DISTRO=rolling
2+
3+
FROM ros:$ROS_DISTRO as core
4+
5+
LABEL maintainer="Evan Palmer"
6+
LABEL maintainer-email="[email protected]"
7+
8+
ENV DEBIAN_FRONTEND=noninteractive
9+
10+
# Install core apt dependencies
11+
RUN apt-get update && apt-get install -y --no-install-recommends \
12+
apt-utils \
13+
software-properties-common \
14+
git \
15+
wget \
16+
gnupg2 \
17+
lsb-release \
18+
&& apt-get autoremove -y \
19+
&& apt-get clean -y \
20+
&& rm -rf /var/lib/apt/lists/*
21+
22+
# Install core ROS dependencies
23+
RUN apt-get update && apt-get install -y --no-install-recommends \
24+
ros-$ROS_DISTRO-robot-state-publisher \
25+
ros-$ROS_DISTRO-xacro \
26+
ros-$ROS_DISTRO-ros2-control \
27+
ros-$ROS_DISTRO-ros2-controllers \
28+
ros-$ROS_DISTRO-controller-manager \
29+
&& apt-get autoremove -y \
30+
&& apt-get clean -y \
31+
&& rm -rf /var/lib/apt/lists/*
32+
33+
FROM core as ci
34+
35+
# Install CI apt dependencies
36+
RUN apt-get update && apt-get install -y --no-install-recommends \
37+
clang-format \
38+
python3-dev \
39+
python3-pip \
40+
&& apt-get autoremove -y \
41+
&& apt-get clean -y \
42+
&& rm -rf /var/lib/apt/lists/*
43+
44+
# Install debugging/linting Python packages
45+
RUN pip3 install \
46+
black \
47+
flake8 \
48+
isort \
49+
pydocstyle \
50+
pre-commit \
51+
mypy
52+
53+
FROM ci as base
54+
55+
RUN apt-get update && apt-get install -y --no-install-recommends \
56+
ros-$ROS_DISTRO-rviz2 \
57+
ros-dev-tools \
58+
ros-$ROS_DISTRO-moveit \
59+
ros-$ROS_DISTRO-gazebo-ros-pkgs \
60+
ros-$ROS_DISTRO-gazebo-ros2-control \
61+
&& apt-get autoremove -y \
62+
&& apt-get clean -y \
63+
&& rm -rf /var/lib/apt/lists/*
64+
65+
FROM base as develop
66+
67+
RUN apt-get update && apt-get install -y --no-install-recommends \
68+
iputils-ping \
69+
net-tools \
70+
lsb-release \
71+
gdb \
72+
&& apt-get autoremove -y \
73+
&& apt-get clean -y \
74+
&& rm -rf /var/lib/apt/lists/*
75+
76+
# Configure a new non-root user
77+
ARG USERNAME=dev
78+
ARG USER_UID=1000
79+
ARG USER_GID=$USER_UID
80+
81+
RUN groupadd --gid $USER_GID $USERNAME \
82+
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
83+
&& apt-get update \
84+
&& apt-get install -y sudo \
85+
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
86+
&& chmod 0440 /etc/sudoers.d/$USERNAME \
87+
&& rm -rf /var/lib/apt/lists/* \
88+
&& echo "source /usr/share/bash-completion/completions/git" >> /home/$USERNAME/.bashrc \
89+
&& echo "if [ -f /opt/ros/${ROS_DISTRO}/setup.bash ]; then source /opt/ros/${ROS_DISTRO}/setup.bash; fi" >> /home/$USERNAME/.bashrc
90+
91+
ARG WORKSPACE
92+
RUN echo "if [ -f ${WORKSPACE}/install/setup.bash ]; then source ${WORKSPACE}/install/setup.bash; fi" >> /home/$USERNAME/.bashrc
93+
RUN echo "export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:${WORKSPACE}/" >> /home/$USERNAME/.bashrc
94+
RUN echo "source /usr/share/gazebo/setup.sh" >> /home/$USERNAME/.bashrc

.devcontainer/devcontainer.json

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
{
2+
"dockerFile": "Dockerfile",
3+
"build": {
4+
"args": {
5+
"WORKSPACE": "${containerWorkspaceFolder}",
6+
"ROS_DISTRO": "humble"
7+
}
8+
},
9+
"remoteUser": "dev",
10+
"runArgs": [
11+
"--network=host",
12+
"--cap-add=SYS_PTRACE",
13+
"--security-opt=seccomp:unconfined",
14+
"--security-opt=apparmor:unconfined",
15+
"--volume=/dev:/dev",
16+
"--privileged"
17+
],
18+
"containerEnv": {
19+
"DISPLAY": "${localEnv:DISPLAY}",
20+
"WAYLAND_DISPLAY": "${localEnv:WAYLAND_DISPLAY}",
21+
"XDG_RUNTIME_DIR": "${localEnv:XDG_RUNTIME_DIR}",
22+
"PULSE_SERVER": "${localEnv:PULSE_SERVER}"
23+
},
24+
"customizations": {
25+
"vscode": {
26+
"settings": {
27+
"terminal.integrated.profiles.linux": {
28+
"bash": {
29+
"path": "/bin/bash"
30+
}
31+
},
32+
"terminal.integrated.defaultProfile.linux": "bash",
33+
"files.associations": {
34+
"*.repos": "yaml",
35+
"*.world": "xml",
36+
"*.xacro": "xml",
37+
"*.srdf": "xml",
38+
"*.rviz": "yaml"
39+
},
40+
"files.eol": "\n",
41+
"files.insertFinalNewline": true,
42+
"files.trimTrailingWhitespace": true,
43+
"editor.acceptSuggestionOnEnter": "smart",
44+
"editor.wordWrap": "on",
45+
"editor.formatOnSave": true,
46+
"editor.tabSize": 2,
47+
"editor.rulers": [80],
48+
"editor.defaultFormatter": "esbenp.prettier-vscode",
49+
"xml.format.maxLineWidth": 80,
50+
"json.format.enable": true,
51+
"python.linting.enabled": true,
52+
"python.linting.flake8Enabled": true,
53+
"python.linting.pylintEnabled": false,
54+
"python.linting.pydocstyleEnabled": true,
55+
"python.linting.mypyEnabled": true,
56+
"python.formatting.provider": "black",
57+
"python.formatting.blackPath": "/usr/local/bin/black",
58+
"python.autoComplete.extraPaths": [
59+
"/opt/ros/humble/lib/python3.10/site-packages/"
60+
],
61+
"python.analysis.extraPaths": [
62+
"/opt/ros/humble/lib/python3.10/site-packages/"
63+
],
64+
"C_Cpp.default.intelliSenseMode": "linux-gcc-x86",
65+
"C_Cpp.clang_format_fallbackStyle": "Google",
66+
"C_Cpp.codeAnalysis.clangTidy.enabled": true,
67+
"C_Cpp.codeAnalysis.clangTidy.runAutomatically": true,
68+
"clang-format.executable": "/usr/bin/clang-format",
69+
"uncrustify.configPath.linux": "/opt/ros/humble/lib/python3.10/site-packages/ament_uncrustify/configuration/ament_code_style.cfg",
70+
"[cpp]": {
71+
"editor.wordBasedSuggestions": false,
72+
"editor.suggest.insertMode": "replace",
73+
"editor.semanticHighlighting.enabled": true,
74+
"editor.rulers": [100],
75+
"editor.defaultFormatter": "xaver.clang-format",
76+
"editor.formatOnSave": true
77+
},
78+
"[python]": {
79+
"editor.tabSize": 4,
80+
"editor.rulers": [90],
81+
"editor.defaultFormatter": "ms-python.python",
82+
"editor.codeActionsOnSave": {
83+
"source.organizeImports": true
84+
},
85+
"editor.formatOnSave": true
86+
},
87+
"[dockerfile]": {
88+
"editor.quickSuggestions": {
89+
"strings": true
90+
},
91+
"editor.defaultFormatter": "ms-azuretools.vscode-docker",
92+
"editor.tabSize": 4
93+
},
94+
"[json]": {
95+
"editor.quickSuggestions": {
96+
"strings": true
97+
},
98+
"editor.suggest.insertMode": "replace"
99+
},
100+
"[xml]": {
101+
"editor.defaultFormatter": "redhat.vscode-xml"
102+
},
103+
"[yaml]": {
104+
"editor.insertSpaces": true,
105+
"editor.autoIndent": "advanced",
106+
"editor.defaultFormatter": "redhat.vscode-yaml"
107+
},
108+
"[markdown]": {
109+
"editor.unicodeHighlight.ambiguousCharacters": false,
110+
"editor.unicodeHighlight.invisibleCharacters": false,
111+
"diffEditor.ignoreTrimWhitespace": false,
112+
"editor.wordWrap": "on",
113+
"editor.quickSuggestions": {
114+
"comments": "off",
115+
"strings": "off",
116+
"other": "off"
117+
}
118+
},
119+
"search.exclude": {
120+
"**/node_modules": true,
121+
"**/bower_components": true,
122+
"**/*.code-search": true,
123+
"**/build": true,
124+
"**/install": true,
125+
"**/log": true
126+
}
127+
},
128+
"extensions": [
129+
"ms-azuretools.vscode-docker",
130+
"ms-python.python",
131+
"ms-python.vscode-pylance",
132+
"njpwerner.autodocstring",
133+
"redhat.vscode-xml",
134+
"redhat.vscode-yaml",
135+
"cschlosser.doxdocgen",
136+
"ms-vscode.cpptools",
137+
"josetr.cmake-language-support-vscode",
138+
"smilerobotics.urdf",
139+
"DavidAnson.vscode-markdownlint",
140+
"esbenp.prettier-vscode",
141+
"xaver.clang-format"
142+
]
143+
}
144+
}
145+
}

0 commit comments

Comments
 (0)