Directory: | ./ |
---|---|
File: | bindings/python/crocoddyl/core/actions/diff-lqr.cpp |
Date: | 2025-01-16 08:47:40 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 119 | 119 | 100.0% |
Branches: | 120 | 240 | 50.0% |
Line | Branch | Exec | Source |
---|---|---|---|
1 | /////////////////////////////////////////////////////////////////////////////// | ||
2 | // BSD 3-Clause License | ||
3 | // | ||
4 | // Copyright (C) 2019-2024, LAAS-CNRS, University of Edinburgh | ||
5 | // Heriot-Watt University | ||
6 | // Copyright note valid unless otherwise stated in individual files. | ||
7 | // All rights reserved. | ||
8 | /////////////////////////////////////////////////////////////////////////////// | ||
9 | |||
10 | #include "crocoddyl/core/actions/diff-lqr.hpp" | ||
11 | |||
12 | #include "python/crocoddyl/core/core.hpp" | ||
13 | #include "python/crocoddyl/core/diff-action-base.hpp" | ||
14 | #include "python/crocoddyl/utils/copyable.hpp" | ||
15 | #include "python/crocoddyl/utils/deprecate.hpp" | ||
16 | |||
17 | namespace crocoddyl { | ||
18 | namespace python { | ||
19 | |||
20 | 22 | BOOST_PYTHON_FUNCTION_OVERLOADS(DifferentialActionModelLQR_Random_wrap, | |
21 | DifferentialActionModelLQR::Random, 2, 4) | ||
22 | |||
23 | 10 | void exposeDifferentialActionLQR() { | |
24 | // TODO: Remove once the deprecated update call has been removed in a future | ||
25 | // release | ||
26 | #pragma GCC diagnostic push | ||
27 | #pragma GCC diagnostic ignored "-Wdeprecated-declarations" | ||
28 | |||
29 | boost::python::register_ptr_to_python< | ||
30 | 10 | boost::shared_ptr<DifferentialActionModelLQR> >(); | |
31 | |||
32 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::class_<DifferentialActionModelLQR, |
33 | bp::bases<DifferentialActionModelAbstract> >( | ||
34 | "DifferentialActionModelLQR", | ||
35 | "Differential action model for linear dynamics and quadratic cost.\n\n" | ||
36 | "This class implements a linear dynamics, quadratic costs, and linear " | ||
37 | "constraints (i.e. LQR action). Since the DAM is a second order system, " | ||
38 | "and the integrated action models are implemented as being second order " | ||
39 | "integrators. This class implements a second order linear system given " | ||
40 | "by\n" | ||
41 | " x = [q, v]\n" | ||
42 | " dv = Fq q + Fv v + Fu u + f0\n" | ||
43 | "where Fq, Fv, Fu and f are randomly chosen constant terms. On the other " | ||
44 | "hand, the cost function is given by\n" | ||
45 | " l(x,u) = 1/2 [x,u].T [Q N; N.T R] [x,u] + [q,r].T [x,u],\n" | ||
46 | "and the linear equality and inequality constraints has the form:\n" | ||
47 | " g(x,u) = G [x,u] + g<=0\n" | ||
48 | " h(x,u) = H [x,u] + h.", | ||
49 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::init<Eigen::MatrixXd, Eigen::MatrixXd, Eigen::MatrixXd, |
50 | Eigen::MatrixXd, Eigen::MatrixXd, Eigen::MatrixXd>( | ||
51 | 20 | bp::args("self", "Aq", "Av", "B", "Q", "R", "N"), | |
52 | "Initialize the differential LQR action model.\n\n" | ||
53 | ":param Aq: position matrix\n" | ||
54 | ":param Av: velocity matrix\n" | ||
55 | ":param B: input matrix\n" | ||
56 | ":param Q: state weight matrix\n" | ||
57 | ":param R: input weight matrix\n" | ||
58 | ":param N: state-input weight matrix")) | ||
59 |
2/4✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 10 times.
✗ Branch 5 not taken.
|
10 | .def(bp::init<Eigen::MatrixXd, Eigen::MatrixXd, Eigen::MatrixXd, |
60 | Eigen::MatrixXd, Eigen::MatrixXd, Eigen::MatrixXd, | ||
61 | Eigen::VectorXd, Eigen::VectorXd, Eigen::VectorXd>( | ||
62 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
20 | bp::args("self", "Aq", "Av", "B", "Q", "R", "N", "f", "q", "r"), |
63 | "Initialize the differential LQR action model.\n\n" | ||
64 | ":param Aq: position matrix\n" | ||
65 | ":param Av: velocity matrix\n" | ||
66 | ":param B: input matrix\n" | ||
67 | ":param Q: state weight matrix\n" | ||
68 | ":param R: input weight matrix\n" | ||
69 | ":param N: state-input weight matrix\n" | ||
70 | ":param f: dynamics drift\n" | ||
71 | ":param q: state weight vector\n" | ||
72 | ":param r: input weight vector")) | ||
73 |
2/4✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 10 times.
✗ Branch 5 not taken.
|
10 | .def(bp::init<Eigen::MatrixXd, Eigen::MatrixXd, Eigen::MatrixXd, |
74 | Eigen::MatrixXd, Eigen::MatrixXd, Eigen::MatrixXd, | ||
75 | Eigen::MatrixXd, Eigen::MatrixXd, Eigen::VectorXd, | ||
76 | Eigen::VectorXd, Eigen::VectorXd, Eigen::VectorXd, | ||
77 | Eigen::VectorXd>( | ||
78 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
20 | bp::args("self", "Aq", "Av", "B", "Q", "R", "N", "G", "H", "f", "q", |
79 | "r", "g", "h"), | ||
80 | "Initialize the differential LQR action model.\n\n" | ||
81 | ":param Aq: position matrix\n" | ||
82 | ":param Av: velocity matrix\n" | ||
83 | ":param B: input matrix\n" | ||
84 | ":param Q: state weight matrix\n" | ||
85 | ":param R: input weight matrix\n" | ||
86 | ":param N: state-input weight matrix\n" | ||
87 | ":param G: state-input inequality constraint matrix\n" | ||
88 | ":param H: state-input equality constraint matrix\n" | ||
89 | ":param f: dynamics drift\n" | ||
90 | ":param q: state weight vector\n" | ||
91 | ":param r: input weight vector\n" | ||
92 | ":param g: state-input inequality constraint bias\n" | ||
93 | ":param h: state-input equality constraint bias")) | ||
94 |
2/4✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 10 times.
✗ Branch 5 not taken.
|
10 | .def(bp::init<std::size_t, std::size_t, bp::optional<bool> >( |
95 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
20 | bp::args("self", "nq", "nu", "driftFree"), |
96 | "Initialize the differential LQR action model.\n\n" | ||
97 | ":param nx: dimension of the state vector\n" | ||
98 | ":param nu: dimension of the control vector\n" | ||
99 | ":param driftFree: enable/disable the bias term of the linear " | ||
100 | "dynamics (default True)")) | ||
101 | .def<void (DifferentialActionModelLQR::*)( | ||
102 | const boost::shared_ptr<DifferentialActionDataAbstract>&, | ||
103 | const Eigen::Ref<const Eigen::VectorXd>&, | ||
104 | 20 | const Eigen::Ref<const Eigen::VectorXd>&)>( | |
105 | "calc", &DifferentialActionModelLQR::calc, | ||
106 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
20 | bp::args("self", "data", "x", "u"), |
107 | "Compute the next state and cost value.\n\n" | ||
108 | "It describes the time-continuous evolution of the LQR system. " | ||
109 | "Additionally it\n" | ||
110 | "computes the cost value associated to this discrete state and " | ||
111 | "control pair.\n" | ||
112 | ":param data: action data\n" | ||
113 | ":param x: time-continuous state vector\n" | ||
114 | ":param u: time-continuous control input") | ||
115 | .def<void (DifferentialActionModelLQR::*)( | ||
116 | const boost::shared_ptr<DifferentialActionDataAbstract>&, | ||
117 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | const Eigen::Ref<const Eigen::VectorXd>&)>( |
118 | "calc", &DifferentialActionModelAbstract::calc, | ||
119 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
20 | bp::args("self", "data", "x")) |
120 | .def<void (DifferentialActionModelLQR::*)( | ||
121 | const boost::shared_ptr<DifferentialActionDataAbstract>&, | ||
122 | const Eigen::Ref<const Eigen::VectorXd>&, | ||
123 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | const Eigen::Ref<const Eigen::VectorXd>&)>( |
124 | "calcDiff", &DifferentialActionModelLQR::calcDiff, | ||
125 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
20 | bp::args("self", "data", "x", "u"), |
126 | "Compute the derivatives of the differential LQR dynamics and cost " | ||
127 | "functions.\n\n" | ||
128 | "It computes the partial derivatives of the differential LQR system " | ||
129 | "and the\n" | ||
130 | "cost function. It assumes that calc has been run first.\n" | ||
131 | "This function builds a quadratic approximation of the\n" | ||
132 | "action model (i.e. dynamical system and cost function).\n" | ||
133 | ":param data: action data\n" | ||
134 | ":param x: time-continuous state vector\n" | ||
135 | ":param u: time-continuous control input\n") | ||
136 | .def<void (DifferentialActionModelLQR::*)( | ||
137 | const boost::shared_ptr<DifferentialActionDataAbstract>&, | ||
138 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | const Eigen::Ref<const Eigen::VectorXd>&)>( |
139 | "calcDiff", &DifferentialActionModelAbstract::calcDiff, | ||
140 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
20 | bp::args("self", "data", "x")) |
141 |
2/4✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 10 times.
✗ Branch 5 not taken.
|
20 | .def("createData", &DifferentialActionModelLQR::createData, |
142 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
20 | bp::args("self"), "Create the differential LQR action data.") |
143 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | .def("Random", &DifferentialActionModelLQR::Random, |
144 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | DifferentialActionModelLQR_Random_wrap( |
145 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
20 | bp::args("nq", "nu", "ng", "nh"), |
146 | "Create a random LQR model.\n\n" | ||
147 | ":param: nq: position dimension\n" | ||
148 | ":param nu: control dimension\n" | ||
149 | ":param ng: inequality constraint dimension (default 0)\n" | ||
150 | ":param nh: equality constraint dimension (default 0)")) | ||
151 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | .staticmethod("Random") |
152 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | .def("setLQR", &DifferentialActionModelLQR::set_LQR, |
153 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
20 | bp::args("self", "Aq", "Av", "B", "Q", "R", "N", "f", "q", "r"), |
154 | "Modify the LQR action model.\n\n" | ||
155 | ":param Aq: position matrix\n" | ||
156 | ":param Av: velocity matrix\n" | ||
157 | ":param B: input matrix\n" | ||
158 | ":param Q: state weight matrix\n" | ||
159 | ":param R: input weight matrix\n" | ||
160 | ":param N: state-input weight matrix\n" | ||
161 | ":param f: dynamics drift\n" | ||
162 | ":param q: state weight vector\n" | ||
163 | ":param r: input weight vector") | ||
164 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | .add_property("Aq", |
165 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::make_function(&DifferentialActionModelLQR::get_Aq, |
166 | 10 | bp::return_internal_reference<>()), | |
167 | "position matrix") | ||
168 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | .add_property("Av", |
169 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::make_function(&DifferentialActionModelLQR::get_Av, |
170 | 10 | bp::return_internal_reference<>()), | |
171 | "velocity matrix") | ||
172 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | .add_property("B", |
173 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::make_function(&DifferentialActionModelLQR::get_B, |
174 | 10 | bp::return_internal_reference<>()), | |
175 | "input matrix") | ||
176 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | .add_property("f", |
177 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::make_function(&DifferentialActionModelLQR::get_f, |
178 | 10 | bp::return_internal_reference<>()), | |
179 | "dynamics drift") | ||
180 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | .add_property("Q", |
181 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::make_function(&DifferentialActionModelLQR::get_Q, |
182 | 10 | bp::return_internal_reference<>()), | |
183 | "state weight matrix") | ||
184 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | .add_property("R", |
185 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::make_function(&DifferentialActionModelLQR::get_R, |
186 | 10 | bp::return_internal_reference<>()), | |
187 | "input weight matrix") | ||
188 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | .add_property("N", |
189 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::make_function(&DifferentialActionModelLQR::get_N, |
190 | 10 | bp::return_internal_reference<>()), | |
191 | "state-input weight matrix") | ||
192 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | .add_property("G", |
193 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::make_function(&DifferentialActionModelLQR::get_G, |
194 | 10 | bp::return_internal_reference<>()), | |
195 | "state-input inequality constraint matrix") | ||
196 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | .add_property("H", |
197 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::make_function(&DifferentialActionModelLQR::get_H, |
198 | 10 | bp::return_internal_reference<>()), | |
199 | "state-input equality constraint matrix") | ||
200 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | .add_property("q", |
201 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::make_function(&DifferentialActionModelLQR::get_q, |
202 | 10 | bp::return_internal_reference<>()), | |
203 | "state weight vector") | ||
204 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | .add_property("r", |
205 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::make_function(&DifferentialActionModelLQR::get_r, |
206 | 10 | bp::return_internal_reference<>()), | |
207 | "input weight vector") | ||
208 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | .add_property("g", |
209 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::make_function(&DifferentialActionModelLQR::get_g, |
210 | 10 | bp::return_internal_reference<>()), | |
211 | "state-input inequality constraint bias") | ||
212 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | .add_property("h", |
213 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::make_function(&DifferentialActionModelLQR::get_h, |
214 | 10 | bp::return_internal_reference<>()), | |
215 | "state-input equality constraint bias") | ||
216 | // deprecated function | ||
217 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | .add_property( |
218 | "Fq", | ||
219 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::make_function(&DifferentialActionModelLQR::get_Aq, |
220 |
2/4✓ Branch 2 taken 10 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 10 times.
✗ Branch 6 not taken.
|
20 | deprecated<bp::return_internal_reference<> >( |
221 | "Deprecated. Use Aq.")), | ||
222 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
20 | bp::make_function(&DifferentialActionModelLQR::set_Fq, |
223 |
2/4✓ Branch 2 taken 10 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 10 times.
✗ Branch 6 not taken.
|
20 | deprecated<>("Deprecated. Use set_LQR.")), |
224 | "position matrix") | ||
225 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | .add_property( |
226 | "Fv", | ||
227 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::make_function(&DifferentialActionModelLQR::get_Av, |
228 |
2/4✓ Branch 2 taken 10 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 10 times.
✗ Branch 6 not taken.
|
20 | deprecated<bp::return_internal_reference<> >( |
229 | "Deprecated. Use Av.")), | ||
230 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
20 | bp::make_function(&DifferentialActionModelLQR::set_Fv, |
231 |
2/4✓ Branch 2 taken 10 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 10 times.
✗ Branch 6 not taken.
|
20 | deprecated<>("Deprecated. Use set_LQR.")), |
232 | "position matrix") | ||
233 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | .add_property( |
234 | "Fu", | ||
235 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::make_function(&DifferentialActionModelLQR::get_B, |
236 |
2/4✓ Branch 2 taken 10 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 10 times.
✗ Branch 6 not taken.
|
20 | deprecated<bp::return_internal_reference<> >( |
237 | "Deprecated. Use B.")), | ||
238 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
20 | bp::make_function(&DifferentialActionModelLQR::set_Fu, |
239 |
2/4✓ Branch 2 taken 10 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 10 times.
✗ Branch 6 not taken.
|
20 | deprecated<>("Deprecated. Use set_LQR.")), |
240 | "input matrix") | ||
241 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | .add_property( |
242 | "f0", | ||
243 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::make_function(&DifferentialActionModelLQR::get_f, |
244 |
2/4✓ Branch 2 taken 10 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 10 times.
✗ Branch 6 not taken.
|
20 | deprecated<bp::return_internal_reference<> >( |
245 | "Deprecated. Use f.")), | ||
246 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
20 | bp::make_function(&DifferentialActionModelLQR::set_f0, |
247 |
2/4✓ Branch 2 taken 10 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 10 times.
✗ Branch 6 not taken.
|
20 | deprecated<>("Deprecated. Use set_LQR.")), |
248 | "dynamics drift") | ||
249 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | .add_property( |
250 | "lx", | ||
251 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::make_function(&DifferentialActionModelLQR::get_q, |
252 |
2/4✓ Branch 2 taken 10 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 10 times.
✗ Branch 6 not taken.
|
20 | deprecated<bp::return_internal_reference<> >( |
253 | "Deprecated. Use q.")), | ||
254 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
20 | bp::make_function(&DifferentialActionModelLQR::set_lx, |
255 |
2/4✓ Branch 2 taken 10 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 10 times.
✗ Branch 6 not taken.
|
20 | deprecated<>("Deprecated. Use set_LQR.")), |
256 | "state weight vector") | ||
257 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | .add_property( |
258 | "lu", | ||
259 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::make_function(&DifferentialActionModelLQR::get_r, |
260 |
2/4✓ Branch 2 taken 10 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 10 times.
✗ Branch 6 not taken.
|
20 | deprecated<bp::return_internal_reference<> >( |
261 | "Deprecated. Use r.")), | ||
262 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
20 | bp::make_function(&DifferentialActionModelLQR::set_lu, |
263 |
2/4✓ Branch 2 taken 10 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 10 times.
✗ Branch 6 not taken.
|
20 | deprecated<>("Deprecated. Use set_LQR.")), |
264 | "input weight vector") | ||
265 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | .add_property( |
266 | "Lxx", | ||
267 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::make_function(&DifferentialActionModelLQR::get_Q, |
268 |
2/4✓ Branch 2 taken 10 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 10 times.
✗ Branch 6 not taken.
|
20 | deprecated<bp::return_internal_reference<> >( |
269 | "Deprecated. Use Q.")), | ||
270 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
20 | bp::make_function(&DifferentialActionModelLQR::set_Lxx, |
271 |
2/4✓ Branch 2 taken 10 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 10 times.
✗ Branch 6 not taken.
|
20 | deprecated<>("Deprecated. Use set_LQR.")), |
272 | "state weight matrix") | ||
273 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | .add_property( |
274 | "Lxu", | ||
275 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::make_function(&DifferentialActionModelLQR::get_N, |
276 |
2/4✓ Branch 2 taken 10 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 10 times.
✗ Branch 6 not taken.
|
20 | deprecated<bp::return_internal_reference<> >( |
277 | "Deprecated. Use N.")), | ||
278 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
20 | bp::make_function(&DifferentialActionModelLQR::set_Lxu, |
279 |
2/4✓ Branch 2 taken 10 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 10 times.
✗ Branch 6 not taken.
|
20 | deprecated<>("Deprecated. Use set_LQR.")), |
280 | "state-input weight matrix") | ||
281 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | .add_property( |
282 | "Luu", | ||
283 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::make_function(&DifferentialActionModelLQR::get_R, |
284 |
2/4✓ Branch 2 taken 10 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 10 times.
✗ Branch 6 not taken.
|
20 | deprecated<bp::return_internal_reference<> >( |
285 | "Deprecated. Use R.")), | ||
286 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
20 | bp::make_function(&DifferentialActionModelLQR::set_Luu, |
287 |
2/4✓ Branch 2 taken 10 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 10 times.
✗ Branch 6 not taken.
|
20 | deprecated<>("Deprecated. Use set_LQR.")), |
288 | "input weight matrix") | ||
289 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | .def(CopyableVisitor<DifferentialActionModelLQR>()); |
290 | |||
291 | boost::python::register_ptr_to_python< | ||
292 | 10 | boost::shared_ptr<DifferentialActionDataLQR> >(); | |
293 | |||
294 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::class_<DifferentialActionDataLQR, |
295 | bp::bases<DifferentialActionDataAbstract> >( | ||
296 | "DifferentialActionDataLQR", | ||
297 | "Action data for the differential LQR system.", | ||
298 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | bp::init<DifferentialActionModelLQR*>( |
299 | 20 | bp::args("self", "model"), | |
300 | "Create differential LQR data.\n\n" | ||
301 | ":param model: differential LQR action model")) | ||
302 |
1/2✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
|
10 | .def(CopyableVisitor<DifferentialActionDataLQR>()); |
303 | |||
304 | #pragma GCC diagnostic pop | ||
305 | 10 | } | |
306 | |||
307 | } // namespace python | ||
308 | } // namespace crocoddyl | ||
309 |