Skip to content

Commit 1adb624

Browse files
authored
ci: utilize prebuilt stonefish image for simulator test (#595)
* Verify reusable workflow reference for simulator tests * Comment out Stonefish installation in setup.sh Comment out the installation of Stonefish in setup script. * test: publish killswitch and auto mode 5 times to ensure it arrives * remove duplicate installations, which are already present in the stonefish image * remove executor sequential from build in setup.sh * revert to using vortex-ci@main for reusable simulator test
1 parent 49572cb commit 1adb624

2 files changed

Lines changed: 2 additions & 70 deletions

File tree

tests/setup.sh

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#!/bin/bash
22
set -e
33

4-
# ----------------------------- GLOBAL VARIABLES -----------------------------
5-
STONEFISH_DIR="$HOME/opt/stonefish"
64
ROS_WORKSPACE="${WORKSPACE:-$HOME/ros2_ws}"
75
LOG_PREFIX="[$(date +%T)]"
86

@@ -15,64 +13,6 @@ log_error() {
1513
echo -e "$LOG_PREFIX [ERROR] $1" >&2
1614
}
1715

18-
# ----------------------------- PYTHON DEPENDENCIES -----------------------------
19-
install_python_dependencies() {
20-
log_info "Installing/upgrading Python dependencies..."
21-
pip3 install --upgrade pip
22-
pip3 install --upgrade 'numpy<1.25' 'scipy<1.12'
23-
log_info "Python dependencies installed."
24-
}
25-
26-
# ----------------------------- C++ DEPENDENCIES -----------------------------
27-
install_cpp_dependencies() {
28-
log_info "Installing required C++ dependencies..."
29-
sudo apt-get update -qq
30-
sudo apt-get install -y \
31-
build-essential \
32-
cmake \
33-
git \
34-
libglm-dev \
35-
libsdl2-dev \
36-
libfreetype6-dev \
37-
ros-humble-rosbag2-storage-mcap
38-
log_info "C++ dependencies installed."
39-
}
40-
41-
install_gcc13_compiler() {
42-
log_info "Installing GCC 13 compiler..."
43-
sudo apt-get update -qq
44-
sudo apt-get install -y --no-install-recommends software-properties-common
45-
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
46-
sudo apt-get update -qq
47-
48-
sudo apt-get install -y --no-install-recommends gcc-13 g++-13
49-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 100
50-
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 100
51-
}
52-
53-
# ----------------------------- STONEFISH INSTALLATION -----------------------------
54-
install_stonefish() {
55-
if [ -d "$STONEFISH_DIR" ]; then
56-
log_info "Stonefish is already installed at $STONEFISH_DIR. Skipping clone."
57-
else
58-
log_info "Cloning Stonefish repository..."
59-
mkdir -p "$STONEFISH_DIR"
60-
git clone https://github.com/vortexntnu/stonefish.git "$STONEFISH_DIR"
61-
sed -i '30i#include <cstdint>' /github/home/opt/stonefish/Library/include/sensors/Sample.h
62-
fi
63-
64-
log_info "Building Stonefish..."
65-
mkdir -p "$STONEFISH_DIR/build"
66-
cd "$STONEFISH_DIR/build"
67-
68-
cmake ..
69-
make -j"$(nproc)"
70-
sudo make install
71-
72-
log_info "Stonefish installation complete."
73-
}
74-
75-
# ----------------------------- BUILD ROS 2 PACKAGES -----------------------------
7616
build_ros_workspace() {
7717
log_info "Setting up ROS 2 workspace..."
7818
cd "$ROS_WORKSPACE"
@@ -92,12 +32,4 @@ build_ros_workspace() {
9232
log_info "ROS 2 workspace build complete."
9333
}
9434

95-
# ----------------------------- EXECUTE INSTALLATION -----------------------------
96-
log_info "Starting manual installation of extra dependencies..."
97-
install_python_dependencies
98-
install_cpp_dependencies
99-
install_gcc13_compiler
100-
install_stonefish
10135
build_ros_workspace
102-
103-
log_info "All dependencies installed successfully."

tests/simulator_tests/waypoint_navigation/simulator_test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ fi
7979

8080
# Set operation mode
8181
echo "Turning off killswitch and setting operation mode to autonomous mode"
82-
ros2 topic pub /orca/killswitch std_msgs/msg/Bool "{data: false}" -1
83-
ros2 topic pub /orca/operation_mode std_msgs/msg/String "{data: 'autonomous mode'}" -1
82+
ros2 topic pub /orca/killswitch std_msgs/msg/Bool "{data: false}" -t 5 # Ensure the message arrives
83+
ros2 topic pub /orca/operation_mode std_msgs/msg/String "{data: 'autonomous mode'}" -t 5 # Ensure the message arrives
8484

8585
# Send waypoint goal
8686
echo "Sending goal"

0 commit comments

Comments
 (0)