Skip to content

Commit

Permalink
Merge branch 'ports/3_to_4' into main (#104)
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Carroll <michael@openrobotics.org>
  • Loading branch information
mjcarroll committed Oct 29, 2020
2 parents 526c2ac + 68d9445 commit 29c142c
Show file tree
Hide file tree
Showing 101 changed files with 8,719 additions and 4,509 deletions.
5 changes: 3 additions & 2 deletions .github/ci-bionic/after_make.sh → .github/ci/after_make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

set -x

BUILD_DIR=`pwd`

# Install
make install

Expand All @@ -12,5 +14,4 @@ cd build
cmake ..
make

# return to the compilation place
cd ../../build
cd $BUILD_DIR
13 changes: 13 additions & 0 deletions .github/ci/packages.apt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
libavcodec-dev
libavdevice-dev
libavformat-dev
libavutil-dev
libfreeimage-dev
libgts-dev
libignition-cmake2-dev
libignition-math6-dev
libswscale-dev
libtinyxml2-dev
pkg-config
ruby-ronn
uuid-dev
18 changes: 0 additions & 18 deletions .github/workflows/ci-bionic.yml

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Ubuntu CI

on: [push, pull_request]

jobs:
bionic-ci:
runs-on: ubuntu-latest
name: Ubuntu Bionic CI
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Compile and test
id: ci
uses: ignition-tooling/action-ignition-ci@master
with:
codecov-token: ${{ secrets.CODECOV_TOKEN }}
focal-ci:
runs-on: ubuntu-latest
name: Ubuntu Focal CI
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Compile and test
id: ci
uses: ignition-tooling/action-ignition-ci@focal
2 changes: 1 addition & 1 deletion .github/workflows/pr-collection-labeler.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: PR Collection Labeler

on: pull_request
on: pull_request_target

jobs:
pr_collection_labeler:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/triage.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
on:
issues:
types: [opened]
pull_request:
pull_request_target:
types: [opened]
name: Ticket opened
jobs:
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# CMake folders
build
build_*

# OS generated files
.DS_Store
*.swp
100 changes: 100 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,110 @@

## Ignition Common 3.X.X

## Ignition Common 3.7.0 (2020-10-21)

1. Miscellaneous Cleanups
* Feature: Join function for combining strings with a delimiter
* [Pull Request 107](https://github.com/ignitionrobotics/ign-common/pull/107)

1. Improve fork experience
* [Pull Request 103](https://github.com/ignitionrobotics/ign-common/pull/103)

1. Add Console example
* [Pull Request 106](https://github.com/ignitionrobotics/ign-common/pull/106)

1. Support fuel URLs for textures
* [Pull Request 102](https://github.com/ignitionrobotics/ign-common/pull/102)

1. Fix loading dae file with hierarchical node that does not have a name
* [Pull Request 101](https://github.com/ignitionrobotics/ign-common/pull/101)

1. Fix more Animation memory leaks
* [Pull Request 98](https://github.com/ignitionrobotics/ign-common/pull/98)

1. 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](https://github.com/ignitionrobotics/ign-common/pull/97)

## Ignition Common 3.6.1 (2020-09-16)

1. Fix hierarchical submesh processing in the ColladaLoader.
* [Pull Request 78](https://github.com/ignitionrobotics/ign-common/pull/78)

1. Tutorial updates
* [Pull Request 86](https://github.com/ignitionrobotics/ign-common/pull/86)
* [Pull Request 87](https://github.com/ignitionrobotics/ign-common/pull/87)
* [Pull Request 92](https://github.com/ignitionrobotics/ign-common/pull/92)

1. Fix the AudioDecoder class
* [Pull Request 81](https://github.com/ignitionrobotics/ign-common/pull/81)

1. Fix actions CI
* [Pull Request 83](https://github.com/ignitionrobotics/ign-common/pull/83)

1. Fix trajectory info memory leak
* [Pull Request 93](https://github.com/ignitionrobotics/ign-common/pull/93)

1. Remove URI warning on constructor
* [Pull Request 94](https://github.com/ignitionrobotics/ign-common/pull/94)

## Ignition Common 3.6.0 (2020-06-09)

1. Refactor Image::MaxColor to reduce computation time
* [Pull request 66](https://github.com/ignitionrobotics/ign-common/pull/66)

1. Update to gtest 1.10.0 with patch for gcc warnings
* [Pull request 67](https://github.com/ignitionrobotics/ign-common/pull/67)

1. Fix ColladaLoader loading <transparent> tag when <transparency> does not exist
* [Pull request 68](https://github.com/ignitionrobotics/ign-common/pull/68)

1. Remove unused included headers
* [Pull request 71](https://github.com/ignitionrobotics/ign-common/pull/71)

1. More file path APIs
* [Pull request 70](https://github.com/ignitionrobotics/ign-common/pull/70)

## Ignition Common 3.5.0 (2020-04-09)

1. Add interpolate\_x property to actor animations
* [BitBucket pull request 232](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-common/pull-requests/232)

1. Update PBR metalness default value to 0.0
* [BitBucket pull request 231](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-common/pull-requests/231)

1. Fix crash when loading OBJ meshes with invalid materials
* [BitBucket pull request 230](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-common/pull-requests/230)

## Ignition Common 3.4.0 (2020-02-20)

1. Add PBR material class
* [BitBucket pull request 227](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-common/pull-requests/227)

1. Custom paths for file URIs (env var + URI)
* [BitBucket pull request 210](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-common/pull-requests/210)

1. Add function to get NodeAnimation
* [BitBucket pull request 223](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-common/pull-requests/223)

1. Handle unexpected COLLADA more gracefully
* [BitBucket pull request 218](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-common/pull-requests/218)

1. Add support for alpha based texture transparency.
* [BitBucket pull request 221](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-common/pull-requests/221)

1. `tiny_obj_loader`: set better diffuse value when `map_kD` is present and `Kd` is not specified.
* [BitBucket pull request 216](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-common/pull-requests/216)
* [BitBucket pull request 217](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-common/pull-requests/217)

1. ColladaLoader: load files with actors with multiple skeletons
* [BitBucket pull request 215](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-common/pull-requests/215)

1. Compute volume of mesh shapes with `Mesh::Volume` and `SubMesh::Volume`.
* [BitBucket pull request 214](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-common/pull-requests/214)

1. Port Skeleton fixes from gazebo.
* [BitBucket pull request 209](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-common/pull-requests/209)

Expand All @@ -33,6 +130,9 @@
1. Fix `Image::ConvertPixelFormat` for `BAYER_BGGR8`
* [BitBucket pull request 211](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-common/pull-requests/211)

1. Support custom callbacks to find files on global interface
* [BitBucket pull request 226](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-common/pull-requests/226)

## Ignition Common 3.3.0 (2019-08-27)

1. skip GTSMeshUtils test on Windows due to issue #50
Expand Down
1 change: 1 addition & 0 deletions av/include/ignition/common/AudioDecoder.hh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ namespace ignition

/// \brief Get the sample rate from the latest decoded file.
/// \return Integer sample rate, such as 44100.
/// If no file is decoded, -1 is returned.
public: int SampleRate();

/// \brief Free audio object, close files, streams.
Expand Down
5 changes: 4 additions & 1 deletion av/src/AudioDecoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,10 @@ bool AudioDecoder::Decode(uint8_t **_outBuffer, unsigned int *_outBufferSize)
/////////////////////////////////////////////////
int AudioDecoder::SampleRate()
{
return this->data->codecCtx->sample_rate;
if (this->data->codecCtx)
return this->data->codecCtx->sample_rate;

return -1;
}

/////////////////////////////////////////////////
Expand Down
25 changes: 17 additions & 8 deletions av/src/AudioDecoder_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ TEST(AudioDecoder, FileNotSet)
unsigned int dataBufferSize;
uint8_t *dataBuffer = NULL;
EXPECT_FALSE(audio.Decode(&dataBuffer, &dataBufferSize));

EXPECT_EQ(audio.File(), "");
EXPECT_EQ(audio.SampleRate(), -1);
}

/////////////////////////////////////////////////
Expand Down Expand Up @@ -59,7 +62,7 @@ TEST(AudioDecoder, DataBuffer)
{
common::AudioDecoder audio;

std::string path = PROJECT_SOURCE_PATH;
std::string path = TEST_PATH;
path += "/data/cheer.wav";
EXPECT_TRUE(audio.SetFile(path));

Expand Down Expand Up @@ -110,8 +113,8 @@ TEST(AudioDecoder, CheerFile)
path = TEST_PATH;
path += "/data/cheer.wav";
EXPECT_TRUE(audio.SetFile(path));
EXPECT_EQ(audio.GetFile(), path);
EXPECT_EQ(audio.GetSampleRate(), 48000);
EXPECT_EQ(audio.File(), path);
EXPECT_EQ(audio.SampleRate(), 48000);

audio.Decode(&dataBuffer, &dataBufferSize);
EXPECT_EQ(dataBufferSize, 5428692u);
Expand All @@ -122,8 +125,8 @@ TEST(AudioDecoder, CheerFile)
path = TEST_PATH;
path += "/data/cheer.ogg";
EXPECT_TRUE(audio.SetFile(path));
EXPECT_EQ(audio.GetFile(), path);
EXPECT_EQ(audio.GetSampleRate(), 44100);
EXPECT_EQ(audio.File(), path);
EXPECT_EQ(audio.SampleRate(), 44100);

audio.Decode(&dataBuffer, &dataBufferSize);
// In Ubuntu trusty the buffer size double for ogg decoding.
Expand All @@ -137,11 +140,17 @@ TEST(AudioDecoder, CheerFile)
path = TEST_PATH;
path += "/data/cheer.mp3";
EXPECT_TRUE(audio.SetFile(path));
EXPECT_EQ(audio.GetFile(), path);
EXPECT_EQ(audio.GetSampleRate(), 44100);
EXPECT_EQ(audio.File(), path);
EXPECT_EQ(audio.SampleRate(), 44100);

audio.Decode(&dataBuffer, &dataBufferSize);
EXPECT_EQ(dataBufferSize, 4995072u);

// later versions of ffmpeg produces a different buffer size probably due to
// underlying changes in the decoder. The size of the first decoded frame
// is much smaller than all other frames.
EXPECT_TRUE(dataBufferSize == 4995072u ||
dataBufferSize == 4987612u ||
dataBufferSize == 4987612u * 2);
}
}

Expand Down
4 changes: 0 additions & 4 deletions av/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
ign_get_libsources_and_unittests(sources gtest_sources)

# FIXME: This class does not currently work
list(REMOVE_ITEM sources AudioDecoder.cc)
list(REMOVE_ITEM gtest_sources AudioDecoder_TEST.cc)

ign_add_component(av SOURCES ${sources} GET_TARGET_NAME av_target)

target_link_libraries(${av_target}
Expand Down
4 changes: 0 additions & 4 deletions av/src/VideoEncoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
*
*/
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/ioctl.h>

#include <mutex>

Expand Down
12 changes: 8 additions & 4 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)

# Find the ignition-common library
find_package(ignition-common4 QUIET REQUIRED COMPONENTS events profiler)
set(IGN_COMMON_VER 4)
find_package(ignition-common${IGN_COMMON_VER} QUIET REQUIRED COMPONENTS events profiler)

add_executable(assert_example assert_example.cc)
target_link_libraries(assert_example ignition-common4::core)
target_link_libraries(assert_example ignition-common${IGN_COMMON_VER}::core)

add_executable(console_example console.cc)
target_link_libraries(console_example ignition-common${IGN_COMMON_VER}::core)

add_executable(events_example events.cc)
target_link_libraries(events_example ignition-common4::events)
target_link_libraries(events_example ignition-common${IGN_COMMON_VER}::events)

add_executable(profiler_example profiler.cc)
target_link_libraries(profiler_example ignition-common4::profiler)
target_link_libraries(profiler_example ignition-common${IGN_COMMON_VER}::profiler)
target_compile_definitions(profiler_example PUBLIC "IGN_PROFILER_ENABLE=1")
25 changes: 25 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Examples

These examples demonstrate various Ignition Common features.

## Build

After installing Ignition Common, from source or from binaries, build with:

```
git clone https://github.com/ignitionrobotics/ign-common/
cd ign-common/examples
mkdir build
cd build
cmake ..
make
```

## Run

One execuable is created inside the `build` folder for each example.

You can run each executable from the build folder with `./executablename`. For example:

`./events_example`

Loading

0 comments on commit 29c142c

Please sign in to comment.