Directory: | ./ |
---|---|
File: | python/ndcurves/curves_python.cpp |
Date: | 2025-03-05 17:18:30 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 792 | 1018 | 77.8% |
Branches: | 837 | 1936 | 43.2% |
Line | Branch | Exec | Source |
---|---|---|---|
1 | #ifdef CURVES_WITH_PINOCCHIO_SUPPORT | ||
2 | #include <pinocchio/spatial/motion.hpp> | ||
3 | #include <pinocchio/spatial/se3.hpp> | ||
4 | #endif // CURVES_WITH_PINOCCHIO_SUPPORT | ||
5 | |||
6 | #include <boost/python.hpp> | ||
7 | #include <boost/python/call_method.hpp> | ||
8 | #include <boost/python/class.hpp> | ||
9 | #include <boost/python/def.hpp> | ||
10 | #include <boost/python/module_init.hpp> | ||
11 | #include <boost/python/register_ptr_to_python.hpp> | ||
12 | #include <boost/ref.hpp> | ||
13 | #include <boost/utility.hpp> | ||
14 | #include <ndcurves/serialization/curves.hpp> | ||
15 | |||
16 | #include "archive_python_binding.h" | ||
17 | #include "optimization_python.h" | ||
18 | #include "python_variables.h" | ||
19 | |||
20 | namespace ndcurves { | ||
21 | using namespace boost::python; | ||
22 | |||
23 | /* base wrap of curve_abc and others parent abstract class: must implement all | ||
24 | * pure virtual methods */ | ||
25 | struct curve_abc_callback : curve_abc_t { | ||
26 | ✗ | curve_abc_callback(PyObject* p) : self(p) {} | |
27 | ✗ | virtual point_t operator()(const real t) const { | |
28 | ✗ | return call_method<point_t>(self, "operator()", t); | |
29 | } | ||
30 | ✗ | virtual point_t derivate(const real t, const std::size_t n) const { | |
31 | ✗ | return call_method<point_t>(self, "derivate", t, n); | |
32 | } | ||
33 | ✗ | virtual curve_t* compute_derivate_ptr(const std::size_t n) const { | |
34 | ✗ | return call_method<curve_t*>(self, "compute_derivate", n); | |
35 | } | ||
36 | ✗ | virtual std::size_t dim() const { | |
37 | ✗ | return call_method<std::size_t>(self, "dim"); | |
38 | } | ||
39 | ✗ | virtual real min() const { return call_method<real>(self, "min"); } | |
40 | ✗ | virtual real max() const { return call_method<real>(self, "max"); } | |
41 | ✗ | virtual std::size_t degree() const { | |
42 | ✗ | return call_method<std::size_t>(self, "degree"); | |
43 | } | ||
44 | ✗ | virtual bool isApprox( | |
45 | const curve_t* other, | ||
46 | const real prec = Eigen::NumTraits<real>::dummy_precision()) const { | ||
47 | ✗ | return call_method<bool>(self, "isApprox", other, prec); | |
48 | } | ||
49 | PyObject* self; | ||
50 | }; | ||
51 | 30 | BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(curve_abc_t_isEquivalent_overloads, | |
52 | curve_abc_t::isEquivalent, 1, 3) | ||
53 | |||
54 | struct curve_3_callback : curve_3_t { | ||
55 | ✗ | curve_3_callback(PyObject* p) : self(p) {} | |
56 | ✗ | virtual point3_t operator()(const real t) const { | |
57 | ✗ | return call_method<point3_t>(self, "operator()", t); | |
58 | } | ||
59 | ✗ | virtual point3_t derivate(const real t, const std::size_t n) const { | |
60 | ✗ | return call_method<point3_t>(self, "derivate", t, n); | |
61 | } | ||
62 | ✗ | virtual curve_t* compute_derivate_ptr(const std::size_t n) const { | |
63 | ✗ | return call_method<curve_t*>(self, "compute_derivate", n); | |
64 | } | ||
65 | ✗ | virtual std::size_t dim() const { | |
66 | ✗ | return call_method<std::size_t>(self, "dim"); | |
67 | } | ||
68 | ✗ | virtual real min() const { return call_method<real>(self, "min"); } | |
69 | ✗ | virtual real max() const { return call_method<real>(self, "max"); } | |
70 | ✗ | virtual std::size_t degree() const { | |
71 | ✗ | return call_method<std::size_t>(self, "degree"); | |
72 | } | ||
73 | ✗ | virtual bool isApprox( | |
74 | const curve_t* other, | ||
75 | const real prec = Eigen::NumTraits<real>::dummy_precision()) const { | ||
76 | ✗ | return call_method<bool>(self, "isApprox", other, prec); | |
77 | } | ||
78 | PyObject* self; | ||
79 | }; | ||
80 | 16 | BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(curve_3_t_isEquivalent_overloads, | |
81 | curve_3_t::isEquivalent, 1, 3) | ||
82 | |||
83 | struct curve_rotation_callback : curve_rotation_t { | ||
84 | ✗ | curve_rotation_callback(PyObject* p) : self(p) {} | |
85 | ✗ | virtual curve_rotation_t::point_t operator()(const real t) const { | |
86 | ✗ | return call_method<curve_rotation_t::point_t>(self, "operator()", t); | |
87 | } | ||
88 | ✗ | virtual curve_rotation_t::point_derivate_t derivate( | |
89 | const real t, const std::size_t n) const { | ||
90 | ✗ | return call_method<curve_rotation_t::point_derivate_t>(self, "derivate", t, | |
91 | ✗ | n); | |
92 | } | ||
93 | ✗ | virtual curve_rotation_t::curve_derivate_t* compute_derivate_ptr( | |
94 | const std::size_t n) const { | ||
95 | ✗ | return call_method<curve_rotation_t::curve_derivate_t*>( | |
96 | ✗ | self, "compute_derivate", n); | |
97 | } | ||
98 | ✗ | virtual std::size_t dim() const { | |
99 | ✗ | return call_method<std::size_t>(self, "dim"); | |
100 | } | ||
101 | ✗ | virtual real min() const { return call_method<real>(self, "min"); } | |
102 | ✗ | virtual real max() const { return call_method<real>(self, "max"); } | |
103 | ✗ | virtual std::size_t degree() const { | |
104 | ✗ | return call_method<std::size_t>(self, "degree"); | |
105 | } | ||
106 | ✗ | virtual bool isApprox( | |
107 | const curve_t* other, | ||
108 | const real prec = Eigen::NumTraits<real>::dummy_precision()) const { | ||
109 | ✗ | return call_method<bool>(self, "isApprox", other, prec); | |
110 | } | ||
111 | PyObject* self; | ||
112 | }; | ||
113 | 16 | BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(curve_rotation_t_isEquivalent_overloads, | |
114 | curve_rotation_t::isEquivalent, 1, 3) | ||
115 | |||
116 | struct curve_SE3_callback : curve_SE3_t { | ||
117 | ✗ | curve_SE3_callback(PyObject* p) : self(p) {} | |
118 | ✗ | virtual curve_SE3_t::point_t operator()(const real t) const { | |
119 | ✗ | return call_method<curve_SE3_t::point_t>(self, "operator()", t); | |
120 | } | ||
121 | ✗ | virtual curve_SE3_t::point_derivate_t derivate(const real t, | |
122 | const std::size_t n) const { | ||
123 | ✗ | return call_method<curve_SE3_t::point_derivate_t>(self, "derivate", t, n); | |
124 | } | ||
125 | ✗ | virtual curve_SE3_t::curve_derivate_t* compute_derivate_ptr( | |
126 | const std::size_t n) const { | ||
127 | ✗ | return call_method<curve_SE3_t::curve_derivate_t*>(self, "compute_derivate", | |
128 | ✗ | n); | |
129 | } | ||
130 | ✗ | virtual std::size_t dim() const { | |
131 | ✗ | return call_method<std::size_t>(self, "dim"); | |
132 | } | ||
133 | ✗ | virtual real min() const { return call_method<real>(self, "min"); } | |
134 | ✗ | virtual real max() const { return call_method<real>(self, "max"); } | |
135 | ✗ | virtual std::size_t degree() const { | |
136 | ✗ | return call_method<std::size_t>(self, "degree"); | |
137 | } | ||
138 | ✗ | virtual bool isApprox( | |
139 | const curve_t* other, | ||
140 | const real prec = Eigen::NumTraits<real>::dummy_precision()) const { | ||
141 | ✗ | return call_method<bool>(self, "isApprox", other, prec); | |
142 | } | ||
143 | PyObject* self; | ||
144 | }; | ||
145 | 16 | BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(curve_SE3_t_isEquivalent_overloads, | |
146 | curve_SE3_t::isEquivalent, 1, 3) | ||
147 | |||
148 | /* end base wrap of curve_abc */ | ||
149 | |||
150 | /* Structure used to define pickle serialization of python curves */ | ||
151 | template <typename Curve> | ||
152 | struct curve_pickle_suite : pickle_suite { | ||
153 | 26 | static object getstate(const Curve& curve) { | |
154 |
1/2✓ Branch 1 taken 13 times.
✗ Branch 2 not taken.
|
26 | std::ostringstream os; |
155 |
1/2✓ Branch 1 taken 13 times.
✗ Branch 2 not taken.
|
26 | boost::archive::text_oarchive oa(os); |
156 |
1/2✓ Branch 1 taken 13 times.
✗ Branch 2 not taken.
|
26 | oa << curve; |
157 |
3/6✓ Branch 1 taken 13 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 13 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 13 times.
✗ Branch 8 not taken.
|
78 | return str(os.str()); |
158 | } | ||
159 | |||
160 | 26 | static void setstate(Curve& curve, object entries) { | |
161 |
2/4✓ Branch 1 taken 13 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 13 times.
✗ Branch 5 not taken.
|
26 | str s = extract<str>(entries)(); |
162 |
3/6✓ Branch 1 taken 13 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 13 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 13 times.
✗ Branch 8 not taken.
|
26 | std::string st = extract<std::string>(s)(); |
163 |
1/2✓ Branch 1 taken 13 times.
✗ Branch 2 not taken.
|
26 | std::istringstream is(st); |
164 |
1/2✓ Branch 1 taken 13 times.
✗ Branch 2 not taken.
|
26 | boost::archive::text_iarchive ia(is); |
165 |
1/2✓ Branch 1 taken 13 times.
✗ Branch 2 not taken.
|
26 | ia >> curve; |
166 | } | ||
167 | }; | ||
168 | |||
169 | template <class C> | ||
170 | struct CopyableVisitor : public def_visitor<CopyableVisitor<C>> { | ||
171 | template <class PyClass> | ||
172 | 272 | void visit(PyClass& cl) const { | |
173 |
1/2✓ Branch 2 taken 136 times.
✗ Branch 3 not taken.
|
272 | cl.def("copy", ©, bp::arg("self"), "Returns a copy of *this."); |
174 |
1/2✓ Branch 2 taken 136 times.
✗ Branch 3 not taken.
|
272 | cl.def("__copy__", ©, bp::arg("self"), "Returns a copy of *this."); |
175 |
1/2✓ Branch 2 taken 136 times.
✗ Branch 3 not taken.
|
272 | cl.def("__deepcopy__", &deepcopy, bp::args("self", "memo"), |
176 | "Returns a deep copy of *this."); | ||
177 | 272 | } | |
178 | |||
179 | private: | ||
180 | ✗ | static C copy(const C& self) { return C(self); } | |
181 | ✗ | static C deepcopy(const C& self, bp::dict) { return C(self); } | |
182 | }; | ||
183 | |||
184 | /* Template constructor bezier */ | ||
185 | template <typename Bezier, typename PointList, typename T_Point> | ||
186 | 64 | Bezier* wrapBezierConstructorTemplate(const PointList& array, | |
187 | const real T_min = 0., | ||
188 | const real T_max = 1.) { | ||
189 |
1/2✓ Branch 1 taken 32 times.
✗ Branch 2 not taken.
|
64 | T_Point asVector = vectorFromEigenArray<PointList, T_Point>(array); |
190 |
2/4✓ Branch 3 taken 32 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 32 times.
✗ Branch 7 not taken.
|
128 | return new Bezier(asVector.begin(), asVector.end(), T_min, T_max); |
191 | 64 | } | |
192 | |||
193 | template <typename Bezier, typename PointList, typename T_Point, | ||
194 | typename CurveConstraints> | ||
195 | 4 | Bezier* wrapBezierConstructorConstraintsTemplate( | |
196 | const PointList& array, const CurveConstraints& constraints, | ||
197 | const real T_min = 0., const real T_max = 1.) { | ||
198 |
1/2✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
|
4 | T_Point asVector = vectorFromEigenArray<PointList, T_Point>(array); |
199 |
2/4✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
|
4 | return new Bezier(asVector.begin(), asVector.end(), constraints, T_min, |
200 | 4 | T_max); | |
201 | 4 | } | |
202 | /* End Template constructor bezier */ | ||
203 | /* Helper converter constraintsX -> constraints 3 */ | ||
204 | 1 | curve_constraints3_t convertToConstraints3(curve_constraints_t constraintsX) { | |
205 | 1 | curve_constraints3_t constraints3(3); | |
206 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | constraints3.init_vel = point3_t(constraintsX.init_vel); |
207 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | constraints3.init_acc = point3_t(constraintsX.init_acc); |
208 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | constraints3.end_vel = point3_t(constraintsX.end_vel); |
209 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | constraints3.end_acc = point3_t(constraintsX.end_acc); |
210 | 1 | return constraints3; | |
211 | } | ||
212 | /* END helper converter constraintsX -> constraints 3 */ | ||
213 | |||
214 | /*3D constructors bezier */ | ||
215 | 1 | bezier3_t* wrapBezier3Constructor(const pointX_list_t& array) { | |
216 | 1 | return wrapBezierConstructorTemplate<bezier3_t, pointX_list_t, t_point3_t>( | |
217 | 1 | array); | |
218 | } | ||
219 | 15 | bezier3_t* wrapBezier3ConstructorBounds(const pointX_list_t& array, | |
220 | const real T_min, const real T_max) { | ||
221 | 15 | return wrapBezierConstructorTemplate<bezier3_t, pointX_list_t, t_point3_t>( | |
222 | 15 | array, T_min, T_max); | |
223 | } | ||
224 | 1 | bezier3_t* wrapBezier3ConstructorConstraints( | |
225 | const pointX_list_t& array, const curve_constraints_t& constraints) { | ||
226 | return wrapBezierConstructorConstraintsTemplate< | ||
227 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | bezier3_t, pointX_list_t, t_point3_t, curve_constraints3_t>( |
228 |
1/2✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
|
2 | array, convertToConstraints3(constraints)); |
229 | } | ||
230 | ✗ | bezier3_t* wrapBezier3ConstructorBoundsConstraints( | |
231 | const pointX_list_t& array, const curve_constraints_t& constraints, | ||
232 | const real T_min, const real T_max) { | ||
233 | return wrapBezierConstructorConstraintsTemplate< | ||
234 | ✗ | bezier3_t, pointX_list_t, t_point3_t, curve_constraints3_t>( | |
235 | ✗ | array, convertToConstraints3(constraints), T_min, T_max); | |
236 | } | ||
237 | |||
238 | 3 | pointX_list_t wrapBezier3Waypoints(bezier3_t& self) { | |
239 | return vectorToEigenArray<bezier3_t::t_point_t, pointX_list_t>( | ||
240 | 3 | self.waypoints()); | |
241 | } | ||
242 | /*END 3D constructors bezier */ | ||
243 | |||
244 | /*constructors bezier */ | ||
245 | 4 | bezier_t* wrapBezierConstructor(const pointX_list_t& array) { | |
246 | 4 | return wrapBezierConstructorTemplate<bezier_t, pointX_list_t, t_pointX_t>( | |
247 | 4 | array); | |
248 | } | ||
249 | 12 | bezier_t* wrapBezierConstructorBounds(const pointX_list_t& array, | |
250 | const real T_min, const real T_max) { | ||
251 | 12 | return wrapBezierConstructorTemplate<bezier_t, pointX_list_t, t_pointX_t>( | |
252 | 12 | array, T_min, T_max); | |
253 | } | ||
254 | 1 | bezier_t* wrapBezierConstructorConstraints( | |
255 | const pointX_list_t& array, const curve_constraints_t& constraints) { | ||
256 | return wrapBezierConstructorConstraintsTemplate< | ||
257 | 1 | bezier_t, pointX_list_t, t_pointX_t, curve_constraints_t>(array, | |
258 | 1 | constraints); | |
259 | } | ||
260 | ✗ | bezier_t* wrapBezierConstructorBoundsConstraints( | |
261 | const pointX_list_t& array, const curve_constraints_t& constraints, | ||
262 | const real T_min, const real T_max) { | ||
263 | return wrapBezierConstructorConstraintsTemplate< | ||
264 | ✗ | bezier_t, pointX_list_t, t_pointX_t, curve_constraints_t>( | |
265 | ✗ | array, constraints, T_min, T_max); | |
266 | } | ||
267 | 3 | pointX_list_t wrapBezierWaypoints(bezier_t& self) { | |
268 | return vectorToEigenArray<bezier_t::t_point_t, pointX_list_t>( | ||
269 | 3 | self.waypoints()); | |
270 | } | ||
271 | /*END constructors bezier */ | ||
272 | |||
273 | /* Wrap Cubic hermite spline */ | ||
274 | 5 | t_pair_pointX_tangent_t getPairsPointTangent(const pointX_list_t& points, | |
275 | const pointX_list_t& tangents) { | ||
276 | 5 | t_pair_pointX_tangent_t res; | |
277 |
1/2✗ Branch 2 not taken.
✓ Branch 3 taken 5 times.
|
5 | if (points.size() != tangents.size()) { |
278 | ✗ | throw std::length_error("size of points and tangents must be the same"); | |
279 | } | ||
280 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 2 taken 5 times.
|
15 | for (int i = 0; i < points.cols(); ++i) { |
281 |
4/8✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 10 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 10 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 10 times.
✗ Branch 11 not taken.
|
10 | res.push_back(pair_pointX_tangent_t(points.col(i), tangents.col(i))); |
282 | } | ||
283 | 5 | return res; | |
284 | } | ||
285 | |||
286 | 5 | cubic_hermite_spline_t* wrapCubicHermiteSplineConstructor( | |
287 | const pointX_list_t& points, const pointX_list_t& tangents, | ||
288 | const time_waypoints_t& time_pts) { | ||
289 |
1/2✓ Branch 1 taken 5 times.
✗ Branch 2 not taken.
|
5 | t_pair_pointX_tangent_t ppt = getPairsPointTangent(points, tangents); |
290 | 5 | std::vector<real> time_control_pts; | |
291 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 2 taken 5 times.
|
15 | for (int i = 0; i < time_pts.size(); ++i) { |
292 |
2/4✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 10 times.
✗ Branch 5 not taken.
|
10 | time_control_pts.push_back(time_pts[i]); |
293 | } | ||
294 |
2/4✓ Branch 3 taken 5 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 5 times.
✗ Branch 7 not taken.
|
10 | return new cubic_hermite_spline_t(ppt.begin(), ppt.end(), time_control_pts); |
295 | 5 | } | |
296 | /* End wrap Cubic hermite spline */ | ||
297 | |||
298 | /* Wrap polynomial */ | ||
299 | 7 | polynomial_t* wrapPolynomialConstructor1(const coeff_t& array, const real min, | |
300 | const real max) { | ||
301 |
1/2✓ Branch 2 taken 7 times.
✗ Branch 3 not taken.
|
7 | return new polynomial_t(array, min, max); |
302 | } | ||
303 | 1 | polynomial_t* wrapPolynomialConstructor2(const coeff_t& array) { | |
304 |
1/2✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
|
1 | return new polynomial_t(array, 0., 1.); |
305 | } | ||
306 | 2 | polynomial_t* wrapPolynomialConstructorFromBoundaryConditionsDegree1( | |
307 | const pointX_t& init, const pointX_t& end, const real min, const real max) { | ||
308 |
2/2✓ Branch 2 taken 1 times.
✓ Branch 3 taken 1 times.
|
2 | return new polynomial_t(init, end, min, max); |
309 | } | ||
310 | 3 | polynomial_t* wrapPolynomialConstructorFromBoundaryConditionsDegree3( | |
311 | const pointX_t& init, const pointX_t& d_init, const pointX_t& end, | ||
312 | const pointX_t& d_end, const real min, const real max) { | ||
313 |
2/2✓ Branch 2 taken 2 times.
✓ Branch 3 taken 1 times.
|
3 | return new polynomial_t(init, d_init, end, d_end, min, max); |
314 | } | ||
315 | 5 | polynomial_t* wrapPolynomialConstructorFromBoundaryConditionsDegree5( | |
316 | const pointX_t& init, const pointX_t& d_init, const pointX_t& dd_init, | ||
317 | const pointX_t& end, const pointX_t& d_end, const pointX_t& dd_end, | ||
318 | const real min, const real max) { | ||
319 |
2/2✓ Branch 2 taken 4 times.
✓ Branch 3 taken 1 times.
|
5 | return new polynomial_t(init, d_init, dd_init, end, d_end, dd_end, min, max); |
320 | } | ||
321 | 2 | static polynomial_t minimumJerk(const pointX_t& init, const pointX_t& end) { | |
322 | 2 | return polynomial_t::MinimumJerk(init, end); | |
323 | } | ||
324 | 3 | static polynomial_t minimumJerkWithTiming(const pointX_t& init, | |
325 | const pointX_t& end, const real min, | ||
326 | const real max) { | ||
327 | 3 | return polynomial_t::MinimumJerk(init, end, min, max); | |
328 | } | ||
329 | /* End wrap polynomial */ | ||
330 | |||
331 | /* Wrap piecewise curve */ | ||
332 | 4 | piecewise_t* wrapPiecewiseCurveConstructor(const curve_ptr_t& curve) { | |
333 |
1/2✓ Branch 2 taken 4 times.
✗ Branch 3 not taken.
|
4 | return new piecewise_t(curve); |
334 | } | ||
335 | ✗ | piecewise_t* wrapPiecewisePolynomialCurveEmptyConstructor() { | |
336 | ✗ | return new piecewise_t(); | |
337 | } | ||
338 | 2 | piecewise_SE3_t* wrapPiecewiseSE3Constructor(const curve_SE3_ptr_t& curve) { | |
339 |
1/2✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
|
2 | return new piecewise_SE3_t(curve); |
340 | } | ||
341 | 6 | piecewise_SE3_t* wrapPiecewiseSE3EmptyConstructor() { | |
342 | 6 | return new piecewise_SE3_t(); | |
343 | } | ||
344 | |||
345 | typedef bezier_t::piecewise_curve_t piecewise_bezier_t; | ||
346 | ✗ | piecewise_bezier_t* wrapPiecewiseBezierConstructor( | |
347 | const bezier_t::bezier_curve_ptr_t& curve) { | ||
348 | ✗ | return new piecewise_bezier_t(curve); | |
349 | } | ||
350 | ✗ | piecewise_bezier_t* wrapPiecewiseBezierEmptyConstructor() { | |
351 | ✗ | return new piecewise_bezier_t(); | |
352 | } | ||
353 | typedef bezier_linear_variable_t::piecewise_curve_t piecewise_linear_bezier_t; | ||
354 | ✗ | piecewise_linear_bezier_t* wrapPiecewiseBezierLinearConstructor( | |
355 | const bezier_linear_variable_t::bezier_curve_ptr_t& curve) { | ||
356 | ✗ | return new piecewise_linear_bezier_t(curve); | |
357 | } | ||
358 | ✗ | piecewise_linear_bezier_t* wrapPiecewiseBezierLinearEmptyConstructor() { | |
359 | ✗ | return new piecewise_linear_bezier_t(); | |
360 | } | ||
361 | |||
362 | 2 | static piecewise_t discretPointToPolynomialC0( | |
363 | const pointX_list_t& points, const time_waypoints_t& time_points) { | ||
364 | t_pointX_t points_list = | ||
365 |
1/2✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
|
2 | vectorFromEigenArray<pointX_list_t, t_pointX_t>(points); |
366 | t_time_t time_points_list = | ||
367 |
1/2✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
|
2 | vectorFromEigenVector<time_waypoints_t, t_time_t>(time_points); |
368 | return piecewise_t::convert_discrete_points_to_polynomial<polynomial_t>( | ||
369 |
4/6✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✓ Branch 8 taken 1 times.
|
5 | points_list, time_points_list); |
370 | 3 | } | |
371 | 2 | static piecewise_t discretPointToPolynomialC1( | |
372 | const pointX_list_t& points, const pointX_list_t& points_derivative, | ||
373 | const time_waypoints_t& time_points) { | ||
374 | t_pointX_t points_list = | ||
375 |
1/2✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
|
2 | vectorFromEigenArray<pointX_list_t, t_pointX_t>(points); |
376 | t_pointX_t points_derivative_list = | ||
377 |
1/2✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
|
2 | vectorFromEigenArray<pointX_list_t, t_pointX_t>(points_derivative); |
378 | t_time_t time_points_list = | ||
379 |
1/2✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
|
2 | vectorFromEigenVector<time_waypoints_t, t_time_t>(time_points); |
380 | return piecewise_t::convert_discrete_points_to_polynomial<polynomial_t>( | ||
381 |
5/8✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 2 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✓ Branch 11 taken 1 times.
|
6 | points_list, points_derivative_list, time_points_list); |
382 | 4 | } | |
383 | 2 | static piecewise_t discretPointToPolynomialC2( | |
384 | const pointX_list_t& points, const pointX_list_t& points_derivative, | ||
385 | const pointX_list_t& points_second_derivative, | ||
386 | const time_waypoints_t& time_points) { | ||
387 | t_pointX_t points_list = | ||
388 |
1/2✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
|
2 | vectorFromEigenArray<pointX_list_t, t_pointX_t>(points); |
389 | t_pointX_t points_derivative_list = | ||
390 |
1/2✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
|
2 | vectorFromEigenArray<pointX_list_t, t_pointX_t>(points_derivative); |
391 | t_pointX_t points_second_derivative_list = | ||
392 |
1/2✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
|
2 | vectorFromEigenArray<pointX_list_t, t_pointX_t>(points_second_derivative); |
393 | |||
394 | t_time_t time_points_list = | ||
395 |
1/2✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
|
2 | vectorFromEigenVector<time_waypoints_t, t_time_t>(time_points); |
396 | return piecewise_t::convert_discrete_points_to_polynomial<polynomial_t>( | ||
397 | points_list, points_derivative_list, points_second_derivative_list, | ||
398 |
6/10✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 2 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 2 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✓ Branch 14 taken 1 times.
|
7 | time_points_list); |
399 | 5 | } | |
400 | |||
401 | ✗ | static piecewise_t load_piecewise_from_text_file(const std::string& filename, | |
402 | const real dt, | ||
403 | const std::size_t dim) { | ||
404 | return piecewise_t::load_piecewise_from_text_file<polynomial_t>(filename, dt, | ||
405 | ✗ | dim); | |
406 | } | ||
407 | |||
408 | 3 | void addFinalPointC0(piecewise_t& self, const pointX_t& end, const real time) { | |
409 |
2/2✓ Branch 1 taken 1 times.
✓ Branch 2 taken 2 times.
|
3 | if (self.num_curves() == 0) |
410 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | throw std::runtime_error( |
411 | "Piecewise append : you need to add at least one curve before using " | ||
412 | 2 | "append(finalPoint) method."); | |
413 |
4/8✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
✗ Branch 6 not taken.
✓ Branch 7 taken 2 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 2 times.
|
2 | if (self.is_continuous(1) && self.num_curves() > 1) |
414 | std::cout << "Warning: by adding this final point to the piecewise curve, " | ||
415 | "you loose C1 continuity and only " | ||
416 | ✗ | "guarantee C0 continuity." | |
417 | ✗ | << std::endl; | |
418 |
7/12✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 2 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 2 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✓ Branch 14 taken 1 times.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
|
3 | curve_ptr_t pol(new polynomial_t(self(self.max()), end, self.max(), time)); |
419 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | self.add_curve_ptr(pol); |
420 | 1 | } | |
421 | ✗ | void addFinalPointC1(piecewise_t& self, const pointX_t& end, | |
422 | const pointX_t& d_end, const real time) { | ||
423 | ✗ | if (self.num_curves() == 0) | |
424 | ✗ | throw std::runtime_error( | |
425 | "Piecewise append : you need to add at least one curve before using " | ||
426 | ✗ | "append(finalPoint) method."); | |
427 | ✗ | if (self.is_continuous(2) && self.num_curves() > 1) | |
428 | std::cout << "Warning: by adding this final point to the piecewise curve, " | ||
429 | "you loose C2 continuity and only " | ||
430 | ✗ | "guarantee C1 continuity." | |
431 | ✗ | << std::endl; | |
432 | ✗ | if (!self.is_continuous(1)) | |
433 | ✗ | std::cout << "Warning: the current piecewise curve is not C1 continuous." | |
434 | ✗ | << std::endl; | |
435 | ✗ | curve_ptr_t pol(new polynomial_t(self(self.max()), | |
436 | ✗ | self.derivate(self.max(), 1), end, d_end, | |
437 | ✗ | self.max(), time)); | |
438 | ✗ | self.add_curve_ptr(pol); | |
439 | } | ||
440 | ✗ | void addFinalPointC2(piecewise_t& self, const pointX_t& end, | |
441 | const pointX_t& d_end, const pointX_t& dd_end, | ||
442 | const real time) { | ||
443 | ✗ | if (self.num_curves() == 0) | |
444 | ✗ | throw std::runtime_error( | |
445 | "Piecewise append : you need to add at least one curve before using " | ||
446 | ✗ | "append(finalPoint) method."); | |
447 | ✗ | if (self.is_continuous(3) && self.num_curves() > 1) | |
448 | std::cout << "Warning: by adding this final point to the piecewise curve, " | ||
449 | "you loose C3 continuity and only " | ||
450 | ✗ | "guarantee C2 continuity." | |
451 | ✗ | << std::endl; | |
452 | ✗ | if (!self.is_continuous(2)) | |
453 | ✗ | std::cout << "Warning: the current piecewise curve is not C2 continuous." | |
454 | ✗ | << std::endl; | |
455 | curve_ptr_t pol(new polynomial_t( | ||
456 | ✗ | self(self.max()), self.derivate(self.max(), 1), | |
457 | ✗ | self.derivate(self.max(), 2), end, d_end, dd_end, self.max(), time)); | |
458 | ✗ | self.add_curve_ptr(pol); | |
459 | } | ||
460 | |||
461 | /* end wrap piecewise polynomial curve */ | ||
462 | |||
463 | /* Wrap piecewise3 curve */ | ||
464 | ✗ | piecewise3_t* wrapPiecewise3CurveConstructor( | |
465 | const curve_translation_ptr_t& curve) { | ||
466 | ✗ | return new piecewise3_t(curve); | |
467 | } | ||
468 | ✗ | piecewise3_t* wrapPiecewise3PolynomialCurveEmptyConstructor() { | |
469 | ✗ | return new piecewise3_t(); | |
470 | } | ||
471 | ✗ | piecewise_SE3_t* wrapPiecewise3SE3Constructor(const curve_SE3_ptr_t& curve) { | |
472 | ✗ | return new piecewise_SE3_t(curve); | |
473 | } | ||
474 | ✗ | piecewise_SE3_t* wrapPiecewise3SE3EmptyConstructor() { | |
475 | ✗ | return new piecewise_SE3_t(); | |
476 | } | ||
477 | |||
478 | typedef bezier3_t::piecewise_curve_t piecewise_bezier3_t; | ||
479 | ✗ | piecewise_bezier3_t* wrapPiecewise3BezierConstructor( | |
480 | const bezier3_t::bezier_curve_ptr_t& curve) { | ||
481 | ✗ | return new piecewise_bezier3_t(curve); | |
482 | } | ||
483 | ✗ | piecewise_bezier3_t* wrapPiecewise3BezierEmptyConstructor() { | |
484 | ✗ | return new piecewise_bezier3_t(); | |
485 | } | ||
486 | typedef bezier_linear_variable_t::piecewise_curve_t piecewise_linear_bezier_t; | ||
487 | ✗ | piecewise_linear_bezier_t* wrapPiecewise3BezierLinearConstructor( | |
488 | const bezier_linear_variable_t::bezier_curve_ptr_t& curve) { | ||
489 | ✗ | return new piecewise_linear_bezier_t(curve); | |
490 | } | ||
491 | ✗ | piecewise_linear_bezier_t* wrapPiecewise3BezierLinearEmptyConstructor() { | |
492 | ✗ | return new piecewise_linear_bezier_t(); | |
493 | } | ||
494 | |||
495 | 1 | static piecewise3_t discretPointsToPolynomial3C0( | |
496 | const pointX_list_t& points, const time_waypoints_t& time_points) { | ||
497 | t_point3_t points_list = | ||
498 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | vectorFromEigenArray<pointX_list_t, t_point3_t>(points); |
499 | t_time_t time_points_list = | ||
500 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | vectorFromEigenVector<time_waypoints_t, t_time_t>(time_points); |
501 | return piecewise3_t::convert_discrete_points_to_polynomial<polynomial3_t>( | ||
502 |
3/6✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
|
2 | points_list, time_points_list); |
503 | 1 | } | |
504 | ✗ | static piecewise3_t discretPointsToPolynomial3C1( | |
505 | const pointX_list_t& points, const pointX_list_t& points_derivative, | ||
506 | const time_waypoints_t& time_points) { | ||
507 | t_point3_t points_list = | ||
508 | ✗ | vectorFromEigenArray<pointX_list_t, t_point3_t>(points); | |
509 | t_point3_t points_derivative_list = | ||
510 | ✗ | vectorFromEigenArray<pointX_list_t, t_point3_t>(points_derivative); | |
511 | t_time_t time_points_list = | ||
512 | ✗ | vectorFromEigenVector<time_waypoints_t, t_time_t>(time_points); | |
513 | return piecewise3_t::convert_discrete_points_to_polynomial<polynomial3_t>( | ||
514 | ✗ | points_list, points_derivative_list, time_points_list); | |
515 | } | ||
516 | ✗ | static piecewise3_t discretPointsToPolynomial3C2( | |
517 | const pointX_list_t& points, const pointX_list_t& points_derivative, | ||
518 | const pointX_list_t& points_second_derivative, | ||
519 | const time_waypoints_t& time_points) { | ||
520 | t_point3_t points_list = | ||
521 | ✗ | vectorFromEigenArray<pointX_list_t, t_point3_t>(points); | |
522 | t_point3_t points_derivative_list = | ||
523 | ✗ | vectorFromEigenArray<pointX_list_t, t_point3_t>(points_derivative); | |
524 | t_point3_t points_second_derivative_list = | ||
525 | ✗ | vectorFromEigenArray<pointX_list_t, t_point3_t>(points_second_derivative); | |
526 | |||
527 | t_time_t time_points_list = | ||
528 | ✗ | vectorFromEigenVector<time_waypoints_t, t_time_t>(time_points); | |
529 | return piecewise3_t::convert_discrete_points_to_polynomial<polynomial3_t>( | ||
530 | points_list, points_derivative_list, points_second_derivative_list, | ||
531 | ✗ | time_points_list); | |
532 | } | ||
533 | |||
534 | ✗ | static piecewise3_t load_piecewise3_from_text_file(const std::string& filename, | |
535 | const real dt, | ||
536 | const std::size_t dim) { | ||
537 | return piecewise3_t::load_piecewise_from_text_file<polynomial3_t>(filename, | ||
538 | ✗ | dt, dim); | |
539 | } | ||
540 | |||
541 | ✗ | void addFinalPoint3C0(piecewise3_t& self, const pointX_t& end, | |
542 | const real time) { | ||
543 | ✗ | if (self.num_curves() == 0) | |
544 | ✗ | throw std::runtime_error( | |
545 | "Piecewise append : you need to add at least one curve before using " | ||
546 | ✗ | "append(finalPoint) method."); | |
547 | ✗ | if (self.is_continuous(1) && self.num_curves() > 1) | |
548 | std::cout << "Warning: by adding this final point to the piecewise curve, " | ||
549 | "you loose C1 continuity and only " | ||
550 | ✗ | "guarantee C0 continuity." | |
551 | ✗ | << std::endl; | |
552 | curve_translation_ptr_t pol( | ||
553 | ✗ | new polynomial3_t(self(self.max()), end, self.max(), time)); | |
554 | ✗ | self.add_curve_ptr(pol); | |
555 | } | ||
556 | ✗ | void addFinalPoint3C1(piecewise3_t& self, const pointX_t& end, | |
557 | const pointX_t& d_end, const real time) { | ||
558 | ✗ | if (self.num_curves() == 0) | |
559 | ✗ | throw std::runtime_error( | |
560 | "Piecewise append : you need to add at least one curve before using " | ||
561 | ✗ | "append(finalPoint) method."); | |
562 | ✗ | if (self.is_continuous(2) && self.num_curves() > 1) | |
563 | std::cout << "Warning: by adding this final point to the piecewise curve, " | ||
564 | "you loose C2 continuity and only " | ||
565 | ✗ | "guarantee C1 continuity." | |
566 | ✗ | << std::endl; | |
567 | ✗ | if (!self.is_continuous(1)) | |
568 | ✗ | std::cout << "Warning: the current piecewise curve is not C1 continuous." | |
569 | ✗ | << std::endl; | |
570 | ✗ | curve_translation_ptr_t pol(new polynomial3_t(self(self.max()), | |
571 | ✗ | self.derivate(self.max(), 1), | |
572 | ✗ | end, d_end, self.max(), time)); | |
573 | ✗ | self.add_curve_ptr(pol); | |
574 | } | ||
575 | ✗ | void addFinalPoint3C2(piecewise3_t& self, const pointX_t& end, | |
576 | const pointX_t& d_end, const pointX_t& dd_end, | ||
577 | const real time) { | ||
578 | ✗ | if (self.num_curves() == 0) | |
579 | ✗ | throw std::runtime_error( | |
580 | "Piecewise append : you need to add at least one curve before using " | ||
581 | ✗ | "append(finalPoint) method."); | |
582 | ✗ | if (self.is_continuous(3) && self.num_curves() > 1) | |
583 | std::cout << "Warning: by adding this final point to the piecewise curve, " | ||
584 | "you loose C3 continuity and only " | ||
585 | ✗ | "guarantee C2 continuity." | |
586 | ✗ | << std::endl; | |
587 | ✗ | if (!self.is_continuous(2)) | |
588 | ✗ | std::cout << "Warning: the current piecewise curve is not C2 continuous." | |
589 | ✗ | << std::endl; | |
590 | curve_translation_ptr_t pol(new polynomial3_t( | ||
591 | ✗ | self(self.max()), self.derivate(self.max(), 1), | |
592 | ✗ | self.derivate(self.max(), 2), end, d_end, dd_end, self.max(), time)); | |
593 | ✗ | self.add_curve_ptr(pol); | |
594 | } | ||
595 | |||
596 | /* end wrap piecewise polynomial3 curve */ | ||
597 | |||
598 | /* Wrap exact cubic spline */ | ||
599 | 3 | t_waypoint_t getWayPoints(const coeff_t& array, | |
600 | const time_waypoints_t& time_wp) { | ||
601 | 3 | t_waypoint_t res; | |
602 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 2 taken 3 times.
|
9 | for (int i = 0; i < array.cols(); ++i) { |
603 |
5/10✓ Branch 1 taken 6 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 6 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 6 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 6 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 6 times.
✗ Branch 14 not taken.
|
6 | res.push_back(std::make_pair(time_wp(i), array.col(i))); |
604 | } | ||
605 | 3 | return res; | |
606 | } | ||
607 | |||
608 | 2 | exact_cubic_t* wrapExactCubicConstructor(const coeff_t& array, | |
609 | const time_waypoints_t& time_wp) { | ||
610 |
1/2✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
|
2 | t_waypoint_t wps = getWayPoints(array, time_wp); |
611 |
2/4✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
|
4 | return new exact_cubic_t(wps.begin(), wps.end()); |
612 | 2 | } | |
613 | |||
614 | 1 | exact_cubic_t* wrapExactCubicConstructorConstraint( | |
615 | const coeff_t& array, const time_waypoints_t& time_wp, | ||
616 | const curve_constraints_t& constraints) { | ||
617 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | t_waypoint_t wps = getWayPoints(array, time_wp); |
618 |
2/4✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
|
2 | return new exact_cubic_t(wps.begin(), wps.end(), constraints); |
619 | 1 | } | |
620 | |||
621 | /// For constraints XD | ||
622 | 4 | pointX_t get_init_vel(const curve_constraints_t& c) { return c.init_vel; } | |
623 | |||
624 | 1 | pointX_t get_init_acc(const curve_constraints_t& c) { return c.init_acc; } | |
625 | |||
626 | ✗ | pointX_t get_init_jerk(const curve_constraints_t& c) { return c.init_jerk; } | |
627 | |||
628 | 1 | pointX_t get_end_vel(const curve_constraints_t& c) { return c.end_vel; } | |
629 | |||
630 | 3 | pointX_t get_end_acc(const curve_constraints_t& c) { return c.end_acc; } | |
631 | |||
632 | ✗ | pointX_t get_end_jerk(const curve_constraints_t& c) { return c.end_jerk; } | |
633 | |||
634 | 9 | void set_init_vel(curve_constraints_t& c, const pointX_t& val) { | |
635 | 9 | c.init_vel = val; | |
636 | 9 | } | |
637 | |||
638 | 8 | void set_init_acc(curve_constraints_t& c, const pointX_t& val) { | |
639 | 8 | c.init_acc = val; | |
640 | 8 | } | |
641 | |||
642 | 3 | void set_init_jerk(curve_constraints_t& c, const pointX_t& val) { | |
643 | 3 | c.init_jerk = val; | |
644 | 3 | } | |
645 | |||
646 | 8 | void set_end_vel(curve_constraints_t& c, const pointX_t& val) { | |
647 | 8 | c.end_vel = val; | |
648 | 8 | } | |
649 | |||
650 | 8 | void set_end_acc(curve_constraints_t& c, const pointX_t& val) { | |
651 | 8 | c.end_acc = val; | |
652 | 8 | } | |
653 | |||
654 | 3 | void set_end_jerk(curve_constraints_t& c, const pointX_t& val) { | |
655 | 3 | c.end_jerk = val; | |
656 | 3 | } | |
657 | |||
658 | ✗ | bezier_t* bezier_t_compute_primitive_init(const bezier_t* b, | |
659 | const std::size_t order, | ||
660 | const bezier_t::point_t& init) { | ||
661 | ✗ | return new bezier_t(b->compute_primitive(order, init)); | |
662 | } | ||
663 | 4 | bezier_t* bezier_t_compute_primitive_zero(const bezier_t* b, | |
664 | const std::size_t order) { | ||
665 |
1/2✓ Branch 2 taken 4 times.
✗ Branch 3 not taken.
|
4 | return new bezier_t(b->compute_primitive(order)); |
666 | } | ||
667 | |||
668 | ✗ | bezier3_t* bezier3_t_compute_primitive_init(const bezier3_t* b, | |
669 | const std::size_t order, | ||
670 | const bezier3_t::point_t& init) { | ||
671 | ✗ | return new bezier3_t(b->compute_primitive(order, init)); | |
672 | } | ||
673 | 4 | bezier3_t* bezier3_t_compute_primitive_zero(const bezier3_t* b, | |
674 | const std::size_t order) { | ||
675 |
1/2✓ Branch 2 taken 4 times.
✗ Branch 3 not taken.
|
4 | return new bezier3_t(b->compute_primitive(order)); |
676 | } | ||
677 | |||
678 | ✗ | bezier_linear_variable_t* bezier_linear_variable_t_compute_primitive_init( | |
679 | const bezier_linear_variable_t* b, const std::size_t order, | ||
680 | const bezier_linear_variable_t::point_t* init) { | ||
681 | ✗ | return new bezier_linear_variable_t(b->compute_primitive(order, *init)); | |
682 | } | ||
683 | ✗ | bezier_linear_variable_t* bezier_linear_variable_t_compute_primitive_zero( | |
684 | const bezier_linear_variable_t* b, const std::size_t order) { | ||
685 | ✗ | return new bezier_linear_variable_t(b->compute_primitive(order)); | |
686 | } | ||
687 | |||
688 | 8 | bezier_t* bezier_linear_variable_t_evaluate(const bezier_linear_variable_t* b, | |
689 | const pointX_t& x) { | ||
690 | return new bezier_t( | ||
691 |
2/4✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
8 | evaluateLinear<bezier_t, bezier_linear_variable_t>(*b, x)); |
692 | } | ||
693 | |||
694 | bezier_t::piecewise_curve_t (bezier_t::*splitspe)( | ||
695 | const bezier_t::vector_x_t&) const = &bezier_t::split; | ||
696 | bezier_linear_variable_t::piecewise_curve_t ( | ||
697 | bezier_linear_variable_t::*split_py)( | ||
698 | const bezier_linear_variable_t::vector_x_t&) const = | ||
699 | &bezier_linear_variable_t::split; | ||
700 | |||
701 | /* End wrap exact cubic spline */ | ||
702 | |||
703 | /* Wrap SO3Linear */ | ||
704 | 1 | SO3Linear_t* wrapSO3LinearConstructorFromQuaternion( | |
705 | const quaternion_t& init_rot, const quaternion_t& end_rot, const real min, | ||
706 | const real max) { | ||
707 |
1/2✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
|
1 | return new SO3Linear_t(init_rot, end_rot, min, max); |
708 | } | ||
709 | |||
710 | 9 | SO3Linear_t* wrapSO3LinearConstructorFromMatrix(const matrix3_t& init_rot, | |
711 | const matrix3_t& end_rot, | ||
712 | const real min, | ||
713 | const real max) { | ||
714 |
2/2✓ Branch 2 taken 8 times.
✓ Branch 3 taken 1 times.
|
9 | return new SO3Linear_t(init_rot, end_rot, min, max); |
715 | } | ||
716 | |||
717 | /* End wrap SO3Linear */ | ||
718 | |||
719 | /* Wrap SE3Curves */ | ||
720 | |||
721 | 6452 | matrix4_t se3Return(const curve_SE3_t& curve, const real t) { | |
722 |
1/2✓ Branch 3 taken 6446 times.
✗ Branch 4 not taken.
|
12898 | return curve(t).matrix(); |
723 | } | ||
724 | |||
725 | 12 | matrix3_t se3returnRotation(const curve_SE3_t& curve, const real t) { | |
726 |
1/2✓ Branch 2 taken 12 times.
✗ Branch 3 not taken.
|
24 | return curve(t).rotation(); |
727 | } | ||
728 | |||
729 | 15 | pointX_t se3returnTranslation(const curve_SE3_t& curve, const real t) { | |
730 |
2/4✓ Branch 2 taken 15 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 15 times.
✗ Branch 6 not taken.
|
30 | return pointX_t(curve(t).translation()); |
731 | } | ||
732 | |||
733 | 6 | SE3Curve_t* wrapSE3CurveFromTransform(const matrix4_t& init_pose, | |
734 | const matrix4_t& end_pose, const real min, | ||
735 | const real max) { | ||
736 |
1/2✓ Branch 2 taken 6 times.
✗ Branch 3 not taken.
|
7 | return new SE3Curve_t(transform_t(init_pose), transform_t(end_pose), min, |
737 |
3/4✓ Branch 1 taken 6 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 5 times.
✓ Branch 5 taken 1 times.
|
6 | max); |
738 | } | ||
739 | |||
740 | 1 | SE3Curve_t* wrapSE3CurveFromPosAndRotation(const pointX_t& init_pos, | |
741 | const pointX_t& end_pos, | ||
742 | const matrix3_t& init_rot, | ||
743 | const matrix3_t& end_rot, | ||
744 | const real& t_min, | ||
745 | const real& t_max) { | ||
746 |
3/6✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
|
1 | return new SE3Curve_t(init_pos, end_pos, init_rot, end_rot, t_min, t_max); |
747 | } | ||
748 | |||
749 | 8 | SE3Curve_t* wrapSE3CurveFromBezier3Translation(bezier3_t& translation_curve, | |
750 | const matrix3_t& init_rot, | ||
751 | const matrix3_t& end_rot) { | ||
752 | std::shared_ptr<bezier3_t> translation = std::make_shared<bezier3_t>( | ||
753 | 8 | translation_curve.waypoints().begin(), | |
754 | 8 | translation_curve.waypoints().end(), translation_curve.min(), | |
755 |
3/6✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 8 times.
✗ Branch 8 not taken.
|
16 | translation_curve.max()); |
756 |
2/4✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
16 | return new SE3Curve_t(translation, init_rot, end_rot); |
757 | 8 | } | |
758 | |||
759 | 1 | SE3Curve_t* wrapSE3CurveFromTranslation( | |
760 | const curve_translation_ptr_t& translation_curve, const matrix3_t& init_rot, | ||
761 | const matrix3_t& end_rot) { | ||
762 |
2/4✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
|
1 | return new SE3Curve_t(translation_curve, init_rot, end_rot); |
763 | } | ||
764 | |||
765 | 6 | SE3Curve_t* wrapSE3CurveFromTwoCurves( | |
766 | const curve_translation_ptr_t& translation_curve, | ||
767 | const curve_rotation_ptr_t& rotation_curve) { | ||
768 |
3/4✓ Branch 3 taken 6 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 2 times.
✓ Branch 7 taken 4 times.
|
14 | return new SE3Curve_t(translation_curve, rotation_curve); |
769 | } | ||
770 | |||
771 | #ifdef CURVES_WITH_PINOCCHIO_SUPPORT | ||
772 | typedef pinocchio::SE3Tpl<real, 0> SE3_t; | ||
773 | typedef pinocchio::MotionTpl<real, 0> Motion_t; | ||
774 | |||
775 | 3 | SE3Curve_t* wrapSE3CurveFromSE3Pinocchio(const SE3_t& init_pose, | |
776 | const SE3_t& end_pose, const real min, | ||
777 | const real max) { | ||
778 |
1/2✓ Branch 2 taken 3 times.
✗ Branch 3 not taken.
|
3 | return new SE3Curve_t(transform_t(init_pose.toHomogeneousMatrix()), |
779 |
4/8✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 3 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 3 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 3 times.
✗ Branch 11 not taken.
|
3 | transform_t(end_pose.toHomogeneousMatrix()), min, max); |
780 | } | ||
781 | |||
782 | 306 | SE3_t se3ReturnPinocchio(const curve_SE3_t& curve, const real t) { | |
783 |
1/2✓ Branch 3 taken 306 times.
✗ Branch 4 not taken.
|
612 | return SE3_t(curve(t).matrix()); |
784 | } | ||
785 | |||
786 | 297 | Motion_t se3ReturnDerivatePinocchio(const curve_SE3_t& curve, const real t, | |
787 | const std::size_t order) { | ||
788 |
1/2✓ Branch 2 taken 297 times.
✗ Branch 3 not taken.
|
594 | return Motion_t(curve.derivate(t, order)); |
789 | } | ||
790 | #endif // CURVES_WITH_PINOCCHIO_SUPPORT | ||
791 | /* End wrap SE3Curves */ | ||
792 | |||
793 | /* Wrap piecewiseSE3Curves */ | ||
794 | #ifdef CURVES_WITH_PINOCCHIO_SUPPORT | ||
795 | typedef pinocchio::SE3Tpl<real, 0> SE3_t; | ||
796 | typedef pinocchio::MotionTpl<real, 0> Motion_t; | ||
797 | |||
798 | 2 | void addFinalSE3(piecewise_SE3_t& self, const SE3_t& end, const real time) { | |
799 |
2/2✓ Branch 1 taken 1 times.
✓ Branch 2 taken 1 times.
|
2 | if (self.num_curves() == 0) |
800 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | throw std::runtime_error( |
801 | "Piecewise append : you need to add at least one curve before using " | ||
802 | 2 | "append(finalPoint) method."); | |
803 |
3/8✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✓ Branch 9 taken 1 times.
|
1 | if (self.is_continuous(1) && self.num_curves() > 1) |
804 | std::cout << "Warning: by adding this final transform to the piecewise " | ||
805 | "curve, you loose C1 continuity and only " | ||
806 | ✗ | "guarantee C0 continuity." | |
807 | ✗ | << std::endl; | |
808 |
3/6✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
|
1 | SE3Curve_t curve(self(self.max()), transform_t(end.toHomogeneousMatrix()), |
809 |
3/6✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
|
2 | self.max(), time); |
810 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | self.add_curve(curve); |
811 | 1 | } | |
812 | |||
813 | #endif // CURVES_WITH_PINOCCHIO_SUPPORT | ||
814 | |||
815 | 1 | void addFinalTransform(piecewise_SE3_t& self, const matrix4_t& end, | |
816 | const real time) { | ||
817 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
|
1 | if (self.num_curves() == 0) |
818 | ✗ | throw std::runtime_error( | |
819 | "Piecewise append : you need to add at least one curve before using " | ||
820 | ✗ | "append(finalPoint) method."); | |
821 |
4/8✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
✗ Branch 6 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 1 times.
|
1 | if (self.is_continuous(1) && self.num_curves() > 1) |
822 | std::cout << "Warning: by adding this final transform to the piecewise " | ||
823 | "curve, you loose C1 continuity and only " | ||
824 | ✗ | "guarantee C0 continuity." | |
825 | ✗ | << std::endl; | |
826 |
5/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
|
1 | SE3Curve_t curve(self(self.max()), transform_t(end), self.max(), time); |
827 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | self.add_curve(curve); |
828 | 1 | } | |
829 | |||
830 | /* End wrap piecewiseSE3Curves */ | ||
831 | |||
832 | /* Wrap constant */ | ||
833 | 12 | constant_t* wrapConstantConstructorTime(const pointX_t& value, const real min, | |
834 | const real max) { | ||
835 |
2/2✓ Branch 2 taken 10 times.
✓ Branch 3 taken 2 times.
|
12 | return new constant_t(value, min, max); |
836 | } | ||
837 | 1 | constant_t* wrapConstantConstructor(const pointX_t& value) { | |
838 |
1/2✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
|
1 | return new constant_t(value); |
839 | } | ||
840 | /* End wrap constant */ | ||
841 | /* Wrap constant 3*/ | ||
842 | 2 | constant3_t* wrapConstant3ConstructorTime(const pointX_t& value, const real min, | |
843 | const real max) { | ||
844 |
2/4✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
|
2 | return new constant3_t(value, min, max); |
845 | } | ||
846 | 1 | constant3_t* wrapConstant3Constructor(const pointX_t& value) { | |
847 |
2/4✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
|
1 | return new constant3_t(value); |
848 | } | ||
849 | /* End wrap constant 3*/ | ||
850 | /* Wrap sinusoidal */ | ||
851 | 12 | sinusoidal_t* wrapSinusoidalConstructorTime(const pointX_t& p0, | |
852 | const pointX_t& amplitude, | ||
853 | const real T, const real phi, | ||
854 | const real min, const real max) { | ||
855 |
2/2✓ Branch 2 taken 11 times.
✓ Branch 3 taken 1 times.
|
12 | return new sinusoidal_t(p0, amplitude, T, phi, min, max); |
856 | } | ||
857 | 3 | sinusoidal_t* wrapSinusoidalConstructor(const pointX_t& p0, | |
858 | const pointX_t& amplitude, const real T, | ||
859 | const real phi) { | ||
860 |
1/2✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
|
3 | return new sinusoidal_t(p0, amplitude, T, phi); |
861 | } | ||
862 | 1 | sinusoidal_t* wrapSinusoidalConstructorStationaryTime(const real time_traj, | |
863 | const pointX_t& p_init, | ||
864 | const pointX_t& p_final, | ||
865 | const real min, | ||
866 | const real max) { | ||
867 |
1/2✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
|
1 | return new sinusoidal_t(time_traj, p_init, p_final, min, max); |
868 | } | ||
869 | 1 | sinusoidal_t* wrapSinusoidalConstructorStationary(const real time_traj, | |
870 | const pointX_t& p_init, | ||
871 | const pointX_t& p_final) { | ||
872 |
1/2✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
|
1 | return new sinusoidal_t(time_traj, p_init, p_final); |
873 | } | ||
874 | /* End wrap sinusoidal */ | ||
875 | // TO DO : Replace all load and save function for serialization in class by | ||
876 | // using | ||
877 | // SerializableVisitor in archive_python_binding. | ||
878 |
2/4✓ Branch 0 taken 8 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 8 times.
✗ Branch 4 not taken.
|
32 | BOOST_PYTHON_MODULE(ndcurves) { |
879 | /** BEGIN eigenpy init**/ | ||
880 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | eigenpy::enableEigenPy(); |
881 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | ENABLE_SPECIFIC_MATRIX_TYPE(pointX_t); |
882 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | ENABLE_SPECIFIC_MATRIX_TYPE(point3_t); |
883 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | ENABLE_SPECIFIC_MATRIX_TYPE(point6_t); |
884 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | ENABLE_SPECIFIC_MATRIX_TYPE(pointX_list_t); |
885 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | ENABLE_SPECIFIC_MATRIX_TYPE(coeff_t); |
886 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | ENABLE_SPECIFIC_MATRIX_TYPE(matrix3_t); |
887 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | ENABLE_SPECIFIC_MATRIX_TYPE(matrix4_t); |
888 | // ENABLE_SPECIFIC_MATRIX_TYPE(quaternion_t); | ||
889 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | eigenpy::exposeQuaternion(); |
890 | /*eigenpy::exposeAngleAxis(); | ||
891 | eigenpy::exposeQuaternion();*/ | ||
892 | /** END eigenpy init**/ | ||
893 | /** Expose base abstracts class for each dimension/type : **/ | ||
894 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | class_<curve_abc_t, boost::noncopyable, std::shared_ptr<curve_abc_callback>>( |
895 | "curve") | ||
896 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("__call__", &curve_abc_t::operator(), |
897 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | "Evaluate the curve at the given time.", args("self", "t")) |
898 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("derivate", &curve_abc_t::derivate, |
899 | "Evaluate the derivative of order N of curve at time t.", | ||
900 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("self", "t", "N")) |
901 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("isEquivalent", &curve_abc_t::isEquivalent, |
902 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | curve_abc_t_isEquivalent_overloads( |
903 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | (bp::arg("other"), |
904 |
3/6✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 8 times.
✗ Branch 9 not taken.
|
32 | bp::arg("prec") = Eigen::NumTraits<double>::dummy_precision(), |
905 |
3/6✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 8 times.
✗ Branch 8 not taken.
|
32 | bp::arg("order") = 5), |
906 | "isEquivalent check if self and other are approximately equal " | ||
907 | "by values, given a precision threshold.")) | ||
908 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("compute_derivate", &curve_abc_t::compute_derivate_ptr, |
909 | ✗ | return_value_policy<manage_new_object>(), | |
910 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | "Return the derivative of *this at the order N.", args("self", "N")) |
911 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("min", &curve_abc_t::min, |
912 | "Get the LOWER bound on interval definition of the curve.") | ||
913 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("max", &curve_abc_t::max, |
914 | "Get the HIGHER bound on interval definition of the curve.") | ||
915 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("dim", &curve_abc_t::dim, "Get the dimension of the curve.") |
916 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("degree", &curve_abc_t::degree, |
917 | "Get the degree of the representation of the curve (if applicable).") | ||
918 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
16 | .def("saveAsText", pure_virtual(&curve_abc_t::saveAsText<curve_abc_t>), |
919 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | bp::args("filename"), "Saves *this inside a text file.") |
920 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
16 | .def("loadFromText", |
921 | pure_virtual(&curve_abc_t::loadFromText<curve_abc_t>), | ||
922 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | bp::args("filename"), "Loads *this from a text file.") |
923 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
16 | .def("saveAsXML", pure_virtual(&curve_abc_t::saveAsXML<curve_abc_t>), |
924 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | bp::args("filename", "tag_name"), "Saves *this inside a XML file.") |
925 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
16 | .def("loadFromXML", pure_virtual(&curve_abc_t::loadFromXML<curve_abc_t>), |
926 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | bp::args("filename", "tag_name"), "Loads *this from a XML file.") |
927 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
16 | .def("saveAsBinary", |
928 | pure_virtual(&curve_abc_t::saveAsBinary<curve_abc_t>), | ||
929 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | bp::args("filename"), "Saves *this inside a binary file.") |
930 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
16 | .def("loadFromBinary", |
931 | pure_virtual(&curve_abc_t::loadFromBinary<curve_abc_t>), | ||
932 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | bp::args("filename"), "Loads *this from a binary file.") |
933 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def_pickle(curve_pickle_suite<curve_abc_t>()); |
934 | |||
935 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | class_<curve_3_t, boost::noncopyable, bases<curve_abc_t>, |
936 | std::shared_ptr<curve_3_callback>>("curve3") | ||
937 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("__call__", &curve_3_t::operator(), |
938 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | "Evaluate the curve at the given time.", args("self", "t")) |
939 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("derivate", &curve_3_t::derivate, |
940 | "Evaluate the derivative of order N of curve at time t.", | ||
941 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("self", "t", "N")) |
942 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("isEquivalent", &curve_3_t::isEquivalent, |
943 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | curve_3_t_isEquivalent_overloads( |
944 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | (bp::arg("other"), |
945 |
3/6✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 8 times.
✗ Branch 9 not taken.
|
32 | bp::arg("prec") = Eigen::NumTraits<double>::dummy_precision(), |
946 |
3/6✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 8 times.
✗ Branch 8 not taken.
|
32 | bp::arg("order") = 5), |
947 | "isEquivalent check if self and other are approximately equal " | ||
948 | "by values, given a precision threshold.")) | ||
949 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("compute_derivate", &curve_3_t::compute_derivate_ptr, |
950 | ✗ | return_value_policy<manage_new_object>(), | |
951 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | "Return the derivative of *this at the order N.", args("self", "N")) |
952 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("min", &curve_3_t::min, |
953 | "Get the LOWER bound on interval definition of the curve.") | ||
954 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("max", &curve_3_t::max, |
955 | "Get the HIGHER bound on interval definition of the curve.") | ||
956 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("dim", &curve_3_t::dim, "Get the dimension of the curve.") |
957 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("degree", &curve_3_t::degree, |
958 | "Get the degree of the representation of the curve (if applicable).") | ||
959 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def_pickle(curve_pickle_suite<curve_3_t>()); |
960 | |||
961 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | class_<curve_rotation_t, boost::noncopyable, bases<curve_abc_t>, |
962 | std::shared_ptr<curve_rotation_callback>>("curve_rotation") | ||
963 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("__call__", &curve_rotation_t::operator(), |
964 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | "Evaluate the curve at the given time.", args("self", "t")) |
965 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("derivate", &curve_rotation_t::derivate, |
966 | "Evaluate the derivative of order N of curve at time t.", | ||
967 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("self", "t", "N")) |
968 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("isEquivalent", &curve_rotation_t::isEquivalent, |
969 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | curve_rotation_t_isEquivalent_overloads( |
970 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | (bp::arg("other"), |
971 |
3/6✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 8 times.
✗ Branch 9 not taken.
|
32 | bp::arg("prec") = Eigen::NumTraits<double>::dummy_precision(), |
972 |
3/6✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 8 times.
✗ Branch 8 not taken.
|
32 | bp::arg("order") = 5), |
973 | "isEquivalent check if self and other are approximately equal " | ||
974 | "by values, given a precision threshold.")) | ||
975 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("compute_derivate", &curve_rotation_t::compute_derivate_ptr, |
976 | ✗ | return_value_policy<manage_new_object>(), | |
977 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | "Return the derivative of *this at the order N.", args("self", "N")) |
978 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("min", &curve_rotation_t::min, |
979 | "Get the LOWER bound on interval definition of the curve.") | ||
980 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("max", &curve_rotation_t::max, |
981 | "Get the HIGHER bound on interval definition of the curve.") | ||
982 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("dim", &curve_rotation_t::dim, "Get the dimension of the curve.") |
983 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("degree", &curve_rotation_t::degree, |
984 | "Get the degree of the representation of the curve (if applicable).") | ||
985 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def_pickle(curve_pickle_suite<curve_rotation_t>()); |
986 | |||
987 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | class_<curve_SE3_t, boost::noncopyable, bases<curve_abc_t>, |
988 | std::shared_ptr<curve_SE3_callback>>("curve_SE3") | ||
989 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("__call__", &se3Return, |
990 | "Evaluate the curve at the given time. Return as an homogeneous " | ||
991 | "matrix.", | ||
992 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("self", "t")) |
993 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("derivate", &curve_SE3_t::derivate, |
994 | "Evaluate the derivative of order N of curve at time t. Return as a " | ||
995 | "vector 6.", | ||
996 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("self", "t", "N")) |
997 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("isEquivalent", &curve_SE3_t::isEquivalent, |
998 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | curve_SE3_t_isEquivalent_overloads( |
999 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | (bp::arg("other"), |
1000 |
3/6✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 8 times.
✗ Branch 9 not taken.
|
32 | bp::arg("prec") = Eigen::NumTraits<double>::dummy_precision(), |
1001 |
3/6✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 8 times.
✗ Branch 8 not taken.
|
32 | bp::arg("order") = 5), |
1002 | "isEquivalent check if self and other are approximately equal " | ||
1003 | "by values, given a precision threshold.")) | ||
1004 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("compute_derivate", &curve_SE3_t::compute_derivate_ptr, |
1005 | ✗ | return_value_policy<manage_new_object>(), | |
1006 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | "Return the derivative of *this at the order N.", args("self", "N")) |
1007 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("min", &curve_SE3_t::min, |
1008 | "Get the LOWER bound on interval definition of the curve.") | ||
1009 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("max", &curve_SE3_t::max, |
1010 | "Get the HIGHER bound on interval definition of the curve.") | ||
1011 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("dim", &curve_SE3_t::dim, "Get the dimension of the curve.") |
1012 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("rotation", &se3returnRotation, |
1013 | "Output the rotation (as a 3x3 matrix) at the given time.", | ||
1014 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("self", "time")) |
1015 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("translation", &se3returnTranslation, |
1016 | "Output the rotation (as a vector 3) at the given time.", | ||
1017 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("self", "time")) |
1018 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def_pickle(curve_pickle_suite<curve_SE3_t>()) |
1019 | #ifdef CURVES_WITH_PINOCCHIO_SUPPORT | ||
1020 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("evaluateAsSE3", &se3ReturnPinocchio, |
1021 | "Evaluate the curve at the given time. Return as a pinocchio.SE3 " | ||
1022 | "object", | ||
1023 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("self", "t")) |
1024 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("derivateAsMotion", &se3ReturnDerivatePinocchio, |
1025 | "Evaluate the derivative of order N of curve at time t. Return as a " | ||
1026 | "pinocchio.Motion", | ||
1027 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("self", "t", "N")) |
1028 | #endif // CURVES_WITH_PINOCCHIO_SUPPORT | ||
1029 | ; | ||
1030 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | register_ptr_to_python<curve_ptr_t>(); |
1031 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | register_ptr_to_python<curve3_ptr_t>(); |
1032 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | register_ptr_to_python<curve_translation_ptr_t>(); |
1033 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | register_ptr_to_python<curve_rotation_ptr_t>(); |
1034 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | register_ptr_to_python<curve_SE3_ptr_t>(); |
1035 | /** END base abstracts class for each dimension/type : **/ | ||
1036 | |||
1037 | /** BEGIN bezier3 curve**/ | ||
1038 | 16 | bezier3_t (bezier3_t::*cross_bez3)(const bezier3_t&) const = | |
1039 | &bezier3_t::cross; | ||
1040 | 16 | bezier3_t (bezier3_t::*cross_pointBez3)(const bezier3_t::point_t&) const = | |
1041 | &bezier3_t::cross; | ||
1042 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | class_<bezier3_t, bases<curve_3_t>, std::shared_ptr<bezier3_t>>("bezier3", |
1043 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | init<>()) |
1044 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
32 | .def("__init__", make_constructor(&wrapBezier3Constructor)) |
1045 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
32 | .def("__init__", make_constructor(&wrapBezier3ConstructorBounds)) |
1046 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
32 | .def("__init__", make_constructor(&wrapBezier3ConstructorConstraints)) |
1047 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("__init__", |
1048 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | make_constructor(&wrapBezier3ConstructorBoundsConstraints)) |
1049 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("compute_primitive", &bezier3_t_compute_primitive_init, |
1050 | ✗ | return_value_policy<manage_new_object>()) | |
1051 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("compute_primitive", &bezier3_t_compute_primitive_zero, |
1052 | ✗ | return_value_policy<manage_new_object>()) | |
1053 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("compute_derivate", &bezier3_t::compute_derivate_ptr, |
1054 | ✗ | return_value_policy<manage_new_object>()) | |
1055 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("waypointAtIndex", &bezier3_t::waypointAtIndex) |
1056 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("waypoints", &wrapBezier3Waypoints) |
1057 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
32 | .def("elevate", &bezier3_t::elevate, bp::args("order"), |
1058 | "Computes a Bezier curve of order degrees higher than the current " | ||
1059 | "curve, but strictly equivalent.") | ||
1060 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
32 | .def("elevateSelf", &bezier3_t::elevate_self, bp::args("order"), |
1061 | "Elevate the Bezier curve of order degrees higher than the current " | ||
1062 | "curve, but strictly equivalent.") | ||
1063 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def_readonly("degree", &bezier3_t::degree_) |
1064 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def_readonly("nbWaypoints", &bezier3_t::size_) |
1065 | 32 | .def("saveAsText", &bezier3_t::saveAsText<bezier3_t>, | |
1066 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | bp::args("filename"), "Saves *this inside a text file.") |
1067 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("loadFromText", &bezier3_t::loadFromText<bezier3_t>, |
1068 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | bp::args("filename"), "Loads *this from a text file.") |
1069 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("saveAsXML", &bezier3_t::saveAsXML<bezier3_t>, |
1070 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | bp::args("filename", "tag_name"), "Saves *this inside a XML file.") |
1071 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("loadFromXML", &bezier3_t::loadFromXML<bezier3_t>, |
1072 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | bp::args("filename", "tag_name"), "Loads *this from a XML file.") |
1073 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("saveAsBinary", &bezier3_t::saveAsBinary<bezier3_t>, |
1074 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | bp::args("filename"), "Saves *this inside a binary file.") |
1075 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("loadFromBinary", &bezier3_t::loadFromBinary<bezier3_t>, |
1076 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | bp::args("filename"), "Loads *this from a binary file.") |
1077 | //.def(SerializableVisitor<bezier_t>()) | ||
1078 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
16 | .def(bp::self == bp::self) |
1079 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(bp::self != bp::self) |
1080 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
32 | .def("cross", cross_bez3, bp::args("other"), |
1081 | "Compute the cross product of the current bezier by another bezier. " | ||
1082 | "The cross product p1Xp2 of 2 " | ||
1083 | "polynomials p1 and p2 is defined such that forall t, p1Xp2(t) = " | ||
1084 | "p1(t) X p2(t), with X designing the cross " | ||
1085 | "product. This method of course only makes sense for dimension 3 " | ||
1086 | "curves.") | ||
1087 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
32 | .def("cross", cross_pointBez3, bp::args("point"), |
1088 | "Compute the cross product PXpt of the current Bezier P by a point " | ||
1089 | "pt, such that for all t, PXpt(t) = P(t) " | ||
1090 | "X pt") | ||
1091 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(self *= double()) |
1092 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(self /= double()) |
1093 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
32 | .def(self + bezier3_t()) |
1094 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
32 | .def(self - bezier3_t()) |
1095 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
32 | .def(self += bezier3_t()) |
1096 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
32 | .def(self -= bezier3_t()) |
1097 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
16 | .def(self + bezier3_t::point_t()) |
1098 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
16 | .def(self - bezier3_t::point_t()) |
1099 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
16 | .def(self += bezier3_t::point_t()) |
1100 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
16 | .def(self -= bezier3_t::point_t()) |
1101 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(-self) |
1102 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(self * double()) |
1103 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(self / double()) |
1104 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def(CopyableVisitor<bezier3_t>()) |
1105 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def_pickle(curve_pickle_suite<bezier3_t>()); |
1106 | /** END bezier3 curve**/ | ||
1107 | /** BEGIN bezier curve**/ | ||
1108 | 16 | bezier_t (bezier_t::*cross_bez)(const bezier_t&) const = &bezier_t::cross; | |
1109 | 16 | bezier_t (bezier_t::*cross_pointBez)(const bezier_t::point_t&) const = | |
1110 | &bezier_t::cross; | ||
1111 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | class_<bezier_t, bases<curve_abc_t>, std::shared_ptr<bezier_t>>("bezier", |
1112 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | init<>()) |
1113 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
32 | .def("__init__", make_constructor(&wrapBezierConstructor)) |
1114 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
32 | .def("__init__", make_constructor(&wrapBezierConstructorBounds)) |
1115 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
32 | .def("__init__", make_constructor(&wrapBezierConstructorConstraints)) |
1116 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("__init__", |
1117 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | make_constructor(&wrapBezierConstructorBoundsConstraints)) |
1118 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("compute_primitive", &bezier_t_compute_primitive_init, |
1119 | ✗ | return_value_policy<manage_new_object>()) | |
1120 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("compute_primitive", &bezier_t_compute_primitive_zero, |
1121 | ✗ | return_value_policy<manage_new_object>()) | |
1122 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("compute_derivate", &bezier_t::compute_derivate) |
1123 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("waypointAtIndex", &bezier_t::waypointAtIndex) |
1124 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("waypoints", &wrapBezierWaypoints) |
1125 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
32 | .def("elevate", &bezier_t::elevate, bp::args("order"), |
1126 | "Computes a Bezier curve of order degrees higher than the current " | ||
1127 | "curve, but strictly equivalent.") | ||
1128 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
32 | .def("elevateSelf", &bezier_t::elevate_self, bp::args("order"), |
1129 | "Elevate the Bezier curve of order degrees higher than the current " | ||
1130 | "curve, but strictly equivalent.") | ||
1131 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def_readonly("degree", &bezier_t::degree_) |
1132 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def_readonly("nbWaypoints", &bezier_t::size_) |
1133 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("split", splitspe) |
1134 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(bp::self == bp::self) |
1135 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(bp::self != bp::self) |
1136 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
32 | .def("cross", cross_bez, bp::args("other"), |
1137 | "Compute the cross product of the current bezier by another bezier. " | ||
1138 | "The cross product p1Xp2 of 2 " | ||
1139 | "polynomials p1 and p2 is defined such that forall t, p1Xp2(t) = " | ||
1140 | "p1(t) X p2(t), with X designing the cross " | ||
1141 | "product. This method of course only makes sense for dimension 3 " | ||
1142 | "curves.") | ||
1143 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
32 | .def("cross", cross_pointBez, bp::args("point"), |
1144 | "Compute the cross product PXpt of the current Bezier P by a point " | ||
1145 | "pt, such that for all t, PXpt(t) = P(t) " | ||
1146 | "X pt") | ||
1147 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
32 | .def(self += bezier_t()) |
1148 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
32 | .def(self -= bezier_t()) |
1149 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
32 | .def(self + bezier_t()) |
1150 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
32 | .def(self - bezier_t()) |
1151 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
32 | .def(self += bezier_t::point_t()) |
1152 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
32 | .def(self -= bezier_t::point_t()) |
1153 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
32 | .def(self + bezier_t::point_t()) |
1154 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
32 | .def(self - bezier_t::point_t()) |
1155 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(self *= double()) |
1156 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(self /= double()) |
1157 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(-self) |
1158 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(self * double()) |
1159 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(self / double()) |
1160 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def(SerializableVisitor<bezier_t>()) |
1161 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def(CopyableVisitor<bezier_t>()) |
1162 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def_pickle(curve_pickle_suite<bezier_t>()); |
1163 | /** END bezier curve**/ | ||
1164 | /** BEGIN variable points bezier curve**/ | ||
1165 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | class_<matrix_pair>("matrix_pair", no_init) |
1166 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def_readonly("A", &matrix_pair::A) |
1167 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def_readonly("b", &matrix_pair::b); |
1168 | |||
1169 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | class_<LinearBezierVector>("bezierVarVector", no_init) |
1170 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def_readonly("size", &LinearBezierVector::size) |
1171 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("at", &LinearBezierVector::at, |
1172 | 16 | return_value_policy<manage_new_object>()); | |
1173 | |||
1174 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
16 | class_<linear_variable_t>("linear_variable", init<>()) |
1175 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
16 | .def(init<linear_variable_t::vector_x_t>()) |
1176 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
16 | .def(init<linear_variable_t::matrix_x_t>()) |
1177 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
16 | .def(init<linear_variable_t::matrix_x_t, linear_variable_t::vector_x_t>()) |
1178 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
16 | .def(init<linear_variable_t::matrix_x_t, linear_variable_t::vector_x_t>()) |
1179 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("__call__", &linear_variable_t::operator()) |
1180 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
32 | .def(self += linear_variable_t()) |
1181 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
32 | .def(self -= linear_variable_t()) |
1182 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(self *= double()) |
1183 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(self /= double()) |
1184 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
32 | .def(self + linear_variable_t()) |
1185 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
32 | .def(self - linear_variable_t()) |
1186 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(-self) |
1187 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(self * double()) |
1188 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(self / double()) |
1189 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
32 | .def(self * linear_variable_t()) |
1190 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("B", &linear_variable_t::B, |
1191 | ✗ | return_value_policy<copy_const_reference>()) | |
1192 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("c", &linear_variable_t::c, |
1193 | ✗ | return_value_policy<copy_const_reference>()) | |
1194 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("size", &linear_variable_t::size) |
1195 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("isZero", &linear_variable_t::isZero) |
1196 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("norm", &linear_variable_t::norm) |
1197 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
16 | .def("cross", &linear_variable_t::cross, bp::args("other"), |
1198 | "Compute the cross product of the current linear_variable and the " | ||
1199 | "other. Only works for dimension 3"); | ||
1200 | |||
1201 | 16 | bezier_linear_variable_t (bezier_linear_variable_t::*cross_bez_var)( | |
1202 | const bezier_linear_variable_t&) const = &bezier_linear_variable_t::cross; | ||
1203 | 16 | bezier_linear_variable_t (bezier_linear_variable_t::*cross_point_var)( | |
1204 | const bezier_linear_variable_t::point_t&) const = | ||
1205 | &bezier_linear_variable_t::cross; | ||
1206 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | class_<bezier_linear_variable_t, bases<curve_abc_t>, |
1207 | std::shared_ptr<bezier_linear_variable_t>>("bezier_linear_variable", | ||
1208 | no_init) | ||
1209 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
32 | .def("__init__", make_constructor(&wrapBezierLinearConstructor)) |
1210 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
32 | .def("__init__", make_constructor(&wrapBezierLinearConstructorBounds)) |
1211 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("min", &bezier_linear_variable_t::min) |
1212 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("max", &bezier_linear_variable_t::max) |
1213 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("__call__", &bezier_linear_variable_t::operator()) |
1214 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("evaluate", &bezier_linear_variable_t_evaluate, |
1215 | ✗ | bp::return_value_policy<bp::manage_new_object>()) | |
1216 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("derivate", &bezier_linear_variable_t::derivate) |
1217 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("compute_derivate", &bezier_linear_variable_t::compute_derivate_ptr, |
1218 | ✗ | return_value_policy<manage_new_object>()) | |
1219 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("compute_primitive", |
1220 | &bezier_linear_variable_t_compute_primitive_init, | ||
1221 | ✗ | return_value_policy<manage_new_object>()) | |
1222 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("compute_primitive", |
1223 | &bezier_linear_variable_t_compute_primitive_zero, | ||
1224 | ✗ | return_value_policy<manage_new_object>()) | |
1225 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("split", split_py) |
1226 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("waypoints", &wayPointsToLists, |
1227 | ✗ | return_value_policy<manage_new_object>()) | |
1228 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("waypointAtIndex", &bezier_linear_variable_t::waypointAtIndex) |
1229 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def_readonly("degree", &bezier_linear_variable_t::degree_) |
1230 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def_readonly("nbWaypoints", &bezier_linear_variable_t::size_) |
1231 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
32 | .def("cross", cross_bez_var, bp::args("other"), |
1232 | "Compute the cross product of the current Bezier by another Bezier. " | ||
1233 | "The cross product p1Xp2 of 2 " | ||
1234 | "polynomials p1 and p2 is defined such that forall t, p1Xp2(t) = " | ||
1235 | "p1(t) X p2(t), with X designing the cross " | ||
1236 | "product. This method of course only makes sense for dimension 3 " | ||
1237 | "polynomials.") | ||
1238 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
32 | .def("cross", cross_point_var, bp::args("point"), |
1239 | "Compute the cross product PXpt of the current Bezier P by a point " | ||
1240 | "pt, such that for all t, PXpt(t) = P(t) " | ||
1241 | "X pt") | ||
1242 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(bp::self == bp::self) |
1243 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(bp::self != bp::self) |
1244 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
32 | .def(self += bezier_linear_variable_t()) |
1245 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
32 | .def(self -= bezier_linear_variable_t()) |
1246 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
32 | .def(self + bezier_linear_variable_t()) |
1247 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
32 | .def(self - bezier_linear_variable_t()) |
1248 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
32 | .def(self += linear_variable_t()) |
1249 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
32 | .def(self -= linear_variable_t()) |
1250 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
32 | .def(self + linear_variable_t()) |
1251 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
32 | .def(self - linear_variable_t()) |
1252 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(self *= double()) |
1253 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(self /= double()) |
1254 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(-self) |
1255 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(self * double()) |
1256 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(self / double()) |
1257 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def(CopyableVisitor<bezier_linear_variable_t>()) |
1258 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def_pickle(curve_pickle_suite<bezier_linear_variable_t>()); |
1259 | |||
1260 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | class_<quadratic_variable_t>("cost", no_init) |
1261 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .add_property("A", &cost_t_quad) |
1262 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .add_property("b", &cost_t_linear) |
1263 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .add_property("c", &cost_t_constant); |
1264 | |||
1265 | /** END variable points bezier curve**/ | ||
1266 | /** BEGIN polynomial curve function**/ | ||
1267 | 16 | polynomial_t (polynomial_t::*cross_pol)(const polynomial_t&) const = | |
1268 | &polynomial_t::cross; | ||
1269 | 16 | polynomial_t (polynomial_t::*cross_point)(const polynomial_t::point_t&) | |
1270 | const = &polynomial_t::cross; | ||
1271 | |||
1272 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | class_<polynomial_t, bases<curve_abc_t>, std::shared_ptr<polynomial_t>>( |
1273 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | "polynomial", init<>()) |
1274 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def( |
1275 | "__init__", | ||
1276 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | make_constructor(&wrapPolynomialConstructor1, default_call_policies(), |
1277 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("coeffs", "min", "max")), |
1278 | "Create polynomial spline from an Eigen matrix of coefficient " | ||
1279 | "defined for t in [min,max]." | ||
1280 | " The matrix should contain one coefficient per column, from the " | ||
1281 | "zero order coefficient,up to the highest " | ||
1282 | "order." | ||
1283 | " Spline order is given by the number of the columns -1.") | ||
1284 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("__init__", |
1285 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | make_constructor(&wrapPolynomialConstructor2, |
1286 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | default_call_policies(), arg("coeffs")), |
1287 | "Create polynomial spline from an Eigen matrix of coefficient " | ||
1288 | "defined for t in [0,1]." | ||
1289 | " The matrix should contain one coefficient per column, from the " | ||
1290 | "zero order coefficient,up to the highest " | ||
1291 | "order." | ||
1292 | " Spline order is given by the number of the columns -1.") | ||
1293 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("__init__", |
1294 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | make_constructor( |
1295 | &wrapPolynomialConstructorFromBoundaryConditionsDegree1, | ||
1296 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | default_call_policies(), args("init", "end", "min", "max")), |
1297 | "Create a polynomial of degree 1 defined for t in [min,max], " | ||
1298 | "such that c(min) == init and c(max) == end.") | ||
1299 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("__init__", |
1300 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | make_constructor( |
1301 | &wrapPolynomialConstructorFromBoundaryConditionsDegree3, | ||
1302 | ✗ | default_call_policies(), | |
1303 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("init", "d_init", "end", "d_end", "min", "max")), |
1304 | "Create a polynomial of degree 3 defined for t in [min,max], " | ||
1305 | "such that c(min) == init and c(max) == end" | ||
1306 | " dc(min) == d_init and dc(max) == d_end") | ||
1307 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("__init__", |
1308 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | make_constructor( |
1309 | &wrapPolynomialConstructorFromBoundaryConditionsDegree5, | ||
1310 | ✗ | default_call_policies(), | |
1311 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("init", "d_init", "dd_init", "end", "d_end", "dd_end", |
1312 | "min", "max")), | ||
1313 | "Create a polynomial of degree 5 defined for t in [min,max], " | ||
1314 | "such that c(min) == init and c(max) == end" | ||
1315 | " dc(min) == d_init and dc(max) == d_end" | ||
1316 | " ddc(min) == dd_init and ddc(max) == dd_end") | ||
1317 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
32 | .def("MinimumJerk", &minimumJerk, args("init", "end"), |
1318 | "Build a polynomial curve connecting init to end minimizing the " | ||
1319 | "time integral of the squared jerk," | ||
1320 | "with a zero initial and final velocity and acceleration." | ||
1321 | "The curve is defined in [0; 1], of duration 1.") | ||
1322 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("MinimumJerk", &minimumJerkWithTiming, |
1323 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("init", "end", "t_min", "t_max"), |
1324 | "Build a polynomial curve connecting init to end minimizing the " | ||
1325 | "time integral of the squared jerk," | ||
1326 | "with a zero initial and final velocity and acceleration." | ||
1327 | "The curve is defined in [t_min; t_max], of duration t_max - t_min.") | ||
1328 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .staticmethod("MinimumJerk") |
1329 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("coeffAtDegree", &polynomial_t::coeffAtDegree) |
1330 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("coeff", &polynomial_t::coeff) |
1331 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def(SerializableVisitor<polynomial_t>()) |
1332 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
32 | .def("cross", cross_pol, bp::args("other"), |
1333 | "Compute the cross product of the current polynomial by another " | ||
1334 | "polynomial. The cross product p1Xp2 of 2 " | ||
1335 | "polynomials p1 and p2 is defined such that forall t, p1Xp2(t) = " | ||
1336 | "p1(t) X p2(t), with X designing the cross " | ||
1337 | "product. This method of course only makes sense for dimension 3 " | ||
1338 | "polynomials.") | ||
1339 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
32 | .def("cross", cross_point, bp::args("point"), |
1340 | "Compute the cross product PXpt of the current polynomial P by a " | ||
1341 | "point pt, such that for all t, PXpt(t) = " | ||
1342 | "P(t) X pt") | ||
1343 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(bp::self == bp::self) |
1344 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(bp::self != bp::self) |
1345 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
32 | .def(self += polynomial_t()) |
1346 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
32 | .def(self -= polynomial_t()) |
1347 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
32 | .def(self + polynomial_t()) |
1348 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
32 | .def(self - polynomial_t()) |
1349 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
32 | .def(self += polynomial_t::point_t()) |
1350 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
32 | .def(self -= polynomial_t::point_t()) |
1351 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
32 | .def(self + polynomial_t::point_t()) |
1352 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
|
32 | .def(self - polynomial_t::point_t()) |
1353 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(self *= double()) |
1354 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(self /= double()) |
1355 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(-self) |
1356 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(self * double()) |
1357 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(self / double()) |
1358 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def(CopyableVisitor<polynomial_t>()) |
1359 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def_pickle(curve_pickle_suite<polynomial_t>()); |
1360 | |||
1361 | /** END polynomial function**/ | ||
1362 | /** BEGIN piecewise curve function **/ | ||
1363 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | class_<piecewise_t, bases<curve_abc_t>, std::shared_ptr<piecewise_t>>( |
1364 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | "piecewise", init<>()) |
1365 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("__init__", |
1366 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | make_constructor(&wrapPiecewiseCurveConstructor, |
1367 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | default_call_policies(), arg("curve")), |
1368 | "Create a piecewise curve containing the given curve.") | ||
1369 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("FromPointsList", &discretPointToPolynomialC0, |
1370 | "Create a piecewise-polynomial connecting exactly all the given " | ||
1371 | "points at the given time. The created " | ||
1372 | "piecewise is C0 continuous.", | ||
1373 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("points", "time_points")) |
1374 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("FromPointsList", &discretPointToPolynomialC1, |
1375 | "Create a piecewise-polynomial connecting exactly all the given " | ||
1376 | "points at the given time and respect the " | ||
1377 | "given points derivative values. The created piecewise is C1 " | ||
1378 | "continuous.", | ||
1379 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("points", "points_derivative", "time_points")) |
1380 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("FromPointsList", &discretPointToPolynomialC2, |
1381 | "Create a piecewise-polynomial connecting exactly all the given " | ||
1382 | "points at the given time and respect the " | ||
1383 | "given points derivative and second derivative values. The created " | ||
1384 | "piecewise is C2 continuous.", | ||
1385 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("points", "points_derivative", "points_second_derivative", |
1386 | "time_points")) | ||
1387 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .staticmethod("FromPointsList") |
1388 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("FromPointsFile", &load_piecewise_from_text_file, |
1389 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("filename", "dt", "dimension"), |
1390 | "Create a piecewise-polynomial connecting exactly all the points in " | ||
1391 | "the given text file." | ||
1392 | "The file should contains one points per line, optionally with it's " | ||
1393 | "derivative and second derivatives." | ||
1394 | "Each lines should thus contains dim, 2*dim or 3*dim values") | ||
1395 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .staticmethod("FromPointsFile") |
1396 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("append", &addFinalPointC0, |
1397 | "Append a new polynomial curve of degree 1 at the end of the " | ||
1398 | "piecewise curve, defined between self.max() " | ||
1399 | "and time and connecting exactly self(self.max()) and end", | ||
1400 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("self", "end", "time")) |
1401 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("append", &addFinalPointC1, |
1402 | "Append a new polynomial curve of degree 3 at the end of the " | ||
1403 | "piecewise curve, defined between self.max() " | ||
1404 | "and time and connecting exactly self(self.max()) and end. It " | ||
1405 | "guarantee C1 continuity and guarantee that " | ||
1406 | "self.derivate(time,1) == d_end", | ||
1407 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("self", "end", "d_end", "time")) |
1408 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("append", &addFinalPointC2, |
1409 | "Append a new polynomial curve of degree 5 at the end of the " | ||
1410 | "piecewise curve, defined between self.max() " | ||
1411 | "and time and connecting exactly self(self.max()) and end. It " | ||
1412 | "guarantee C2 continuity and guarantee that " | ||
1413 | "self.derivate(time,1) == d_end and self.derivate(time,2) == dd_end", | ||
1414 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("self", "end", "d_end", "d_end", "time")) |
1415 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("append", &piecewise_t::add_curve_ptr, |
1416 | "Add a new curve to piecewise curve, which should be defined in " | ||
1417 | "T_{min},T_{max}] " | ||
1418 | "where T_{min} is equal toT_{max} of the actual piecewise curve.") | ||
1419 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("is_continuous", &piecewise_t::is_continuous, |
1420 | "Check if the curve is continuous at the given order.", | ||
1421 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("self", "order")) |
1422 | 32 | .def("convert_piecewise_curve_to_polynomial", | |
1423 | &piecewise_t::convert_piecewise_curve_to_polynomial<polynomial_t>, | ||
1424 | "Convert a piecewise curve to to a piecewise polynomial curve") | ||
1425 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("convert_piecewise_curve_to_bezier", |
1426 | &piecewise_t::convert_piecewise_curve_to_bezier<bezier_t>, | ||
1427 | "Convert a piecewise curve to to a piecewise bezier curve") | ||
1428 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("convert_piecewise_curve_to_cubic_hermite", |
1429 | &piecewise_t::convert_piecewise_curve_to_cubic_hermite< | ||
1430 | cubic_hermite_spline_t>, | ||
1431 | "Convert a piecewise curve to to a piecewise cubic hermite spline") | ||
1432 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
16 | .def("curve_at_index", &piecewise_t::curve_at_index) |
1433 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("curve_at_time", &piecewise_t::curve_at_time) |
1434 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("num_curves", &piecewise_t::num_curves) |
1435 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def(SerializableVisitor<piecewise_t>()) |
1436 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(bp::self == bp::self) |
1437 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(bp::self != bp::self) |
1438 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def(CopyableVisitor<piecewise_t>()) |
1439 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def_pickle(curve_pickle_suite<piecewise_t>()); |
1440 | |||
1441 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | class_<piecewise3_t, bases<curve_3_t>, std::shared_ptr<piecewise3_t>>( |
1442 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | "piecewise3", init<>()) |
1443 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("__init__", |
1444 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | make_constructor(&wrapPiecewise3CurveConstructor, |
1445 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | default_call_policies(), arg("curve")), |
1446 | "Create a piecewise curve containing the given curve.") | ||
1447 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("FromPointsList", &discretPointsToPolynomial3C0, |
1448 | "Create a piecewise-polynomial connecting exactly all the given " | ||
1449 | "points at the given time. The created " | ||
1450 | "piecewise is C0 continuous.", | ||
1451 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("points", "time_points")) |
1452 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("FromPointsList", &discretPointsToPolynomial3C1, |
1453 | "Create a piecewise-polynomial connecting exactly all the given " | ||
1454 | "points at the given time and respect the " | ||
1455 | "given points derivative values. The created piecewise is C1 " | ||
1456 | "continuous.", | ||
1457 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("points", "points_derivative", "time_points")) |
1458 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("FromPointsList", &discretPointsToPolynomial3C2, |
1459 | "Create a piecewise-polynomial connecting exactly all the given " | ||
1460 | "points at the given time and respect the " | ||
1461 | "given points derivative and second derivative values. The created " | ||
1462 | "piecewise is C2 continuous.", | ||
1463 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("points", "points_derivative", "points_second_derivative", |
1464 | "time_points")) | ||
1465 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .staticmethod("FromPointsList") |
1466 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("FromPointsFile", &load_piecewise3_from_text_file, |
1467 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("filename", "dt", "dimension"), |
1468 | "Create a piecewise-polynomial connecting exactly all the points in " | ||
1469 | "the given text file." | ||
1470 | "The file should contains one points per line, optionally with it's " | ||
1471 | "derivative and second derivatives." | ||
1472 | "Each lines should thus contains dim, 2*dim or 3*dim values") | ||
1473 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .staticmethod("FromPointsFile") |
1474 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("append", &addFinalPoint3C0, |
1475 | "Append a new polynomial curve of degree 1 at the end of the " | ||
1476 | "piecewise curve, defined between self.max() " | ||
1477 | "and time and connecting exactly self(self.max()) and end", | ||
1478 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("self", "end", "time")) |
1479 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("append", &addFinalPoint3C1, |
1480 | "Append a new polynomial curve of degree 3 at the end of the " | ||
1481 | "piecewise curve, defined between self.max() " | ||
1482 | "and time and connecting exactly self(self.max()) and end. It " | ||
1483 | "guarantee C1 continuity and guarantee that " | ||
1484 | "self.derivate(time,1) == d_end", | ||
1485 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("self", "end", "d_end", "time")) |
1486 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("append", &addFinalPoint3C2, |
1487 | "Append a new polynomial curve of degree 5 at the end of the " | ||
1488 | "piecewise curve, defined between self.max() " | ||
1489 | "and time and connecting exactly self(self.max()) and end. It " | ||
1490 | "guarantee C2 continuity and guarantee that " | ||
1491 | "self.derivate(time,1) == d_end and self.derivate(time,2) == dd_end", | ||
1492 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("self", "end", "d_end", "d_end", "time")) |
1493 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("append", &piecewise3_t::add_curve_ptr, |
1494 | "Add a new curve to piecewise curve, which should be defined in " | ||
1495 | "T_{min},T_{max}] " | ||
1496 | "where T_{min} is equal toT_{max} of the actual piecewise curve.") | ||
1497 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("is_continuous", &piecewise3_t::is_continuous, |
1498 | "Check if the curve is continuous at the given order.", | ||
1499 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("self", "order")) |
1500 | 32 | .def("convert_piecewise_curve_to_polynomial", | |
1501 | &piecewise3_t::convert_piecewise_curve_to_polynomial<polynomial3_t>, | ||
1502 | "Convert a piecewise curve to to a piecewise polynomial curve") | ||
1503 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("convert_piecewise_curve_to_bezier", |
1504 | &piecewise3_t::convert_piecewise_curve_to_bezier<bezier3_t>, | ||
1505 | "Convert a piecewise curve to to a piecewise bezier curve") | ||
1506 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
16 | .def("curve_at_index", &piecewise3_t::curve_at_index) |
1507 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("curve_at_time", &piecewise3_t::curve_at_time) |
1508 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("num_curves", &piecewise3_t::num_curves) |
1509 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def(SerializableVisitor<piecewise3_t>()) |
1510 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(bp::self == bp::self) |
1511 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(bp::self != bp::self) |
1512 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def(CopyableVisitor<piecewise3_t>()) |
1513 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def_pickle(curve_pickle_suite<piecewise3_t>()); |
1514 | |||
1515 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | class_<piecewise_bezier_t, bases<curve_abc_t>, |
1516 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | std::shared_ptr<piecewise_bezier_t>>("piecewise_bezier", init<>()) |
1517 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("__init__", |
1518 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | make_constructor(&wrapPiecewiseBezierConstructor, |
1519 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | default_call_policies(), arg("curve")), |
1520 | "Create a peicewise Bezier curve containing the given curve.") | ||
1521 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
32 | .def("__init__", make_constructor(&wrapPiecewiseBezierEmptyConstructor), |
1522 | "Create an empty piecewise-Beziercurve.") | ||
1523 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("append", &piecewise_bezier_t::add_curve_ptr, |
1524 | "Add a new curve to piecewise curve, which should be defined in " | ||
1525 | "T_{min},T_{max}] " | ||
1526 | "where T_{min} is equal toT_{max} of the actual piecewise curve.") | ||
1527 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("is_continuous", &piecewise_bezier_t::is_continuous, |
1528 | "Check if the curve is continuous at the given order.", | ||
1529 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("self", "order")) |
1530 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("curve_at_index", &piecewise_bezier_t::curve_at_index) |
1531 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("curve_at_time", &piecewise_bezier_t::curve_at_time) |
1532 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("num_curves", &piecewise_bezier_t::num_curves) |
1533 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def(SerializableVisitor<piecewise_bezier_t>()) |
1534 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(bp::self == bp::self) |
1535 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(bp::self != bp::self) |
1536 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def(CopyableVisitor<piecewise_bezier_t>()) |
1537 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def_pickle(curve_pickle_suite<piecewise_bezier_t>()); |
1538 | |||
1539 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | class_<piecewise_linear_bezier_t, bases<curve_abc_t>, |
1540 | std::shared_ptr<piecewise_linear_bezier_t>>("piecewise_bezier_linear", | ||
1541 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
32 | init<>(args("self"))) |
1542 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("__init__", |
1543 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | make_constructor(&wrapPiecewiseBezierLinearConstructor, |
1544 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | default_call_policies(), arg("curve")), |
1545 | "Create a peicewise Bezier curve containing the given curve.") | ||
1546 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("__init__", |
1547 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | make_constructor(&wrapPiecewiseBezierLinearEmptyConstructor), |
1548 | "Create an empty piecewise-Beziercurve.") | ||
1549 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("append", &piecewise_linear_bezier_t::add_curve_ptr, |
1550 | "Add a new curve to piecewise curve, which should be defined in " | ||
1551 | "T_{min},T_{max}] " | ||
1552 | "where T_{min} is equal toT_{max} of the actual piecewise curve.") | ||
1553 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("is_continuous", &piecewise_linear_bezier_t::is_continuous, |
1554 | "Check if the curve is continuous at the given order.", | ||
1555 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("self", "order")) |
1556 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("curve_at_index", &piecewise_linear_bezier_t::curve_at_index) |
1557 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("curve_at_time", &piecewise_linear_bezier_t::curve_at_time) |
1558 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("num_curves", &piecewise_linear_bezier_t::num_curves) |
1559 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def(SerializableVisitor<piecewise_linear_bezier_t>()) |
1560 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(bp::self == bp::self) |
1561 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(bp::self != bp::self) |
1562 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def(CopyableVisitor<piecewise_linear_bezier_t>()) |
1563 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def_pickle(curve_pickle_suite<piecewise_linear_bezier_t>()); |
1564 | |||
1565 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | class_<piecewise_SE3_t, bases<curve_SE3_t>, std::shared_ptr<piecewise_SE3_t>>( |
1566 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | "piecewise_SE3", init<>()) |
1567 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("__init__", |
1568 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | make_constructor(&wrapPiecewiseSE3Constructor, |
1569 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | default_call_policies(), arg("curve")), |
1570 | "Create a piecewise-se3 curve containing the given se3 curve.") | ||
1571 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
32 | .def("__init__", make_constructor(&wrapPiecewiseSE3EmptyConstructor), |
1572 | "Create an empty piecewise-se3 curve.") | ||
1573 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("append", &piecewise_SE3_t::add_curve_ptr, |
1574 | "Add a new curve to piecewise curve, which should be defined in " | ||
1575 | "T_{min},T_{max}] " | ||
1576 | "where T_{min} is equal toT_{max} of the actual piecewise curve.", | ||
1577 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("self", "curve")) |
1578 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("is_continuous", &piecewise_SE3_t::is_continuous, |
1579 | "Check if the curve is continuous at the given order.", | ||
1580 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("self", "order")) |
1581 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("curve_at_index", &piecewise_SE3_t::curve_at_index) |
1582 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("curve_at_time", &piecewise_SE3_t::curve_at_time) |
1583 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("num_curves", &piecewise_SE3_t::num_curves) |
1584 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("append", &addFinalTransform, |
1585 | "Append a new linear SE3 curve at the end of the piecewise curve, " | ||
1586 | "defined between self.max() " | ||
1587 | "and time and connecting exactly self(self.max()) and end", | ||
1588 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("self", "end", "time")) |
1589 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def(SerializableVisitor<piecewise_SE3_t>()) |
1590 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(bp::self == bp::self) |
1591 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(bp::self != bp::self) |
1592 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def(CopyableVisitor<piecewise_SE3_t>()) |
1593 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def_pickle(curve_pickle_suite<piecewise_SE3_t>()) |
1594 | #ifdef CURVES_WITH_PINOCCHIO_SUPPORT | ||
1595 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("append", &addFinalSE3, |
1596 | "Append a new linear SE3 curve at the end of the piecewise curve, " | ||
1597 | "defined between self.max() " | ||
1598 | "and time and connecting exactly self(self.max()) and end", | ||
1599 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("self", "end", "time")) |
1600 | #endif // CURVES_WITH_PINOCCHIO_SUPPORT | ||
1601 | ; | ||
1602 | |||
1603 | /** END piecewise curve function **/ | ||
1604 | /** BEGIN exact_cubic curve**/ | ||
1605 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | class_<exact_cubic_t, bases<curve_abc_t>, std::shared_ptr<exact_cubic_t>>( |
1606 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
32 | "exact_cubic", init<>(args("self"))) |
1607 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("__init__", |
1608 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | make_constructor(&wrapExactCubicConstructor, default_call_policies(), |
1609 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("array", "time_wp"))) |
1610 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("__init__", |
1611 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | make_constructor(&wrapExactCubicConstructorConstraint, |
1612 | ✗ | default_call_policies(), | |
1613 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("array", "time_wp", "constraints"))) |
1614 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
32 | .def("getNumberSplines", &exact_cubic_t::getNumberSplines, args("self")) |
1615 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
32 | .def("getSplineAt", &exact_cubic_t::getSplineAt, args("self", "index")) |
1616 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def(SerializableVisitor<exact_cubic_t>()) |
1617 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(bp::self == bp::self) |
1618 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(bp::self != bp::self) |
1619 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def(CopyableVisitor<exact_cubic_t>()) |
1620 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def_pickle(curve_pickle_suite<exact_cubic_t>()); |
1621 | |||
1622 | /** END exact_cubic curve**/ | ||
1623 | /** BEGIN cubic_hermite_spline **/ | ||
1624 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | class_<cubic_hermite_spline_t, bases<curve_abc_t>, |
1625 | std::shared_ptr<cubic_hermite_spline_t>>("cubic_hermite_spline", | ||
1626 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
32 | init<>(args("self"))) |
1627 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
16 | .def("__init__", make_constructor(&wrapCubicHermiteSplineConstructor, |
1628 | ✗ | bp::default_call_policies(), | |
1629 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("points", "tangents", "times"))) |
1630 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def(SerializableVisitor<cubic_hermite_spline_t>()) |
1631 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(bp::self == bp::self) |
1632 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(bp::self != bp::self) |
1633 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def(CopyableVisitor<cubic_hermite_spline_t>()) |
1634 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(bp::self == bp::self) |
1635 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def_pickle(curve_pickle_suite<cubic_hermite_spline_t>()); |
1636 | |||
1637 | /** END cubic_hermite_spline **/ | ||
1638 | /** BEGIN curve constraints**/ | ||
1639 |
2/4✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
|
16 | class_<curve_constraints_t>("curve_constraints", init<>()) |
1640 |
3/6✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 8 times.
✗ Branch 8 not taken.
|
32 | .def(bp::init<int>(args("self", "dimension"), |
1641 | "Init with a given dimension.")) | ||
1642 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .add_property("init_vel", &get_init_vel, &set_init_vel) |
1643 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .add_property("init_acc", &get_init_acc, &set_init_acc) |
1644 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .add_property("init_jerk", &get_init_jerk, &set_init_jerk) |
1645 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .add_property("end_vel", &get_end_vel, &set_end_vel) |
1646 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .add_property("end_acc", &get_end_acc, &set_end_acc) |
1647 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .add_property("end_jerk", &get_end_jerk, &set_end_jerk) |
1648 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("__eq__", &curve_constraints_t::operator==) |
1649 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("__ne__", &curve_constraints_t::operator!=) |
1650 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def(SerializableVisitor<curve_constraints_t>()) |
1651 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def(CopyableVisitor<curve_constraints_t>()) |
1652 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def_pickle(curve_pickle_suite<curve_constraints_t>()); |
1653 | ; | ||
1654 | /** END curve constraints**/ | ||
1655 | /** BEGIN bernstein polynomial**/ | ||
1656 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | class_<bernstein_t>("bernstein", |
1657 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | init<const unsigned int, const unsigned int>()) |
1658 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("__call__", &bernstein_t::operator()) |
1659 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(bp::self == bp::self) |
1660 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(bp::self != bp::self); |
1661 | /** END bernstein polynomial**/ | ||
1662 | |||
1663 | /** BEGIN SO3 Linear**/ | ||
1664 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | class_<SO3Linear_t, bases<curve_rotation_t>, std::shared_ptr<SO3Linear_t>>( |
1665 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | "SO3Linear", init<>()) |
1666 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("__init__", |
1667 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | make_constructor( |
1668 | ✗ | &wrapSO3LinearConstructorFromMatrix, default_call_policies(), | |
1669 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("init_rotation", "end_rotation", "min", "max")), |
1670 | "Create a SO3 Linear curve between two rotations, defined for t in " | ||
1671 | "[min,max]." | ||
1672 | " The input rotations are expressed as 3x3 matrix.") | ||
1673 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("__init__", |
1674 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | make_constructor( |
1675 | ✗ | &wrapSO3LinearConstructorFromQuaternion, default_call_policies(), | |
1676 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("init_rotation", "end_rotation", "min", "max")), |
1677 | "Create a SO3 Linear curve between two rotations, defined for t in " | ||
1678 | "[min,max]." | ||
1679 | " The input rotations are expressed as Quaternions.") | ||
1680 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("computeAsQuaternion", &SO3Linear_t::computeAsQuaternion, |
1681 | "Output the quaternion of the rotation at the given time. This " | ||
1682 | "rotation is obtained by a Spherical Linear " | ||
1683 | "Interpolation between the initial and final rotation.") | ||
1684 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def(SerializableVisitor<SO3Linear_t>()) |
1685 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(bp::self == bp::self) |
1686 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(bp::self != bp::self) |
1687 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def(CopyableVisitor<SO3Linear_t>()) |
1688 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def_pickle(curve_pickle_suite<SO3Linear_t>()); |
1689 | |||
1690 | /** END SO3 Linear**/ | ||
1691 | /** BEGIN SE3 Curve**/ | ||
1692 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | class_<SE3Curve_t, bases<curve_SE3_t>, std::shared_ptr<SE3Curve_t>>( |
1693 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | "SE3Curve", init<>()) |
1694 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("__init__", |
1695 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | make_constructor( |
1696 | ✗ | &wrapSE3CurveFromTransform, default_call_policies(), | |
1697 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("init_transform", "end_transform", "min", "max")), |
1698 | "Create a SE3 curve between two transform, defined for t in " | ||
1699 | "[min,max]." | ||
1700 | " Using linear interpolation for translation and slerp for rotation " | ||
1701 | "between init and end." | ||
1702 | " The input transform are expressed as 4x4 matrix.") | ||
1703 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("__init__", |
1704 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | make_constructor( |
1705 | ✗ | &wrapSE3CurveFromPosAndRotation, default_call_policies(), | |
1706 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("init_translation", "end_translation", "init_rotation", |
1707 | "end_rotation", "min", "max")), | ||
1708 | "Create a SE3 curve between two transform, defined for t in " | ||
1709 | "[min,max]." | ||
1710 | " Using linear interpolation for translation and slerp for rotation " | ||
1711 | "between init and end." | ||
1712 | " The input translations are expressed as 3d vector and the " | ||
1713 | "rotations as 3x3 matrix.") | ||
1714 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("__init__", |
1715 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | make_constructor(&wrapSE3CurveFromTwoCurves, default_call_policies(), |
1716 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("translation_curve", "rotation_curve")), |
1717 | "Create a SE3 curve from a translation curve and a rotation one." | ||
1718 | "The translation curve should be of dimension 3 and the rotation " | ||
1719 | "one should output 3x3 matrix" | ||
1720 | "Both curves should have the same time bounds.") | ||
1721 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("__init__", |
1722 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | make_constructor( |
1723 | ✗ | &wrapSE3CurveFromTranslation, default_call_policies(), | |
1724 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("translation_curve", "init_rotation", "end_rotation")), |
1725 | "Create a SE3 curve from a translation curve and two rotation" | ||
1726 | "The translation curve should be of dimension 3, the time " | ||
1727 | "definition of the SE3curve will the same as the " | ||
1728 | "translation curve." | ||
1729 | "The orientation along the SE3Curve will be a slerp between the two " | ||
1730 | "given rotations." | ||
1731 | "The orientations should be represented as 3x3 rotation matrix") | ||
1732 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("__init__", |
1733 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | make_constructor( |
1734 | ✗ | &wrapSE3CurveFromBezier3Translation, default_call_policies(), | |
1735 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("translation_curve", "init_rotation", "end_rotation")), |
1736 | "Create a SE3 curve from a translation curve and two rotation" | ||
1737 | "The translation curve should be of dimension 3, the time " | ||
1738 | "definition of the SE3curve will the same as the " | ||
1739 | "translation curve." | ||
1740 | "The orientation along the SE3Curve will be a slerp between the two " | ||
1741 | "given rotations." | ||
1742 | "The orientations should be represented as 3x3 rotation matrix") | ||
1743 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("translation_curve", &SE3Curve_t::translation_curve, |
1744 | "Return a curve corresponding to the translation part of self.") | ||
1745 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("rotation_curve", &SE3Curve_t::rotation_curve, |
1746 | "Return a curve corresponding to the rotation part of self.") | ||
1747 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def(SerializableVisitor<SE3Curve_t>()) |
1748 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(bp::self == bp::self) |
1749 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(bp::self != bp::self) |
1750 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def(CopyableVisitor<SE3Curve_t>()) |
1751 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def_pickle(curve_pickle_suite<SE3Curve_t>()) |
1752 | #ifdef CURVES_WITH_PINOCCHIO_SUPPORT | ||
1753 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("__init__", |
1754 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | make_constructor(&wrapSE3CurveFromSE3Pinocchio, |
1755 | ✗ | default_call_policies(), | |
1756 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("init_SE3", "end_SE3", "min", "max")), |
1757 | "Create a SE3 curve between two SE3 objects from Pinocchio, defined " | ||
1758 | "for t in [min,max]." | ||
1759 | " Using linear interpolation for translation and slerp for rotation " | ||
1760 | "between init and end.") | ||
1761 | #endif // CURVES_WITH_PINOCCHIO_SUPPORT | ||
1762 | ; | ||
1763 | |||
1764 | /** END SE3 Curve**/ | ||
1765 | /** BEGIN constant curve function**/ | ||
1766 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | class_<constant_t, bases<curve_abc_t>, std::shared_ptr<constant_t>>( |
1767 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | "constant", init<>()) |
1768 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("__init__", |
1769 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | make_constructor(&wrapConstantConstructorTime, |
1770 | ✗ | default_call_policies(), | |
1771 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("value", "min", "max")), |
1772 | "Create a constant curve defined for t in [min,max]." | ||
1773 | " This curve always evaluate to the given value and derivate to " | ||
1774 | "zero value.") | ||
1775 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("__init__", |
1776 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | make_constructor(&wrapConstantConstructor, default_call_policies(), |
1777 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | arg("value")), |
1778 | "Create a constant curve defined for t in [0,inf]." | ||
1779 | " This curve always evaluate to the given value and derivate to " | ||
1780 | "zero value.") | ||
1781 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def(SerializableVisitor<constant_t>()) |
1782 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(bp::self == bp::self) |
1783 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(bp::self != bp::self) |
1784 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def(CopyableVisitor<constant_t>()) |
1785 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def_pickle(curve_pickle_suite<constant_t>()); |
1786 | /** END constant function**/ | ||
1787 | /** BEGIN constant 3 curve function**/ | ||
1788 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | class_<constant3_t, bases<curve_3_t>, std::shared_ptr<constant3_t>>( |
1789 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | "constant3", init<>()) |
1790 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("__init__", |
1791 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | make_constructor(&wrapConstant3ConstructorTime, |
1792 | ✗ | default_call_policies(), | |
1793 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("value", "min", "max")), |
1794 | "Create a constant curve defined for t in [min,max]." | ||
1795 | " This curve always evaluate to the given value and derivate to " | ||
1796 | "zero value.") | ||
1797 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("__init__", |
1798 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | make_constructor(&wrapConstant3Constructor, default_call_policies(), |
1799 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | arg("value")), |
1800 | "Create a constant curve defined for t in [0,inf]." | ||
1801 | " This curve always evaluate to the given value and derivate to " | ||
1802 | "zero value.") | ||
1803 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def(SerializableVisitor<constant3_t>()) |
1804 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(bp::self == bp::self) |
1805 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(bp::self != bp::self) |
1806 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def(CopyableVisitor<constant3_t>()) |
1807 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def_pickle(curve_pickle_suite<constant3_t>()); |
1808 | /** END constant 3 function**/ | ||
1809 | /** BEGIN sinusoidal curve function**/ | ||
1810 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | class_<sinusoidal_t, bases<curve_abc_t>, std::shared_ptr<sinusoidal_t>>( |
1811 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | "sinusoidal", init<>()) |
1812 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("__init__", |
1813 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | make_constructor(&wrapSinusoidalConstructor, default_call_policies(), |
1814 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("Offset", "Amplitude", "Period", "Phase")), |
1815 | "Create a sinusoidal curve defined for t in [0, inf]." | ||
1816 | " c(t) = offset + amplitude * sin(2pi/T * t + phi)") | ||
1817 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("__init__", |
1818 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | make_constructor( |
1819 | ✗ | &wrapSinusoidalConstructorTime, default_call_policies(), | |
1820 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("Offset", "Amplitude", "Period", "Phase", "min", "max")), |
1821 | "Create a sinusoidal curve defined for t in [min, max]." | ||
1822 | " c(t) = offset + amplitude * sin(2pi/T * t + phi)") | ||
1823 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def("__init__", |
1824 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | make_constructor(&wrapSinusoidalConstructorStationary, |
1825 | ✗ | default_call_policies(), | |
1826 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("duration", "p_init", "p_final")), |
1827 | "Create a sinusoidal curve defined for t in [0, inf]." | ||
1828 | "That connect the two stationnary points p_init and p_final in " | ||
1829 | "duration (an half period)") | ||
1830 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def( |
1831 | "__init__", | ||
1832 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | make_constructor(&wrapSinusoidalConstructorStationaryTime, |
1833 | ✗ | default_call_policies(), | |
1834 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
32 | args("duration", "p_init", "p_final", "min", "max")), |
1835 | "Create a sinusoidal curve defined for t in [min, max]." | ||
1836 | "That connect the two stationnary points p_init and p_final in " | ||
1837 | "duration (an half period)") | ||
1838 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def(SerializableVisitor<sinusoidal_t>()) |
1839 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(bp::self == bp::self) |
1840 |
1/2✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
|
16 | .def(bp::self != bp::self) |
1841 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def(CopyableVisitor<sinusoidal_t>()) |
1842 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | .def_pickle(curve_pickle_suite<sinusoidal_t>()); |
1843 | /** END sinusoidal function**/ | ||
1844 | /** BEGIN curves conversion**/ | ||
1845 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | def("convert_to_polynomial", polynomial_from_curve<polynomial_t>); |
1846 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | def("convert_to_bezier", bezier_from_curve<bezier_t>); |
1847 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | def("convert_to_hermite", hermite_from_curve<cubic_hermite_spline_t>); |
1848 | /** END curves conversion**/ | ||
1849 | |||
1850 |
1/2✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
16 | optimization::python::exposeOptimization(); |
1851 | |||
1852 | #ifdef CURVES_WITH_PINOCCHIO_SUPPORT | ||
1853 |
3/6✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 8 times.
✗ Branch 8 not taken.
|
16 | scope().attr("CURVES_WITH_PINOCCHIO_SUPPORT") = true; |
1854 | #else | ||
1855 | scope().attr("CURVES_WITH_PINOCCHIO_SUPPORT") = false; | ||
1856 | #endif | ||
1857 | |||
1858 | 16 | } // End BOOST_PYTHON_MODULE | |
1859 | } // namespace ndcurves | ||
1860 |