Gazebo Math
API Reference
7.4.0
insert_drive_file
Tutorials
library_books
Classes
toc
Namespaces
insert_drive_file
Files
launch
Gazebo Website
Index
List
Hierarchy
Members: All
Members: Functions
Members: Variables
Members: Typedefs
Members: Enumerations
Members: Enumerator
List
Members
Functions
Typedefs
Variables
Enumerations
Enumerator
include
gz
math
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
27
{
28
namespace
math
29
{
30
// Use a steady clock
31
using
clock
=
std::chrono::steady_clock
;
32
33
// Inline bracket to help doxygen filtering.
34
inline
namespace
GZ_MATH_VERSION_NAMESPACE {
77
class
GZ_MATH_VISIBLE
DiffDriveOdometry
78
{
82
public
:
explicit
DiffDriveOdometry
(
size_t
_windowSize = 10);
83
86
public
:
void
Init
(
const
clock::time_point &_time);
87
90
public
:
bool
Initialized
()
const
;
91
98
public
:
bool
Update
(
const
Angle
&_leftPos,
const
Angle
&_rightPos,
99
const
clock::time_point &_time);
100
103
public
:
const
Angle
&
Heading
()
const
;
104
107
public
:
double
X
()
const
;
108
111
public
:
double
Y
()
const
;
112
115
public
:
double
LinearVelocity
()
const
;
116
119
public
:
const
Angle
&
AngularVelocity
()
const
;
120
125
public
:
void
SetWheelParams
(
double
_wheelSeparation,
126
double
_leftWheelRadius,
127
double
_rightWheelRadius);
128
131
public
:
void
SetVelocityRollingWindowSize
(
size_t
_size);
132
134
GZ_UTILS_IMPL_PTR(dataPtr)
135
};
136
}
137
}
138
}
139
140
#endif