Skip to content

Commit 3924f0e

Browse files
CI: Add RoboStack cross-platform build (#1636)
Co-authored-by: Robert Haschke <[email protected]>
1 parent a4919f5 commit 3924f0e

File tree

12 files changed

+185
-3
lines changed

12 files changed

+185
-3
lines changed

.github/robostack_env.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: test
2+
channels:
3+
- robostack
4+
- conda-forge
5+
dependencies:
6+
- compilers
7+
- ninja
8+
- cmake
9+
- catkin_pkg
10+
- pkg-config
11+
- rosdep
12+
- rosdistro
13+
- ros-distro-mutex 0.1 noetic
14+
- ros-noetic-catkin
15+
- ros-noetic-ros-environment
16+
- openssl 1.1.1*
File renamed without changes.

.github/workflows/robostack.yaml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: RoboStack
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches:
8+
- master
9+
- "[kmn]*-devel*"
10+
11+
jobs:
12+
run_rviz_compilation:
13+
runs-on: ${{ matrix.os }}
14+
name: ${{ matrix.os }}
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
os: [ubuntu-latest, macos-latest, windows-latest]
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
23+
- name: Set up Build Dependencies
24+
uses: mamba-org/provision-with-micromamba@v11
25+
with:
26+
environment-file: .github/robostack_env.yaml
27+
micromamba-version: "0.17.0"
28+
29+
- name: Set up rviz Dependencies on Unix
30+
if: runner.os == 'Linux' || runner.os == 'macOS'
31+
shell: bash -l -eo pipefail {0}
32+
run: |
33+
micromamba activate test
34+
export PATH=$HOME/micromamba-bin:$PATH
35+
36+
if [[ `uname -s` == "Linux" ]]; then
37+
CDT="-cos6-x86_64"
38+
micromamba install -y mesa-libgl-devel$CDT mesa-dri-drivers$CDT \
39+
libselinux$CDT libxdamage$CDT libxxf86vm$CDT \
40+
libxext$CDT libxfixes$CDT -c conda-forge
41+
fi
42+
43+
rosdep init
44+
rosdep update
45+
rosdep install --from-paths . --ignore-src -r -y
46+
47+
- name: Build rviz on Unix
48+
if: runner.os == 'Linux' || runner.os == 'macOS'
49+
shell: bash -l -eo pipefail {0}
50+
run: |
51+
export CTEST_OUTPUT_ON_FAILURE=1
52+
mkdir build
53+
cd build
54+
55+
cmake .. -DCMAKE_PREFIX_PATH=$CONDA_PREFIX \
56+
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
57+
-DCMAKE_BUILD_TYPE=Release \
58+
-DCATKIN_SKIP_TESTING=OFF \
59+
-G "Ninja"
60+
61+
ninja
62+
ninja run_tests
63+
64+
- name: Set up rviz Dependencies on Windows
65+
if: runner.os == 'Windows'
66+
shell: cmd
67+
run: |
68+
echo "Activate environment, and use rosdep to install dependencies"
69+
call C:\Users\runneradmin\micromamba\condabin\micromamba.bat activate test
70+
rosdep init
71+
rosdep update
72+
rosdep install --from-paths . --ignore-src -r -y
73+
- name: Build rviz on Windows
74+
if: runner.os == 'Windows'
75+
shell: cmd
76+
run: |
77+
echo "Remove unnecessary / colliding things from PATH"
78+
set "PATH=%PATH:C:\ProgramData\Chocolatey\bin;=%"
79+
set "PATH=%PATH:C:\Program Files (x86)\sbt\bin;=%"
80+
set "PATH=%PATH:C:\Rust\.cargo\bin;=%"
81+
set "PATH=%PATH:C:\Program Files\Git\usr\bin;=%"
82+
set "PATH=%PATH:C:\Program Files\Git\cmd;=%"
83+
set "PATH=%PATH:C:\Program Files\Git\mingw64\bin;=%"
84+
set "PATH=%PATH:C:\Program Files (x86)\Subversion\bin;=%"
85+
set "PATH=%PATH:C:\Program Files\CMake\bin;=%"
86+
set "PATH=%PATH:C:\Program Files\OpenSSL\bin;=%"
87+
set "PATH=%PATH:C:\Strawberry\c\bin;=%"
88+
set "PATH=%PATH:C:\Strawberry\perl\bin;=%"
89+
set "PATH=%PATH:C:\Strawberry\perl\site\bin;=%"
90+
set "PATH=%PATH:c:\tools\php;=%"
91+
set "PATH=%PATH:ostedtoolcache=%"
92+
call C:\Users\runneradmin\micromamba\condabin\micromamba.bat activate test
93+
mkdir build
94+
cd build
95+
SET "CTEST_OUTPUT_ON_FAILURE=1"
96+
cmake .. -DCMAKE_PREFIX_PATH="%CONDA_PREFIX%\Library" ^
97+
-DCMAKE_INSTALL_PREFIX="%CONDA_PREFIX%\Library" ^
98+
-DCMAKE_BUILD_TYPE=Release ^
99+
-DCATKIN_SKIP_TESTING=OFF ^
100+
-DBoost_USE_STATIC_LIBS=OFF ^
101+
-G "Ninja"
102+
ninja
103+
ninja run_tests

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ find_package(Boost REQUIRED
2626
find_package(urdfdom_headers REQUIRED)
2727

2828
set(CMAKE_POLICY_DEFAULT_CMP0012 NEW) # required due to a bug in assimp 5.0
29-
find_package(ASSIMP REQUIRED)
29+
find_package(assimp REQUIRED)
3030
if(NOT DEFINED ASSIMP_LIBRARIES AND TARGET assimp::assimp)
3131
# ASSIMP >= 5.0 no longer defines ASSIMP_LIBRARIES
3232
set(ASSIMP_LIBRARIES assimp::assimp)

package.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
<build_depend>liburdfdom-dev</build_depend>
2929
<build_depend>liburdfdom-headers-dev</build_depend>
3030
<build_depend>message_generation</build_depend>
31+
<build_depend>assimp</build_depend>
3132

3233
<build_export_depend>libogre-dev</build_export_depend>
3334

src/rviz/default_plugin/interactive_markers/interactive_marker_control.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
#ifndef INTERACTIVE_MARKER_CONTROL_H_
3131
#define INTERACTIVE_MARKER_CONTROL_H_
3232

33-
3433
#ifndef Q_MOC_RUN
3534
#include <boost/shared_ptr.hpp>
3635
#include <boost/enable_shared_from_this.hpp>
@@ -45,6 +44,7 @@
4544

4645
#include <visualization_msgs/InteractiveMarkerControl.h>
4746

47+
#include <rviz/windows_compat.h>
4848
#include <rviz/default_plugin/markers/marker_base.h>
4949
#include <rviz/selection/forwards.h>
5050
#include <rviz/viewport_mouse_event.h>

src/rviz/default_plugin/marker_display.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,11 @@
4040
#include <rviz/properties/property.h>
4141
#include <rviz/properties/ros_topic_property.h>
4242
#include <rviz/selection/selection_manager.h>
43+
#include <rviz/windows_compat.h>
4344

4445
#include <rviz/default_plugin/marker_display.h>
4546

47+
4648
namespace rviz
4749
{
4850
////////////////////////////////////////////////////////////////////////////////////////////////////////////////

src/rviz/default_plugin/marker_utils.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444
#include <rviz/properties/status_list.h>
4545
#include <rviz/validate_quaternions.h>
4646
#include <rviz/validate_floats.h>
47+
#include <rviz/windows_compat.h>
48+
4749

4850
namespace rviz
4951
{

src/rviz/mesh_loader.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,8 @@ Ogre::SkeletonPtr loadSkeletonFromResource(const std::string& resource_path)
768768
Ogre::SkeletonSerializer ser;
769769
Ogre::DataStreamPtr stream(new Ogre::MemoryDataStream(res.data.get(), res.size));
770770
Ogre::SkeletonPtr skeleton = Ogre::SkeletonManager::getSingleton().create(
771-
skeleton_path.filename().c_str(), Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, true);
771+
skeleton_path.filename().string().c_str(),
772+
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, true);
772773
ser.importSkeleton(stream, skeleton.get());
773774

774775
return skeleton;

src/rviz/ogre_helpers/render_system.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@
4040
#include <GL/glx.h>
4141
#endif
4242

43+
#if defined(Q_OS_MAC)
44+
#include <OpenGL/gl.h>
45+
#endif
46+
4347
// X.h #defines CursorShape to be "0". Qt uses CursorShape in normal
4448
// C++ way. This wasn't an issue until ogre_logging.h (below)
4549
// introduced a #include of <QString>.
@@ -183,9 +187,13 @@ void RenderSystem::detectGlVersion()
183187
int minor = caps->getDriverVersion().minor;
184188
gl_version_ = major * 100 + minor * 10;
185189

190+
#ifdef __linux__
186191
std::string gl_version_string = (const char*)glGetString(GL_VERSION);
187192
// The "Mesa 2" string is intended to match "Mesa 20.", "Mesa 21." and so on
188193
mesa_workaround = gl_version_string.find("Mesa 2") != std::string::npos && gl_version_ >= 320;
194+
#else
195+
mesa_workaround = false;
196+
#endif
189197
}
190198

191199
switch (gl_version_)

src/rviz/windows_compat.h

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* Copyright (c) 2021, Tobias Fischer, Queensland University of Technology
3+
* All rights reserved.
4+
*
5+
* Redistribution and use in source and binary forms, with or without
6+
* modification, are permitted provided that the following conditions are met:
7+
*
8+
* * Redistributions of source code must retain the above copyright
9+
* notice, this list of conditions and the following disclaimer.
10+
* * Redistributions in binary form must reproduce the above copyright
11+
* notice, this list of conditions and the following disclaimer in the
12+
* documentation and/or other materials provided with the distribution.
13+
* * Neither the name of the Queensland Uni of Technology nor the names of its
14+
* contributors may be used to endorse or promote products derived from
15+
* this software without specific prior written permission.
16+
*
17+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20+
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21+
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27+
* POSSIBILITY OF SUCH DAMAGE.
28+
*/
29+
30+
#ifndef WINDOWS_COMPAT_H
31+
#define WINDOWS_COMPAT_H
32+
33+
#ifdef _WIN32
34+
35+
#ifdef ERROR
36+
#undef ERROR
37+
#endif
38+
39+
#ifdef DELETE
40+
#undef DELETE
41+
#endif
42+
43+
#endif // _WIN32
44+
45+
#endif // WINDOWS_COMPAT_H

src/rviz/yaml_config_writer.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,11 @@ void YamlConfigWriter::writeConfigNode(const Config& config, YAML::Emitter& emit
152152
break;
153153
}
154154
default:
155+
// Workaround as YAML::Null is missing from Windows DLLs;
156+
// see https://github.com/jbeder/yaml-cpp/issues/950
157+
#ifndef _WIN32
155158
emitter << YAML::Null;
159+
#endif
156160
break;
157161
}
158162
}

0 commit comments

Comments
 (0)