Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pierre Fernbach
curves
Commits
c4dc932f
Commit
c4dc932f
authored
Oct 04, 2019
by
stevet
Browse files
quadratic_variable
parent
c3efc262
Changes
5
Hide whitespace changes
Inline
Side-by-side
include/curves/quadratic_variable.h
View file @
c4dc932f
...
...
@@ -10,8 +10,8 @@
#ifndef _CLASS_QUADRATIC_VARIABLE
#define _CLASS_QUADRATIC_VARIABLE
#include "
hpp/spline
/curve_abc.h"
#include "
hpp/spline
/linear_variable.h"
#include "
curves
/curve_abc.h"
#include "
curves
/linear_variable.h"
#include "MathDefs.h"
...
...
@@ -128,7 +128,7 @@ struct quadratic_variable
const
point_t
&
b
()
const
{
assert
(
!
isZero
());
return
b_
;}
const
Numeric
c
()
const
{
assert
(
!
isZero
());
return
c_
;}
bool
isZero
()
const
{
return
zero
;}
std
::
size_t
size
()
const
{
return
zero
?
0
:
std
::
max
(
A_
.
cols
(),
(
std
::
max
(
B
_
.
cols
(),
c_
.
size
())))
;}
std
::
size_t
size
()
const
{
return
zero
?
0
:
std
::
max
(
A_
.
cols
(),
(
std
::
max
(
b
_
.
cols
(),
c_
.
size
())))
;}
private:
Numeric
c_
;
...
...
python/curves_python.cpp
View file @
c4dc932f
...
...
@@ -380,6 +380,15 @@ namespace curves
.
def_readonly
(
"degree"
,
&
bezier_linear_variable_t
::
degree_
)
.
def_readonly
(
"nbWaypoints"
,
&
bezier_linear_variable_t
::
size_
)
;
class_
<
quadratic_variable_t
>
(
"cost"
,
no_init
)
.
add_property
(
"A"
,
&
cost_t_quad
)
.
add_property
(
"b"
,
&
cost_t_linear
)
.
add_property
(
"c"
,
&
cost_t_constant
)
;
/** END variable points bezier curve**/
/** BEGIN polynomial curve function**/
class_
<
polynomial_t
>
(
"polynomial"
,
init
<>
())
...
...
python/python_definitions.h
View file @
c4dc932f
#include "curves/bezier_curve.h"
#include "curves/linear_variable.h"
#include "curves/quadratic_variable.h"
#include <vector>
...
...
python/python_variables.cpp
View file @
c4dc932f
...
...
@@ -48,6 +48,22 @@ namespace curves
}
Eigen
::
Matrix
<
real
,
Eigen
::
Dynamic
,
Eigen
::
Dynamic
>
cost_t_quad
(
const
quadratic_variable_t
&
p
)
{
Eigen
::
Matrix
<
real
,
Eigen
::
Dynamic
,
Eigen
::
Dynamic
>
A
=
p
.
A
();
return
A
;
}
Eigen
::
Matrix
<
real
,
Eigen
::
Dynamic
,
1
>
cost_t_linear
(
const
quadratic_variable_t
&
p
)
{
Eigen
::
Matrix
<
real
,
Eigen
::
Dynamic
,
1
>
b
=
p
.
b
();
return
b
;
}
real
cost_t_constant
(
const
quadratic_variable_t
&
p
)
{
return
p
.
c
();
}
matrix_pair
*
wayPointsToLists
(
const
bezier_linear_variable_t
&
self
)
{
...
...
python/python_variables.h
View file @
c4dc932f
...
...
@@ -13,11 +13,11 @@ namespace curves
{
static
const
int
dim
=
3
;
typedef
linear_variable
<
dim
,
real
>
linear_variable_3_t
;
typedef
quadratic_variable
<
real
>
quadratic_variable_t
;
typedef
bezier_curve
<
real
,
real
,
true
,
linear_variable_3_t
>
bezier_linear_variable_t
;
/*linear variable control points*/
bezier_linear_variable_t
*
wrapBezierLinearConstructor
(
const
point_list_t
&
matrices
,
const
point_list_t
&
vectors
);
bezier_linear_variable_t
*
wrapBezierLinearConstructorBounds
(
const
point_list_t
&
matrices
,
const
point_list_t
&
vectors
,
const
real
T_min
,
const
real
T_max
);
...
...
@@ -32,6 +32,10 @@ namespace curves
};
Eigen
::
Matrix
<
real
,
Eigen
::
Dynamic
,
Eigen
::
Dynamic
>
cost_t_quad
(
const
quadratic_variable_t
&
p
);
Eigen
::
Matrix
<
real
,
Eigen
::
Dynamic
,
1
>
cost_t_linear
(
const
quadratic_variable_t
&
p
);
real
cost_t_constant
(
const
quadratic_variable_t
&
p
);
matrix_pair
*
wayPointsToLists
(
const
bezier_linear_variable_t
&
self
);
struct
LinearBezierVector
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment