Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pinocchio
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stack Of Tasks
pinocchio
Commits
210186eb
Commit
210186eb
authored
9 years ago
by
jcarpent
Browse files
Options
Downloads
Patches
Plain Diff
[Python] Expose kineticEnergy algo
parent
599fd965
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/python/algorithms.hpp
+25
-6
25 additions, 6 deletions
src/python/algorithms.hpp
src/python/data.hpp
+5
-1
5 additions, 1 deletion
src/python/data.hpp
with
30 additions
and
7 deletions
src/python/algorithms.hpp
+
25
−
6
View file @
210186eb
//
// Copyright (c) 2015 CNRS
// Copyright (c) 2015
-2016
CNRS
//
// This file is part of Pinocchio
// Pinocchio is free software: you can redistribute it
...
...
@@ -31,14 +31,15 @@
#include
"pinocchio/algorithm/jacobian.hpp"
#include
"pinocchio/algorithm/center-of-mass.hpp"
#include
"pinocchio/algorithm/joint-limits.hpp"
#include
"pinocchio/algorithm/energy.hpp"
#include
"pinocchio/simulation/compute-all-terms.hpp"
#ifdef WITH_HPP_FCL
#include
"pinocchio/multibody/geometry.hpp"
#include
"pinocchio/python/geometry-model.hpp"
#include
"pinocchio/python/geometry-data.hpp"
#include
"pinocchio/algorithm/collisions.hpp"
#include
"pinocchio/multibody/geometry.hpp"
#include
"pinocchio/python/geometry-model.hpp"
#include
"pinocchio/python/geometry-data.hpp"
#include
"pinocchio/algorithm/collisions.hpp"
#endif
namespace
se3
...
...
@@ -153,6 +154,15 @@ namespace se3
{
jointLimits
(
*
model
,
*
data
,
q
);
}
static
double
kineticEnergy_proxy
(
const
ModelHandler
&
model
,
DataHandler
&
data
,
const
VectorXd_fx
&
q
,
const
VectorXd_fx
&
v
,
const
bool
update_kinematics
=
true
)
{
return
kineticEnergy
(
*
model
,
*
data
,
q
,
v
,
update_kinematics
);
}
#ifdef WITH_HPP_FCL
static
bool
computeCollisions_proxy
(
GeometryDataHandler
&
data_geom
,
...
...
@@ -275,7 +285,16 @@ namespace se3
bp
::
args
(
"Model"
,
"Data"
,
"Configuration q (size Model::nq)"
),
"Compute the maximum limits of all the joints of the model "
"and put the results in data."
);
"and put the results in data."
);
bp
::
def
(
"kineticEnergy"
,
kineticEnergy_proxy
,
bp
::
args
(
"Model"
,
"Data"
,
"Configuration q (size Model::nq)"
,
"Velocity v (size Model::nv)"
,
"Update kinematics (bool)"
),
"Compute the kinematic energy of the model for the "
"given joint configuration and velocity and store it "
" in data.kinetic_energy. By default, the kinematics of model is updated."
);
#ifdef WITH_HPP_FCL
bp
::
def
(
"computeCollisions"
,
computeCollisions_proxy
,
...
...
This diff is collapsed.
Click to expand it.
src/python/data.hpp
+
5
−
1
View file @
210186eb
//
// Copyright (c) 2015 CNRS
// Copyright (c) 2015
-2016
CNRS
//
// This file is part of Pinocchio
// Pinocchio is free software: you can redistribute it
...
...
@@ -102,6 +102,8 @@ namespace se3
.
ADD_DATA_PROPERTY_CONST
(
Eigen
::
VectorXd
,
lowerPositionLimit
,
"Limit for joint lower position"
)
.
ADD_DATA_PROPERTY_CONST
(
Eigen
::
VectorXd
,
upperPositionLimit
,
"Limit for joint upper position"
)
.
ADD_DATA_PROPERTY_CONST
(
double
,
kinetic_energy
,
"Kinetic energy in [J] computed by kineticEnergy(model,data,q,v,True/False)"
)
;
}
...
...
@@ -135,6 +137,8 @@ namespace se3
IMPL_DATA_PROPERTY_CONST
(
Eigen
::
VectorXd
,
lowerPositionLimit
,
"Limit for joint lower position"
)
IMPL_DATA_PROPERTY_CONST
(
Eigen
::
VectorXd
,
upperPositionLimit
,
"Limit for joint upper position"
)
IMPL_DATA_PROPERTY_CONST
(
double
,
kinetic_energy
,
"Kinetic energy in [J] computed by kineticEnergy(model,data,q,v,True/False)"
)
static
Vector3d_fx
com_pos
(
DataHandler
&
d
,
int
i
)
{
return
d
->
com
[(
size_t
)
i
];
}
static
Vector3d_fx
com_vel
(
DataHandler
&
d
,
int
i
)
{
return
d
->
vcom
[(
size_t
)
i
];
}
static
Vector3d_fx
com_acc
(
DataHandler
&
d
,
int
i
)
{
return
d
->
acom
[(
size_t
)
i
];
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment