Go to the documentation of this file. 1 #ifndef AIKIDO_COMMON_STEPSEQUENCE_HPP_
2 #define AIKIDO_COMMON_STEPSEQUENCE_HPP_
8 #include <boost/iterator/iterator_facade.hpp>
35 bool includeStartpoint =
true,
36 bool includeEndpoint =
true,
37 double startPoint = 0.0,
38 double endPoint = 1.0);
45 bool includeEndpoint =
true);
97 :
public boost::iterator_facade<
98 StepSequence::const_iterator,
100 boost::forward_traversal_tag,
135 #endif // AIKIDO_COMMON_STEPSEQUENCE_HPP_
const_iterator end() const
Returns an iterator to the element following the last element of the sequence.
std::size_t mNumSteps
The total length of sequence.
Definition: StepSequence.hpp:93
double dereference() const
Dereference implementation for boost::iterator_facade.
std::size_t getLength() const
Returns the total length of sequence.
Format of serialized trajectory in YAML.
Definition: algorithm.hpp:4
const_iterator begin() const
Returns an iterator to the first element of the sequence.
void updateNumSteps()
Computes the total length of sequence given step size.
bool equal(const StepSequence::const_iterator &other) const
Equal implementation for boost::iterator_facade.
Definition: StepSequence.hpp:96
const bool mIncludeEndPoint
Whether the end point in the sequence will be the end point.
Definition: StepSequence.hpp:84
void updateStepSize()
Computes the step size of sequence given number of steps.
const double mEndPoint
The end point that defines the sequence.
Definition: StepSequence.hpp:90
const double mStartPoint
The start point that defines the sequence.
Definition: StepSequence.hpp:87
double operator[](std::size_t n) const
Returns the n-th element of the sequence.
An iterator that returns a sequence of numbers between start point and end point stepping at a fixed ...
Definition: StepSequence.hpp:15
const StepSequence & mSeq
StepSequence associated with this iterator.
Definition: StepSequence.hpp:123
void increment()
Increment implementation for boost::iterator_facade.
double mValue
Value of the current step.
Definition: StepSequence.hpp:129
StepSequence(double stepSize, bool includeStartpoint=true, bool includeEndpoint=true, double startPoint=0.0, double endPoint=1.0)
Constructor.
const_iterator(const StepSequence &seq, std::size_t step)
Private constructor that should always be constructed from StepSequence::begin().
double mStepSize
Step size increments from the start point to the end point.
Definition: StepSequence.hpp:78
std::size_t mStep
Current step number.
Definition: StepSequence.hpp:126
const bool mIncludeStartPoint
Whether the start point in the sequence will be the start point.
Definition: StepSequence.hpp:81