Skip to content

Commit 6c81d4b

Browse files
authored
Merge branch 'NVIDIA-ISAAC-ROS:main' into feature-registry-file
2 parents 9e46244 + 0f35afb commit 6c81d4b

Some content is hidden

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

43 files changed

+131
-4708
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: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@
1818
name: ROS2 Tests
1919

2020
on:
21-
push:
22-
branches: [ "**" ] # Run on all branches
21+
pull_request:
22+
branches: [ main ]
23+
types: [ opened, synchronize, reopened, ready_for_review ]
2324

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

5475
- name: Setup ROS repository and install rosdep
5576
run: |
@@ -69,43 +90,46 @@ jobs:
6990
run: |
7091
rosdep init
7192
rosdep update --include-eol-distros
72-
rosdep install --from-paths . --rosdistro ${{ matrix.ros_distro }} --ignore-src -r -y
93+
rosdep install --from-paths greenwave_monitor --rosdistro ${{ matrix.ros_distro }} --ignore-src -r -y
7394
shell: bash
7495
env:
7596
DEBIAN_FRONTEND: noninteractive
7697

77-
- name: Install Python dependencies
98+
- name: Build packages
99+
run: |
100+
source /opt/ros/${{ matrix.ros_distro }}/setup.bash
101+
echo "Building and testing on ROS2 ${{ matrix.ros_distro }}"
102+
colcon build --packages-up-to greenwave_monitor
103+
shell: bash
104+
105+
- name: Install r2s_gw with pip
78106
run: |
107+
source /opt/ros/${{ matrix.ros_distro }}/setup.bash
108+
source install/setup.bash
109+
cd r2s_gw
79110
if [[ "${{ matrix.ros_distro }}" == "jazzy" || \
80111
"${{ matrix.ros_distro }}" == "kilted" || \
81112
"${{ matrix.ros_distro }}" == "rolling" ]]; then
82-
pip3 install --break-system-packages -I pygments textual
113+
pip3 install --break-system-packages --ignore-installed pygments -e .
83114
else
84-
pip3 install textual
115+
pip3 install --ignore-installed pygments -e .
85116
fi
86117
shell: bash
87118

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-
95119
- name: Smoke test README commands
96120
run: |
97121
source /opt/ros/${{ matrix.ros_distro }}/setup.bash
98122
source install/setup.bash
99123
set -e
100124
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
125+
timeout 10s bash -lc "script -qfec 'ros2 run r2s_gw r2s_gw_dashboard' /dev/null <<< \$'q'" || true
102126
timeout 5s ros2 launch greenwave_monitor hz.launch.py topics:='["/topic1"]' || true
103127
shell: bash
104128

105129
- name: Run tests
106130
run: |
107131
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
132+
colcon test --event-handlers console_direct+ --return-code-on-test-failure --packages-up-to greenwave_monitor
109133
shell: bash
110134

111135
- 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
@@ -72,7 +72,6 @@ install(
7272
# Install Python scripts
7373
install(
7474
PROGRAMS
75-
scripts/r2s_gw_dashboard
7675
scripts/ncurses_dashboard
7776
DESTINATION lib/${PROJECT_NAME}
7877
)

greenwave_monitor/greenwave_monitor/test_utils.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,14 @@
3030

3131
# Test configurations for various message types and frequencies
3232
# (message_type, expected_frequency, tolerance_hz)
33+
# NOTE: Tolerances and frequencies are set conservatively for reliable operation
34+
# on slow/loaded CI systems such as the ROS buildfarm. The 30% tolerance standard
35+
# ensures tests pass even under system load.
3336
TEST_CONFIGURATIONS = [
34-
('imu', 1.0, 0.5),
37+
('imu', 1.0, 0.3),
3538
('imu', 100.0, 30.0),
36-
('imu', 5000.0, 250.0),
37-
('image', 10.0, 2.0),
39+
('imu', 500.0, 150.0),
40+
('image', 10.0, 3.0),
3841
('string', 100.0, 30.0),
3942
]
4043

@@ -253,9 +256,10 @@ def verify_diagnostic_values(status: DiagnosticStatus,
253256
errors.append(
254257
f'Message frequency {reported_frequency_msg} not within '
255258
f'{tolerance_hz} Hz of expected {expected_frequency}')
256-
if reported_latency_ms > 10:
259+
# Relaxed to 50ms for slow/loaded CI systems (was 10ms)
260+
if reported_latency_ms > 50:
257261
errors.append(
258-
f'Latency should be <= 10 ms for non-string types, '
262+
f'Latency should be <= 50 ms for non-string types, '
259263
f'got {reported_latency_ms}')
260264

261265
return errors

greenwave_monitor/package.xml

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

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

0 commit comments

Comments
 (0)