LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
Loading...
Searching...
No Matches
constraints.hpp
Go to the documentation of this file.
1
7
#ifndef _SQUIGGLES_CONSTRAINTS_HPP_
8
#define _SQUIGGLES_CONSTRAINTS_HPP_
9
10
#include <cmath>
11
#include <string>
12
13
namespace
squiggles
{
14
struct
Constraints
{
30
Constraints
(
double
imax_vel,
31
double
imax_accel = std::numeric_limits<double>::max(),
32
double
imax_jerk = std::numeric_limits<double>::max(),
33
double
imax_curvature = 1000,
34
double
imin_accel = std::nan(
""
))
35
:
max_vel
(imax_vel),
36
max_accel
(imax_accel),
37
max_jerk
(imax_jerk),
38
max_curvature
(imax_curvature) {
39
if
(imax_accel == std::numeric_limits<double>::max()) {
40
min_accel
= std::numeric_limits<double>::lowest();
41
}
else
{
42
min_accel
= std::isnan(imin_accel) ? -imax_accel : imin_accel;
43
}
44
}
45
51
std::string
to_string
()
const
{
52
return
"Constraints: {max_vel: "
+ std::to_string(
max_vel
) +
53
", max_accel: "
+ std::to_string(
max_accel
) +
54
", max_jerk: "
+ std::to_string(
max_jerk
) +
55
", min_accel: "
+ std::to_string(
min_accel
) +
"}"
;
56
}
57
58
double
max_vel
;
59
double
max_accel
;
60
double
max_jerk
;
61
double
min_accel
;
62
double
max_curvature
;
63
};
64
}
// namespace squiggles
65
#endif
squiggles
Copyright 2020 Jonathan Bayless.
Definition
constraints.hpp:13
squiggles::Constraints
Definition
constraints.hpp:14
squiggles::Constraints::min_accel
double min_accel
Definition
constraints.hpp:61
squiggles::Constraints::max_accel
double max_accel
Definition
constraints.hpp:59
squiggles::Constraints::max_vel
double max_vel
Definition
constraints.hpp:58
squiggles::Constraints::max_jerk
double max_jerk
Definition
constraints.hpp:60
squiggles::Constraints::to_string
std::string to_string() const
Serializes the Constraints data for debugging.
Definition
constraints.hpp:51
squiggles::Constraints::Constraints
Constraints(double imax_vel, double imax_accel=std::numeric_limits< double >::max(), double imax_jerk=std::numeric_limits< double >::max(), double imax_curvature=1000, double imin_accel=std::nan(""))
Defines the motion constraints for a path.
Definition
constraints.hpp:30
squiggles::Constraints::max_curvature
double max_curvature
Definition
constraints.hpp:62
include
okapi
squiggles
constraints.hpp
Generated by
1.9.8