Go to the documentation of this file. 1 #ifndef AIKIDO_TRAJECTORY_BSPLIINE_HPP_
2 #define AIKIDO_TRAJECTORY_BSPLIINE_HPP_
11 namespace trajectory {
65 double startTime = 0.0,
66 double endTime = 1.0);
83 std::size_t numControlPoints,
84 double startTime = 0.0,
85 double endTime = 1.0);
111 std::unique_ptr<trajectory::Trajectory>
clone()
const;
130 void setStartPoint(std::size_t stateSpaceIndex,
double value);
148 void setEndPoint(std::size_t stateSpaceIndex,
double value);
172 std::size_t stateSpaceIndex,
174 bool withStartControlPoint =
true,
175 bool withEndControlPoint =
true);
185 std::size_t stateSpaceIndex,
187 bool withStartControlPoint =
true,
188 bool withEndControlPoint =
true);
196 std::size_t stateSpaceIndex)
const;
206 std::size_t stateSpaceIndex,
207 bool withStartControlPoint,
208 bool withEndControlPoint)
const;
230 double t,
int derivative, Eigen::VectorXd& tangentVector)
const override;
238 double resolution = 0.1)
const;
245 std::size_t degree, std::size_t numControlPoints);
257 std::size_t numControlPoints,
258 double startTime = 0.0,
259 double endTime = 1.0);
283 #endif // AIKIDO_TRAJECTORY_BSPLIINE_HPP_
void setEndPoint(std::size_t stateSpaceIndex, double value)
Sets end point of one sub space of the state space.
BSpline & operator=(const BSpline &other)
Copy assignment operator.
void setControlPoints(std::size_t stateSpaceIndex, const ControlPointVectorType &controlPoints, bool withStartControlPoint=true, bool withEndControlPoint=true)
Sets all the control points of one subspace of the state space.
Format of serialized trajectory in YAML.
Definition: algorithm.hpp:4
typename SplineType::ControlPointVectorType ControlPointVectorType
Definition: BSpline.hpp:21
void evaluateDerivative(double t, int derivative, Eigen::VectorXd &tangentVector) const override
Evaluates the derivative of the trajectory at time _t.
std::unique_ptr< trajectory::Trajectory > clone() const
Returns a clone of this BSpline.
statespace::ConstStateSpacePtr getStateSpace() const override
Gets the StateSpace that this trajectory is defined in.
std::shared_ptr< const StateSpace > ConstStateSpacePtr
Definition: StateSpace.hpp:15
BSpline(statespace::ConstStateSpacePtr stateSpace, const KnotVectorType &knots, const ControlPointVectorType &controlPoints)
Constructs BSpline from control points and knots.
std::size_t getNumKnots() const
Returns the number of knots.
double getEndTime() const override
Time at which the trajectory ends.
Definition: BSpline.hpp:39
double getDuration() const override
Duration of the trajectory.
std::vector< SplineType > mSplines
One-demensional splines.
Definition: BSpline.hpp:265
SplineTraits< BSpline >::KnotVectorType KnotVectorType
The data type used to store knot vectors.
Definition: BSpline.hpp:56
std::size_t getNumControlPoints() const
Returns the number of control points.
double mEndTime
End time of b-spline.
Definition: BSpline.hpp:274
SplineTraits< BSpline >::ControlPointVectorType ControlPointVectorType
The data type representing the spline's control points.
Definition: BSpline.hpp:72
virtual double computeArcLength(const distance::DistanceMetric &distanceMetric, double resolution=0.1) const
Computes arc length.
std::size_t getNumDerivatives() const override
Gets an upper bound on the number of non-zero derivatives available in this parameterization.
const ControlPointVectorType & getControlPoints(std::size_t stateSpaceIndex) const
Returns control points of one subspace of the state space.
void evaluate(double t, statespace::StateSpace::State *state) const override
Evaluates the state of the trajectory at time _t and store the result in a _state allocated by getSta...
static KnotVectorType computeUniformKnots(std::size_t degree, std::size_t numControlPoints, double startTime=0.0, double endTime=1.0)
Computes uniform knots.
B-spline trajectory define in a StateSpace.
Definition: BSpline.hpp:16
statespace::ConstStateSpacePtr mStateSpace
State space.
Definition: BSpline.hpp:262
typename SplineType::KnotVectorType KnotVectorType
Definition: BSpline.hpp:20
Implements a distance metric defined on a StateSpace.
Definition: DistanceMetric.hpp:13
Definition: StateSpace.hpp:167
double getStartTime() const override
Time at which the trajectory starts.
double mStartTime
Start time of b-spline.
Definition: BSpline.hpp:268
static std::size_t computeNumKnots(std::size_t degree, std::size_t numControlPoints)
Computes number of knots given degree and number of control points.
std::size_t getOrder() const
Returns order of the spline. Order is degree + 1.
~BSpline() override
Destructor.
std::size_t getDegree() const
Returns degree of the spline. Degree is order - 1.
#define AIKIDO_DECLARE_POINTERS(X)
Definition: pointers.hpp:21
Time-parameterized path in a StateSpace.
Definition: Trajectory.hpp:20
void setStartPoint(std::size_t stateSpaceIndex, double value)
Sets start point of one sub space of the state space.