Gazebo Math
API Reference
8.0.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
src
gz-math
include
gz
math
MecanumDriveOdometry.hh
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2022 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_MECANUMDRIVEODOMETRY_HH_
18
#define GZ_MATH_MECANUMDRIVEODOMETRY_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
// Inline bracket to help doxygen filtering.
29
inline
namespace
GZ_MATH_VERSION_NAMESPACE {
47
class
GZ_MATH_VISIBLE
MecanumDriveOdometry
48
{
49
// Use a steady clock
50
public
:
using
clock
=
std::chrono::steady_clock
;
51
55
public
:
explicit
MecanumDriveOdometry
(
size_t
_windowSize
= 10);
56
59
public
:
void
Init
(
const
clock::time_point &
_time
);
60
63
public
:
bool
Initialized
()
const
;
64
73
public
:
bool
Update
(
74
const
Angle
&
_frontLeftPos
,
const
Angle
&
_frontRightPos
,
75
const
Angle
&
_backLeftPos
,
const
Angle
&
_backRightPos
,
76
const
clock::time_point &
_time
);
77
80
public
:
const
Angle
&
Heading
()
const
;
81
84
public
:
double
X
()
const
;
85
88
public
:
double
Y
()
const
;
89
92
public
:
double
LinearVelocity
()
const
;
93
96
public
:
double
LateralVelocity
()
const
;
97
100
public
:
const
Angle
&
AngularVelocity
()
const
;
101
107
public
:
void
SetWheelParams
(
double
_wheelSeparation
,
double
_wheelBase
,
108
double
_leftWheelRadius
,
double
_rightWheelRadius
);
111
public
:
void
SetVelocityRollingWindowSize
(
size_t
_size
);
112
115
public
:
double
WheelSeparation
()
const
;
116
119
public
:
double
WheelBase
()
const
;
120
123
public
:
double
LeftWheelRadius
()
const
;
124
127
public
:
double
RightWheelRadius
()
const
;
128
130
GZ_UTILS_IMPL_PTR
(dataPtr)
131
};
132
}
// namespace GZ_MATH_VERSION_NAMESPACE
133
}
// namespace gz::math
134
#endif
// GZ_MATH_MECANUMDRIVEODOMETRY_HH_