Skip to content

Commit 6fa8a19

Browse files
authored
11 ➡️ main (#559)
Signed-off-by: Jenn Nguyen <jenn@openrobotics.org>
2 parents 54e3499 + aaa71f2 commit 6fa8a19

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+2527
-175
lines changed

Changelog.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,17 @@
150150

151151
## libsdformat 10.X
152152

153-
### libsdformat 10.X.X (202X-XX-XX)
153+
### libsdformat 10.4.0 (2021-04-06)
154+
155+
1. Added particle emitter.
156+
+ [Pull request 528](https://github.com/osrf/sdformat/pull/528)
157+
158+
1. Fixed application of <sensor><pose> tags in lumped linkes during URDF
159+
conversion.
160+
+ [Pull request 525](https://github.com/osrf/sdformat/pull/525)
161+
162+
1. Add camera type aliases to docs.
163+
+ [Pull request 514](https://github.com/osrf/sdformat/pull/514)
154164

155165
### libsdformat 10.3.0 (2021-02-18)
156166

Migration.md

+26
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,33 @@ forward programmatically.
1212
This document aims to contain similar information to those files
1313
but with improved human-readability..
1414

15+
## libsdformat 11.0.0 to 11.x.x
16+
17+
### Additions
18+
19+
1. **sdf/Console.hh** Add functions to retrieve message stream objects. These
20+
can be useful for redirecting the console output to other streams.
21+
+ ConsoleStream &GetMsgStream()
22+
+ ConsoleStream &GetLogStream()
23+
24+
1. **sdf/ParserConfig.hh**:
25+
+ void SetDeprecatedElementsPolicy(EnforcementPolicy _policy)
26+
+ void ResetDeprecatedElementsPolicy()
27+
+ EnforcementPolicy DeprecatedElementsPolicy() const
28+
29+
1. **test/test_utils.hh**:
30+
+ ScopeExit: A utility struct that calls a function when going out of scope.
31+
+ RedirectConsoleStream: A utility class used for redirecting the output of
32+
sdferr, sdfwarn, etc to a more convenient stream object like a
33+
std::stringstream for testing purposes.
34+
1535
## libsdformat 10.x to 11.0
1636

1737
### Additions
1838

39+
1. **sdf/ParserConfig.hh** A class that contains configuration options for the
40+
libsdformat parser.
41+
1942
1. + Depend on ignition-utils1 for the ImplPtr and UniqueImplPtr.
2043
+ [Pull request 474](https://github.com/osrf/sdformat/pull/474)
2144

@@ -69,6 +92,9 @@ but with improved human-readability..
6992

7093
1. Fixed Atmosphere DOM class's temperature default value. Changed from -0.065 to -0.0065.
7194
* [Pull request 482](https://github.com/osrf/sdformat/pull/482)
95+
96+
1. Fixed parsing of `<sensor><pose>` tags on lumped links when converting from URDF.
97+
* [Pull request 525](https://github.com/osrf/sdformat/pull/525)
7298

7399
## libsdformat 9.x to 10.0
74100

include/sdf/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ set (headers
4242
Param.hh
4343
parser.hh
4444
ParserConfig.hh
45+
ParticleEmitter.hh
4546
Pbr.hh
4647
Physics.hh
4748
Plane.hh

include/sdf/Console.hh

+22
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,16 @@ namespace sdf
9292
const std::string &_file,
9393
unsigned int _line, int _color);
9494

95+
/// \brief Set the stream object.
96+
/// \param[in] _stream Pointer to an output stream. This can be
97+
/// useful for redirecting the output, for example, to a std::stringstream
98+
/// for testing.
99+
public: void SetStream(std::ostream *_stream);
100+
101+
/// \brief Get the current stream object.
102+
/// \return Pointer to current stream object.
103+
public: std::ostream *GetStream();
104+
95105
/// \brief The ostream to log to; can be NULL/nullptr.
96106
private: std::ostream *stream;
97107
};
@@ -131,6 +141,18 @@ namespace sdf
131141
const std::string &file,
132142
unsigned int line);
133143

144+
/// \brief Get the current message stream object. This can be
145+
/// useful for redirecting the output, for example, to a std::stringstream
146+
/// for testing.
147+
/// \return Mutable reference to current message stream object.
148+
public: ConsoleStream &GetMsgStream();
149+
150+
/// \brief Get the current log stream object. This can be
151+
/// useful for redirecting the output, for example, to a std::stringstream
152+
/// for testing.
153+
/// \return Mutable reference to current log stream object.
154+
public: ConsoleStream &GetLogStream();
155+
134156
/// \internal
135157
/// \brief Pointer to private data.
136158
private: std::unique_ptr<ConsolePrivate> dataPtr;

include/sdf/Element.hh

+8
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ namespace sdf
101101

102102
/// \brief Set the requirement type.
103103
/// \param[in] _req Requirement type for this element:
104+
/// -1: Deprecated.
104105
/// 0: Not required.
105106
/// 1: Exactly one element is required.
106107
/// +: One or more elements are required.
@@ -241,6 +242,13 @@ namespace sdf
241242
/// \return True if the attribute is set, false otherwise.
242243
public: bool GetAttributeSet(const std::string &_key) const;
243244

245+
/// \brief Remove an attribute.
246+
/// \param[in] _key the key of the attribute.
247+
public: void RemoveAttribute(const std::string &_key);
248+
249+
/// \brief Removes all attributes.
250+
public: void RemoveAllAttributes();
251+
244252
/// \brief Get the param of the elements value
245253
/// return A Param pointer to the value of this element.
246254
public: ParamPtr GetValue() const;

include/sdf/Link.hh

+27
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ namespace sdf
3636
// Forward declarations.
3737
class Collision;
3838
class Light;
39+
class ParticleEmitter;
3940
class Sensor;
4041
class Visual;
4142
struct PoseRelativeToGraph;
@@ -150,6 +151,32 @@ namespace sdf
150151
/// \sa bool SensorNameExists(const std::string &_name) const
151152
public: const Sensor *SensorByName(const std::string &_name) const;
152153

154+
/// \brief Get the number of particle emitters.
155+
/// \return Number of particle emitters contained in this Link object.
156+
public: uint64_t ParticleEmitterCount() const;
157+
158+
/// \brief Get a particle emitter based on an index.
159+
/// \param[in] _index Index of the particle emitter.
160+
/// The index should be in the range [0..ParticleEmitterCount()).
161+
/// \return Pointer to the particle emitter. Nullptr if the index does
162+
/// not exist.
163+
/// \sa uint64_t ParticleEmitterCount() const
164+
public: const ParticleEmitter *ParticleEmitterByIndex(
165+
const uint64_t _index) const;
166+
167+
/// \brief Get whether a particle emitter name exists.
168+
/// \param[in] _name Name of the particle emitter to check.
169+
/// \return True if there exists a particle emitter with the given name.
170+
public: bool ParticleEmitterNameExists(const std::string &_name) const;
171+
172+
/// \brief Get a particle emitter based on a name.
173+
/// \param[in] _name Name of the particle emitter.
174+
/// \return Pointer to the particle emitter. Nullptr if a particle emitter
175+
/// with the given name does not exist.
176+
/// \sa bool ParticleEmitterNameExists(const std::string &_name) const
177+
public: const ParticleEmitter *ParticleEmitterByName(
178+
const std::string &_name) const;
179+
153180
/// \brief Get the inertial value for this link. The inertial object
154181
/// consists of the link's mass, a 3x3 rotational inertia matrix, and
155182
/// a pose for the inertial reference frame. The units for mass is

include/sdf/ParserConfig.hh

+16
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,22 @@ class SDFORMAT_VISIBLE ParserConfig
144144
/// \return The unrecognized elements policy enum value
145145
public: EnforcementPolicy UnrecognizedElementsPolicy() const;
146146

147+
/// \brief Set the policy for deprecated elements.
148+
/// \param[in] _policy The deprecated elements enforcement policy
149+
public: void SetDeprecatedElementsPolicy(EnforcementPolicy _policy);
150+
151+
/// \brief Resets the policy for deprecated elements so that it follows
152+
/// WarningsPolicy.
153+
public: void ResetDeprecatedElementsPolicy();
154+
155+
/// \brief Get the current deprecated elements policy. By default, the policy
156+
/// is the same as the overall WarningsPolicy, but it can be overriden by
157+
/// SetDeprecatedElementsPolicy. Once it is overriden, changing
158+
/// SetWarningsPolicy will not change the value of DeprecatedElementsPolicy
159+
/// unless ResetDeprecatedElementsPolicy is called.
160+
/// \return The deperacted elements policy enum value
161+
public: EnforcementPolicy DeprecatedElementsPolicy() const;
162+
147163
/// \brief Registers a custom model parser.
148164
/// \param[in] _modelParser Callback as described in
149165
/// sdf/InterfaceElements.hh.

0 commit comments

Comments
 (0)