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

ign -> gz CMake, Python, Partial Source, and File Migrations : gz-rendering #669

Merged
merged 2 commits into from
Jul 15, 2022
Merged
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
12 changes: 6 additions & 6 deletions .github/ci/packages.apt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
freeglut3-dev
libfreeimage-dev
libglew-dev
libignition-cmake3-dev
libignition-common5-dev
libignition-math7-dev
libignition-math7-eigen3-dev
libignition-plugin2-dev
libignition-utils2-dev
libgz-cmake3-dev
libgz-common5-dev
libgz-math7-dev
libgz-math7-eigen3-dev
libgz-plugin2-dev
libgz-utils2-dev
libogre-1.9-dev
libxi-dev
libxmu-dev
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
uses: actions/checkout@v2
- name: Compile and test
id: ci
uses: ignition-tooling/action-ignition-ci@focal
uses: gazebo-tooling/action-gz-ci@focal
with:
codecov-enabled: true
cppcheck-enabled: true
Expand All @@ -25,4 +25,4 @@ jobs:
uses: actions/checkout@v2
- name: Compile and test
id: ci
uses: ignition-tooling/action-ignition-ci@jammy
uses: gazebo-tooling/action-gz-ci@jammy
2 changes: 1 addition & 1 deletion .github/workflows/pr-collection-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ jobs:
steps:
- name: Add collection labels
if: github.event.action == 'opened'
uses: ignition-tooling/pr-collection-labeler@v1
uses: gazebo-tooling/pr-collection-labeler@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
20 changes: 9 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ set(GZ_CMAKE_VER ${gz-cmake3_VERSION_MAJOR})
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

gz_configure_project(
REPLACE_IGNITION_INCLUDE_PATH gz/rendering
VERSION_SUFFIX pre1)
gz_configure_project(VERSION_SUFFIX pre1)

#============================================================================
# Set project-specific options
Expand Down Expand Up @@ -77,7 +75,7 @@ endif()
# Find OGRE
list(APPEND gz_ogre_components "RTShaderSystem" "Terrain" "Overlay" "Paging")

gz_find_package(IgnOGRE VERSION 1.9.0
gz_find_package(GzOGRE VERSION 1.9.0
COMPONENTS ${gz_ogre_components}
REQUIRED_BY ogre
PRIVATE_FOR ogre)
Expand All @@ -87,7 +85,7 @@ gz_find_package(IgnOGRE VERSION 1.9.0
# USE_UNOFFICIAL_OGRE_VERSIONS flag
if (NOT USE_UNOFFICIAL_OGRE_VERSIONS)
if (${OGRE_VERSION} VERSION_GREATER_EQUAL 1.10.0)
IGN_BUILD_WARNING("Ogre 1.x versions greater than 1.9 are not officially supported."
GZ_BUILD_WARNING("Ogre 1.x versions greater than 1.9 are not officially supported."
"The software might compile and even work but support from upstream"
"could be reduced to accepting patches for newer versions")
endif()
Expand All @@ -105,16 +103,16 @@ endif()

#--------------------------------------
# Find OGRE2: first try to find OGRE2 built with PlanarReflections support and
# fallback to look for OGRE2 without it. Both seems to works for ign-rendering.
# fallback to look for OGRE2 without it. Both seems to works for gz-rendering.
# See https://github.com/gazebosim/gz-rendering/issues/597
gz_find_package(IgnOGRE2 VERSION 2.2.0
gz_find_package(GzOGRE2 VERSION 2.2.0
COMPONENTS HlmsPbs HlmsUnlit Overlay PlanarReflections
PRIVATE_FOR ogre2
QUIET)

if ("${OGRE2-PlanarReflections}" STREQUAL "OGRE2-PlanarReflections-NOTFOUND")
message(STATUS "PlanarReflections component was not found. Try looking without it:")
gz_find_package(IgnOGRE2 VERSION 2.2.0
gz_find_package(GzOGRE2 VERSION 2.2.0
COMPONENTS HlmsPbs HlmsUnlit Overlay
REQUIRED_BY ogre2
PRIVATE_FOR ogre2)
Expand All @@ -126,7 +124,7 @@ endif()

# Plugin install dirs
set(GZ_RENDERING_ENGINE_INSTALL_DIR
${CMAKE_INSTALL_PREFIX}/${IGN_LIB_INSTALL_DIR}/gz-${IGN_DESIGNATION}-${PROJECT_VERSION_MAJOR}/engine-plugins
${CMAKE_INSTALL_PREFIX}/${GZ_LIB_INSTALL_DIR}/gz-${GZ_DESIGNATION}-${PROJECT_VERSION_MAJOR}/engine-plugins
)

#--------------------------------------
Expand Down Expand Up @@ -155,7 +153,7 @@ else()
set(GZ_RENDERING_PLUGIN_PATH ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
endif()

set(GZ_RENDERING_RESOURCE_PATH ${CMAKE_INSTALL_PREFIX}/${IGN_DATA_INSTALL_DIR})
set(GZ_RENDERING_RESOURCE_PATH ${CMAKE_INSTALL_PREFIX}/${GZ_DATA_INSTALL_DIR})

#============================================================================
# Configure the build
Expand All @@ -180,7 +178,7 @@ gz_configure_build(QUIT_IF_BUILD_ERRORS

if (HAVE_OGRE2)
# Must be done after gz_configure_build or else Terra
# won't see IGN_ADD_fPIC_TO_LIBRARIES
# won't see GZ_ADD_fPIC_TO_LIBRARIES
add_subdirectory(ogre2/src/terrain/Terra)
endif()

Expand Down
2 changes: 1 addition & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@
1. relax gaussian test tolerance
* [Pull request #344](https://github.com/gazebosim/gz-rendering/pull/344)

1. Fix custom shaders uniforms ign version number
1. Fix custom shaders uniforms gz version number
* [Pull request #343](https://github.com/gazebosim/gz-rendering/pull/343)

1. recreate node only when needed
Expand Down
2 changes: 1 addition & 1 deletion Migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ release will remove the deprecated code.
*Note*: Calling instead `Camera::Update` for each camera is a waste of CPU resources.
+ It is invalid to modify the scene between `Scene::PreRender` and `Scene::PostRender` (e.g. add/remove objects, lights, etc)
+ Added `Scene::SetCameraPassCountPerGpuFlush`. Setting this value to 0 forces legacy behavior which eases porting.
+ Systems that rely on Graphics components like particle FXs and postprocessing are explicitly affected by Scene's Pre/PostRender. Once `Scene::PostRender` is called, the particle FXs' simulation is moved forward, as well as time values sent to postprocessing shaders. In previous ign-rendering versions each `Camera::Render` call would move the particle simulation forward, which could cause subtle bugs or inconsistencies when Cameras were rendering the same frame from different angles. Setting SetCameraPassCountPerGpuFlush to 0 will also cause these subtle bugs to reappear.
+ Systems that rely on Graphics components like particle FXs and postprocessing are explicitly affected by Scene's Pre/PostRender. Once `Scene::PostRender` is called, the particle FXs' simulation is moved forward, as well as time values sent to postprocessing shaders. In previous gz-rendering versions each `Camera::Render` call would move the particle simulation forward, which could cause subtle bugs or inconsistencies when Cameras were rendering the same frame from different angles. Setting SetCameraPassCountPerGpuFlush to 0 will also cause these subtle bugs to reappear.

1. **Visual.hh** and **Node.hh**
+ `*UserData` methods and the `Variant` type alias have been moved from the `Visual` class to the `Node` class.
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Gazebo Rendering is a C++ library designed to provide an abstraction
for different rendering engines. It offers unified APIs for creating
3D graphics applications.

Gazebo Rendering is a component in the ignition framework, a set
Gazebo Rendering is a component in the Gazebo framework, a set
of libraries designed to rapidly develop robot applications.

# Table of Contents
Expand Down Expand Up @@ -51,22 +51,22 @@ See the [installation tutorial](https://gazebosim.org/api/rendering/5.0/installa

# Usage

The Ign Rendering API can be found in the documentation. See the
The Gazebo Rendering API can be found in the documentation. See the
[installation tutorial](https://gazebosim.org/api/rendering/5.0/installation.html)
on how to build the documentation files using Doxygen.

You can also take a look at the sample applications in the `examples` folder.

# Folder Structure

* `include/ignition/rendering`: Contains all the public header files which will be installed
* `include/gz/rendering`: Contains all the public header files which will be installed

* `src`: Contains all the C++ source code which are not installed.

* `test`: All integration, performance and regression tests go here, under their
specific folders.

* `examples`: Sample programs to demonstrate different features of ign-rendering
* `examples`: Sample programs to demonstrate different features of gz-rendering

* `doc`: Files used by Doxygen when generating documentation.

Expand Down Expand Up @@ -95,4 +95,3 @@ This library uses [Semantic Versioning](https://semver.org/). Additionally, this
# License

This library is licensed under [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0). See also the [LICENSE](https://github.com/gazebosim/gz-rendering/blob/main/LICENSE) file.

4 changes: 2 additions & 2 deletions api.md.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Gazebo @IGN_DESIGNATION_CAP@
## Gazebo @GZ_DESIGNATION_CAP@

Gazebo @IGN_DESIGNATION_CAP@ is a component in Gazebo, a set of libraries
Gazebo @GZ_DESIGNATION_CAP@ is a component in Gazebo, a set of libraries
designed to rapidly develop robot and simulation applications.

## License
Expand Down
6 changes: 3 additions & 3 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
find_package(Doxygen)

set(IGNITION_DOXYGEN_TAGFILES
set(GZ_DOXYGEN_TAGFILES
"\"${CMAKE_BINARY_DIR}/doc/ogre_1-9.tag.xml=https://www.ogre3d.org/docs/api/1.9/\"")

if (DOXYGEN_FOUND)
configure_file(${IGNITION_CMAKE_DOXYGEN_DIR}/api.in
configure_file(${GZ_CMAKE_DOXYGEN_DIR}/api.in
${CMAKE_BINARY_DIR}/api.dox @ONLY)

configure_file(${IGNITION_CMAKE_DOXYGEN_DIR}/tutorials.in
configure_file(${GZ_CMAKE_DOXYGEN_DIR}/tutorials.in
${CMAKE_BINARY_DIR}/tutorials.dox @ONLY)

# Find tar
Expand Down
6 changes: 3 additions & 3 deletions examples/depth_camera/GlutWindow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ void handleMouse()
}

//////////////////////////////////////////////////
// From ign-sensors/src/DepthCameraSensor.cc
// From gz-sensors/src/DepthCameraSensor.cc
//! [convert depth to image]
void ConvertDepthToImage(
const float *_data,
Expand Down Expand Up @@ -295,7 +295,7 @@ void keyboardCB(unsigned char _key, int, int)
}

//////////////////////////////////////////////////
// See ign-sensors/src/DepthCameraSensor.cc
// See gz-sensors/src/DepthCameraSensor.cc
//! [depth frame callback]
void OnNewDepthFrame(const float *_scan,
unsigned int _width, unsigned int _height,
Expand All @@ -314,7 +314,7 @@ void initCamera(ir::CameraPtr _camera)
g_camera = _camera;
imgw = g_camera->ImageWidth();
imgh = g_camera->ImageHeight();
ir::Image image = g_camera->CreateImage();
ir::Image image = g_camera->CreateImage();
g_image = std::make_shared<ir::Image>(image);

ir::DepthCameraPtr depthCamera = std::dynamic_pointer_cast<ir::DepthCamera>(
Expand Down
2 changes: 1 addition & 1 deletion examples/ogre2_demo/Main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ void buildScene(ScenePtr _scene)

// create a backpack
// backpack mesh is mirrored and requires texture addressing mode to be
// set to 'wrap', which is the default in ign-rendering-ogre2
// set to 'wrap', which is the default in gz-rendering-ogre2
VisualPtr backpack = _scene->CreateVisual("backpack");
backpack->SetLocalPosition(2.5, -1, 0);
backpack->SetLocalRotation(0, 0, -1.57);
Expand Down
6 changes: 3 additions & 3 deletions examples/simple_demo_qml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ set(CMAKE_AUTOUIC ON)

add_executable(simple_demo_qml
Main.cc
IgnitionRenderer.hh
IgnitionRenderer.cc
GzRenderer.hh
GzRenderer.cc
ThreadRenderer.h
ThreadRenderer.cpp
${QT_RESOURCES}
Expand All @@ -79,7 +79,7 @@ target_link_libraries(simple_demo_qml PUBLIC
set_target_properties(simple_demo_qml
PROPERTIES
QT_QML_MODULE_VERSION 1.0
QT_QML_MODULE_URI IgnitionRendering
QT_QML_MODULE_URI GzRendering
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// The functions BuildScene and createCamera are copied from the simple_demo
// example.

#include "IgnitionRenderer.hh"
#include "GzRenderer.hh"

#include <QOpenGLContext>
#include <QQuickWindow>
Expand Down Expand Up @@ -194,23 +194,23 @@ gz::rendering::CameraPtr CreateCamera(const std::string &_engineName)
}

//////////////////////////////////////////////////
IgnitionRenderer::~IgnitionRenderer()
GzRenderer::~GzRenderer()
{
}

//////////////////////////////////////////////////
IgnitionRenderer::IgnitionRenderer()
GzRenderer::GzRenderer()
{
}

//////////////////////////////////////////////////
void IgnitionRenderer::Initialise()
void GzRenderer::Initialise()
{
// no-op - all initialised on the main thread
}

//////////////////////////////////////////////////
void IgnitionRenderer::InitialiseOnMainThread()
void GzRenderer::InitialiseOnMainThread()
{
if (!this->initialised)
{
Expand All @@ -220,7 +220,7 @@ void IgnitionRenderer::InitialiseOnMainThread()
}

//////////////////////////////////////////////////
void IgnitionRenderer::Render()
void GzRenderer::Render()
{
// pre-render may regenerate textureId if the size changes
this->camera->PreRender();
Expand All @@ -234,25 +234,25 @@ void IgnitionRenderer::Render()
}

//////////////////////////////////////////////////
bool IgnitionRenderer::Initialised() const
bool GzRenderer::Initialised() const
{
return this->initialised;
}

//////////////////////////////////////////////////
unsigned int IgnitionRenderer::TextureId() const
unsigned int GzRenderer::TextureId() const
{
return this->textureId;
}

//////////////////////////////////////////////////
QSize IgnitionRenderer::TextureSize() const
QSize GzRenderer::TextureSize() const
{
return this->textureSize;
}

//////////////////////////////////////////////////
void IgnitionRenderer::InitEngine()
void GzRenderer::InitEngine()
{
std::string engineName("ogre2");

Expand Down Expand Up @@ -283,7 +283,7 @@ void IgnitionRenderer::InitEngine()
}

//////////////////////////////////////////////////
void IgnitionRenderer::UpdateCamera()
void GzRenderer::UpdateCamera()
{
double angle = this->cameraOffset / 2 * M_PI;
double x = sin(angle) * 3.0 + 3.0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
/// and update of a Gazebo rendering engine instance and makes the
/// rendered texture available in a shared context for an application
/// to apply to a render surface.
class IgnitionRenderer
class GzRenderer
{
/// \brief Destructor
public: virtual ~IgnitionRenderer();
public: virtual ~GzRenderer();

/// \brief Constructor
public: IgnitionRenderer();
public: GzRenderer();

/// \brief Render the next frame. May be called on a render thread.
public: void Render();
Expand Down
2 changes: 1 addition & 1 deletion examples/simple_demo_qml/Main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ int main(int _argc, char** _argv)
QSurfaceFormat::setDefaultFormat(format);
RenderThread::Print(format);

qmlRegisterType<ThreadRenderer>("IgnitionRendering", 1, 0,
qmlRegisterType<ThreadRenderer>("GzRendering", 1, 0,
"ThreadRenderer");

QGuiApplication app(_argc, _argv);
Expand Down
2 changes: 1 addition & 1 deletion examples/simple_demo_qml/Main.qml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import QtQuick 2.0
import IgnitionRendering 1.0
import GzRendering 1.0

Item {
width: 800
Expand Down
4 changes: 2 additions & 2 deletions examples/simple_demo_qml/ThreadRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
****************************************************************************/

#include "ThreadRenderer.h"
#include "IgnitionRenderer.hh"
#include "GzRenderer.hh"

#include <QGuiApplication>
#include <QMutex>
Expand Down Expand Up @@ -211,7 +211,7 @@ void RenderThread::InitialiseOnMainThread()
Print(this->context->format());

// create renderer
this->renderer = new IgnitionRenderer();
this->renderer = new GzRenderer();
this->renderer->InitialiseOnMainThread();

this->context->doneCurrent();
Expand Down
Loading