forked from ToyotaResearchInstitute/idto
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathproblem_definition_py.cc
87 lines (85 loc) · 2.48 KB
/
problem_definition_py.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#include "optimizer/problem_definition.h"
#include <pybind11/eigen.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
namespace py = pybind11;
using idto::optimizer::ProblemDefinition;
PYBIND11_MODULE(problem_definition, m) {
py::class_<ProblemDefinition>(m, "ProblemDefinition")
.def(py::init<>())
.def_readwrite("num_steps", &ProblemDefinition::num_steps)
.def_property(
"q_init",
[](ProblemDefinition& self) {
return self.q_init;
},
[](ProblemDefinition& self, const Eigen::VectorXd& q_init) {
self.q_init = q_init;
})
.def_property(
"v_init",
[](ProblemDefinition& self) {
return self.v_init;
},
[](ProblemDefinition& self, const Eigen::VectorXd& v_init) {
self.v_init = v_init;
})
.def_property(
"Qq",
[](ProblemDefinition& self) {
return self.Qq;
},
[](ProblemDefinition& self, const Eigen::MatrixXd& Qq) {
self.Qq = Qq;
})
.def_property(
"Qv",
[](ProblemDefinition& self) {
return self.Qv;
},
[](ProblemDefinition& self, const Eigen::MatrixXd& Qv) {
self.Qv = Qv;
})
.def_property(
"Qf_q",
[](ProblemDefinition& self) {
return self.Qf_q;
},
[](ProblemDefinition& self, const Eigen::MatrixXd& Qf_q) {
self.Qf_q = Qf_q;
})
.def_property(
"Qf_v",
[](ProblemDefinition& self) {
return self.Qf_v;
},
[](ProblemDefinition& self, const Eigen::MatrixXd& Qf_v) {
self.Qf_v = Qf_v;
})
.def_property(
"R",
[](ProblemDefinition& self) {
return self.R;
},
[](ProblemDefinition& self, const Eigen::MatrixXd& R) {
self.R = R;
})
.def_property(
"q_nom",
[](ProblemDefinition& self) {
return self.q_nom;
},
[](ProblemDefinition& self,
const std::vector<Eigen::VectorXd>& q_nom) {
self.q_nom = q_nom;
})
.def_property(
"v_nom",
[](ProblemDefinition& self) {
return self.v_nom;
},
[](ProblemDefinition& self,
const std::vector<Eigen::VectorXd>& v_nom) {
self.v_nom = v_nom;
});
}