Skip to content

Commit

Permalink
Partial source and cmake migrations (#669)
Browse files Browse the repository at this point in the history
Signed-off-by: methylDragon <[email protected]>
  • Loading branch information
methylDragon committed Jul 13, 2022
1 parent 5ee9cf0 commit 6332da7
Show file tree
Hide file tree
Showing 78 changed files with 200 additions and 203 deletions.
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
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
4 changes: 2 additions & 2 deletions examples/simple_demo_qml/ThreadRenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
#ifndef GZ_RENDERING_EXAMPLES_SIMPLE_DEMO_QML_THREAD_RENDERER_HH_
#define GZ_RENDERING_EXAMPLES_SIMPLE_DEMO_QML_THREAD_RENDERER_HH_

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

#include <QQuickItem>
#include <QMutex>
Expand Down Expand Up @@ -109,7 +109,7 @@ public slots:
void TextureReady(int _id, const QSize &_size);

private:
IgnitionRenderer *renderer = nullptr;
GzRenderer *renderer = nullptr;
QSize size;

/// \brief reference to the render window item
Expand Down
2 changes: 1 addition & 1 deletion examples/waves/media/GerstnerWaves_fs.metal
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ fragment float4 main_metal
float3 E = normalize(inPs.eyeVec);
float3 R = reflect(E, N);

// Negate z for use with the skybox texture that comes with ign-rendering
// Negate z for use with the skybox texture that comes with gz-rendering
R = float3(R.x, R.y, -R.z);

// uncomment this line if using other textures that are Y up
Expand Down
2 changes: 1 addition & 1 deletion examples/waves/media/GerstnerWaves_fs_330.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void main()
vec3 E = normalize(inPs.eyeVec);
vec3 R = reflect(E, N);

// negate z for use with the skybox texture that comes with ign-rendering
// negate z for use with the skybox texture that comes with gz-rendering
R = vec3(R.x, R.y, -R.z);

// uncomment this line if using other textures that are Y up
Expand Down
2 changes: 1 addition & 1 deletion include/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
add_subdirectory(gz)
install(DIRECTORY ignition DESTINATION ${IGN_INCLUDE_INSTALL_DIR_FULL})
install(DIRECTORY ignition DESTINATION ${GZ_INCLUDE_INSTALL_DIR_FULL})
2 changes: 1 addition & 1 deletion include/gz/rendering/RenderEngineManager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ namespace gz
public: unsigned int EngineCount() const;

/// \brief Determine if a render-engine with the given name is avaiable.
/// It also checks the list of default engines supplied by ign-rendering.
/// It also checks the list of default engines supplied by gz-rendering.
/// \param[in] _name Name of the desired render-engine
/// \return True if the specified render-engine is available
public: bool HasEngine(const std::string &_name) const;
Expand Down
2 changes: 1 addition & 1 deletion include/gz/rendering/Scene.hh
Original file line number Diff line number Diff line change
Expand Up @@ -1210,7 +1210,7 @@ namespace gz
///
/// # Legacy mode: Set this value to 0.
///
/// Old projects migrating to newer ign versions may break
/// Old projects migrating to newer gz versions may break
/// these rules (e.g. not calling Render between Scene's
/// Pre/PostRender).
///
Expand Down
2 changes: 1 addition & 1 deletion include/gz/rendering/base/BaseRayQuery.hh
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ namespace gz
math::Matrix4d viewProjInv = (projectionMatrix * viewMatrix).Inverse();

// rotate start and end
// ign math does not support matrix4 * vec4
// gz math does not support matrix4 * vec4
// so calc homogeneous coordinate w ourselves
double startw = viewProjInv(3, 0) * start[0] +
viewProjInv(3, 1) * start[1] +
Expand Down
2 changes: 1 addition & 1 deletion include/gz/rendering/base/base.hh.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Automatically generated
#include <gz/${IGN_PROJECT_NAME}/config.hh>
#include <gz/${GZ_PROJECT_NAME}/config.hh>
${ign_headers}
2 changes: 1 addition & 1 deletion include/gz/rendering/rendering.hh.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Automatically generated
//#include <gz/${IGN_PROJECT_NAME}/config.hh>
//#include <gz/${GZ_PROJECT_NAME}/config.hh>
${ign_headers}
2 changes: 1 addition & 1 deletion ogre/include/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
add_subdirectory(gz)
install(DIRECTORY ignition DESTINATION ${IGN_INCLUDE_INSTALL_DIR_FULL})
install(DIRECTORY ignition DESTINATION ${GZ_INCLUDE_INSTALL_DIR_FULL})
Loading

0 comments on commit 6332da7

Please sign in to comment.