Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
b
c
d
e
f
i
m
n
o
p
s
t
v
w
Functions
Variables
Typedefs
Enumerations
Enumerator
b
c
f
i
m
o
s
t
v
w
Classes
Class List
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
y
~
Functions
a
c
d
e
f
g
i
n
o
p
r
s
u
v
~
Variables
a
b
c
d
e
f
h
i
m
n
p
r
s
t
v
w
x
y
Typedefs
Enumerations
Enumerator
Files
File List
File Members
All
a
b
c
g
m
s
t
Functions
m
t
Macros
include
create
util.h
Go to the documentation of this file.
1
32
#ifndef CREATE_UTIL_H
33
#define CREATE_UTIL_H
34
35
#include <cmath>
36
37
#define COUT(prefix,msg) (std::cout<<prefix<<msg<<std::endl)
38
#define CERR(prefix,msg) (std::cerr<<prefix<<msg<<std::endl)
39
40
namespace
create
{
41
namespace
util {
42
43
static
const
uint8_t
STREAM_HEADER
= 19;
44
static
const
float
V_3_TICKS_PER_REV
= 508.8;
45
static
const
uint32_t
V_3_MAX_ENCODER_TICKS
= 65535;
46
static
const
float
MAX_RADIUS
= 2.0;
47
static
const
float
STRAIGHT_RADIUS
= 32.768;
48
static
const
float
IN_PLACE_RADIUS
= 0.001;
49
static
const
float
PI
= 3.14159;
50
static
const
float
TWO_PI
= 6.28318;
51
static
const
float
EPS
= 0.0001;
52
53
inline
float
normalizeAngle
(
const
float
& angle) {
54
float
a = angle;
55
while
(a < -
PI
) a +=
TWO_PI
;
56
while
(a >
PI
) a -=
TWO_PI
;
57
return
a;
58
}
59
60
inline
bool
willFloatOverflow
(
const
float
a,
const
float
b) {
61
return
( (a < 0.0) == (b < 0.0) && std::abs(b) > std::numeric_limits<float>::max() - std::abs(a) );
62
}
63
}
// namespace util
64
}
// namespace create
65
66
#endif // CREATE_UTIL_H
create::util::STRAIGHT_RADIUS
static const float STRAIGHT_RADIUS
Definition:
util.h:47
create::util::TWO_PI
static const float TWO_PI
Definition:
util.h:50
create::util::STREAM_HEADER
static const uint8_t STREAM_HEADER
Definition:
util.h:43
create::util::normalizeAngle
float normalizeAngle(const float &angle)
Definition:
util.h:53
create::util::MAX_RADIUS
static const float MAX_RADIUS
Definition:
util.h:46
create::util::PI
static const float PI
Definition:
util.h:49
create::util::willFloatOverflow
bool willFloatOverflow(const float a, const float b)
Definition:
util.h:60
create::util::V_3_TICKS_PER_REV
static const float V_3_TICKS_PER_REV
Definition:
util.h:44
create::util::V_3_MAX_ENCODER_TICKS
static const uint32_t V_3_MAX_ENCODER_TICKS
Definition:
util.h:45
create::util::IN_PLACE_RADIUS
static const float IN_PLACE_RADIUS
Definition:
util.h:48
create::util::EPS
static const float EPS
Definition:
util.h:51
create
Definition:
create.h:48
libcreate
Author(s): Jacob Perron
autogenerated on Wed May 24 2023 02:24:57