Skip to content

Commit

Permalink
Merge branch 'main' into nkoenig/remove-ign
Browse files Browse the repository at this point in the history
  • Loading branch information
mjcarroll committed Oct 23, 2023
2 parents 4251d2f + 2765c5f commit 9a3b38e
Show file tree
Hide file tree
Showing 14 changed files with 343 additions and 246 deletions.
6 changes: 3 additions & 3 deletions .github/ci/packages.apt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ libavutil-dev
libfreeimage-dev
libgdal-dev
libgts-dev
libgz-cmake3-dev
libgz-math7-dev
libgz-utils2-dev
libgz-cmake4-dev
libgz-math8-dev
libgz-utils3-dev
libswscale-dev
libtinyxml2-dev
pkg-config
Expand Down
13 changes: 2 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,6 @@ name: Ubuntu CI
on: [push, pull_request]

jobs:
focal-ci:
runs-on: ubuntu-latest
name: Ubuntu Focal CI
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Compile and test
id: ci
uses: gazebo-tooling/action-gz-ci@focal
with:
codecov-enabled: true
jammy-ci:
runs-on: ubuntu-latest
name: Ubuntu Jammy CI
Expand All @@ -23,3 +12,5 @@ jobs:
- name: Compile and test
id: ci
uses: gazebo-tooling/action-gz-ci@jammy
with:
codecov-enabled: true
21 changes: 16 additions & 5 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ jobs:
uses: Homebrew/actions/setup-homebrew@master
- run: brew config

# Workaround for https://github.com/actions/setup-python/issues/577
- name: Clean up python binaries
run: |
rm -f /usr/local/bin/2to3*;
rm -f /usr/local/bin/idle3*;
rm -f /usr/local/bin/pydoc3*;
rm -f /usr/local/bin/python3*;
rm -f /usr/local/bin/python3*-config;
- name: Install base dependencies
run: |
brew tap osrf/simulation;
Expand All @@ -30,7 +39,7 @@ jobs:
popd
echo '# END SECTION'
fi
# gz-math7 has problems with swig, remove it for now
# gz-math8 has problems with swig, remove it for now
brew remove swig || true
brew install --only-dependencies ${PACKAGE};
- run: mkdir build
Expand All @@ -39,12 +48,14 @@ jobs:
run: cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/${PACKAGE}/HEAD
- run: make
working-directory: build
- run: make test
working-directory: build
env:
CTEST_OUTPUT_ON_FAILURE: 1
# Run make install before make test so that the package will be available to
# build examples as part of the test
- name: make install
working-directory: build
run: |
make install;
brew link ${PACKAGE};
- run: make test
working-directory: build
env:
CTEST_OUTPUT_ON_FAILURE: 1
8 changes: 3 additions & 5 deletions .github/workflows/triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Add ticket to inbox
uses: technote-space/create-project-card-action@v1
uses: actions/[email protected]
with:
PROJECT: Core development
COLUMN: Inbox
GITHUB_TOKEN: ${{ secrets.TRIAGE_TOKEN }}
CHECK_ORG_PROJECT: true
project-url: https://github.com/orgs/gazebosim/projects/7
github-token: ${{ secrets.TRIAGE_TOKEN }}

11 changes: 10 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ gz_configure_build(QUIT_IF_BUILD_ERRORS
#============================================================================
gz_create_packages()


#============================================================================
# Create documentation
#============================================================================
Expand All @@ -152,3 +151,13 @@ gz_create_docs(
TAGFILES
"${GZ-MATH_DOXYGEN_TAGFILE} = ${GZ-MATH_API_URL}"
)

#============================================================================
# Build examples
#============================================================================
if (BUILD_TESTING)
gz_build_examples(
SOURCE_DIR ${PROJECT_SOURCE_DIR}/examples
BINARY_DIR ${PROJECT_BINARY_DIR}/examples
)
endif()
48 changes: 48 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,54 @@

## Gazebo Common 5.x

## Gazebo Common 5.4.2 (2023-09-26)

1. Documentation fixes
* [Pull request #534](https://github.com/gazebosim/gz-common/pull/534)
* [Pull request #535](https://github.com/gazebosim/gz-common/pull/535)

1. Fix glTF metalness and roughness map orientation
* [Pull request #532](https://github.com/gazebosim/gz-common/pull/532)

1. Build examples from CMake rather than executable
* [Pull request #502](https://github.com/gazebosim/gz-common/pull/502)


## Gazebo Common 5.4.1 (2023-08-21)

1. Use `pull_request_target` for triage workflow
* [Pull request #527](https://github.com/gazebosim/gz-common/pull/527)

1. Fix Github project automation for new project board
* [Pull request #526](https://github.com/gazebosim/gz-common/pull/526)

1. Fix Github Actions on macOS
* [Pull request #524](https://github.com/gazebosim/gz-common/pull/524)

1. Only build integration tests if libraries exist
* [Pull request #523](https://github.com/gazebosim/gz-common/pull/523)

1. Fix compiling under linux
* [Pull request #521](https://github.com/gazebosim/gz-common/pull/521)

1. Add missing <fstream> header includes
* [Pull request #518](https://github.com/gazebosim/gz-common/pull/518)

1. Header was dropped in the forward port and breaks downstream
* [Pull request #515](https://github.com/gazebosim/gz-common/pull/515)

1. Port: 4 to 5
* [Pull request #511](https://github.com/gazebosim/gz-common/pull/511)

1. Lint
* [Pull request #Lint](https://github.com/gazebosim/gz-common/pull/Lint)

1. 🎈 4.7.0
* [Pull request #510](https://github.com/gazebosim/gz-common/pull/510)

1. Fix build error when using gz:: with ign-common4
* [Pull request #489](https://github.com/gazebosim/gz-common/pull/489)

## Gazebo Common 5.4.0 (2023-04-28)

1. Add support for bayer images to be saved in a directory
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ callback system.

# Install

See the [installation tutorial](https://gazebosim.org/api/common/4.0/install.html).
See the [installation tutorial](https://gazebosim.org/api/common/6/install.html).

# Usage

Expand All @@ -69,8 +69,10 @@ Refer to the following table for information about important directories and fil
+-- av Header and source files for the AV component.
+-- events Header and source files for the Event component.
+-- examples Example programs.
+-- geospatial Geospatial component for heightmap & DEMs
+-- graphics Header and source files for the Graphics component.
+-- include/gz/common Header files for the core component.
+-- io IO component. Read object from stream.
+-- profiler Header and source files for the Profiler component.
+-- src Core source files and unit tests.
+-- test
Expand Down
4 changes: 3 additions & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)

project(gz-common-examples)

# Find the gz-common library
find_package(gz-common6 QUIET REQUIRED COMPONENTS events profiler)
Expand Down
32 changes: 19 additions & 13 deletions graphics/src/AssimpLoader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,21 @@ MaterialPtr AssimpLoader::Implementation::CreateMaterial(
this->GenerateTextureName(_scene, assimpMat, "Roughness"));
pbr.SetRoughnessMap(texName, texData);
}
// Load lightmap only if it is not a glb/glTF mesh that contains a
// MetallicRoughness texture
// It was found that lightmap field just stores the entire MetallicRoughness
// texture. Issues were also reported in assimp:
// https://github.com/assimp/assimp/issues/3120
// https://github.com/assimp/assimp/issues/4637
unsigned int uvIdx = 0;
ret = assimpMat->GetTexture(
aiTextureType_LIGHTMAP, 0, &texturePath, NULL, &uvIdx);
if (ret == AI_SUCCESS)
{
auto [texName, texData] = this->LoadTexture(_scene, texturePath,
this->GenerateTextureName(_scene, assimpMat, "Lightmap"));
pbr.SetLightMap(texName, uvIdx, texData);
}
}
#endif
ret = assimpMat->GetTexture(aiTextureType_NORMALS, 0, &texturePath);
Expand All @@ -442,15 +457,6 @@ MaterialPtr AssimpLoader::Implementation::CreateMaterial(
this->GenerateTextureName(_scene, assimpMat, "Emissive"));
pbr.SetEmissiveMap(texName, texData);
}
unsigned int uvIdx = 0;
ret = assimpMat->GetTexture(
aiTextureType_LIGHTMAP, 0, &texturePath, NULL, &uvIdx);
if (ret == AI_SUCCESS)
{
auto [texName, texData] = this->LoadTexture(_scene, texturePath,
this->GenerateTextureName(_scene, assimpMat, "Lightmap"));
pbr.SetLightMap(texName, uvIdx, texData);
}
#ifndef GZ_ASSIMP_PRE_5_2_0
float value;
ret = assimpMat->Get(AI_MATKEY_METALLIC_FACTOR, value);
Expand Down Expand Up @@ -507,13 +513,13 @@ std::pair<ImagePtr, ImagePtr>
std::vector<unsigned char> metalnessData(width * height * bytesPerPixel);
std::vector<unsigned char> roughnessData(width * height * bytesPerPixel);

for (unsigned int x = 0; x < width; ++x)
for (unsigned int y = 0; y < height; ++y)
{
for (unsigned int y = 0; y < height; ++y)
for (unsigned int x = 0; x < width; ++x)
{
// RGBA so 4 bytes per pixel, alpha fully opaque
auto baseIndex = bytesPerPixel * (x * height + y);
auto color = _img.Pixel(x, y);
auto baseIndex = bytesPerPixel * (y * width + x);
auto color = _img.Pixel(x, (height - y - 1));
metalnessData[baseIndex] = color.B() * 255.0;
metalnessData[baseIndex + 1] = color.B() * 255.0;
metalnessData[baseIndex + 2] = color.B() * 255.0;
Expand Down
10 changes: 8 additions & 2 deletions graphics/src/AssimpLoader_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -708,10 +708,16 @@ TEST_F(AssimpLoader, LoadGlbPbrAsset)
// Check pixel values to test metallicroughness texture splitting
EXPECT_FLOAT_EQ(pbr->MetalnessMapData()->Pixel(256, 256).R(), 0.0);
EXPECT_FLOAT_EQ(pbr->RoughnessMapData()->Pixel(256, 256).R(), 124.0 / 255.0);

// Bug in assimp 5.0.x that doesn't parse coordinate sets properly
EXPECT_EQ(pbr->LightMapTexCoordSet(), 1);
// \todo(iche033) Lightmaps are disabled for glb meshes
// due to upstream bug
// EXPECT_EQ(pbr->LightMapTexCoordSet(), 1);
#endif
EXPECT_NE(pbr->LightMapData(), nullptr);

// \todo(iche033) Lightmaps are disabled for glb meshes
// due to upstream bug
// EXPECT_NE(pbr->LightMapData(), nullptr);

// Mesh has 3 animations
auto skel = mesh->MeshSkeleton();
Expand Down
Loading

0 comments on commit 9a3b38e

Please sign in to comment.