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
Gabriele Buondonno
pinocchio
Commits
144d9c21
Commit
144d9c21
authored
Sep 09, 2015
by
Justin Carpentier
Browse files
Merge pull request #39 from nmansard/devel
Added two minor functionalities in the python bindings
parents
7dc90d58
17202073
Changes
2
Show whitespace changes
Inline
Side-by-side
src/python/algorithms.hpp
View file @
144d9c21
...
...
@@ -134,7 +134,10 @@ namespace se3
const
VectorXd_fx
&
q
,
const
VectorXd_fx
&
v
)
{
data
->
M
.
fill
(
0
);
computeAllTerms
(
*
model
,
*
data
,
q
,
v
);
data
->
M
.
triangularView
<
Eigen
::
StrictlyLower
>
()
=
data
->
M
.
transpose
().
triangularView
<
Eigen
::
StrictlyLower
>
();
}
static
void
jointLimits_proxy
(
const
ModelHandler
&
model
,
...
...
src/python/model.hpp
View file @
144d9c21
...
...
@@ -94,6 +94,12 @@ namespace se3
.
add_property
(
"fix_hasVisual"
,
bp
::
make_function
(
&
ModelPythonVisitor
::
fix_hasVisual
,
bp
::
return_internal_reference
<>
())
)
.
add_property
(
"fix_bodyNames"
,
bp
::
make_function
(
&
ModelPythonVisitor
::
fix_bodyNames
,
bp
::
return_internal_reference
<>
())
)
// Add here some access of joint data (to be modified when the joints will be binded).
.
def
(
"joint_nq"
,
bp
::
make_function
(
&
ModelPythonVisitor
::
joint_nq
)
)
.
def
(
"joint_nv"
,
bp
::
make_function
(
&
ModelPythonVisitor
::
joint_nv
)
)
.
def
(
"joint_idx_q"
,
bp
::
make_function
(
&
ModelPythonVisitor
::
joint_idx_q
)
)
.
def
(
"joint_idx_v"
,
bp
::
make_function
(
&
ModelPythonVisitor
::
joint_idx_v
)
)
.
add_property
(
"gravity"
,
&
ModelPythonVisitor
::
gravity
,
&
ModelPythonVisitor
::
setGravity
)
.
def
(
"BuildEmptyModel"
,
&
ModelPythonVisitor
::
maker_empty
)
.
staticmethod
(
"BuildEmptyModel"
)
...
...
@@ -123,6 +129,11 @@ namespace se3
static
std
::
vector
<
bool
>
&
fix_hasVisual
(
ModelHandler
&
m
)
{
return
m
->
fix_hasVisual
;
}
static
std
::
vector
<
std
::
string
>
&
fix_bodyNames
(
ModelHandler
&
m
)
{
return
m
->
fix_bodyNames
;
}
static
int
joint_nq
(
ModelHandler
&
m
,
const
Model
::
Index
&
idx
)
{
return
se3
::
nq
(
m
->
joints
[
idx
]
);
}
static
int
joint_nv
(
ModelHandler
&
m
,
const
Model
::
Index
&
idx
)
{
return
se3
::
nv
(
m
->
joints
[
idx
]
);
}
static
int
joint_idx_q
(
ModelHandler
&
m
,
const
Model
::
Index
&
idx
)
{
return
se3
::
idx_q
(
m
->
joints
[
idx
]
);
}
static
int
joint_idx_v
(
ModelHandler
&
m
,
const
Model
::
Index
&
idx
)
{
return
se3
::
idx_v
(
m
->
joints
[
idx
]
);
}
static
Motion
gravity
(
ModelHandler
&
m
)
{
return
m
->
gravity
;
}
static
void
setGravity
(
ModelHandler
&
m
,
const
Motion_fx
&
g
)
{
m
->
gravity
=
g
;
}
...
...
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