Skip to content

Commit 0aea55a

Browse files
authored
Make r2s_gw an optional dependency (#13)
r2s_gw requires a version of textual that the ubuntu noble Debians don't have, which makes getting into ros2 build farm annoying, so just make it it's own repo that is optional, and use curses UI as the primary. Move r2s_gw into seperate repo, r2s_gw depends on greenwave_monitor, but no dependencies in the other direction.
1 parent f013b8e commit 0aea55a

Some content is hidden

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

42 files changed

+119
-4701
lines changed

.github/workflows/debian-packages.yml

Lines changed: 56 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,10 @@ jobs:
151151
ls -la debian_packages/${{ matrix.ros_distro }}/
152152
153153
# Install the debian packages on top of ros-core
154-
apt-get install -y ./debian_packages/${{ matrix.ros_distro }}/ros-${{ matrix.ros_distro }}-greenwave-monitor-interfaces_*.deb ./debian_packages/${{ matrix.ros_distro }}/ros-${{ matrix.ros_distro }}-greenwave-monitor_*.deb ./debian_packages/${{ matrix.ros_distro }}/ros-${{ matrix.ros_distro }}-r2s-gw_*.deb
154+
apt-get install -y ./debian_packages/${{ matrix.ros_distro }}/ros-${{ matrix.ros_distro }}-greenwave-monitor-interfaces_*.deb ./debian_packages/${{ matrix.ros_distro }}/ros-${{ matrix.ros_distro }}-greenwave-monitor_*.deb
155155
156156
# Verify packages are installed
157-
dpkg -s ros-${{ matrix.ros_distro }}-r2s-gw ros-${{ matrix.ros_distro }}-greenwave-monitor ros-${{ matrix.ros_distro }}-greenwave-monitor-interfaces
157+
dpkg -s ros-${{ matrix.ros_distro }}-greenwave-monitor ros-${{ matrix.ros_distro }}-greenwave-monitor-interfaces
158158
shell: bash
159159
env:
160160
DEBIAN_FRONTEND: noninteractive
@@ -173,8 +173,9 @@ jobs:
173173
174174
# Run ncurses frontend with simulated terminal and quit command
175175
# Exit code 0 means clean exit (not 11 for SIGSEGV or 134 for SIGABRT)
176+
# Set TERM=linux to provide basic terminal capabilities for curses
176177
set +e
177-
timeout 10s script -qfec 'ros2 run greenwave_monitor ncurses_dashboard' /dev/null <<< $'q'
178+
TERM=linux timeout 10s script -qfec 'ros2 run greenwave_monitor ncurses_dashboard' /dev/null <<< $'q'
178179
EXIT_CODE=$?
179180
set -e
180181
@@ -202,24 +203,69 @@ jobs:
202203
kill -9 "$(cat /tmp/gwm_ncurses.pid)" 2>/dev/null || true
203204
shell: bash
204205

206+
- name: Clone r2s_gw repository for integration testing
207+
run: |
208+
# Install git if not available
209+
apt-get update -qq
210+
apt-get install -y git
211+
212+
# Try to clone the matching branch, fallback to main if it doesn't exist
213+
# Use head_ref for PRs (actual branch name), ref_name for pushes
214+
BRANCH_NAME="${{ github.head_ref || github.ref_name }}"
215+
if git ls-remote --exit-code --heads https://github.com/NVIDIA-ISAAC-ROS/r2s_gw.git "$BRANCH_NAME" > /dev/null 2>&1; then
216+
echo "Cloning r2s_gw branch: $BRANCH_NAME"
217+
git clone --branch "$BRANCH_NAME" --depth 1 https://github.com/NVIDIA-ISAAC-ROS/r2s_gw.git
218+
else
219+
echo "Branch $BRANCH_NAME not found in r2s_gw, falling back to main"
220+
git clone --branch main --depth 1 https://github.com/NVIDIA-ISAAC-ROS/r2s_gw.git
221+
fi
222+
shell: bash
223+
205224
- name: Install Python dependencies for r2s_gw
206225
run: |
207-
# Install Python dependencies (only needed for r2s_gw, not ncurses)
208-
apt-get install -y python3-pip || true
226+
# Install pip if not available
227+
apt-get install -y python3-pip python3-colcon-common-extensions || true
228+
229+
# Install Python dependencies
209230
if [[ "${{ matrix.ros_distro }}" == "jazzy" || \
210231
"${{ matrix.ros_distro }}" == "kilted" || \
211232
"${{ matrix.ros_distro }}" == "rolling" ]]; then
212-
python3 -m pip install -I textual --break-system-packages
233+
pip3 install --break-system-packages --ignore-installed pygments textual
213234
else
214-
python3 -m pip install textual
235+
pip3 install --ignore-installed pygments textual
215236
fi
216237
shell: bash
217238

218-
- name: Test r2s_gw execution
239+
- name: Build r2s_gw with colcon
240+
run: |
241+
source /opt/ros/${{ matrix.ros_distro }}/setup.bash
242+
# Build r2s_gw to register it as a ROS package
243+
colcon build --packages-select r2s_gw --base-paths .
244+
shell: bash
245+
246+
- name: Test r2s_gw_dashboard execution
219247
run: |
220248
source /opt/ros/${{ matrix.ros_distro }}/setup.bash
221-
timeout 10s bash -lc "script -qfec 'ros2 run r2s_gw r2s_gw' /dev/null <<< \$'q'" || true
222-
timeout 10s bash -lc "script -qfec 'ros2 run greenwave_monitor r2s_gw_dashboard' /dev/null <<< \$'q'" || true
249+
source install/local_setup.bash
250+
251+
echo "Testing r2s_gw_dashboard with debian-installed greenwave_monitor..."
252+
253+
# Test r2s_gw dashboard with proper terminal
254+
# The dashboard script automatically starts the monitor node
255+
set +e
256+
TERM=linux timeout 10s script -qfec 'ros2 run r2s_gw r2s_gw_dashboard' /dev/null <<< $'q'
257+
EXIT_CODE=$?
258+
set -e
259+
260+
if [ $EXIT_CODE -eq 0 ]; then
261+
echo "✓ r2s_gw_dashboard exited cleanly"
262+
elif [ $EXIT_CODE -eq 124 ]; then
263+
echo "✗ r2s_gw_dashboard timed out"
264+
exit 1
265+
else
266+
echo "✗ r2s_gw_dashboard exited with unexpected code: $EXIT_CODE"
267+
exit 1
268+
fi
223269
shell: bash
224270

225271
- name: Test greenwave_monitor execution

.github/workflows/ros-tests.yml

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,26 @@ jobs:
5050
steps:
5151
- name: Checkout code
5252
uses: actions/checkout@v4
53+
with:
54+
path: greenwave_monitor
55+
56+
- name: Clone r2s_gw repository
57+
run: |
58+
# Install git if not already available
59+
apt-get update -qq
60+
apt-get install -y git
61+
62+
# Try to clone the matching branch, fallback to main if it doesn't exist
63+
# Use head_ref for PRs (actual branch name), ref_name for pushes
64+
BRANCH_NAME="${{ github.head_ref || github.ref_name }}"
65+
if git ls-remote --exit-code --heads https://github.com/NVIDIA-ISAAC-ROS/r2s_gw.git "$BRANCH_NAME" > /dev/null 2>&1; then
66+
echo "Cloning r2s_gw branch: $BRANCH_NAME"
67+
git clone --branch "$BRANCH_NAME" --depth 1 https://github.com/NVIDIA-ISAAC-ROS/r2s_gw.git r2s_gw
68+
else
69+
echo "Branch $BRANCH_NAME not found in r2s_gw, falling back to main"
70+
git clone --branch main --depth 1 https://github.com/NVIDIA-ISAAC-ROS/r2s_gw.git r2s_gw
71+
fi
72+
shell: bash
5373

5474
- name: Setup ROS repository and install rosdep
5575
run: |
@@ -69,43 +89,46 @@ jobs:
6989
run: |
7090
rosdep init
7191
rosdep update --include-eol-distros
72-
rosdep install --from-paths . --rosdistro ${{ matrix.ros_distro }} --ignore-src -r -y
92+
rosdep install --from-paths greenwave_monitor --rosdistro ${{ matrix.ros_distro }} --ignore-src -r -y
7393
shell: bash
7494
env:
7595
DEBIAN_FRONTEND: noninteractive
7696

77-
- name: Install Python dependencies
97+
- name: Build packages
98+
run: |
99+
source /opt/ros/${{ matrix.ros_distro }}/setup.bash
100+
echo "Building and testing on ROS2 ${{ matrix.ros_distro }}"
101+
colcon build --packages-up-to greenwave_monitor
102+
shell: bash
103+
104+
- name: Install r2s_gw with pip
78105
run: |
106+
source /opt/ros/${{ matrix.ros_distro }}/setup.bash
107+
source install/setup.bash
108+
cd r2s_gw
79109
if [[ "${{ matrix.ros_distro }}" == "jazzy" || \
80110
"${{ matrix.ros_distro }}" == "kilted" || \
81111
"${{ matrix.ros_distro }}" == "rolling" ]]; then
82-
pip3 install --break-system-packages -I pygments textual
112+
pip3 install --break-system-packages --ignore-installed pygments -e .
83113
else
84-
pip3 install textual
114+
pip3 install --ignore-installed pygments -e .
85115
fi
86116
shell: bash
87117

88-
- name: Build packages
89-
run: |
90-
source /opt/ros/${{ matrix.ros_distro }}/setup.bash
91-
echo "Building and testing on ROS2 ${{ matrix.ros_distro }}"
92-
colcon build --packages-up-to r2s_gw
93-
shell: bash
94-
95118
- name: Smoke test README commands
96119
run: |
97120
source /opt/ros/${{ matrix.ros_distro }}/setup.bash
98121
source install/setup.bash
99122
set -e
100123
timeout 10s bash -lc "script -qfec 'ros2 run greenwave_monitor ncurses_dashboard' /dev/null <<< \$'q'" || true
101-
timeout 10s bash -lc "script -qfec 'ros2 run greenwave_monitor r2s_gw_dashboard' /dev/null <<< \$'q'" || true
124+
timeout 10s bash -lc "script -qfec 'ros2 run r2s_gw r2s_gw_dashboard' /dev/null <<< \$'q'" || true
102125
timeout 5s ros2 launch greenwave_monitor hz.launch.py topics:='["/topic1"]' || true
103126
shell: bash
104127

105128
- name: Run tests
106129
run: |
107130
source /opt/ros/${{ matrix.ros_distro }}/setup.bash
108-
colcon test --event-handlers console_direct+ --return-code-on-test-failure --packages-up-to r2s_gw
131+
colcon test --event-handlers console_direct+ --return-code-on-test-failure --packages-up-to greenwave_monitor
109132
shell: bash
110133

111134
- name: Upload test results

README.md

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,9 @@ source install/setup.bash
5353

5454
## Usage
5555

56-
Greenwave monitor provides two dashboard frontends, a lightweight ncurses interface and a rich terminal interface (a fork of [r2s](https://github.com/mjcarroll/r2s)). Note we rename the fork r2s_gw to avoid conflicts with the original r2s package.
56+
Greenwave monitor provides a lightweight ncurses dashboard for monitoring topics. An optional rich TUI (r2s integration) with additional features is also available as a separate package.
5757

58-
We have found that the r2s dashboard gets sluggish when there are many topics, so we recommend using the ncurses dashboard for large deployments.
59-
60-
### ncurses Dashboard (Lightweight)
58+
### ncurses Dashboard
6159

6260
After installing, you can launch the ncurses dashboard with:
6361

@@ -71,27 +69,37 @@ You can also launch the dashboard with some demo publishers to see everything in
7169
ros2 run greenwave_monitor ncurses_dashboard --demo
7270
```
7371

74-
### r2s_gw Dashboard (Rich TUI)
72+
### Rich TUI (r2s integration) - Optional
73+
74+
For users who want an advanced, feature-rich terminal interface, **r2s_gw** is available as a separate package. Built on the excellent [r2s](https://github.com/mjcarroll/r2s) TUI framework and powered by [Textual](https://github.com/textualize/textual/), r2s_gw provides a beautiful, modern interface with enhanced navigation and visualization capabilities.
7575

76-
First you need to build the r2s_gw package and some additional dependencies, r2s_gw is included in the greenwave_monitor package.
76+
**r2s_gw** is perfect for interactive development and debugging sessions. For production deployments with many topics or minimal dependency requirements, the lightweight ncurses dashboard above is recommended.
7777

78+
To use r2s_gw:
79+
80+
1. Clone the r2s_gw repository into a workspace:
7881
```bash
79-
cd ros_ws/
80-
colcon build --packages-up-to r2s_gw
81-
pip install -I textual # There is a requirements.txt file in the r2s_gw package, but in case you installed from debian and that's not handy ...
82-
source install/setup.bash
82+
mkdir -p ~/ros_ws/src
83+
cd ~/ros_ws/src
84+
git clone https://github.com/NVIDIA-ISAAC-ROS/r2s_gw.git
8385
```
8486

85-
Then you can launch the dashboard with the following. Use tab to navigate between different UI elements.
86-
87+
2. Install dependencies and build:
8788
```bash
88-
ros2 run greenwave_monitor r2s_gw_dashboard
89+
pip install --ignore-installed pygments -r r2s_gw/requirements.txt
90+
cd ~/ros_ws
91+
colcon build --packages-select r2s_gw
92+
source install/setup.bash
8993
```
9094

91-
Just like before, you can also launch the dashboard with some demo publishers to see everything in action.
95+
3. Launch the dashboard (use tab to navigate between UI elements):
96+
```bash
97+
ros2 run r2s_gw r2s_gw_dashboard
98+
```
9299

100+
4. Or launch with demo publishers:
93101
```bash
94-
ros2 run greenwave_monitor r2s_gw_dashboard -- --demo
102+
ros2 run r2s_gw r2s_gw_dashboard -- --demo
95103
```
96104

97105
### Manual Launch (ros2 topic hz mode)

greenwave_monitor/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ install(
6767
# Install Python scripts
6868
install(
6969
PROGRAMS
70-
scripts/r2s_gw_dashboard
7170
scripts/ncurses_dashboard
7271
DESTINATION lib/${PROJECT_NAME}
7372
)

greenwave_monitor/package.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@
5050
<test_depend>launch_testing</test_depend>
5151
<test_depend>launch_testing_ros</test_depend>
5252

53-
<!-- TODO add textual as dependency (need to host rosdep)-->
54-
5553
<build_depend>rosidl_default_generators</build_depend>
5654
<exec_depend>rosidl_default_runtime</exec_depend>
5755
<member_of_group>rosidl_interface_packages</member_of_group>

greenwave_monitor/scripts/r2s_gw_dashboard

Lines changed: 0 additions & 120 deletions
This file was deleted.

0 commit comments

Comments
 (0)