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
df435589
Commit
df435589
authored
8 years ago
by
jcarpent
Browse files
Options
Downloads
Patches
Plain Diff
[C++] New algo to retrieve the increment for finite differences
parent
31acfc3f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+2
-0
2 additions, 0 deletions
CMakeLists.txt
src/algorithm/finite-differences.hpp
+38
-0
38 additions, 0 deletions
src/algorithm/finite-differences.hpp
src/algorithm/finite-differences.hxx
+64
-0
64 additions, 0 deletions
src/algorithm/finite-differences.hxx
with
104 additions
and
0 deletions
CMakeLists.txt
+
2
−
0
View file @
df435589
...
...
@@ -173,6 +173,8 @@ SET(${PROJECT_NAME}_ALGORITHM_HEADERS
algorithm/rnea.hxx
algorithm/crba.hpp
algorithm/crba.hxx
algorithm/finite-differences.hpp
algorithm/finite-differences.hxx
algorithm/jacobian.hpp
algorithm/jacobian.hxx
algorithm/cholesky.hpp
...
...
This diff is collapsed.
Click to expand it.
src/algorithm/finite-differences.hpp
0 → 100644
+
38
−
0
View file @
df435589
//
// Copyright (c) 2016 CNRS
//
// This file is part of Pinocchio
// Pinocchio is free software: you can redistribute it
// and/or modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation, either version
// 3 of the License, or (at your option) any later version.
//
// Pinocchio is distributed in the hope that it will be
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Lesser Public License for more details. You should have
// received a copy of the GNU Lesser General Public License along with
// Pinocchio If not, see
// <http://www.gnu.org/licenses/>.
#ifndef __se3_finite_differences_hpp__
#define __se3_finite_differences_hpp__
#include
"pinocchio/multibody/model.hpp"
namespace
se3
{
///
/// \brief Computes the finite difference increments for each degree of freedom according to the current joint configuration.
///
/// \input[in] model The model of the kinematic tree.
///
/// \returns The finite difference increments for each degree of freedom.
///
inline
Eigen
::
VectorXd
finiteDifferenceIncrement
(
const
Model
&
model
);
}
/* --- Details -------------------------------------------------------------------- */
#include
"pinocchio/algorithm/finite-differences.hxx"
#endif // ifndef __se3_finite_differences_hpp__
This diff is collapsed.
Click to expand it.
src/algorithm/finite-differences.hxx
0 → 100644
+
64
−
0
View file @
df435589
//
// Copyright (c) 2016 CNRS
//
// This file is part of Pinocchio
// Pinocchio is free software: you can redistribute it
// and/or modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation, either version
// 3 of the License, or (at your option) any later version.
//
// Pinocchio is distributed in the hope that it will be
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Lesser Public License for more details. You should have
// received a copy of the GNU Lesser General Public License along with
// Pinocchio If not, see
// <http://www.gnu.org/licenses/>.
#ifndef __se3_finite_differences_hxx__
#define __se3_finite_differences_hxx__
#include
"pinocchio/multibody/visitor.hpp"
#include
<boost/foreach.hpp>
/// @cond DEV
namespace
se3
{
namespace
details
{
struct
FinitDiffEpsVisitor
:
public
fusion
::
JointModelVisitor
<
FinitDiffEpsVisitor
>
{
typedef
boost
::
fusion
::
vector
<
Eigen
::
VectorXd
&
>
ArgsType
;
JOINT_MODEL_VISITOR_INIT
(
FinitDiffEpsVisitor
);
template
<
typename
JointModel
>
static
void
algo
(
const
se3
::
JointModelBase
<
JointModel
>
&
jmodel
,
Eigen
::
VectorXd
&
fd_increment
)
{
jmodel
.
jointVelocitySelector
(
fd_increment
).
fill
(
jmodel
.
finiteDifferenceIncrement
());
}
};
// struct FinitDiffEpsVisitor
}
// namespace details
inline
Eigen
::
VectorXd
finiteDifferenceIncrement
(
const
Model
&
model
)
{
using
namespace
se3
::
details
;
Eigen
::
VectorXd
fd_increment
(
model
.
nv
);
BOOST_FOREACH
(
const
JointModel
&
jmodel
,
model
.
joints
)
{
FinitDiffEpsVisitor
::
run
(
jmodel
,
FinitDiffEpsVisitor
::
ArgsType
(
fd_increment
));
}
return
fd_increment
;
}
}
// namespace se3
/// @endcond
#endif // ifndef __se3_finite_differences_hxx__
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