Gazebo Math

API Reference

6.15.1
gz/math/RotationSpline.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 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 #ifndef GZ_MATH_ROTATIONSPLINE_HH_
18 #define GZ_MATH_ROTATIONSPLINE_HH_
19 
20 #include <gz/math/Quaternion.hh>
21 #include <gz/math/config.hh>
22 
23 namespace ignition
24 {
25  namespace math
26  {
27  // Inline bracket to help doxygen filtering.
28  inline namespace IGNITION_MATH_VERSION_NAMESPACE {
29  //
30  // Forward declare private data
31  class RotationSplinePrivate;
32 
35  class IGNITION_MATH_VISIBLE RotationSpline
36  {
38  public: RotationSpline();
39 
41  public: ~RotationSpline();
42 
45  public: void AddPoint(const Quaterniond &_p);
46 
54  public: const Quaterniond &Point(const unsigned int _index) const;
55 
58  public: unsigned int PointCount() const;
59 
61  public: void Clear();
62 
69  public: bool UpdatePoint(const unsigned int _index,
70  const Quaterniond &_value);
71 
82  public: Quaterniond Interpolate(double _t,
83  const bool _useShortestPath = true);
84 
94  public: Quaterniond Interpolate(const unsigned int _fromIndex,
95  const double _t, const bool _useShortestPath = true);
96 
111  public: void AutoCalculate(bool _autoCalc);
112 
117  public: void RecalcTangents();
118 
120  private: RotationSplinePrivate *dataPtr;
121  };
122  }
123  }
124 }
125 
126 #endif
unsigned int PointCount() const
Gets the number of control points in the spline.
Definition: gz/math/AdditivelySeparableScalarField3.hh:27
void RecalcTangents()
Recalculates the tangents associated with this spline.
void AutoCalculate(bool _autoCalc)
Tells the spline whether it should automatically calculate tangents on demand as points are added.
A quaternion class.
Definition: gz/math/Matrix3.hh:35
~RotationSpline()
Destructor. Nothing is done.
const Quaterniond & Point(const unsigned int _index) const
Gets the detail of one of the control points of the spline.
void Clear()
Clears all the points in the spline.
RotationSpline()
Constructor. Sets the autoCalc to true.
Quaterniond Interpolate(double _t, const bool _useShortestPath=true)
Returns an interpolated point based on a parametric value over the whole series.
Spline for rotations.
Definition: gz/math/RotationSpline.hh:35
bool UpdatePoint(const unsigned int _index, const Quaterniond &_value)
Updates a single point in the spline.
void AddPoint(const Quaterniond &_p)
Adds a control point to the end of the spline.