6#ifndef BEZIER_COM_TRAJ_LIB_UTILS_H
7#define BEZIER_COM_TRAJ_LIB_UTILS_H
39 Eigen::NumTraits<value_type>::dummy_precision())
const {
65template <
typename Bezier,
typename Po
int>
68 const std::vector<Point>&
pi,
112template <
typename Bezier,
typename Po
int>
115 const std::vector<Point>& pi,
117 std::vector<Point> wps;
120 wps.push_back(pi[i]);
123 wps.push_back(pi[i]);
126 wps.push_back(pi[i]);
139 "You cannot constrain final acceleration if final velocity is not "
141 wps.push_back(pi[i]);
146 "You cannot constrain final velocity if final position is not "
148 wps.push_back(pi[i]);
152 wps.push_back(pi[i]);
156 return Bezier(wps.begin(), wps.end(), 0., T);
END_ACC
Definition flags.hh:25
INIT_VEL
Definition flags.hh:21
END_VEL
Definition flags.hh:24
END_POS
Definition flags.hh:23
INIT_ACC
Definition flags.hh:22
INIT_POS
Definition flags.hh:20
#define BEZIER_COM_TRAJ_DLLAPI
Definition local_config.hh:52
Definition common_solve_methods.hh:15
int Normalize(Ref_matrixXX A, Ref_vectorX b)
normalize inequality constraints
Definition common_solve_methods.cpp:78
centroidal_dynamics::VectorX VectorX
Definition definitions.hh:24
BEZIER_COM_TRAJ_DLLAPI Bezier computeBezierCurve(const ConstraintFlag &flag, const double T, const std::vector< Point > &pi, const Point &x)
given the constraints of the problem, and a set of waypoints, return the bezier curve corresponding
double value_type
Definition definitions.hh:16
BEZIER_COM_TRAJ_DLLAPI Matrix3 skew(point_t_tC x)
skew symmetric matrix
Definition utils.cpp:62
Eigen::Matrix< value_type, 3, 3 > Matrix3
Definition definitions.hh:17
waypoint_t operator*(const double k, const waypoint_t &w)
Definition utils.cpp:30
void printQHullFile(const std::pair< MatrixXX, VectorX > &Ab, VectorX intPoint, const std::string &fileName, bool clipZ=false)
write a polytope describe by A x <= b linear constraints in a given filename
Definition utils.cpp:120
const Eigen::Ref< const point_t > & point_t_tC
Definition definitions.hh:43
std::vector< std::pair< double, int > > T_time
Definition definitions.hh:59
T_time computeDiscretizedTimeFixed(const VectorX &phaseTimings, const unsigned int pointsPerPhase)
computeDiscretizedTime build an array of discretized points in time, such that there is the same numb...
Definition utils.cpp:81
waypoint6_t w1(point_t_tC p0, point_t_tC p1, point_t_tC, const Matrix3 &, const Matrix3 &, const Matrix3 &gX, const double alpha)
Definition solve_0_step.cpp:23
Eigen::Ref< VectorX > Ref_vectorX
Definition definitions.hh:27
waypoint_t operator+(const waypoint_t &w1, const waypoint_t &w2)
Definition utils.cpp:16
waypoint6_t w2(point_t_tC p0, point_t_tC p1, point_t_tC g, const Matrix3 &, const Matrix3 &, const Matrix3 &gX, const double alpha)
Definition solve_0_step.cpp:34
waypoint_t operator-(const waypoint_t &w1, const waypoint_t &w2)
Definition utils.cpp:23
std::pair< MatrixXX, VectorX > computeDistanceCostFunction(size_t numPoints, const ProblemData &pData, double T, std::vector< point3_t > pts_path)
Definition solve_end_effector.hh:224
T_time computeDiscretizedTime(const VectorX &phaseTimings, const double timeStep)
computeDiscretizedTime build an array of discretized points in time, given the timestep....
Definition utils.cpp:100
BEZIER_COM_TRAJ_DLLAPI std::vector< ndcurves::Bern< double > > ComputeBersteinPolynoms(const unsigned int degree)
Compute the Bernstein polynoms for a given degree.
Definition utils.cpp:73
Eigen::Ref< MatrixXX > Ref_matrixXX
Definition definitions.hh:29
Eigen::Matrix< value_type, Eigen::Dynamic, Eigen::Dynamic > MatrixXX
Definition definitions.hh:21
static waypoint_t Zero(size_t dim)
Definition utils.hh:33
size_t size() const
Definition utils.hh:35
VectorX second
Definition utils.hh:27
bool operator==(const waypoint_t &other) const
Definition utils.hh:44
bool isApprox(const waypoint_t &other, const value_type prec=Eigen::NumTraits< value_type >::dummy_precision()) const
Definition utils.hh:37
MatrixXX first
Definition utils.hh:26
waypoint_t(MatrixXX A, VectorX b)
Definition utils.hh:31
bool operator!=(const waypoint_t &other) const
Definition utils.hh:46
waypoint_t()
Definition utils.hh:29