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
Stack Of Tasks
pinocchio
Commits
adef26a7
Verified
Commit
adef26a7
authored
Apr 10, 2021
by
Justin Carpentier
Browse files
core: use Allocator to support aligned vectors
parent
2e79ded6
Pipeline
#13971
passed with stage
in 166 minutes and 48 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bindings/python/algorithm/expose-model.cpp
View file @
adef26a7
...
...
@@ -50,17 +50,17 @@ namespace pinocchio
template
<
typename
Scalar
,
int
Options
,
template
<
typename
,
int
>
class
JointCollectionTpl
,
typename
ConfigVectorType
>
bp
::
tuple
buildReducedModel
(
const
ModelTpl
<
Scalar
,
Options
,
JointCollectionTpl
>
&
model
,
const
std
::
vector
<
GeometryMo
de
l
>
&
list_of_
geom_models
,
const
std
::
vector
<
JointIndex
>
&
list_of_joints_to_lock
,
const
Eigen
::
MatrixBase
<
ConfigVectorType
>
&
reference_configuration
)
{
bp
::
tuple
buildReducedModel
(
const
ModelTpl
<
Scalar
,
Options
,
JointCollectionTpl
>
&
model
,
const
std
::
vector
<
GeometryModel
,
Eigen
::
aligned_allocator
<
GeometryModel
>
>
&
list_of_geom_
model
s
,
const
std
::
vector
<
JointIn
de
x
>
&
list_of_
joints_to_lock
,
const
Eigen
::
MatrixBase
<
ConfigVectorType
>
&
reference_configuration
)
{
typedef
ModelTpl
<
Scalar
,
Options
,
JointCollectionTpl
>
Model
;
std
::
vector
<
GeometryModel
>
reduced_geom_models
;
std
::
vector
<
GeometryModel
,
Eigen
::
aligned_allocator
<
GeometryModel
>
>
reduced_geom_models
;
Model
reduced_model
;
buildReducedModel
(
model
,
list_of_geom_models
,
list_of_joints_to_lock
,
reference_configuration
,
reduced_model
,
reduced_geom_models
);
reference_configuration
,
reduced_model
,
reduced_geom_models
);
return
bp
::
make_tuple
(
reduced_model
,
reduced_geom_models
);
}
...
...
@@ -68,7 +68,8 @@ namespace pinocchio
{
using
namespace
Eigen
;
StdVectorPythonVisitor
<
GeometryModel
>::
expose
(
"StdVec_GeometryModel"
);
typedef
std
::
vector
<
GeometryModel
,
Eigen
::
aligned_allocator
<
GeometryModel
>
>
GeometryModelVector
;
StdVectorPythonVisitor
<
GeometryModel
,
GeometryModelVector
::
allocator_type
>::
expose
(
"StdVec_GeometryModel"
);
bp
::
def
(
"appendModel"
,
(
Model
(
*
)(
const
Model
&
,
const
Model
&
,
const
FrameIndex
,
const
SE3
&
))
&
appendModel
<
double
,
0
,
JointCollectionDefaultTpl
>
,
...
...
@@ -105,14 +106,17 @@ namespace pinocchio
"
\t
reference_configuration: reference configuration to compute the placement of the lock joints
\n
"
);
bp
::
def
(
"buildReducedModel"
,
(
bp
::
tuple
(
*
)(
const
Model
&
,
const
GeometryModel
&
,
const
std
::
vector
<
JointIndex
>
&
,
const
Eigen
::
MatrixBase
<
VectorXd
>
&
))
(
bp
::
tuple
(
*
)(
const
Model
&
,
const
GeometryModel
&
,
const
std
::
vector
<
JointIndex
>
&
,
const
Eigen
::
MatrixBase
<
VectorXd
>
&
))
&
buildReducedModel
<
double
,
0
,
JointCollectionDefaultTpl
,
VectorXd
>
,
bp
::
args
(
"model"
,
"geom_model"
,
"list_of_joints_to_lock"
,
"reference_configuration"
),
"Build a reduced model and a rededuced geometry model
from a given input model,"
"a
give
n input geometry model and a list of joint to lock.
\n\n
"
"Build a reduced model and a rededuced geometry model from a given input model,"
"an input geometry model and a list of joint to lock.
\n\n
"
"Parameters:
\n
"
"
\t
model: input kinematic modell to reduce
\n
"
"
\t
geom_model: input geometry model to reduce
\n
"
...
...
@@ -120,15 +124,16 @@ namespace pinocchio
"
\t
reference_configuration: reference configuration to compute the placement of the lock joints
\n
"
);
bp
::
def
(
"buildReducedModel"
,
(
bp
::
tuple
(
*
)(
const
Model
&
,
const
std
::
vector
<
GeometryModel
>
&
,
(
bp
::
tuple
(
*
)(
const
Model
&
,
const
std
::
vector
<
GeometryModel
,
Eigen
::
aligned_allocator
<
GeometryModel
>
>
&
,
const
std
::
vector
<
JointIndex
>
&
,
const
Eigen
::
MatrixBase
<
VectorXd
>
&
))
&
buildReducedModel
<
double
,
0
,
JointCollectionDefaultTpl
,
VectorXd
>
,
const
Eigen
::
MatrixBase
<
VectorXd
>
&
))
buildReducedModel
<
double
,
0
,
JointCollectionDefaultTpl
,
VectorXd
>
,
bp
::
args
(
"model"
,
"list_of_geom_models"
,
"list_of_joints_to_lock"
,
"reference_configuration"
),
"Build a reduced model and
a
reduced geometry model from a given "
"reference_configuration"
),
"Build a reduced model and
the related
reduced geometry model
s
from a given "
"input model,"
"a
given
input geometry model and a list of joint to lock.
\n\n
"
"a
list of
input geometry model and a list of joint to lock.
\n\n
"
"Parameters:
\n
"
"
\t
model: input kinematic model to reduce
\n
"
"
\t
list_of_geom_models: input geometry models to reduce
\n
"
...
...
src/algorithm/model.hpp
View file @
adef26a7
...
...
@@ -160,14 +160,15 @@ namespace pinocchio
*/
template
<
typename
Scalar
,
int
Options
,
template
<
typename
,
int
>
class
JointCollectionTpl
,
typename
GeometryModelAllocator
,
typename
ConfigVectorType
>
void
buildReducedModel
(
const
ModelTpl
<
Scalar
,
Options
,
JointCollectionTpl
>
&
model
,
const
std
::
vector
<
GeometryModel
>
&
list_of_geom_models
,
const
std
::
vector
<
GeometryModel
,
GeometryModelAllocator
>
&
list_of_geom_models
,
const
std
::
vector
<
JointIndex
>
&
list_of_joints_to_lock
,
const
Eigen
::
MatrixBase
<
ConfigVectorType
>
&
reference_configuration
,
ModelTpl
<
Scalar
,
Options
,
JointCollectionTpl
>
&
reduced_model
,
std
::
vector
<
GeometryModel
>
&
list_of_reduced_geom_models
);
std
::
vector
<
GeometryModel
,
GeometryModelAllocator
>
&
list_of_reduced_geom_models
);
}
// namespace pinocchio
...
...
src/algorithm/model.hxx
View file @
adef26a7
...
...
@@ -489,14 +489,15 @@ namespace pinocchio
template
<
typename
Scalar
,
int
Options
,
template
<
typename
,
int
>
class
JointCollectionTpl
,
typename
GeometryModelAllocator
,
typename
ConfigVectorType
>
void
buildReducedModel
(
const
ModelTpl
<
Scalar
,
Options
,
JointCollectionTpl
>
&
input_model
,
const
std
::
vector
<
GeometryModel
>
&
list_of_geom_models
,
const
std
::
vector
<
GeometryModel
,
GeometryModelAllocator
>
&
list_of_geom_models
,
const
std
::
vector
<
JointIndex
>
&
list_of_joints_to_lock
,
const
Eigen
::
MatrixBase
<
ConfigVectorType
>
&
reference_configuration
,
ModelTpl
<
Scalar
,
Options
,
JointCollectionTpl
>
&
reduced_model
,
std
::
vector
<
GeometryModel
>
&
list_of_reduced_geom_models
)
{
std
::
vector
<
GeometryModel
,
GeometryModelAllocator
>
&
list_of_reduced_geom_models
)
{
typedef
ModelTpl
<
Scalar
,
Options
,
JointCollectionTpl
>
Model
;
buildReducedModel
(
input_model
,
list_of_joints_to_lock
,
reference_configuration
,
reduced_model
);
...
...
Write
Preview
Supports
Markdown
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