6 #include "lcmtypes/drake/lcmt_polynomial.hpp" 7 #include "lcmtypes/drake/lcmt_polynomial_matrix.hpp" 8 #include "lcmtypes/drake/lcmt_piecewise_polynomial.hpp" 9 #include "lcmtypes/drake/lcmt_qp_controller_input.hpp" 10 #include "drake/drakeLCMUtil_export.h" 13 drake::lcmt_polynomial& msg);
16 const drake::lcmt_polynomial& msg);
18 template <
int RowsAtCompileTime,
int ColsAtCompileTime>
21 ColsAtCompileTime>& polynomial_matrix,
22 drake::lcmt_polynomial_matrix& msg) {
23 msg.polynomials.clear();
24 msg.polynomials.resize(polynomial_matrix.rows());
25 for (
int row = 0; row < polynomial_matrix.rows(); ++row) {
26 auto& polynomial_msg_row = msg.polynomials[row];
27 polynomial_msg_row.resize(polynomial_matrix.cols());
28 for (
int col = 0; col < polynomial_matrix.cols(); ++col) {
32 msg.rows = polynomial_matrix.rows();
33 msg.cols = polynomial_matrix.cols();
36 template <
int RowsAtCompileTime,
int ColsAtCompileTime>
37 Eigen::Matrix<Polynomial<double>, RowsAtCompileTime, ColsAtCompileTime>
39 Eigen::Matrix<Polynomial<double>, RowsAtCompileTime, ColsAtCompileTime> ret(
41 for (
int row = 0; row < msg.rows; ++row) {
42 for (
int col = 0; col < msg.cols; ++col) {
51 drake::lcmt_piecewise_polynomial& msg);
54 const drake::lcmt_piecewise_polynomial& msg);
57 drake::lcmt_support_data& support_data);
59 drake::lcmt_qp_controller_input& qp_input);
DRAKELCMUTIL_EXPORT void encodePolynomial(const Polynomial< double > &polynomial, drake::lcmt_polynomial &msg)
Definition: lcmUtil.cpp:6
DRAKELCMUTIL_EXPORT void encodePiecewisePolynomial(const PiecewisePolynomial< double > &piecewise_polynomial, drake::lcmt_piecewise_polynomial &msg)
Definition: lcmUtil.cpp:18
DRAKELCMUTIL_EXPORT void verifySubtypeSizes(drake::lcmt_support_data &support_data)
Definition: lcmUtil.cpp:43
A scalar multi-variate polynomial, modeled after the msspoly in spotless.
Definition: Polynomial.h:42
DRAKELCMUTIL_EXPORT PiecewisePolynomial< double > decodePiecewisePolynomial(const drake::lcmt_piecewise_polynomial &msg)
Definition: lcmUtil.cpp:32
A scalar multi-variate piecewise polynomial.
Definition: PiecewisePolynomial.h:33
void encodePolynomialMatrix(const Eigen::Matrix< Polynomial< double >, RowsAtCompileTime, ColsAtCompileTime > &polynomial_matrix, drake::lcmt_polynomial_matrix &msg)
Definition: lcmUtil.h:19
DRAKELCMUTIL_EXPORT Polynomial< double > decodePolynomial(const drake::lcmt_polynomial &msg)
Definition: lcmUtil.cpp:12
Eigen::Matrix< Polynomial< double >, RowsAtCompileTime, ColsAtCompileTime > decodePolynomialMatrix(const drake::lcmt_polynomial_matrix &msg)
Definition: lcmUtil.h:38