common#

Gazebo Common : AV, Graphics, Events, and much more.

Maintainer: nate AT openrobotics DOT org

GitHub open issues GitHub open pull requests Discourse topics Hex.pm

Build

Status

Test coverage

codecov

Ubuntu Jammy

Build Status

Homebrew

Build Status

Windows

Build Status

Gazebo Common, a component of Gazebo, provides a set of libraries that cover many different use cases. An audio-visual library supports processing audio and video files, a graphics library can load a variety 3D mesh file formats into a generic in-memory representation, and the core library of Gazebo Common contains functionality that spans Base64 encoding/decoding to thread pools.

Table of Contents

Features

Install

Usage

Folder Structure

Code of Conduct

Contributing

Versioning

License

Features

Some of the many capabilities contained in Gazebo Common are:

  • AV: FFMpeg based audio decoder, and video encoder and decoder.

  • Core: Base64 encoding and decoding, battery model, console logging, cross-platform filesystem interface, URI processing, and a thread pool.

  • Events: Mouse and keyboard events, and a high-performance signal and callback system.

  • Graphics: Collada, SVG, STL, OBJ, and DEM loaders. In-memory mesh, image, and material representations. Animation processing and BVH loader.

  • Profiler: A common profiler abstraction that can be used to measure and visualize run time of various pieces of Gazebo software.

Install

See the installation tutorial.

Usage

Please refer to the examples directory.

Folder Structure

Refer to the following table for information about important directories and files in this repository.

+-- 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
|    +-- integration         Integration tests.
|    +-- performance         Performance tests.
|    +-- plugins             Plugin tests.
|    +-- static_assertions   Plugin static assertion tests.
|    +-- regression          Regression tests.
+-- tutorials                Tutorials, written in markdown.
+-- Changelog.md             Changelog.
+-- CMakeLists.txt           CMake build script.
+-- Migration.md             Migration guide.

Contributing

Please see the contributing guide.

Code of Conduct

Please see CODE_OF_CONDUCT.md.

Versioning

This library uses Semantic Versioning. Additionally, this library is part of the Gazebo project which periodically releases a versioned set of compatible and complimentary libraries. See the Gazebo website for version and release information.

License

This library is licensed under Apache 2.0. See also the LICENSE file.

Gazebo Common 5.x

Gazebo Common 5.6.0 (2024-04-23)

  1. Clarify units for the DEM classes

  2. Remove pessimizing move

  3. Fix bazel build

  4. Add new function in MeshManager to merge all submeshes of a mesh into one

  5. Adds new function in MeshManager for performing convex decomposition

Gazebo Common 5.5.1 (2024-03-14)

  1. Various Bazel adjustments for linting

  2. Extend AssimpLoader to parse material transmission factor

  3. Fix noise issue that appears in certain image textures

Gazebo Common 5.5.0 (2024-02-26)

  1. Be louder when graphics is missing for geospatial

  2. Multiple memory cleanup fixes

  3. Clarify GDAL version requirement

  4. 🎈 3.17.0

  5. Update CI badges in README

  6. Backwards compatible assimp texture name fix

  7. Fix error output when creating directories

  8. Update github action workflows

  9. Fix segfault in case of no write access to log dir

  10. ign -> gz

  11. Support loading glb with compressed jpeg textures

  12. Fix glTF / glb root node transform

  13. EnumIface: suppress deprecation warning

  14. Prevent loading lightmaps if mesh is a glb file that has an occlusion-metallic-roughness texture

  15. 🎈 3.16.0

  16. Fix cstdint with GCC 13

Gazebo Common 5.4.2 (2023-09-26)

  1. Documentation fixes

  2. Fix glTF metalness and roughness map orientation

  3. Build examples from CMake rather than executable

Gazebo Common 5.4.1 (2023-08-21)

  1. Use pull_request_target for triage workflow

  2. Fix Github project automation for new project board

  3. Fix Github Actions on macOS

  4. Only build integration tests if libraries exist

  5. Fix compiling under linux

  6. Add missing header includes

  7. Header was dropped in the forward port and breaks downstream

  8. Port: 4 to 5

  9. Lint

  10. 🎈 4.7.0

  11. Fix build error when using gz:: with ign-common4

Gazebo Common 5.4.0 (2023-04-28)

  1. Add support for bayer images to be saved in a directory

  2. Fix for ffmpeg v6

  3. Include cstring for memcpy

  4. Fixed MeshManager Singleton

  5. Fix for ffmpeg v6

  6. Rename COPYING to LICENSE

  7. Add marcoag as codeowner

  8. CI workflow: use checkout v3

  9. Update common5 for bazel builds

  10. Fix profile tutorial

  11. Update version in Changelog

  12. Fixed metalness/roughness in ASSIMP loader

  13. Fix Capsule mesh generation

  14. Improved coverage remotery

  15. Added BVH and STL loader tests

  16. Increased Image coverage

Gazebo Common 5.3.1 (2022-11-17)

  1. Fix out of bounds access to rotation array in assimp loader

  2. Fix issues detected by ASAN

Gazebo Common 5.3.0 (2022-11-14)

  1. Expose Vertex & Index raw ptrs for efficient reading

Gazebo Common 5.2.2 (2022-10-26)

  1. [Backport] Avoid Io.hh header name clash (#471)

Gazebo Common 5.2.1 (2022-10-19)

  1. Fix arm builds and tests

Gazebo Common 5.2.0 (2022-10-18)

  1. Add CSV data parsing

  2. Skip CSV header when reading DataFrame.

  3. Adds an API to retrieve keys.

Gazebo Common 5.1.0 (2022-10-13)

  1. 4 ➡️ 5

  2. 🎈 4.6.1

  3. 🎈 4.6.0

  4. 🎈 4.5.2

  5. 3 ➡️ 4

  6. 🎈 3.15.1

  7. 🎈 3.15.0

  8. 🎈 3.14.2

  9. Don’t install auto-generated profiler.hh

  10. Fixed MeshManager Singleton

  11. Don’t install CMakeLists.txt

  12. ign -> gz Migrate Ignition Headers : gz-common

  13. Suppress a bunch of unnecessary test output

  14. Fix metallic roughness file path for gltf assets

  15. Include cstring for memcpy

  16. Backport from 5 to 3 - Fix deprecation warning from new ffmpeg

  17. Remove redundant namespace references

Gazebo Common 5.0.0 (2022-09-22)

  1. Improved visualization hw encoding tutorial gz-common5

  2. Updated install instructions gz-common5

  3. Fix reading pixel values from single channel 16 bit image

  4. Add gdal to prerequisites

  5. Cleanup long-deprecated ifdefs

  6. Add a test for loading gltf with external textures

  7. Fix ABI checker with testing module

  8. Implement XDisplacement function for checking x displacement for all nodes

  9. Fix deprecation warning from new ffmpeg

  10. Use assimp for loading meshes

  11. Add API for getting Image bytes as std::vector

  12. Support lunar coordinate transformations

  13. Remove configure.bat, export CXX_STANDARD

  14. Update GoogleTest to latest version

  15. Support compressed images and RGBA data in Image class

  16. Expose API to set non earth DEMs flag

  17. Fix console bug when IGN_HOMEDIR is unset

  18. Test updates for common::testing module.

  19. Ignition -> Gz Renaming

  20. [DOCUMENTATION] Adds full path for the profiler

  21. prevent switch case statement fall through.

  22. Make Timer_TEST more robust

  23. Bumps in garden : ign-common5

  24. Use ign-utils instead of ign-cmake utilities

  25. Bumps in garden : ign-common5

  26. examples/CMakeLists.txt: fix find version variable

  27. Add common::testing module

  28. Fix typo bug in MaterialIndex

  29. Fix edge case handling for SubMesh::MaterialIndex

  30. DEM improvements to nodata, buffer and other corner cases

  31. 🧹 Drop all test main functions from gtest files

  32. Class with final destructor should be final

  33. Geospatial component for heightmaps and DEM support

  34. Fix filesystem::separator, parentPath and basename behavior

  35. Miscellaneous cleanup of Events API

  36. Adds an isRelativePath to determine if path is relative

  37. Image: make several methods const

  38. Utilize ImplPtr in AV component

  39. Update tests to use more STL functionality

  40. Fixed parentPath() return when input has no parent

  41. Utilize ImplPtr for Timer

  42. Update to use std::filesystem rather than Boost

  43. Use SuppressWarning from ign-utils

  44. README: update badge

  45. Revert geospatial component for now

  46. Move geospatial headers to subfolder

  47. Geospatial component for heightmap & DEMs

  48. Upload coverage for Focal builds

  49. Try to checkout matching branch in macos workflow

  50. Bumps in garden: use ignition-math7

  51. Add macOS 11 workflow

  52. Use ImplPtr where relevant

  53. Remove all deprecated functionality from main

  54. ign-common5: drop Bionic

  55. Update tension for common5

  56. Bump main to 5.0.0~pre1

Gazebo Common 4.x

Gazebo Common 4.7.0 (2023-05-17)

  1. Forward Ports: 3 -> 4 (#506)

  2. Fix build error when using gz:: with ign-common4

  3. Fix for ffmpeg v6

  4. Include cstring for memcpy

  5. Fixed MeshManager Singleton

  6. Rename COPYING to LICENSE

  7. Add marcoag as codeowner

  8. CI workflow: use checkout v3

  9. Improved coverage remotery

  10. Added BVH and STL loader tests

  11. Increased Image coverage

Gazebo Common 4.6.2 (2022-11-17)

  1. Fix Capsule mesh generation.

Gazebo Common 4.6.1 (2022-10-11)

  1. All common3 changes up to 3.15.1 release

Gazebo Common 4.6.0 (2022-10-11)

  1. All common3 changes up to 3.15.0 release

  2. Include cstring for memcpy

Gazebo Common 4.5.2 (2022-08-16)

  1. Fix deprecation warning from new ffmpeg

  2. Remove redundant namespace references

  3. Add code coverage ignore file

  4. Change IGN_DESIGNATION to GZ_DESIGNATION

  5. Ignition -> Gazebo

  6. Support absolute Win paths with forward slashes in common::FindFile

  7. Fix FindSharedLibrary for relative plugin paths

  8. Fix race condition in FileLogger

  9. Synchronize console writes

  10. Profiler tutorial: viewing from Docker container

Gazebo Common 4.5.1 (2022-06-21)

  1. Fix spelling in URI error message

  2. gzLogInit fails if run after console output

  3. Fix compatibility with FFmpeg 5.0

  4. packages.apt: don’t install ruby-ronn

  5. Add some tests for parentPath/basename

  6. Add CI support for Jammy

  7. Minor typo in filesystem documentation

  8. Fix out-of-bounds access in sanitizeSlashes

  9. Fix out-of-bound access in URI

  10. Move performance test to examples

  11. Fix memory corruption & leaks in Image

Gazebo Common 4.5.0 (2022-01-12)

  1. Fixed crash when a Collada file has an empty normal vector

  2. Support 16 bit heightmaps

  3. Fix bug in URIPath assignment operator

  4. Use libexec to install binary remotery_vis

  5. Normalize normal vectors from OBJ.

  6. Synchronize console writes

  7. Added method to remove meshes from the MeshManager

  8. Fixed macOS symbol in common::Profiler

  9. Fix skip logic for integration tests

  10. Use direct evaluation for SKIP_av.

Gazebo Common 4.4.0 (2021-10-15)

  1. Add support for animation tension

Gazebo Common 4.3.0 (2021-09-27)

  1. Remove gz-utils from TempDirectory

  2. Add functions and objects for Temporary Directories

  3. Fix memory corruption & leaks in Image

  4. Fix a typo in VideoEncoder_TEST.

  5. Fix segfault caused by destruction order of Event and Connection

  6. Infrastructure

  7. Documentation

Gazebo Common 4.2.0 (2021-08-02)

  1. Export lights to dae

  2. Add cstring for std::memcpy

Gazebo Common 4.1.0 (2021-06-22)

  1. Make KeyEvent rule-of-five compliant

  2. Fix av_* API usage for deprecations

  3. Set project-wide standard to C++17

  4. Remove CMAKE_CXX_FLAGS from test targets

  5. Support loading PBR textures in OBJLoader

  6. Remove tools/code_check and update codecov

  7. Port codecov to new configuration

  8. Fix loading collada files with multiple texcoord sets using the same offset

  9. Add function to convert single channel image data to RGB image

  10. Remove ColladaExporter path constraint

  11. Avoid duplication of / in joinPaths (Windows)

  12. Fixed colladaLoader on Windows

  13. Improved Windows support

  14. Function to serialize compressed image to buffer

  15. Fixed tutorial link

  16. Use matching malloc/free for AudioDecoder.

  17. Add bazel buildsystem support

Gazebo Common 4.0.0 (2021-03-30)

  1. Include windows instructions in examples README.md

  2. Fix crash when using BVH animations

  3. Rotate capsule to Z-up

  4. Add implementation pointer to gz-common classes

  5. Cleanup and add implementation pointer to Animation classes

  6. Install the profiler in a version-safe manner

  7. Restore support for model:// URIs

  8. Deprecated common::Time

  9. Update codeowners

  10. Workflow updates

  11. Update BitBucket Links

  12. Corrected BAYER_RGGR8 to BAYER_BGGR8 in PixelFormatName and PixelFormatType located in graphics/include/gz/common/Image.hh.

  13. Added URI Authority parsing to the URI class. Authority information can be found here. This update also caused some formally valid syntax to become invalid, and some formally invalid syntax to become valid. See the migration guide.

Gazebo Common 3.x

Gazebo Common 3.17.0 (2024-01-05)

  1. Fix error output when creating directories

  2. Update github action workflows

  3. Fix segfault in case of no write access to log dir

Gazebo Common 3.16.0 (2023-06-05)

  1. Include cstdint to build with GCC 13

  2. Fix missing cstdint header in latest gcc build

  3. Fix for ffmpeg v6

  4. Include cstring for memcpy

  5. Fixed MeshManager Singleton

  6. Rename COPYING to LICENSE

  7. Add marcoag as codeowner

  8. CI workflow: use checkout v3

  9. Improved coverage remotery

  10. Added BVH and STL loader tests

  11. Increased Image coverage

Gazebo Common 3.15.1 (2022-10-11)

  1. Fix build on case-insensitive filesystems

  2. Don’t install CMakeLists.txt

Gazebo Common 3.15.0 (2022-10-06)

  1. ign -> gz Migrate Ignition Headers

Gazebo Common 3.14.2 (2022-08-16)

  1. Fix deprecation warning from new ffmpeg

Gazebo Common 3.14.1 (2022-06-01)

  1. Profiler tutorial: viewing from Docker container

  2. ignLogInit can be called after an ignerr, etc

  3. Fix compatibility with FFmpeg 5.0

  4. Fix out-of-bounds access in sanitizeSlashes

  5. Fix memory corruption & leaks in Image

  6. Normalize normal vectors from OBJ.

  7. Fixed macos symbol in common::profiler

  8. Fix skip logic for integration tests

Gazebo Common 3.14.0 (2021-10-12)

  1. Support loading PBR textures in OBJLoader

  2. Remove CMAKE_CXX_FLAGS from test targetrs

  3. Set project-wide standard to C++17

  4. Fix av_* API usage for deprecations

  5. Make KeyEvent rule-of-five compliant

  6. Fix segfault caused by destructionb order of Event and Connection

  7. Fix a typo in VideoEncoder_TEST

  8. Use direct evaluation for SKIP_av

Gazebo Common 3.13.2 (2021-05-11)

  1. Backport collada fixes (Backport #204)

  2. Fix join paths again

Gazebo Common 3.13.1 (2021-05-03)

  1. Fix join paths to remove duplicate separators

  2. Fix loading collada files with multiple texcoord sets using the same offset.

Gazebo Common 3.13.0 (2021-04-27)

  1. Add function to convert single channel image data to RGB image

  2. Avoid duplication of / in joinPaths (Windows)

  3. Fix colladaLoader on Windows

  4. Backport #188: Fix crash when using BVH animations.

  5. Improved Windows support

Gazebo Common 3.12.0 (2021-04-06)

  1. Remove use of _SOURCE and _BINARY dirs in tests.

  2. Add bazel buildsystem support.

  3. Use matching malloc/free for AudioDecoder.

  4. Fixed tutorial link in the README.md.

  5. Function to serialize compressed image to buffer

Gazebo Common 3.11.1 (2021-03-08)

  1. Relax expectation so encoder test passes on ARM

  2. Revert “Associate library materials effect with meshes (#151)”

Gazebo Common 3.11.0 (2021-03-05)

  1. Fix image red and blue swapping

  2. Remove issue & PR templates

  3. Prevent console spamming when exporting a mesh that has multiple texture coordinates

  4. Associate library materials effect with meshes

  5. Added issue & PR templates

  6. Added support for HW-accelerated video encoding.

  7. Added FlagSet utility class

  8. Disable failing VideoEncoder and Audioecoder tests on Windows

  9. Added ellipsoid mesh

  10. Added capsule mesh

Gazebo Common 3.10.1 (2021-01-20)

  1. Fix transparency tag in the Collada exporter.

Gazebo Common 3.10.0 (2021-01-05)

  1. Added render order to material class

  2. Fix memory leak in Pbr.cc

Gazebo Common 3.9.0 (2020-12-21)

  1. Support multiple texture coordinate sets

  2. Add Lightmap to material

Gazebo Common 3.8.0 (2020-12-08)

  1. Call gz::common::load() from Video constructor

  2. Cleanup

  3. Windows

  4. Fix video encoder timing

  5. Feature: Add transformation matrix to ColladaExport

Gazebo Common 3.7.0 (2020-10-21)

  1. Miscellaneous Cleanups

    • Feature: Join function for combining strings with a delimiter

    • Pull Request 107

  2. Improve fork experience

  3. Add Console example

  4. Support fuel URLs for textures

  5. Fix loading dae file with hierarchical node that does not have a name

  6. Fix more Animation memory leaks

  7. Fix env behavior to return true on empty vars

    • Feature: Add setenv for setting environment variables

    • Feature: Add unsetenv for clearing environment variables

    • Feature: Add alternative env implementation that respects empty variables

    • Pull Request 97

Gazebo Common 3.6.1 (2020-09-16)

  1. Fix hierarchical submesh processing in the ColladaLoader.

  2. Tutorial updates

  3. Fix the AudioDecoder class

  4. Fix actions CI

  5. Fix trajectory info memory leak

  6. Remove URI warning on constructor

Gazebo Common 3.6.0 (2020-06-09)

  1. Refactor Image::MaxColor to reduce computation time

  2. Update to gtest 1.10.0 with patch for gcc warnings

  3. Fix ColladaLoader loading tag when does not exist

  4. Remove unused included headers

  5. More file path APIs

Gazebo Common 3.5.0 (2020-04-09)

  1. Add interpolate_x property to actor animations

  2. Update PBR metalness default value to 0.0

  3. Fix crash when loading OBJ meshes with invalid materials

Gazebo Common 3.4.0 (2020-02-20)

  1. Add PBR material class

  2. Custom paths for file URIs (env var + URI)

  3. Add function to get NodeAnimation

  4. Handle unexpected COLLADA more gracefully

  5. Add support for alpha based texture transparency.

  6. tiny_obj_loader: set better diffuse value when map_kD is present and Kd is not specified.

  7. ColladaLoader: load files with actors with multiple skeletons

  8. Compute volume of mesh shapes with Mesh::Volume and SubMesh::Volume.

  9. Port Skeleton fixes from gazebo.

  10. Port gazebo9 fix for ColladaLoader with multiple geometries

  11. SystemPaths::FindSharedLibrary: return input if its is an absolute path to a file

  12. Fix Image::ConvertPixelFormat for BAYER_BGGR8

  13. Support custom callbacks to find files on global interface

Gazebo Common 3.3.0 (2019-08-27)

  1. skip GTSMeshUtils test on Windows due to issue #50

  2. Add bvh animation support for skeleton and TrajectoryInfo

  3. ColladaLoader: fix wrong node weights caused by buffer overflow bug

  4. Filesystem copy directory and parentpath

Gazebo Common 3.2.0 (2019-08-07)

  1. Allow gzLogInit to use an absolute path. Added a timeToIso that converts a given time to an ISO string. Some console timestamps were using GZ_SYSTEM_TIME_NS() and others gz::common::systemTimeISO(). Switched all to use gz::common::systemTimeISO().

  2. Port ColladaLoader fix: use default value of 1 for stride parameter when unset.

Gazebo Common 3.1.0 (2019-05-17)

  1. Image::PixelFormatType: append BAYER_BGGR8 instead of replacing BAYER_RGGR8

  2. Use std::tolower with locale in lowercase helper function

  3. Profiler: give hint on osx to find frameworks so it doesn’t find them inside Xcode

  4. Fix windows tests: SystemPathsFixture.FileSystemPaths and TimeTest.Sleep

  5. Filesystem functions to create unique paths

  6. Battery additions for LinearBatteryPlugin port to gz-sim

  7. Consolidate Console::log streams to reduce colored log size

  8. Fix ColladaLoader to support mixamo models and fix skeleton animation loading

Gazebo Common 3.0.0 (2019-02-28)

  1. Use gz-cmake2 and support Ubuntu Bionic (18.04).

  2. WorkerPool: allow user to set minimum number of worker threads.

  3. ColladaLoader fixes: setting multiple texcoord’s, check for line breaks when using split

  4. Event: replace operator() and Signal() explicit templates with variadic templates and perfect forwarding.

  5. Event: use second template argument to disambiguate events with matching signatures.

  6. Add profiler using Remotery.

  7. Added hash64 function for converting std::string to uint64_t as constexpr.

  8. SystemPaths: search paths in GZ_FILE_PATH environment variable when finding files

  9. Time::Sleep: return amount of time actually slept

  10. NodeTransform: use unique_ptr for private data, add copy constructor/assignment

Gazebo Common 2.x

Gazebo Common 2.x.x (2018-XX-XX)

Gazebo Common 2.0.0 (2018-02-11)

  1. Use ignition-cmake1 and components for av, events, and graphics

  2. Expand plugin functionality with PluginPtr and specializations

  3. Added signal handler class

  4. Update tinyobjloader to version that supports triangulating meshes with concave polygons.

Gazebo Common 1.x.x (2018-XX-XX)

Gazebo Common 1.X.X (20XX-XX-XX)

  1. Time::Sleep: use CLOCK_MONOTONIC on Linux

Gazebo Common 1.1.1 (2018-05-23)

  1. Documentation upload improvements

  2. Fix build on homebrew with ffmpeg4

  3. Remove symbolic link directory

Gazebo Common 1.1.0 (2018-04-16)

  1. Accept spaces on URI path

  2. Fix gcc7 compiler warnings on artful

  3. Fix artful cppcheck

  4. Fix nanosecond to second conversion