Skip to content

Commit b4ac968

Browse files
committed
Finished connection timeout implementation and renamed packages
1 parent acebd1e commit b4ac968

File tree

23 files changed

+223
-236
lines changed

23 files changed

+223
-236
lines changed

.devcontainer/nouveau/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ghcr.io/robotic-decision-making-lab/libwaterlinked:rolling-desktop
1+
FROM ghcr.io/robotic-decision-making-lab/waterlinked_dvl:rolling-desktop
22

33
# Install ROS dependencies
44
# This is done in a previous stage, but we include it again here in case anyone wants to

.devcontainer/nouveau/devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"name": "ROS 2 Dev Container",
33
"dockerFile": "Dockerfile",
44
"context": "../..",
5-
"workspaceMount": "source=${localWorkspaceFolder},target=/home/ubuntu/ws_ros/src/libwaterlinked,type=bind",
6-
"workspaceFolder": "/home/ubuntu/ws_ros/src/libwaterlinked",
5+
"workspaceMount": "source=${localWorkspaceFolder},target=/home/ubuntu/ws_ros/src/waterlinked_dvl,type=bind",
6+
"workspaceFolder": "/home/ubuntu/ws_ros/src/waterlinked_dvl",
77
"remoteUser": "ubuntu",
88
"runArgs": [
99
"--network=host",

.devcontainer/nvidia/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ghcr.io/robotic-decision-making-lab/libwaterlinked:rolling-desktop-nvidia
1+
FROM ghcr.io/robotic-decision-making-lab/waterlinked_dvl:rolling-desktop-nvidia
22

33
# Install ROS dependencies
44
# This is done in a previous stage, but we include it again here in case anyone wants to

.devcontainer/nvidia/devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"name": "ROS 2 NVIDIA Dev Container",
33
"dockerFile": "Dockerfile",
44
"context": "../..",
5-
"workspaceMount": "source=${localWorkspaceFolder},target=/home/ubuntu/ws_ros/src/libwaterlinked,type=bind",
6-
"workspaceFolder": "/home/ubuntu/ws_ros/src/libwaterlinked",
5+
"workspaceMount": "source=${localWorkspaceFolder},target=/home/ubuntu/ws_ros/src/waterlinked_dvl,type=bind",
6+
"workspaceFolder": "/home/ubuntu/ws_ros/src/waterlinked_dvl",
77
"remoteUser": "ubuntu",
88
"runArgs": [
99
"--network=host",

.docker/Dockerfile

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
ARG ROS_DISTRO=rolling
2-
FROM ros:$ROS_DISTRO-ros-base AS ci
2+
FROM ros:$ROS_DISTRO-ros-base AS desktop
33

44
ENV DEBIAN_FRONTEND=noninteractive
55
WORKDIR /root/ws_ros
66

7-
# Update to be your project's name
8-
ENV PROJECT_NAME=libwaterlinked
7+
ENV PROJECT_NAME=waterlinked_dvl
98

109
COPY . src/$PROJECT_NAME
1110

@@ -25,20 +24,6 @@ RUN apt-get -q update \
2524
&& apt-get clean -y \
2625
&& rm -rf /var/lib/apt/lists/*
2726

28-
# Install all ROS dependencies needed for CI
29-
RUN apt-get -q update \
30-
&& apt-get -q -y upgrade \
31-
&& rosdep update \
32-
&& rosdep install -y --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} --as-root=apt:false \
33-
&& rm -rf src \
34-
&& apt-get autoremove -y \
35-
&& apt-get clean -y \
36-
&& rm -rf /var/lib/apt/lists/*
37-
38-
FROM ci AS desktop
39-
40-
ENV DEBIAN_FRONTEND=noninteractive
41-
4227
# Configure the ubuntu non-root user
4328
ARG USERNAME=ubuntu
4429
ARG USER_UID=1000
@@ -80,8 +65,8 @@ RUN sudo apt-get -q update \
8065
&& sudo rm -rf /var/lib/apt/lists/*
8166

8267
RUN . "/opt/ros/${ROS_DISTRO}/setup.sh" \
83-
# && colcon build \
84-
# && echo "source ${USER_WORKSPACE}/install/setup.bash" >> /home/$USERNAME/.bashrc \
68+
&& colcon build \
69+
&& echo "source ${USER_WORKSPACE}/install/setup.bash" >> /home/$USERNAME/.bashrc \
8570
&& echo "if [ -f /opt/ros/${ROS_DISTRO}/setup.bash ]; then source /opt/ros/${ROS_DISTRO}/setup.bash; fi" >> /home/$USERNAME/.bashrc
8671

8772
WORKDIR $USER_WORKSPACE

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
# Except the following
55
!requirements-dev.txt
66
!ros2.repos
7-
!waterlinked_driver
7+
!waterlinked_dvl_driver
88
!libwaterlinked

.github/workflows/ci.yml

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,31 @@
1-
name: Continuous Integration
1+
name: Continuous Integration (CI)
22

33
on:
4+
pull_request:
45
push:
56
branches:
6-
- main
7-
pull_request:
7+
- ros2
88
workflow_dispatch:
99

10-
env:
11-
CLANG_TIDY: true
12-
1310
jobs:
14-
test:
15-
name: Test Implementation
16-
runs-on: ubuntu-latest
17-
11+
pre-commit:
12+
name: CI
13+
runs-on: ubuntu-24.04
1814
strategy:
1915
fail-fast: false
2016
matrix:
2117
env:
22-
- IMAGE: rolling-ci
23-
ROS_DISTRO: rolling
18+
- ROS_DISTRO: rolling
2419
steps:
2520
- name: Checkout repository
2621
uses: actions/checkout@v4
27-
with:
28-
submodules: recursive
29-
30-
- name: Log into registry
31-
uses: docker/login-action@v3.3.0
32-
with:
33-
registry: ghcr.io
34-
username: ${{ github.actor }}
35-
password: ${{ secrets.GITHUB_TOKEN }}
3622

3723
- name: Run ROS Industrial CI
3824
uses: ros-industrial/industrial_ci@master
3925
env:
40-
DOCKER_IMAGE: ghcr.io/robotic-decision-making-lab/libwaterlinked:${{ matrix.env.IMAGE }}
41-
CXXFLAGS: >-
42-
-Wall -Wextra -Wpedantic -Wwrite-strings -Wunreachable-code -Wpointer-arith -Wredundant-decls
43-
CC: ${{ env.CLANG_TIDY && 'clang' }}
44-
CXX: ${{ env.CLANG_TIDY && 'clang++' }}
26+
ROS_DISTRO: ${{ matrix.env.ROS_DISTRO }}
27+
CXXFLAGS: -Wall -Wextra -Wpedantic
28+
CLANG_TIDY: true
29+
UPSTREAM_WORKSPACE: ros2.repos
30+
AFTER_SETUP_UPSTREAM_WORKSPACE: vcs pull $BASEDIR/upstream_ws/src
31+
AFTER_SETUP_DOWNSTREAM_WORKSPACE: vcs pull $BASEDIR/downstream_ws/src

.github/workflows/docker.yml

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -12,50 +12,9 @@ on:
1212
workflow_dispatch:
1313

1414
env:
15-
PUSH: ${{ (github.event_name != 'pull_request') && (github.repository == 'robotic-decision-making-lab/libwaterlinked') }}
15+
PUSH: ${{ (github.event_name != 'pull_request') && (github.repository == 'robotic-decision-making-lab/waterlinked_dvl') }}
1616

1717
jobs:
18-
ci:
19-
strategy:
20-
fail-fast: false
21-
matrix:
22-
ROS_DISTRO: [rolling]
23-
runs-on: ubuntu-latest
24-
permissions:
25-
packages: write
26-
contents: read
27-
steps:
28-
- name: Checkout repository
29-
uses: actions/checkout@v4
30-
31-
- name: Log into registry
32-
if: env.PUSH == 'true'
33-
uses: docker/login-action@v3.3.0
34-
with:
35-
registry: ghcr.io
36-
username: ${{ github.actor }}
37-
password: ${{ secrets.GITHUB_TOKEN }}
38-
39-
- name: Extract Docker metadata
40-
if: env.PUSH == 'true'
41-
id: meta
42-
uses: docker/metadata-action@v5.5.1
43-
with:
44-
images: ghcr.io/${{ github.repository }}
45-
tags: |
46-
type=raw,value=${{ matrix.ROS_DISTRO }}-${{ github.job }}
47-
48-
- name: Build and push Docker image
49-
uses: docker/build-push-action@v6.7.0
50-
with:
51-
context: .
52-
file: .docker/Dockerfile
53-
build-args: ROS_DISTRO=${{ matrix.ROS_DISTRO }}
54-
target: ${{ github.job }}
55-
tags: ${{ steps.meta.outputs.tags }}
56-
labels: ${{ steps.meta.outputs.labels }}
57-
push: ${{ env.PUSH }}
58-
5918
desktop:
6019
strategy:
6120
fail-fast: false

.vscode/settings.json

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,26 @@
77
"*.rviz": "yaml",
88
"*.config": "xml",
99
"*.sdf": "xml",
10-
"chrono": "cpp",
11-
"cstdint": "cpp",
1210
"any": "cpp",
1311
"array": "cpp",
1412
"atomic": "cpp",
1513
"bit": "cpp",
1614
"*.tcc": "cpp",
15+
"bitset": "cpp",
1716
"cctype": "cpp",
1817
"charconv": "cpp",
18+
"chrono": "cpp",
1919
"clocale": "cpp",
2020
"cmath": "cpp",
2121
"codecvt": "cpp",
2222
"compare": "cpp",
2323
"complex": "cpp",
2424
"concepts": "cpp",
2525
"condition_variable": "cpp",
26+
"csignal": "cpp",
2627
"cstdarg": "cpp",
2728
"cstddef": "cpp",
29+
"cstdint": "cpp",
2830
"cstdio": "cpp",
2931
"cstdlib": "cpp",
3032
"cstring": "cpp",
@@ -33,6 +35,7 @@
3335
"cwctype": "cpp",
3436
"deque": "cpp",
3537
"forward_list": "cpp",
38+
"list": "cpp",
3639
"map": "cpp",
3740
"set": "cpp",
3841
"string": "cpp",
@@ -49,12 +52,15 @@
4952
"optional": "cpp",
5053
"random": "cpp",
5154
"ratio": "cpp",
55+
"regex": "cpp",
5256
"string_view": "cpp",
5357
"system_error": "cpp",
5458
"tuple": "cpp",
5559
"type_traits": "cpp",
5660
"utility": "cpp",
61+
"hash_map": "cpp",
5762
"format": "cpp",
63+
"fstream": "cpp",
5864
"future": "cpp",
5965
"initializer_list": "cpp",
6066
"iomanip": "cpp",
@@ -68,6 +74,7 @@
6874
"ostream": "cpp",
6975
"ranges": "cpp",
7076
"semaphore": "cpp",
77+
"shared_mutex": "cpp",
7178
"span": "cpp",
7279
"sstream": "cpp",
7380
"stdexcept": "cpp",
@@ -104,7 +111,7 @@
104111
"/opt/ros/rolling/local/lib/python3.12/dist-packages/",
105112
"${workspaceFolder}/install/"
106113
],
107-
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/libwaterlinked/bin/python",
114+
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/waterlinked_dvl/bin/python",
108115
"C_Cpp.default.intelliSenseMode": "linux-gcc-x86",
109116
"C_Cpp.clang_format_fallbackStyle": "Google",
110117
"C_Cpp.codeAnalysis.clangTidy.enabled": true,
@@ -144,6 +151,9 @@
144151
"editor.rulers": [80],
145152
"editor.defaultFormatter": "DavidAnson.vscode-markdownlint"
146153
},
154+
"[yaml]": {
155+
"editor.rulers": [80]
156+
},
147157
"search.exclude": {
148158
"**/build": true,
149159
"**/install": true,

README.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,51 @@
1-
# libwaterlinked
1+
# Water Linked DVL API
22

3-
libwaterlinked is a C++ library and ROS 2 driver designed to interface with
3+
waterlinked_dvl is a C++ library and ROS 2 driver designed to interface with
44
[Water Linked DVL devices](https://waterlinked.com/dvl), including the DVL-A50
5-
and DVL-A125. Get started with libwaterlinked by installing the project or by
6-
exploring the implemented [examples](https://github.com/Robotic-Decision-Making-Lab/libwaterlinked/tree/main/examples).
5+
and DVL-A125. Get started with waterlinked_dvl by installing the project,
6+
exploring the implemented library [examples](https://github.com/Robotic-Decision-Making-Lab/waterlinked_dvl/tree/main/examples),
7+
or by launching the ROS 2 driver.
78

89
> :warning: This project is not affiliated with or maintained by Water Linked.
910
> Please refer to the Water Linked [GitHub Organization](https://github.com/waterlinked/)
1011
> for all official software.
1112
1213
## Installation
1314

14-
To install libwaterlinked, first clone the repository to the `src/` directory
15+
To install waterlinked_dvl, first clone the repository to the `src/` directory
1516
of your ROS 2 workspace
1617

1718
```bash
18-
git clone git@github.com:Robotic-Decision-Making-Lab/libwaterlinked.git
19+
git clone git@github.com:Robotic-Decision-Making-Lab/waterlinked_dvl.git
1920
```
2021

2122
Then install the project dependencies using vcstool and rosdep
2223

2324
```bash
24-
vcs import src < src/libwaterlinked/ros2.repos && \
25+
vcs import src < src/waterlinked_dvl/ros2.repos && \
2526
rosdep install --from paths src -y --ignore-src
2627
```
2728

2829
Finally, build the workspace using colcon
2930

3031
```bash
31-
colcon build
32+
colcon build && source install/setup.bash
33+
```
34+
35+
## Usage
36+
37+
Run the following command to launch the DVL ROS 2 driver:
38+
39+
```bash
40+
ros2 launch dvl_driver dvl.launch.py
3241
```
3342

3443
## Getting help
3544

36-
If you have questions regarding usage of libreach or regarding contributing to
37-
this project, please ask a question on our [Discussions](https://github.com/Robotic-Decision-Making-Lab/libwaterlinked/discussions)
45+
If you have questions regarding usage of waterlinked_dvl or regarding contributing
46+
to this project, please ask a question on our [Discussions](https://github.com/Robotic-Decision-Making-Lab/waterlinked_dvl/discussions)
3847
board.
3948

4049
## License
4150

42-
libwaterlinked is released under the MIT license.
51+
waterlinked_dvl is released under the MIT license.

libwaterlinked/examples/send_command.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
/// This example demonstrates how to send commands and receive responses from a Water Linked DVL.
2929
auto main() -> int
3030
{
31-
// Create a new client using the default IP address (192.168.194.95) and port (16171) with a 5 second session
31+
// Create a new client using the default IP address (192.168.194.95) and port (16171) with a 5 second connection
3232
// timeout.
3333
waterlinked::WaterLinkedClient client("192.168.194.95", 16171, std::chrono::seconds(5));
3434

libwaterlinked/examples/subscribe_to_reports.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
/// This example demonstrates how to subscribe to velocity and dead reckoning reports from a WaterLinked DVL.
2727
auto main() -> int
2828
{
29-
// Create a new client using the default IP address (192.168.194.95) and port (16171) with a 5 second session timeout.
29+
// Create a new client using the default IP address (192.168.194.95) and port (16171) with a 5 second connection
30+
// timeout.
3031
waterlinked::WaterLinkedClient client("192.168.194.95", 16171, std::chrono::seconds(5));
3132

3233
// Register a callback to receive velocity reports

libwaterlinked/include/libwaterlinked/client.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ class WaterLinkedClient
4444
/// Create new new interface for the WaterLinked DVL-A50 using:
4545
/// - The IP address of the DVL (defaults to 192.168.194.95)
4646
/// - The port of the DVL (defaults to 16171)
47-
/// - a session timeout (s, defaults to 5s)
47+
/// - a connection timeout (s, defaults to 5s)
4848
explicit WaterLinkedClient(
4949
const std::string & addr = "192.168.194.95",
5050
std::uint16_t port = 16171,
51-
std::chrono::seconds session_timeout = std::chrono::seconds(5));
51+
std::chrono::seconds connection_timeout = std::chrono::seconds(5));
5252

5353
~WaterLinkedClient();
5454

0 commit comments

Comments
 (0)