diff --git a/.github/workflows/build-and-test.sh b/.github/workflows/build-and-test.sh index b7eabe7..91f8965 100755 --- a/.github/workflows/build-and-test.sh +++ b/.github/workflows/build-and-test.sh @@ -8,6 +8,10 @@ export COLCON_WS_SRC=${COLCON_WS}/src export DEBIAN_FRONTEND=noninteractive export ROS_PYTHON_VERSION=3 +# For headless rendering +export DISPLAY=:1.0 +export MESA_GL_VERSION_OVERRIDE=3.3 + apt update -qq apt install -qq -y lsb-release wget curl build-essential @@ -26,8 +30,7 @@ curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key apt-get update -qq apt-get install -y $IGN_DEPS \ python3-colcon-common-extensions \ - python3-rosdep \ - xvfb + python3-rosdep rosdep init rosdep update @@ -39,11 +42,6 @@ cp -r $GITHUB_WORKSPACE $COLCON_WS_SRC # Install ROS dependencies rosdep install --from-paths $COLCON_WS_SRC -i -y -r --rosdistro $ROS_DISTRO -# Rendering setup -Xvfb :1 -ac -noreset -core -screen 0 1280x1024x24 & -export DISPLAY=:1.0 -export MESA_GL_VERSION_OVERRIDE=3.3 - # Build source /opt/ros/$ROS_DISTRO/setup.bash cd $COLCON_WS diff --git a/dolly_tests/test/follow_ignition_TEST.cpp b/dolly_tests/test/follow_ignition_TEST.cpp index 6d15710..26b243e 100644 --- a/dolly_tests/test/follow_ignition_TEST.cpp +++ b/dolly_tests/test/follow_ignition_TEST.cpp @@ -41,8 +41,12 @@ TEST(DollyTests, Follow) // Instantiate test fixture. It starts a simulation server and provides // hooks that we'll use to inspect the running simulation. - ignition::gazebo::TestFixture fixture(ignition::common::joinPaths( + ignition::gazebo::ServerConfig config; + config.SetSdfFile(ignition::common::joinPaths( std::string(PROJECT_SOURCE_PATH), "worlds", "empty.sdf")); + config.SetHeadlessRendering(true); + + ignition::gazebo::TestFixture fixture(config); // Variables that will be populated during the simulation int iterations{0};