Skip to content

Commit c811671

Browse files
evan-palmercoamitchEverardoGrakeshv24
authored
Implemented base control architecture and demonstrations (#11)
* Added skeleton packages for controllers * Added vcs install to devcontainers and fixed example_pkg build error * Fixed clang format andlicense * Implemented velocity controller, TAM controller, and thruster controller (#6) * Started ISMC implementation * Continued implementing ismc * Started implementation file * Added hydrodynamic parameters * Added generate_parameter_library integration * Added everything but state callback and control law * Added system state updates * Finished initial version of velocity controller * Cleanup and minor bug fixes * Added missing imports * Added dummy package for testing * Added call to update state values * thruster allocation matrix controller before testing * changes according to PR comments * Fixed pluginlib issue. Able to load both controllers but need to address why ros2_control node dies * WIP: Modified URDF * Partially works. Still need to fix TAM controller * Save point * Started fixed * Added configuration type * Rewrite of tam controller and isolated bug in velocity controller * Added author names * Cleaned up velocity controller and fixed some bugs * Fixed bug with URDF and cleaned up thruster controller * Finished thrust curve controller * Fixed linter errors * Fixed tam bug * fixing tam todos. more work needed. * Added deadband into thruster controller * renamed command interface prefix to reference controller * Updated meta package * Added auv_control_msg package and fixed the TODOs in TAM controller * Removed unnecessary deps * Cleanup a bit * Added missing dep for hydrodynamics to package configuration * Updated to use effort interfaces * Removed unused package * Initial cleanup for pr * Fixed precommit errors and attempting to fix ci workflow * i hate devops so much * take two * Trying ros industrial again * Trying again * WHY * tired * Attempting to setup the upstream workspace * fixed clang-tidy file and linter errors * you win clang tidy * Forgot to remove colcon build from devcontainer stage * Resolved pr comments --------- Co-authored-by: unknown <coamitch@gmail.com> Co-authored-by: EverardoG <everardo.a.gonzalez@gmail.com> Co-authored-by: Rakesh Vivekanandan <rakeshvivek97@gmail.com> * Added documentation and examples to demonstrate project use (#10) * Create README.md Added a readme for the tam controller * Update README.md * additional edits to tam README.md * fixed formatting README.md * revert code block formatting and update summary in tam README.md * Created README.md for velocity controller. * Fixed velocity controller README.md formatting * Created README.md for thrust controllers. * Update README.md * Update README.md * Update README.md * Updated main README * Cleaned up readmes * Fixed notice * More formatting changes * Fixed capitalization of chainable * Fixed formatting in velocity control readme * Added missing abbreviation declaration * Implemented examples and associated documentation (#9) * add auv_control_demos * added example for individual controller * updated package.xml * minor fix to launch file * Suggested PR changes * Made some minor grammar fixes and added copyright to launch files * Fixed lint errors in auv_control_demos top-level readme * Made some formatting improvements to the chained controller demo * Made some final small changes --------- Co-authored-by: EverardoG <everardo.a.gonzalez@gmail.com> Co-authored-by: Evan Palmer <evanp922@gmail.com> --------- Co-authored-by: coamitch <52305806+coamitch@users.noreply.github.com> Co-authored-by: Rakesh Vivekanandan <rakeshvivek97@gmail.com> Co-authored-by: Rakesh Vivekanandan <34474602+rakeshv24@users.noreply.github.com> Co-authored-by: EverardoG <everardo.a.gonzalez@gmail.com> --------- Co-authored-by: unknown <coamitch@gmail.com> Co-authored-by: EverardoG <everardo.a.gonzalez@gmail.com> Co-authored-by: Rakesh Vivekanandan <rakeshvivek97@gmail.com> Co-authored-by: coamitch <52305806+coamitch@users.noreply.github.com> Co-authored-by: Rakesh Vivekanandan <34474602+rakeshv24@users.noreply.github.com>
1 parent cc2e521 commit c811671

File tree

68 files changed

+3549
-252
lines changed

Some content is hidden

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

68 files changed

+3549
-252
lines changed

.clang-format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
Language: Cpp
33
BasedOnStyle: Google
4-
ColumnLimit: 100
4+
ColumnLimit: 120
55
MaxEmptyLinesToKeep: 1
66

77
IndentWidth: 2

.clang-tidy

Lines changed: 30 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -25,56 +25,43 @@ Checks: >
2525
-bugprone-easily-swappable-parameters,
2626
-bugprone-implicit-widening-of-multiplication-result,
2727
-clang-diagnostic-error,
28-
-bugprone-exception-escape
28+
-bugprone-exception-escape,
29+
-misc-include-cleaner,
30+
-bugprone-reserved-identifier
2931
WarningsAsErrors: "*"
3032
CheckOptions:
3133
- key: readability-braces-around-statements.ShortStatementLines
3234
value: "2"
3335
- key: readability-identifier-naming.NamespaceCase
3436
value: lower_case
35-
- key: readability-identifier-naming.ClassCase
37+
# type names
38+
- key: readability-identifier-naming.ClassCase
3639
value: CamelCase
37-
- key: readability-identifier-naming.StructCase
40+
- key: readability-identifier-naming.StructCase
3841
value: CamelCase
39-
- key: readability-identifier-naming.TemplateParameterCase,
40-
value: CamelCase,
41-
- key: readability-identifier-naming.FunctionCase
42-
value: camelBack
43-
- key: readability-identifier-naming.MethodCase
44-
value: camelBack
45-
- key: readability-identifier-naming.VariableCase
46-
value: lower_case
47-
- key: readability-identifier-naming.ClassMemberCase
48-
value: lower_case
49-
- key: readability-identifier-naming.ClassMemberSuffix
50-
value: _
51-
- key: readability-identifier-naming.PrivateMemberSuffix
52-
value: _
53-
- key: readability-identifier-naming.ProtectedMemberSuffix
54-
value: _
55-
- key: readability-identifier-naming.EnumConstantCase
56-
value: CamelCase
57-
- key: readability-identifier-naming.EnumConstantPrefix
58-
value: k
59-
- key: readability-identifier-naming.ConstexprVariableCase
60-
value: CamelCase
61-
- key: readability-identifier-naming.ConstexprVariablePrefix
62-
value: k
63-
- key: readability-identifier-naming.GlobalConstantCase
42+
- key: readability-identifier-naming.EnumCase
6443
value: CamelCase
65-
- key: readability-identifier-naming.GlobalConstantPrefix
66-
value: k
67-
- key: readability-identifier-naming.MemberConstantCase
44+
- key: readability-identifier-naming.UnionCase
6845
value: CamelCase
69-
- key: readability-identifier-naming.MemberConstantPrefix
70-
value: k
71-
- key: readability-identifier-naming.StaticConstantCase
72-
value: CamelCase
73-
- key: readability-identifier-naming.StaticConstantPrefix
74-
value: k
75-
- key: readability-implicit-bool-conversion.AllowIntegerConditions
76-
value: 1
77-
- key: readability-implicit-bool-conversion.AllowPointerConditions
78-
value: 1
79-
- key: readability-function-cognitive-complexity.IgnoreMacros
80-
value: 1
46+
# function names
47+
- key: readability-identifier-naming.FunctionCase
48+
value: lower_case
49+
# method names
50+
- key: readability-identifier-naming.MethodCase
51+
value: lower_case
52+
# variable names
53+
- key: readability-identifier-naming.VariableCase
54+
value: lower_case
55+
- key: readability-identifier-naming.PrivateMemberSuffix
56+
value: "_"
57+
- key: readability-identifier-naming.ProtectedMemberSuffix
58+
value: "_"
59+
# const, static, or global variables
60+
- key: readability-identifier-naming.EnumConstantCase
61+
value: UPPER_CASE
62+
- key: readability-identifier-naming.StaticConstantCase
63+
value: UPPER_CASE
64+
- key: readability-identifier-naming.GlobalConstantCase
65+
value: UPPER_CASE
66+
- key: readability-identifier-naming.ClassConstantCase
67+
value: UPPER_CASE

.devcontainer/nouveau/Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ WORKDIR $USER_WORKSPACE
99

1010
COPY --chown=$USER_UID:$USER_GID . src/$PROJECT_NAME
1111

12-
RUN ls src/$PROJECT_NAME
13-
1412
RUN sudo apt-get -q update \
1513
&& sudo apt-get -q -y upgrade \
1614
&& rosdep update \

.devcontainer/nouveau/devcontainer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
"esbenp.prettier-vscode",
3535
"xaver.clang-format",
3636
"charliermarsh.ruff",
37-
"ms-python.black-formatter"
37+
"ms-python.black-formatter",
38+
"josetr.cmake-language-support-vscode"
3839
]
3940
}
4041
}

.devcontainer/nvidia/Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ WORKDIR $USER_WORKSPACE
99

1010
COPY --chown=$USER_UID:$USER_GID . src/$PROJECT_NAME
1111

12-
RUN ls src/$PROJECT_NAME
13-
1412
RUN sudo apt-get -q update \
1513
&& sudo apt-get -q -y upgrade \
1614
&& rosdep update \

.devcontainer/nvidia/devcontainer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
"esbenp.prettier-vscode",
3939
"xaver.clang-format",
4040
"charliermarsh.ruff",
41-
"ms-python.black-formatter"
41+
"ms-python.black-formatter",
42+
"josetr.cmake-language-support-vscode"
4243
]
4344
}
4445
}

.docker/Dockerfile

Lines changed: 5 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ FROM ros:$ROS_DISTRO-ros-base as ci
44
ENV DEBIAN_FRONTEND=noninteractive
55
WORKDIR /root/ws_ros
66

7-
# Update to be your project's name
87
ENV PROJECT_NAME=auv_controllers
98

109
COPY . src/$PROJECT_NAME
@@ -28,7 +27,8 @@ RUN apt-get -q update \
2827
&& rm -rf /var/lib/apt/lists/*
2928

3029
# Install all ROS dependencies needed for CI
31-
RUN apt-get -q update \
30+
RUN vcs import src < src/$PROJECT_NAME/ros2.repos \
31+
&& apt-get -q update \
3232
&& apt-get -q -y upgrade \
3333
&& rosdep update \
3434
&& rosdep install -y --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} --as-root=apt:false \
@@ -37,7 +37,7 @@ RUN apt-get -q update \
3737
&& apt-get clean -y \
3838
&& rm -rf /var/lib/apt/lists/*
3939

40-
FROM ci as robot
40+
FROM ci as desktop
4141

4242
# Configure a new non-root user
4343
ARG USERNAME=ros
@@ -61,12 +61,10 @@ WORKDIR $USER_WORKSPACE
6161

6262
COPY --chown=$USER_UID:$USER_GID . src/$PROJECT_NAME
6363

64-
# Uncomment to download and install external repos used by the project
65-
# RUN vcs import src < src/$PROJECT_NAME/ros2.repos
66-
6764
# Install all ROS dependencies
6865
WORKDIR $USER_WORKSPACE
69-
RUN sudo apt-get -q update \
66+
RUN vcs import src < src/$PROJECT_NAME/ros2.repos \
67+
&& sudo apt-get -q update \
7068
&& sudo apt-get -q -y upgrade \
7169
&& rosdep update \
7270
&& rosdep install -y --from-paths src --ignore-src -r --rosdistro ${ROS_DISTRO} \
@@ -80,39 +78,6 @@ RUN . "/opt/ros/${ROS_DISTRO}/setup.sh" \
8078
&& echo "source ${USER_WORKSPACE}/install/setup.bash" >> /home/$USERNAME/.bashrc \
8179
&& echo "if [ -f /opt/ros/${ROS_DISTRO}/setup.bash ]; then source /opt/ros/${ROS_DISTRO}/setup.bash; fi" >> /home/$USERNAME/.bashrc
8280

83-
FROM robot as desktop
84-
85-
ENV DEBIAN_FRONTEND=noninteractive
86-
ENV USER_WORKSPACE=/home/$USERNAME/ws_ros
87-
WORKDIR $USER_WORKSPACE
88-
89-
# Install tools needed for Gazebo installation
90-
RUN sudo apt-get -q update \
91-
&& sudo apt-get -q -y upgrade \
92-
&& sudo apt-get install -y \
93-
lsb-release \
94-
wget \
95-
gnupg \
96-
&& sudo apt-get autoremove -y \
97-
&& sudo apt-get clean -y \
98-
&& sudo rm -rf /var/lib/apt/lists/*
99-
100-
# Set to the desired version of Gazebo
101-
# Refer to the official documentation for the recommended pairings:
102-
# https://gazebosim.org/docs/harmonic/ros_installation
103-
ENV GAZEBO_VERSION=harmonic
104-
105-
RUN sudo wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg \
106-
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null \
107-
&& sudo apt-get -q update \
108-
&& sudo apt-get -q -y upgrade \
109-
&& sudo apt-get install -y \
110-
gz-$GAZEBO_VERSION \
111-
ros-$ROS_DISTRO-ros-gz$GAZEBO_VERSION \
112-
&& sudo apt-get autoremove -y \
113-
&& sudo apt-get clean -y \
114-
&& sudo rm -rf /var/lib/apt/lists/*
115-
11681
FROM desktop as desktop-nvidia
11782

11883
# Install NVIDIA software

.dockerignore

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
# Except the following
55
!requirements-dev.txt
6-
7-
# Allow your ROS 2 packages here, e.g.:
8-
!example_pkg
6+
!auv_controllers
7+
!velocity_controllers
8+
!thruster_allocation_matrix_controller
9+
!thruster_controllers
10+
!auv_control_msgs
11+
!ros2.repos

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ jobs:
3838
uses: ros-industrial/industrial_ci@master
3939
env:
4040
DOCKER_IMAGE: ghcr.io/robotic-decision-making-lab/auv_controllers:${{ matrix.env.IMAGE }}
41+
UPSTREAM_WORKSPACE: ros2.repos
42+
AFTER_SETUP_UPSTREAM_WORKSPACE: vcs pull $BASEDIR/upstream_ws/src
43+
AFTER_SETUP_DOWNSTREAM_WORKSPACE: vcs pull $BASEDIR/downstream_ws/src
4144
CXXFLAGS: >-
4245
-Wall -Wextra -Wpedantic -Wwrite-strings -Wunreachable-code -Wpointer-arith -Wredundant-decls
4346
CC: ${{ env.CLANG_TIDY && 'clang' }}

.github/workflows/docker.yml

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -55,54 +55,6 @@ jobs:
5555
labels: ${{ steps.meta.outputs.labels }}
5656
push: ${{ env.PUSH }}
5757

58-
robot:
59-
strategy:
60-
fail-fast: false
61-
matrix:
62-
ROS_DISTRO: [iron]
63-
runs-on: ubuntu-latest
64-
permissions:
65-
packages: write
66-
contents: read
67-
steps:
68-
- name: Checkout repository
69-
uses: actions/checkout@v4
70-
71-
- name: Set up QEMU
72-
uses: docker/setup-qemu-action@v3.0.0
73-
74-
- name: Set up Docker Buildx
75-
uses: docker/setup-buildx-action@v3
76-
77-
- name: Log into registry
78-
if: env.PUSH == 'true'
79-
uses: docker/login-action@v3.1.0
80-
with:
81-
registry: ghcr.io
82-
username: ${{ github.actor }}
83-
password: ${{ secrets.GITHUB_TOKEN }}
84-
85-
- name: Extract Docker metadata
86-
if: env.PUSH == 'true'
87-
id: meta
88-
uses: docker/metadata-action@v5.5.1
89-
with:
90-
images: ghcr.io/${{ github.repository }}
91-
tags: |
92-
type=raw,value=${{ matrix.ROS_DISTRO }}-${{ github.job }}
93-
94-
- name: Build and push Docker image
95-
uses: docker/build-push-action@v5.3.0
96-
with:
97-
context: .
98-
file: .docker/Dockerfile
99-
build-args: ROS_DISTRO=${{ matrix.ROS_DISTRO }}
100-
target: ${{ github.job }}
101-
tags: ${{ steps.meta.outputs.tags }}
102-
labels: ${{ steps.meta.outputs.labels }}
103-
push: ${{ env.PUSH }}
104-
platforms: linux/amd64,linux/arm64
105-
10658
desktop:
10759
strategy:
10860
fail-fast: false

0 commit comments

Comments
 (0)