All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
RotationSpline.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2014 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 _IGNITION_ROTATIONSPLINE_HH_
18 #define _IGNITION_ROTATIONSPLINE_HH_
19 
20 #include <vector>
21 #include <ignition/math/Helpers.hh>
24 
25 namespace ignition
26 {
27  namespace math
28  {
32  {
34  public: RotationSpline();
35 
37  public: ~RotationSpline();
38 
41  public: void AddPoint(const Quaterniond &_p);
42 
48  public: const Quaterniond &Point(unsigned int _index) const;
49 
52  public: unsigned int PointCount() const;
53 
55  public: void Clear();
56 
62  public: void UpdatePoint(unsigned int _index, const Quaterniond &_value);
63 
73  public: Quaterniond Interpolate(double _t, bool _useShortestPath = true);
74 
84  public: Quaterniond Interpolate(unsigned int _fromIndex, double _t,
85  bool _useShortestPath = true);
86 
101  public: void AutoCalculate(bool _autoCalc);
102 
107  public: void RecalcTangents();
108 
111  protected: bool autoCalc;
112 
114  protected: std::vector<Quaterniond> points;
115 
117  protected: std::vector<Quaterniond> tangents;
118  };
119  }
120 }
121 
122 #endif
#define IGNITION_VISIBLE
Use to represent "symbol visible" if supported.
Definition: Helpers.hh:346
Spline for rotations.
Definition: RotationSpline.hh:31
std::vector< Quaterniond > points
the control points
Definition: RotationSpline.hh:114
std::vector< Quaterniond > tangents
the tangents
Definition: RotationSpline.hh:117
A quaternion class.
Definition: Quaternion.hh:31
bool autoCalc
Automatic recalcultation of tangeants when control points are updated.
Definition: RotationSpline.hh:111