Skip to content

Commit f96e361

Browse files
authored
Port: 4 to 5 (#511)
Signed-off-by: Michael Carroll <[email protected]>
2 parents f131cfa + a7d01a8 commit f96e361

33 files changed

+115
-35
lines changed

Changelog.md

+38
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,44 @@
329329

330330
## Gazebo Common 4.x
331331

332+
## Gazebo Common 4.7.0 (2023-05-17)
333+
334+
1. Forward Ports: 3 -> 4 (#506)
335+
* [Pull request #506](https://github.com/gazebosim/gz-common/pull/506)
336+
* [Pull request #500](https://github.com/gazebosim/gz-common/pull/500)
337+
* [Pull request #495](https://github.com/gazebosim/gz-common/pull/495)
338+
* [Pull request #491](https://github.com/gazebosim/gz-common/pull/491)
339+
340+
1. Fix build error when using gz:: with ign-common4
341+
* [Pull request #489](https://github.com/gazebosim/gz-common/pull/489)
342+
343+
1. Fix for ffmpeg v6
344+
* [Pull request #497](https://github.com/gazebosim/gz-common/pull/497)
345+
346+
1. Include cstring for memcpy
347+
* [Pull request #501](https://github.com/gazebosim/gz-common/pull/501)
348+
349+
1. Fixed MeshManager Singleton
350+
* [Pull request #451](https://github.com/gazebosim/gz-common/pull/451)
351+
352+
1. Rename COPYING to LICENSE
353+
* [Pull request #494](https://github.com/gazebosim/gz-common/pull/494)
354+
355+
1. Add marcoag as codeowner
356+
* [Pull request #493](https://github.com/gazebosim/gz-common/pull/493)
357+
358+
1. CI workflow: use checkout v3
359+
* [Pull request #490](https://github.com/gazebosim/gz-common/pull/490)
360+
361+
1. Improved coverage remotery
362+
* [Pull request #467](https://github.com/gazebosim/gz-common/pull/467)
363+
364+
1. Added BVH and STL loader tests
365+
* [Pull request #466](https://github.com/gazebosim/gz-common/pull/466)
366+
367+
1. Increased Image coverage
368+
* [Pull request #465](https://github.com/gazebosim/gz-common/pull/465)
369+
332370
## Gazebo Common 4.6.2 (2022-11-17)
333371

334372
1. Fix Capsule mesh generation.

av/src/VideoEncoder.cc

+6-7
Original file line numberDiff line numberDiff line change
@@ -394,20 +394,19 @@ bool VideoEncoder::Start(
394394
if (this->dataPtr->format.compare(outputFormat->name) == 0)
395395
{
396396
// Allocate the context using the correct outputFormat
397-
auto result = avformat_alloc_output_context2(&this->dataPtr->formatCtx,
397+
auto result = avformat_alloc_output_context2(
398+
&this->dataPtr->formatCtx,
398399
outputFormat, nullptr, this->dataPtr->filename.c_str());
399400
if (result < 0)
400401
{
401-
gzerr << "Failed to allocate AV context [" << av_err2str_cpp(result)
402-
<< "]" << std::endl;
402+
gzerr << "Failed to allocate AV context ["
403+
<< av_err2str_cpp(result)
404+
<< "]" << std::endl;
403405
}
404406
break;
405407
}
406408
}
407-
}
408-
while (outputFormat);
409-
410-
409+
} while (outputFormat);
411410
#endif
412411
}
413412
else

events/src/Event.cc

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
#include "gz/common/Console.hh"
1919
#include "gz/common/Event.hh"
20+
#include "gz/common/Util.hh"
2021

2122
using namespace gz;
2223
using namespace common;

examples/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ target_compile_definitions(profiler_example PUBLIC "GZ_PROFILER_ENABLE=1")
2020
add_executable(logging_performance logging_performance.cc)
2121
target_link_libraries(logging_performance gz-common${GZ_COMMON_VER}::core)
2222

23+
add_executable(util_example util.cc)
24+
target_link_libraries(util_example gz-common${GZ_COMMON_VER}::core)

examples/logging_performance.cc

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@
1717

1818
/* This code is originally from:
1919
* https://gist.github.com/KjellKod/0fde0d2564e2eb1b3560
20-
* For testing worst-case console logging latency with a variable number of
20+
* For testing worst-case console logging latency with a variable number of
2121
* threads.
2222
*/
2323

24+
#include <algorithm>
2425
#include <atomic>
2526
#include <map>
2627
#include <thread>
28+
#include <vector>
2729

2830
#include <gz/common/Console.hh>
2931

examples/util.cc

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Copyright (C) 2023 Open Source Robotics Foundation
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
*/
17+
#include <gz/common/Util.hh>
18+
19+
int main(int argc, char **argv)
20+
{
21+
gz::common::setenv("TEST", "0");
22+
return 0;
23+
}

geospatial/src/Dem.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
#include "gz/common/Console.hh"
2424
#include "gz/common/geospatial/Dem.hh"
25+
#include "gz/common/Util.hh"
2526

2627
using namespace gz;
2728
using namespace common;
@@ -89,7 +90,7 @@ Dem::~Dem()
8990
void Dem::SetSphericalCoordinates(
9091
const math::SphericalCoordinates &_worldSphericalCoordinates)
9192
{
92-
this->dataPtr->sphericalCoordinates =_worldSphericalCoordinates;
93+
this->dataPtr->sphericalCoordinates = _worldSphericalCoordinates;
9394
}
9495

9596
//////////////////////////////////////////////////

geospatial/src/ImageHeightmap.cc

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
*/
1717
#include "gz/common/Console.hh"
1818
#include "gz/common/geospatial/ImageHeightmap.hh"
19+
#include "gz/common/Util.hh"
1920

2021
using namespace gz;
2122
using namespace common;

graphics/include/gz/common/ColladaLoader.hh

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#define GZ_COMMON_COLLADALOADER_HH_
1919

2020
#include <string>
21+
2122
#include <gz/common/graphics/Export.hh>
2223
#include <gz/common/MeshLoader.hh>
2324

graphics/include/gz/common/GTSMeshUtils.hh

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <vector>
2222

2323
#include <gz/math/Vector2.hh>
24+
2425
#include <gz/common/graphics/Export.hh>
2526

2627

graphics/include/gz/common/Image.hh

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <string>
2424
#include <vector>
2525
#include <gz/math/Color.hh>
26+
2627
#include <gz/common/graphics/Export.hh>
2728

2829
#include <gz/utils/ImplPtr.hh>

graphics/include/gz/common/Material.hh

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <string>
2323

2424
#include <gz/math/Color.hh>
25+
2526
#include <gz/common/graphics/Export.hh>
2627
#include <gz/common/EnumIface.hh>
2728
#include <gz/common/Image.hh>

graphics/include/gz/common/MeshExporter.hh

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#define GZ_COMMON_MESHEXPORTER_HH_
1919

2020
#include <string>
21+
2122
#include <gz/common/graphics/Export.hh>
2223

2324
namespace gz

graphics/include/gz/common/STLLoader.hh

-1
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,3 @@ namespace gz
9797
}
9898
}
9999
#endif
100-

graphics/src/Image.cc

+1-2
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ void Image::SetFromData(const unsigned char *_data,
246246
{
247247
bpp = 8;
248248
scanlineBytes = _width;
249-
}
249+
}
250250
else
251251
{
252252
gzerr << "Unable to handle format[" << _format << "]\n";
@@ -613,7 +613,6 @@ math::Color Image::MaxColor() const
613613

614614
if (this->dataPtr->PixelIndex(
615615
this->dataPtr->bitmap, x, y, clr) == FALSE)
616-
617616
{
618617
gzerr << "Image: Coordinates out of range ["
619618
<< x << " " << y << "] \n";

graphics/src/MeshManager.cc

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include "gz/common/ColladaExporter.hh"
3636
#include "gz/common/OBJLoader.hh"
3737
#include "gz/common/STLLoader.hh"
38+
#include "gz/common/Util.hh"
3839
#include "gz/common/config.hh"
3940

4041
#include "gz/common/MeshManager.hh"

include/gz/common/Base64.hh

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#define GZ_COMMON_BASE64_HH_
1919

2020
#include <string>
21+
2122
#include <gz/common/Export.hh>
2223

2324
namespace gz

include/gz/common/Console.hh

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
#include <iostream>
2121
#include <fstream>
2222
#include <memory>
23+
#include <mutex>
2324
#include <sstream>
2425
#include <string>
2526

26-
#include <gz/common/Util.hh>
2727
#include <gz/common/Export.hh>
2828
#include <gz/utils/SuppressWarning.hh>
2929

include/gz/common/EnumIface.hh

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@
2020
#include <string>
2121
#include <vector>
2222
#include <algorithm>
23-
#include <gz/common/Util.hh>
23+
2424
#include <gz/common/Export.hh>
25+
#include <gz/common/Util.hh>
2526

2627
namespace gz
2728
{

include/gz/common/TemplateHelpers.hh

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#ifndef GZ_COMMON_TEMPLATEHELPERS_HH_
2020
#define GZ_COMMON_TEMPLATEHELPERS_HH_
2121

22-
2322
#include "gz/common/detail/TemplateHelpers.hh"
2423

2524
namespace gz

include/ignition/common/SpecializedPlugin.hh

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#include <ignition/common/config.hh>
2121
#include "ignition/common/Plugin.hh"
2222

23+
#include <memory>
24+
2325
namespace gz
2426
{
2527
namespace common

io/include/gz/common/DataFrame.hh

+3-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ namespace gz
7373
public: const std::vector<K> Keys() const
7474
{
7575
std::vector<K> keyList;
76-
for (auto &[k, _]: this->storage)
76+
for (auto &[k, _] : this->storage)
7777
{
7878
keyList.push_back(k);
7979
}
@@ -84,7 +84,8 @@ namespace gz
8484
private: std::unordered_map<K, V> storage;
8585
};
8686

87-
/// \brief Traits for IO of data frames comprised of time varying volumetric grids.
87+
/// \brief Traits for IO of data frames comprised of time varying
88+
/// volumetric grids.
8889
///
8990
/// \tparam K Data frame key type.
9091
/// \tparam T Time coordinate type.

profiler/include/gz/common/Profiler.hh

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
#include <memory>
2222
#include <string>
2323

24+
#include <gz/common/config.hh>
2425
#include <gz/common/profiler/Export.hh>
2526
#include <gz/common/SingletonT.hh>
26-
#include <gz/common/config.hh>
2727

2828
namespace gz
2929
{

src/Console.cc

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
#include <gz/common/Console.hh>
2121
#include <gz/common/config.hh>
22+
#include <gz/common/Util.hh>
2223

2324
#ifdef _WIN32
2425
#include <Windows.h>

src/Plugin.cc

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
#define SUPPRESS_IGNITION_HEADER_DEPRECATION
1919

20+
#include <cassert>
21+
2022
#include "gz/utils/SuppressWarning.hh"
2123
#include "ignition/common/Console.hh"
2224

src/SignalHandler.cc

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
// Suppressing cpplint.py because tools/cpplint.py is old. Remove the NOLINT
1919
// comments when upgrading to gz-cmake's "make codecheck"
2020
#include "gz/common/SignalHandler.hh" // NOLINT(*)
21+
#include <atomic>
2122
#include <csignal> // NOLINT(*)
2223
#include <functional> // NOLINT(*)
2324
#include <map> // NOLINT(*)

src/URI.cc

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
#include "gz/common/Console.hh"
2626
#include "gz/common/URI.hh"
27+
#include "gz/common/Util.hh"
2728

2829
using namespace gz;
2930
using namespace common;

src/WorkerPool_TEST.cc

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <gtest/gtest.h>
1919

2020
#include <atomic>
21+
#include <thread>
2122

2223
#include "gz/common/Console.hh"
2324
#include "gz/common/WorkerPool.hh"

testing/include/gz/common/testing/AutoLogFixture.hh

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
#ifndef GZ_COMMON_TESTING_AUTOLOGFIXTURE_HH_
1818
#define GZ_COMMON_TESTING_AUTOLOGFIXTURE_HH_
1919

20-
/// Protect to guarantee that gtest is included before this header.
21-
#ifdef GTEST_API_
22-
2320
#include <memory>
2421
#include <string>
2522

23+
/// Protect to guarantee that gtest is included before this header.
24+
#ifdef GTEST_API_
25+
2626
#include <gz/utils/ImplPtr.hh>
2727

2828
namespace gz::common::testing

testing/include/gz/common/testing/RedirectConsoleStream.hh

+5-5
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@ enum class StreamSource
3535

3636
class GZ_COMMON_TESTING_VISIBLE RedirectConsoleStream
3737
{
38-
/// \brief Constructor
38+
/// \brief Constructor
3939
///
4040
/// Redirect a choosen stream to a temporary file that can be read back.
4141
/// Upon destruction, any redirection will be removed.
4242
/// Upon destruction, the temporary file will be removed.
4343
/// Access contents before destruction using GetString
4444
///
4545
/// \param[in] _source Console source to redirect (eg stdout or stderr)
46-
/// \param[in] _destination Destination filename
47-
public: RedirectConsoleStream(const StreamSource &_source,
46+
/// \param[in] _destination Destination filename
47+
public: RedirectConsoleStream(const StreamSource &_source,
4848
const std::string &_destination);
4949

5050
/// \brief Get the contents of the redirected console output
@@ -60,14 +60,14 @@ class GZ_COMMON_TESTING_VISIBLE RedirectConsoleStream
6060
};
6161

6262
/// \brief Redirect standard out to a test-specific temporary path
63-
inline RedirectConsoleStream RedirectStdout()
63+
inline RedirectConsoleStream RedirectStdout()
6464
{
6565
auto path = gz::common::testing::TempPath("stdout.out");
6666
return RedirectConsoleStream(StreamSource::STDOUT, path);
6767
}
6868

6969
/// \brief Redirect standard error to a test-specific temporary path
70-
inline RedirectConsoleStream RedirectStderr()
70+
inline RedirectConsoleStream RedirectStderr()
7171
{
7272
auto path = gz::common::testing::TempPath("stderr.out");
7373
return RedirectConsoleStream(StreamSource::STDERR, path);

0 commit comments

Comments
 (0)