broccoli belstar v2.0.0
Release of Broccoli belstar v2.0.0
New Features
- [control]:
- Added Signal class and operators for signal expressions
- Added time-discrete IIR Filter implementation
- IIR-based filters now support nth filter output derivative computation
- Added essential feedback control patterns
- Extended Wrench constructors
- [core]:
- Added type traits for initialization of complex data types with zero
- floats.hpp now provides a new method isZero() for convenient and safe comparison to zero
- Added functions to compute integer tuples for general Leibniz formula (derivative of a product of functions)
- Added binomial and multimonial coefficient
-
PlatformHelper
:- added functions
waitFor(const uin64_t& seconds, const uint64_t& nanoSeconds)
andwaitFor(const timespec& duration)
for precise sleeping - Added method to identify byte-order (endianness) at runtime.
- added functions
-
Time
: now uses newwaitFor
with nanosecond precision. This also fixes a bug with delays > 1s - Added
string.hpp
for common string operations not covered by the stdlib. - Computation of
multinomialCoefficient
now takes aSmartVector
as input to avoids dynamic memory allocation
- [curve]:
- Implemented numeric derivatives for all curves and quaternion curves
- Implemented (dummy) high-performance evaluation functions (D0D1 and D0D1D2) for all curves and quaternion curves. For curves and quaternion curves where an analytic derivative is known, these functions are overwritten by efficient implementations which reuse intermediate results.
- Implemented
BSplineBasis
,BSplineBasisSample
andCumulativeBSplineBasisSample
as background for quaternion B-spline curves (may be used for euclidean B-spline curves in future as well). - New quaternion curves and interpolation methods:
LERP
,NLERP
,Bezier
,SQUAD
andBSpline
- Refactored
BSplineBasis
,BSplineBasisSample
,CumulativeBSplineBasisSample
andQuaternionBSplineCurve
to make use ofSmartVector
(to avoid dynamic memory allocation while still implementing the most general case)
- [memory]:
- Adds CircularAccessor to view linear data structures as circular data
- Added
SmartVector
class as hybrid implementation ofstd::array
andstd::vector
(uses a pre-allocated stack buffer for efficiency and a dynamically allocated heap buffer to extend the stack buffer (for flexibility)).
- [parallel]:
-
BackgroundWorker
:- now uses
Time::sleep
for sleeping - Added methods
waitForSynchronization(timeout)
andtriggerSynchronization()
- now uses
-
- [io/logging]:
- Refactored the interface of ColumnBasedLogFileData: The new ColumnBasedLogStream allows easy definition of data and header name in one place
- Added possibility to set column name prefix in ColumnBasedLogStream
- Added getter for log time in TemporalLogFileData
- LogFile: Added file attributes, which may be used to store custom global data in log file headers / footers. This replaces the default log header implementation.
- Logging: added
XMLBasedLogFileData
and corresponding unit-test -
ColumnBasedLogStream
- added getter function
generateColumnNames()
(allows to distinguish between header and data when encoding data) - added support for eigen quaternions
- added getter function
-
encoding
- added methods to encode and decode arrays, vectors, eigen matrices and eigen quaternions
- Now supports encoding and decoding of
SmartVector
containers - Now supports encoding and decoding of generic
Eigen::QuaternionBase
(arbitrary scalar type)
-
serialization
- Now supports serialization and deserialization of
std::vector
,SmartVector
,Eigen::MatrixBase
andEigen::QuaternionBase
types
- Now supports serialization and deserialization of
-
SerializableData
- Added support for
serialize(SerializableData)
anddeSerialize(SerializableData)
. This allows embeddedSerializableData
-objects in containers like arrays or vectors.
- Added support for
-
NetworkSocket
- Now supports messages >4kB for TCP connections (theoretical maximum is now 4GB)
- Now avoids overflow of TCP and UDP socket buffers (handled by OS kernel)
- Improved error handling for sending and receiving messages
- Improved constructor by dedicated container for options
- Added namespace
ply
and related classes for reading and writing.ply
files (ascii, binary-little-endian, binary-big-endian) and converting to/fromCGMesh
. -
serialization
: Now supports to serialize/deserialize parameter tuples (through variadic templates). This should significantly ease writing serialization and deserialization code for custom classes.
- [geometry]:
- Added quaternion and rotation related methods to geometry/rotations. Adds a custom implementation of SLERP
- In contrast to Eigen's version this function allows the user to specify if the keyframe quaternions should be flipped (q -> -q) such that the result describes the shortest path on the unit sphere. In some cases (e.g. for quaternion Bezier and SQUAD curves we do not want the shortest distance, since this represents a (discontinuous) switching, which in turn breaks C1-continuity of Bezier and SQUAD).
- Added classes
CGMaterial
andCGMesh
as containers for typical material and mesh data structures in Computer Graphics.CGMesh
supports indexed vertex data, per-vertex normals and colors (rgba, 24+8bit), methods for merging, normal averaging, householding, and material to vertex color conversions.
- Added quaternion and rotation related methods to geometry/rotations. Adds a custom implementation of SLERP
Bug Fixes
- [control]: GaussianNoise is now truely deterministic
- [core]:
- (Uncritical)
math::factorial
: In case of an overflow now returns "1" instead of "0" (to prevent division by zero in typical applications) - (Uncritical) Improved overflow handling in computation of Faa di Bruno tuples
-
PlatformHelper::waitFor/Time:sleep
: Delays greater than one second were not executed properly on ALL platforms
- (Uncritical)
- [curve]:
- removed
virtual
tag fromBSplineBasis::setClampedUniformKnots()
andBSplineBasisSample::evaluateX()
since they are called in the constructors
- removed
- [geometry]: quaternionNaturalLogarithm now returns a correct result for all quadrants and uses a taylor series approximation for small angle
- [io]:
-
LogFile
:- Added methods to increment the counters for the total received and written objects. This allows to prevent a possible race condition.
-
TCPClientOptions
: removed argumentownPort
from constructor
-
- [parallel]:
- Changed behavior of BackgroundWorker in single-threaded case: now
start()
does not trigger an execution cycle (bytriggerManualExecution
) anymore. This way the user has more control, since one can choose to calltriggerManualExecution
afterstart()
. - Updated corresponding unit-test
- Changed behavior of BackgroundWorker in single-threaded case: now
Non-Breaking Changes
- [core]:
-
PlatformHelpers
: fixed small bug in comment (namespace transfer fromam2b
tobroccoli
)
-
- [curve]:
- Minor performance improvements in curve-module (mainly functions related to evaluation)
-
QuaternionBSplineCurve
now internally usesSmartVector
for evaluation (increases performance). However, the interface remains the same. - Added
PolynomialSplineSplitter
andPolynomialTrajectorySplitter
classes for improved convenience
- [documentation]:
- Minor improvements in documentation (mainly
core
andcurve
module)
- Minor improvements in documentation (mainly
- [io]:
-
encoding
: Added explicit support for basic datatypes. Resolves ambiguities (char
<->uint8_t
,float
<->double
, etc.)
-
- [toolchain]:
- Broccoli now uses the C++14 standard, effectively dropping support for QNX Neutrino < 7.0
- Improved doxygen layout to support module descriptions
- Added Dockerfile for build container to tools/
- Added pre-commit hook script for clang-format to tools/
- Updated CI pipeline with parallel builds
- Added compiler flag
-Wno-deprecated-copy
for GCC and Clang to silence annoying warning about Eigen-code in Clang 10.
- [memory]:
-
CircularBuffer::pop(std::vector<T>, size_t)
now tries to reserve memory for the vector of target elements in advance (to reduce the time of locked buffer) - Minor clean-up of documentation of
CircularBuffer
-
Breaking Changes
- [control]:
- Reimplemented filters, operators, sources and kinematics to use the Signal API
- Moved LinearFader to operators and redesigned its API
- Moved StatisticsEstimator to core module
- Removed ActivatableModule
- Moved Wrench and SignalLimits to control main folder
- SignalLimits now only stores min/max values
- [core]:
- Moved existing quaternion-related methods to geometry/rotations.hpp
- The methods in floats.hpp are no longer in a separate namespace. Furthermore, floats.hpp is no longer required by math.hpp
- Removed waitForAccurate() from PlatformHelper. This is too specialized for a general implementation
-
math::faaDiBrunoTuples
andmath::generalLeibnizTuples
now useSmartVector
as output for better performance in most cases.
- [curve]:
- Quaternion curves are now derived either from
QuaternionCurveFixedSize
(fixed count of control point quaternions) orQuaternionCurveDynamicSize
(dynamic count of control point quaternions). - Restructured inheritance hierarchy of (euclidean/quaternion) curves, splines and trajectories: now each curve type got its own derived spline and trajectory.
- Splitted
interpolate
functions into more granular protected functions (to improve readability - API not affected) - Complete overhaul of unit-tests for curve-module (to fit new inheritance hierarchy and to cover more functions/cases)
- Changed encoding to new methods for arrays, vectors eigen matrices and eigen quaternions (Warning: some delimiters ',' or ';' may have switched in the new output)
- Quaternion curves are now derived either from
- [io]:
-
LogFile
:- Now starts skipping with the second received object (not the first one).
- Moved all column-based logging related stuff to ColumnBasedLogFileData
- Removed unused return value of the encode methods
-
serialization
:- Changed syntax from
serializeArray()
toserialize()
anddeSerializeArray()
todeSerialize()
- Changed syntax from
serializeString()
toserialize()
anddeSerializeString()
todeSerialize()
- Moved
SerializableData
intoserialization.hpp
(and namespaceserialization
). This is necessary to allow automatic serialization of containers like array, vector, SmartVector with the element typeSerializableData
- Changed syntax from
serialize(stream, stream)
toappend(stream, stream)
to avoid ambiguity with serialization of anstd::vector<uint8_t>
- Changed syntax from
-
NetworkSocket
- Constructor now expects a container of options (
NetworkSocketOptions
or the derived specializationsTCPServerOptions
,TCPClientOptions
,UDPSocketOptions
)
- Constructor now expects a container of options (
-
serialization
: Now explicitly requires the user to specify the "endianess" (big-/little-endian). This allows the user to choose the byte-order for serialization. -
NetworkSocket
: The network socket now has an option to specify the used byte-order for serialization and deserialization. The socket uses "little-endian" per default, however, the user may explicitly force it to big-endian (e.g. for communicating with embedded devices).
-
- [parallel]:
- BackgroundWorker now uses PlatformHelper to set thread priority also on Linux and Mac.
- [geometry]:
- The
Polygon2D
class now uses the newSmartVector
for the list of vertices.Polygon2D
thus is now a template class. This way we can avoid memory fragmentation through allocating many smallEigen::Vector2D
elements on the heap (if we know the maximum vertex count at compile time). - The XML encoding of the
Polygon2D
class now uses the correct tagPolygon2D
instead ofPolygon
. - Changed encoding to new methods for arrays, vectors eigen matrices and eigen quaternions (Warning: some delimiters ',' or ';' may have switched in the new output)
- The
Edited by Ghost User