Gazebo Math

API Reference

7.5.1
gz/math/DiffDriveOdometry.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 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_DIFFDRIVEODOMETRY_HH_
18 #define GZ_MATH_DIFFDRIVEODOMETRY_HH_
19 
20 #include <chrono>
21 #include <gz/math/Angle.hh>
22 #include <gz/math/Export.hh>
23 #include <gz/math/config.hh>
24 #include <gz/utils/ImplPtr.hh>
25 
26 namespace gz::math
27 {
28  // Use a steady clock
30 
31  // Inline bracket to help doxygen filtering.
32  inline namespace GZ_MATH_VERSION_NAMESPACE {
36  class GZ_MATH_VISIBLE DiffDriveOdometry
76  {
80  public: explicit DiffDriveOdometry(size_t _windowSize = 10);
81 
84  public: void Init(const clock::time_point &_time);
85 
88  public: bool Initialized() const;
89 
96  public: bool Update(const Angle &_leftPos, const Angle &_rightPos,
97  const clock::time_point &_time);
98 
101  public: const Angle &Heading() const;
102 
105  public: double X() const;
106 
109  public: double Y() const;
110 
113  public: double LinearVelocity() const;
114 
117  public: const Angle &AngularVelocity() const;
118 
123  public: void SetWheelParams(double _wheelSeparation,
124  double _leftWheelRadius,
125  double _rightWheelRadius);
126 
129  public: void SetVelocityRollingWindowSize(size_t _size);
130 
132  GZ_UTILS_IMPL_PTR(dataPtr)
133  };
134  } // namespace GZ_MATH_VERSION_NAMESPACE
135 } // namespace gz::math
136 #endif // GZ_MATH_DIFFDRIVEODOMETRY_HH_
e of radians and degrees measurements....">Angle &AngularVelocity() const;
118 
123  public: void SetWheelParams(double _wheelSeparation,
124  double _leftWheelRadius,
125  double _rightWheelRadius);
126 
129  public: void SetVelocityRollingWindowSize(size_t _size);
130 
132  GZ_UTILS_IMPL_PTR(dataPtr)
133  };
134  } // namespace GZ_MATH_VERSION_NAMESPACE
135 } // namespace gz::math
136 #endif // GZ_MATH_DIFFDRIVEODOMETRY_HH_