Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add cross-platform CI with conda packages #1600

Draft
wants to merge 1 commit into
base: noetic-devel
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/ci_env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: test
channels:
- robostack
- conda-forge
dependencies:
# build deps
- compilers
- ninja
- cmake
- catkin_pkg
# Other deps
- assimp
- eigen
- ogre 1.10.*
- python 3.8.*
- qt 5.12.*
- ros-distro-mutex 0.1 noetic
- ros-noetic-catkin
- ros-noetic-cmake-modules
- ros-noetic-geometry-msgs
- ros-noetic-image-transport
- ros-noetic-interactive-markers
- ros-noetic-laser-geometry
- ros-noetic-map-msgs
- ros-noetic-message-filters
- ros-noetic-message-generation
- ros-noetic-nav-msgs
- ros-noetic-pluginlib
- ros-noetic-python-qt-binding
- ros-noetic-resource-retriever
- ros-noetic-rosbag
- ros-noetic-rosconsole
- ros-noetic-roscpp
- ros-noetic-roslib
- ros-noetic-rospy
- ros-noetic-rostest
- ros-noetic-rosunit
- ros-noetic-sensor-msgs
- ros-noetic-std-msgs
- ros-noetic-std-srvs
- ros-noetic-tf2-geometry-msgs
- ros-noetic-tf2-ros
- ros-noetic-urdf
- ros-noetic-visualization-msgs
- tinyxml2
- urdfdom 1.0.*
- urdfdom_headers 1.0.*
- yaml-cpp
97 changes: 97 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Build RViz on all platforms

on: push

jobs:
run_rviz_compilation:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- name: Set up Dependencies
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: .github/ci_env.yml
- name: Install System Dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get install libglew-dev mesa-utils xvfb libgl1-mesa-glx libgl1-mesa-dev libglu1-mesa libglu1-mesa-dev \
libselinux1 libxdamage1 libxfixes3 libxxf86vm1

- name: Build RViz on Unix
if: runner.os == 'Linux' || runner.os == 'macOS'
shell: bash -l -eo pipefail {0}
run: |
if [[ `uname -s` == "Linux" ]]; then
CDT="-cos6-x86_64"
micromamba install -y mesa-libgl-devel$CDT mesa-dri-drivers$CDT \
libselinux$CDT libxdamage$CDT libxxf86vm$CDT \
libxext$CDT libxfixes$CDT -c conda-forge
fi

export CTEST_OUTPUT_ON_FAILURE=1

mkdir build
cd build

cmake .. -DCMAKE_PREFIX_PATH=$CONDA_PREFIX \
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
-DCMAKE_BUILD_TYPE=Release \
-DCATKIN_SKIP_TESTING=OFF \
-G "Ninja"

ninja
ninja run_tests

- name: Build RViz on Windows
if: runner.os == 'Windows'
shell: powershell
run: |
micromamba shell hook -s cmd.exe -p C:\Users\runneradmin\micromamba
Get-Content -Path C:\Users\runneradmin\micromamba\condabin\mamba_hook.bat

- name: Build RViz on Windows
if: runner.os == 'Windows'
shell: cmd
run: |

echo "Remove unnecessary / colliding things from PATH"

set "PATH=%PATH:C:\ProgramData\Chocolatey\bin;=%"
set "PATH=%PATH:C:\Program Files (x86)\sbt\bin;=%"
set "PATH=%PATH:C:\Rust\.cargo\bin;=%"
set "PATH=%PATH:C:\Program Files\Git\usr\bin;=%"
set "PATH=%PATH:C:\Program Files\Git\cmd;=%"
set "PATH=%PATH:C:\Program Files\Git\mingw64\bin;=%"
set "PATH=%PATH:C:\Program Files (x86)\Subversion\bin;=%"
set "PATH=%PATH:C:\Program Files\CMake\bin;=%"
set "PATH=%PATH:C:\Program Files\OpenSSL\bin;=%"
set "PATH=%PATH:C:\Strawberry\c\bin;=%"
set "PATH=%PATH:C:\Strawberry\perl\bin;=%"
set "PATH=%PATH:C:\Strawberry\perl\site\bin;=%"
set "PATH=%PATH:c:\tools\php;=%"
:: Make paths like C:\\hostedtoolcache\\windows\\Ruby\\2.5.7\\x64\\bin garbage
set "PATH=%PATH:ostedtoolcache=%"

echo "Activate environment, and compile"

call C:\Users\runneradmin\micromamba\condabin\micromamba.bat activate test

SET "PYTHONPATH=%CONDA_PREFIX%\Library\lib\site-packages"

mkdir build
cd build
SET "CTEST_OUTPUT_ON_FAILURE=1"

cmake .. -DCMAKE_PREFIX_PATH="%CONDA_PREFIX%\Library" ^
-DCMAKE_INSTALL_PREFIX="%CONDA_PREFIX%\Library" ^
-DCMAKE_BUILD_TYPE=Release ^
-DCATKIN_SKIP_TESTING=OFF ^
-DBoost_USE_STATIC_LIBS=OFF ^
-G "Ninja"

ninja
ninja run_tests
18 changes: 6 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,7 @@ find_package(Boost REQUIRED
)

find_package(urdfdom_headers REQUIRED)

set(CMAKE_POLICY_DEFAULT_CMP0012 NEW) # required due to a bug in assimp 5.0
find_package(ASSIMP REQUIRED)
if(NOT DEFINED ASSIMP_LIBRARIES AND TARGET assimp::assimp)
# ASSIMP >= 5.0 no longer defines ASSIMP_LIBRARIES
set(ASSIMP_LIBRARIES assimp::assimp)
endif()
find_package(assimp REQUIRED)

find_package(OGRE QUIET COMPONENTS Overlay)
if(OGRE_FOUND)
Expand Down Expand Up @@ -102,10 +96,10 @@ if(APPLE)
endif()

# Prefer newer vender-specific OpenGL library
if (POLICY CMP0072)
cmake_policy(SET CMP0072 NEW)
endif()
find_package(OpenGL REQUIRED)
# if (POLICY CMP0072)
# cmake_policy(SET CMP0072 NEW)
# endif()
# find_package(OpenGL REQUIRED)

set(CMAKE_AUTOMOC ON)

Expand Down Expand Up @@ -219,7 +213,7 @@ catkin_package(

#catkin_lint: ignore_once external_directory
include_directories(src ${EXPORT_HEADER_DIR})
include_directories(SYSTEM
include_directories(
${EIGEN3_INCLUDE_DIRS}
${OGRE_INCLUDE_DIRS}
${OPENGL_INCLUDE_DIR}
Expand Down
9 changes: 9 additions & 0 deletions ogre_media/fonts/ogre1.10.fontdef
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
Liberation Sans
{
type truetype
source liberation-sans/LiberationSans-Regular.ttf
size 18
resolution 96
}

# Ogre >= 1.10 has changed the format
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I think it's actually Ogre > 1.10 that has changed format, not >= 1.10. As we use Ogre 1.10 in RoboStack, this causes issues. But to be confirmed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you end up with 1.10? You could solve this by updating to 1.12

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does rviz work with 1.12? If yes, we could totally attempt a build!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noetic-devel does, yes, I tried getting it set as the default for noetic actually but gazebo had already released their last ever release and have some issues with it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah we also have gazebo on conda forge and it would be better if rviz and gazebo are side by side installable, so it's the same problem. We could build a variant with updated ogre though

font "Liberation Sans"
{
type truetype
Expand Down
8 changes: 4 additions & 4 deletions src/python_bindings/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ set(rviz_BINDINGS "")

# TODO(wjwwood): re-enabled PySide2 support when it is fixed.
# add_subdirectory(shiboken)
add_subdirectory(sip)
# add_subdirectory(sip)

message(STATUS "Python binding generators: ${rviz_BINDINGS}")
if(NOT rviz_BINDINGS)
message(FATAL_ERROR "No Python binding generator found.")
endif()
# if(NOT rviz_BINDINGS)
# message(FATAL_ERROR "No Python binding generator found.")
# endif()
27 changes: 23 additions & 4 deletions src/rviz/default_plugin/camera_display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <OgreRectangle2D.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should remove the changes that are from #1532 and discuss them there instead.

#include <OgreRenderSystem.h>
#include <OgreRenderWindow.h>
#include <OgreRoot.h>
#include <OgreSceneManager.h>
#include <OgreSceneNode.h>
#include <OgreTextureManager.h>
Expand Down Expand Up @@ -102,6 +103,8 @@ CameraDisplay::CameraDisplay()
SLOT(forceRender()));
zoom_property_->setMin(0.00001);
zoom_property_->setMax(100000);

has_run_once_ = false;
}

CameraDisplay::~CameraDisplay()
Expand All @@ -127,8 +130,15 @@ void CameraDisplay::onInitialize()
{
ImageDisplayBase::onInitialize();

bg_scene_node_ = scene_node_->createChildSceneNode();
fg_scene_node_ = scene_node_->createChildSceneNode();
{
static uint32_t count = 0;
std::stringstream ss;
ss << "CameraDisplay" << count++;
camera_scene_manager_ = Ogre::Root::getSingleton().createSceneManager(Ogre::ST_GENERIC, ss.str());
}

bg_scene_node_ = camera_scene_manager_->getRootSceneNode()->createChildSceneNode();
fg_scene_node_ = camera_scene_manager_->getRootSceneNode()->createChildSceneNode();

{
static int count = 0;
Expand Down Expand Up @@ -189,6 +199,7 @@ void CameraDisplay::onInitialize()
render_panel_->getRenderWindow()->setActive(false);
render_panel_->resize(640, 480);
render_panel_->initialize(context_->getSceneManager(), context_);
// render_panel_->initialize(camera_scene_manager_, context_);

setAssociatedWidget(render_panel_);

Expand All @@ -212,8 +223,16 @@ void CameraDisplay::onInitialize()
void CameraDisplay::preRenderTargetUpdate(const Ogre::RenderTargetEvent& /*evt*/)
{
QString image_position = image_position_property_->getString();
bg_scene_node_->setVisible(caminfo_ok_ && (image_position == BACKGROUND || image_position == BOTH));
fg_scene_node_->setVisible(caminfo_ok_ && (image_position == OVERLAY || image_position == BOTH));

if (has_run_once_)
{
fg_scene_node_->setVisible(caminfo_ok_ && (image_position == OVERLAY || image_position == BOTH));
bg_scene_node_->setVisible(caminfo_ok_ && (image_position == BACKGROUND || image_position == BOTH));
}
else
{
has_run_once_ = true;
}

// set view flags on all displays
visibility_property_->update();
Expand Down
4 changes: 4 additions & 0 deletions src/rviz/default_plugin/camera_display.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ class CameraDisplay : public ImageDisplayBase, public Ogre::RenderTargetListener
ROSImageTexture texture_;
RenderPanel* render_panel_;

Ogre::SceneManager* camera_scene_manager_;

private Q_SLOTS:
void forceRender();
void updateAlpha();
Expand Down Expand Up @@ -135,6 +137,8 @@ private Q_SLOTS:
bool force_render_;

uint32_t vis_bit_;

bool has_run_once_;
};

} // namespace rviz
Expand Down
24 changes: 23 additions & 1 deletion src/rviz/default_plugin/image_display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ ImageDisplay::ImageDisplay() : ImageDisplayBase(), texture_()
this, SLOT(updateNormalizeOptions()));

got_float_image_ = false;
has_run_once_ = false;
}

void ImageDisplay::onInitialize()
Expand Down Expand Up @@ -114,12 +115,13 @@ void ImageDisplay::onInitialize()
screen_rect_->setBoundingBox(aabInf);
setMaterial(*screen_rect_, material_);
img_scene_node_->attachObject(screen_rect_);
img_scene_node_->setVisible(false);
}

render_panel_ = new RenderPanel();
render_panel_->getRenderWindow()->addListener(this);
render_panel_->getRenderWindow()->setAutoUpdated(false);
render_panel_->getRenderWindow()->setActive(false);

render_panel_->resize(640, 480);
render_panel_->initialize(img_scene_manager_, context_);

Expand All @@ -136,12 +138,32 @@ ImageDisplay::~ImageDisplay()
{
if (initialized())
{
render_panel_->getRenderWindow()->removeListener(this);

delete render_panel_;
delete screen_rect_;
removeAndDestroyChildNode(img_scene_node_->getParentSceneNode(), img_scene_node_);
}
}

void ImageDisplay::preRenderTargetUpdate(const Ogre::RenderTargetEvent& /*evt*/)
{
if (has_run_once_)
{
img_scene_node_->setVisible(true);
}
else
{
has_run_once_ = true;
img_scene_node_->setVisible(false);
}
}

void ImageDisplay::postRenderTargetUpdate(const Ogre::RenderTargetEvent& /*evt*/)
{
img_scene_node_->setVisible(false);
}

void ImageDisplay::onEnable()
{
ImageDisplayBase::subscribe();
Expand Down
8 changes: 7 additions & 1 deletion src/rviz/default_plugin/image_display.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ namespace rviz
* \class ImageDisplay
*
*/
class ImageDisplay : public ImageDisplayBase
class ImageDisplay : public ImageDisplayBase, public Ogre::RenderTargetListener
{
Q_OBJECT
public:
Expand All @@ -71,6 +71,10 @@ class ImageDisplay : public ImageDisplayBase
void update(float wall_dt, float ros_dt) override;
void reset() override;

// Overrides from Ogre::RenderTargetListener
void preRenderTargetUpdate(const Ogre::RenderTargetEvent& evt) override;
void postRenderTargetUpdate(const Ogre::RenderTargetEvent& evt) override;

public Q_SLOTS:
virtual void updateNormalizeOptions();

Expand Down Expand Up @@ -98,6 +102,8 @@ public Q_SLOTS:
FloatProperty* max_property_;
IntProperty* median_buffer_size_property_;
bool got_float_image_;

bool has_run_once_;
};

} // namespace rviz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@


#ifndef Q_MOC_RUN
#ifdef _WIN32
#undef ERROR
#undef DELETE
#endif

#include <boost/shared_ptr.hpp>
#include <boost/enable_shared_from_this.hpp>

Expand Down
Loading