Skip to content

Commit ccc834b

Browse files
committed
ci: add node test for eskf
1 parent 7d112b8 commit ccc834b

5 files changed

Lines changed: 41 additions & 3 deletions

File tree

.github/workflows/ros-node-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
matrix:
1515
test_script:
1616
- "tests/ros_node_tests/dp_node_test.sh"
17+
- "tests/ros_node_tests/eskf_node_test.sh"
1718
uses: vortexntnu/vortex-ci/.github/workflows/reusable-ros2-simulator-test.yml@main
1819
with:
1920
vcs_repos_file: "tests/dependencies.repos"

navigation/eskf/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ find_package(tf2 REQUIRED)
1818
find_package(vortex_msgs REQUIRED)
1919
find_package(spdlog REQUIRED)
2020
find_package(fmt REQUIRED)
21-
find_package(stonefish_ros2 REQUIRED)
2221

2322
if(NOT DEFINED EIGEN3_INCLUDE_DIR)
2423
set(EIGEN3_INCLUDE_DIR ${EIGEN3_INCLUDE_DIRS})
@@ -43,7 +42,6 @@ ament_target_dependencies(eskf_node
4342
vortex_msgs
4443
spdlog
4544
fmt
46-
stonefish_ros2
4745
)
4846

4947
target_link_libraries(eskf_node

navigation/eskf/include/eskf/eskf_ros.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include <std_msgs/msg/float64.hpp>
1212
#include <std_msgs/msg/float64_multi_array.hpp>
1313
#include <std_msgs/msg/string.hpp>
14-
#include <stonefish_ros2/msg/dvl.hpp>
1514
#include "eskf/eskf.hpp"
1615
#include "eskf/typedefs.hpp"
1716
#include "spdlog/spdlog.h"

navigation/eskf/launch/eskf.launch.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ def generate_launch_description():
1414
package="eskf",
1515
executable="eskf_node",
1616
name="eskf_node",
17+
namespace="orca",
1718
parameters=[
1819
eskf_params,
1920
],
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
set -e
3+
set -o pipefail
4+
5+
echo "Testing that the ESKF node is able to start up and publish odom"
6+
7+
# Load ROS 2 environment
8+
echo "Setting up ROS 2 environment..."
9+
. /opt/ros/humble/setup.sh
10+
. "${WORKSPACE:-$HOME/ros2_ws}/install/setup.bash"
11+
12+
# Function to terminate processes safely on error
13+
cleanup() {
14+
echo "Error detected. Cleaning up..."
15+
kill -TERM -"$ESKF_PID" || true
16+
exit 1
17+
}
18+
trap cleanup ERR
19+
20+
# Launch eskf node
21+
setsid ros2 launch eskf eskf.launch.py &
22+
ESKF_PID=$!
23+
echo "Launched eskf with PID: $ESKF_PID"
24+
25+
# Check for ROS errors before continuing
26+
if journalctl -u ros2 | grep -i "error"; then
27+
echo "Error detected in ROS logs. Exiting..."
28+
exit 1
29+
fi
30+
31+
# Check if eskf correctly publishes odom
32+
echo "Waiting for odom data..."
33+
timeout 10s ros2 topic echo /orca/odom --once
34+
echo "Got odom data"
35+
36+
# Terminate processes
37+
kill -TERM -"$ESKF_PID"
38+
39+
echo "Test completed successfully."

0 commit comments

Comments
 (0)